/* ============================================================
   TopVaBor — admin panel
   Dizayn tili: topvabor-landing-page (styles.css) tokenlari
   ============================================================ */

/* ── Shriftlar (self-hosted Inter variable) ───────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F,
    U+FE2E-FE2F;
}

/* ── Tokenlar (landing bilan bir xil) ─────────────────────── */
:root {
  --navy: #141470;
  --green: #10b981;
  --green-dark: #047857;
  --green-soft: #d1fae5;
  --ink: #1f2937;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --surface: #f9fafb;
  --white: #fff;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --shadow-sm: 0 8px 18px rgba(16, 185, 129, 0.28);
  --shadow-md: 0 18px 44px rgba(15, 23, 42, 0.16);

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --sidebar-w: 248px;
  --topbar-h: 64px;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--green-dark); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--green); }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Tugmalar (landing .btn bilan bir xil) ────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  background: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #0ea271; color: var(--white); }

.btn-outline {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--muted-2); }

.btn-danger-ghost {
  background: var(--white);
  border-color: var(--line);
  color: var(--danger);
}
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger-soft); }

.btn-block { width: 100%; }

/* ── Formalar ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* Rasm maydoni */
.img-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.img-field img {
  width: 104px;
  height: 66px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line-soft);
}
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }

.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
}

/* ── Login sahifasi ───────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(640px 320px at 85% -10%, var(--green-soft), transparent 70%),
    radial-gradient(520px 300px at -10% 110%, rgba(20, 20, 112, 0.10), transparent 70%),
    var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-brand img { width: 38px; height: 38px; }
.auth-brand span {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.auth-card h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.auth-sub { margin: 6px 0 22px; color: var(--muted); font-size: 14px; }
.auth-card form { display: grid; gap: 14px; }

/* ── Umumiy layout (sidebar + kontent) ────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: var(--navy);
  color: var(--white);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 20px;
}
.sidebar .brand img { width: 32px; height: 32px; border-radius: 8px; background: var(--white); }
.sidebar .brand span { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--white); }
.sidebar .brand small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav { display: grid; gap: 4px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-nav a svg { width: 18px; height: 18px; flex: none; }
.side-nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.side-nav a.is-active { background: var(--green); color: var(--white); box-shadow: var(--shadow-sm); }

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 10px 4px 0; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.07);
}
.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
}
.sidebar-user .who { min-width: 0; }
.sidebar-user .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who small { color: rgba(255, 255, 255, 0.55); font-size: 11px; }

.logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.logout-btn svg { width: 17px; height: 17px; }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 28px clamp(20px, 4vw, 48px) 96px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-head .lede { margin-top: 4px; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-dark);
}

/* ── Kartalar ─────────────────────────────────────────────── */
.card {
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--white);
  margin-bottom: 18px;
}
.card > h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.card .card-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.subcard {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  display: grid;
  gap: 12px;
}
.subcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.subcard-head .pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}
.subcard-head .remove-item {
  border: none;
  background: none;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
}
.subcard-head .remove-item:hover { color: var(--danger); background: var(--danger-soft); }

.stack { display: grid; gap: 14px; }

/* ── Saqlash paneli (pastda suzuvchi) ─────────────────────── */
.save-bar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(20px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line-soft);
}
.save-bar .meta { color: var(--muted); font-size: 13px; }
.save-bar .actions { display: flex; gap: 10px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 90;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-show { opacity: 1; transform: none; }
.toast.is-error { background: var(--danger); }
.toast.is-success { background: var(--green-dark); }

.form-error {
  display: none;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.form-error.is-show { display: block; }

/* ── Profil ───────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--navy), #1d1d8f 60%, #10b981 160%);
  color: var(--white);
}
.profile-hero .avatar {
  width: 56px;
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--green);
  font-size: 22px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.profile-hero h2 { font-size: 19px; font-weight: 800; }
.profile-hero p { color: rgba(255, 255, 255, 0.72); font-size: 13px; margin-top: 2px; }

/* ── Mobil ────────────────────────────────────────────────── */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 80;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
}
.menu-toggle svg { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .menu-toggle { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-md); }
  .main { margin-left: 0; padding-top: 72px; }
  .save-bar { left: 0; }
}
