* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1c1f2a;
  line-height: 1.5;
  background: #e4e9f2;
}

a {
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* ---- App shell ---- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

.topbar {
  background: #0f3460;
  color: #fff;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  flex-direction: column;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ffb703, #fb8500);
  font-size: 1rem;
}

.tagline {
  font-size: 0.8rem;
  color: #cdd6e8;
  margin-top: 2px;
}

.view-wrap {
  flex: 1;
  padding: 20px 20px 24px;
  overflow-y: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ---- Hero / home ---- */
.hero {
  background: linear-gradient(135deg, #16537e, #0f3460);
  color: #fff;
  padding: 28px 20px;
  border-radius: 16px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.hero p {
  font-size: 0.9rem;
  color: #d6e0f0;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  gap: 8px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
}

.search-box button {
  flex-shrink: 0;
  border: none;
  background: #ffb703;
  color: #1c1f2a;
  font-weight: bold;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.section-title {
  font-size: 1.05rem;
  margin: 18px 0 10px;
}

/* ---- Categories ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.category-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  border: 1px solid #e7e9ee;
  transition: box-shadow .15s ease;
}

.category-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.category-card .icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 6px;
}

.category-card .label {
  font-size: 0.78rem;
  color: #444;
}

/* ---- Usta cards ---- */
.usta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.usta-card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.usta-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0f3460;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.usta-info {
  flex: 1;
  min-width: 0;
}

.usta-name {
  font-weight: bold;
  font-size: 0.98rem;
}

.usta-meta {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.usta-rating {
  font-size: 0.82rem;
  color: #d08700;
  margin-top: 4px;
}

.usta-price {
  font-size: 0.78rem;
  color: #0f3460;
  font-weight: bold;
  white-space: nowrap;
}

/* ---- Filters ---- */
.filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.filters input,
.filters select {
  border: 1px solid #d8dbe3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  width: 100%;
}

.empty-state {
  text-align: center;
  color: #888;
  padding: 30px 10px;
  font-size: 0.9rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: #0f3460;
  color: #fff;
}

.btn-secondary {
  background: #e7e9ee;
  color: #1c1f2a;
}

.btn-danger {
  background: #e5484d;
  color: #fff;
}

/* ---- Modal ---- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal.open {
  display: flex;
}

.sheet {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 24px 20px 28px;
  position: relative;
  animation: slide-up .18s ease-out;
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet .close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #888;
}

.sheet h3 {
  margin-bottom: 14px;
}

.sheet label {
  display: block;
  font-size: 0.82rem;
  color: #555;
  margin: 12px 0 4px;
}

.sheet input,
.sheet select,
.sheet textarea {
  width: 100%;
  border: 1px solid #d8dbe3;
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}

.sheet input.invalid,
.sheet select.invalid,
.sheet textarea.invalid {
  border-color: #e5484d;
  background: #fff5f5;
}

.field-error {
  display: block;
  min-height: 16px;
  font-size: 0.74rem;
  color: #e5484d;
  margin-top: 3px;
}

.sheet .btn {
  margin-top: 18px;
}

.sheet-confirm {
  border-radius: 18px;
  text-align: center;
}

.sheet-confirm p {
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  margin-top: 0;
}

/* ---- Profile modal content ---- */
.profile-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
}

.profile-header .usta-avatar {
  width: 64px;
  height: 64px;
  font-size: 1.2rem;
}

.profile-header h3 {
  margin: 0;
}

.profile-section {
  margin-top: 16px;
}

.profile-section h4 {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 8px;
}

.photo-placeholder {
  display: flex;
  gap: 8px;
}

.photo-box {
  flex: 1;
  height: 72px;
  background: repeating-linear-gradient(135deg, #e4e9f2 0, #e4e9f2 10px, #eef1f7 10px, #eef1f7 20px);
  border: 1px dashed #c6ccda;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem;
  color: #8891a3;
}

.photo-box .photo-icon {
  font-size: 1.1rem;
}

.photo-note {
  font-size: 0.72rem;
  color: #999;
  margin-top: 6px;
}

.review-item {
  border-top: 1px solid #eee;
  padding: 10px 0;
}

.review-item .review-name {
  font-weight: bold;
  font-size: 0.85rem;
}

.review-item .review-stars {
  color: #d08700;
  font-size: 0.8rem;
}

.review-item .review-text {
  font-size: 0.85rem;
  color: #555;
  margin-top: 2px;
}

.order-usta-info {
  background: #eef0f4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* ---- Orders ---- */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.order-card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  padding: 12px 14px;
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.order-service {
  font-weight: bold;
  font-size: 0.92rem;
}

.order-date {
  font-size: 0.75rem;
  color: #888;
}

.order-meta {
  font-size: 0.82rem;
  color: #666;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 3px 9px;
  border-radius: 999px;
}

.badge-yangi { background: #fff3cd; color: #946c00; }
.badge-jarayonda { background: #cfe2ff; color: #084298; }
.badge-bajarildi { background: #d1f7df; color: #0a6e32; }
.badge-bekor { background: #f8d7da; color: #842029; }

/* ---- Admin ---- */
.admin-note {
  font-size: 0.8rem;
  color: #888;
  background: #fff3cd;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 14px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: #0f3460;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: #777;
  margin-top: 2px;
}

.admin-orders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-order-card {
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  padding: 12px 14px;
}

.admin-order-card .order-top {
  margin-bottom: 8px;
}

.admin-order-card select {
  width: 100%;
  border: 1px solid #d8dbe3;
  border-radius: 8px;
  padding: 7px 8px;
  margin-top: 6px;
  background: #fff;
}

.admin-order-card .field-label {
  font-size: 0.72rem;
  color: #888;
  margin-top: 8px;
}

.admin-order-card .remove-btn {
  margin-top: 10px;
  background: none;
  border: none;
  color: #b3261e;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- Bottom nav ---- */
.bottom-nav {
  display: flex;
  border-top: 1px solid #e2e4ea;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.nav-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 4px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #888;
  cursor: pointer;
}

.nav-btn b {
  font-size: 1.15rem;
  font-weight: normal;
}

.nav-btn span {
  font-size: 0.68rem;
}

.nav-btn.active {
  color: #0f3460;
  font-weight: bold;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1c1f2a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Desktop layout ---- */
@media (min-width: 860px) {
  body {
    padding: 28px 0;
  }

  .app {
    max-width: 960px;
    min-height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "topbar topbar"
      "nav main";
    border-radius: 18px;
    overflow: hidden;
  }

  .topbar { grid-area: topbar; }
  .view-wrap { grid-area: main; padding: 28px 32px 32px; }

  .bottom-nav {
    grid-area: nav;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid #e2e4ea;
    padding: 20px 10px;
    gap: 4px;
  }

  .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .nav-btn.active {
    background: #eef1f7;
  }

  .nav-btn b { font-size: 1.1rem; }
  .nav-btn span { font-size: 0.85rem; }

  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .usta-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
