/* =============================================================
 * Sog'liq platforma - umumiy stylesheet
 * Vanilla CSS (Tailwind yo'q)
 * ============================================================= */

* { box-sizing: border-box; }

:root {
  --color-brand: #1e3a8a;
  --color-brand-light: #1e40af;
  --color-bg: #f5f8fc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  --color-border: #cbd5e1;
  --color-border-light: #e2e8f0;
  --color-border-lighter: #f1f5f9;
  --color-success: #059669;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-info: #3b82f6;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.1);
  --transition: all 0.15s;
}

[data-theme="dark"] {
  --color-brand: #60a5fa;
  --color-brand-light: #93c5fd;
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-light: #64748b;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --color-border-lighter: #0f172a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] body { background: var(--color-bg); color: var(--color-text); }
[data-theme="dark"] .card { background: var(--color-surface); border-color: var(--color-border); }
[data-theme="dark"] .form-input, [data-theme="dark"] .form-select, [data-theme="dark"] .form-textarea {
  background: var(--color-bg); color: var(--color-text); border-color: var(--color-border);
}
[data-theme="dark"] .badge-pending { background: #451a03; color: #fbbf24; }
[data-theme="dark"] .badge-processed { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .badge-resolved { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] table { background: var(--color-surface); }
[data-theme="dark"] table th { background: var(--color-bg); color: var(--color-text-muted); }
[data-theme="dark"] table td { border-color: var(--color-border); }

/* DARK MODE - Yangi qo'shimcha override'lar */
/* KPI kartochkalar (Jami murojaatlar, Yangi, Jarayonda, Hal qilingan) */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .kpi-card {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Filtr/Hisobot bo'limi */
[data-theme="dark"] .filter-panel,
[data-theme="dark"] .report-panel,
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Header (yuqori qism) - dark mode'da to'q rangli */
[data-theme="dark"] .app-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Header tugmalari */
[data-theme="dark"] .header-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .header-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Lang select */
[data-theme="dark"] .lang-select {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .lang-select option {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Btn secondary - dark mode'da to'q */
[data-theme="dark"] .btn-secondary {
  background: var(--color-surface);
  color: var(--color-brand-light);
  border-color: var(--color-border);
}
[data-theme="dark"] .btn-secondary:hover {
  background: var(--color-bg);
}

/* Searchable dropdown - muassasa tanlash */
[data-theme="dark"] .searchable-dropdown,
[data-theme="dark"] .dropdown-content,
[data-theme="dark"] .dropdown-options,
[data-theme="dark"] .searchable-select,
[data-theme="dark"] .options-list {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .dropdown-option,
[data-theme="dark"] .option-item {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .dropdown-option:hover,
[data-theme="dark"] .option-item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
[data-theme="dark"] .option-item.disabled {
  background: var(--color-bg);
  color: var(--color-text-light);
}

/* Hududlar sahifa - data-card */
[data-theme="dark"] .data-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .data-name {
  color: var(--color-text);
}
[data-theme="dark"] .badge-stat {
  background: var(--color-bg);
  color: var(--color-text-muted);
}

/* Step indicator (forma bosqichlari) */
[data-theme="dark"] .step {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

/* Tabs */
[data-theme="dark"] .tab.active {
  color: var(--color-brand-light);
  border-bottom-color: var(--color-brand-light);
}
[data-theme="dark"] .tab-btn.active {
  color: var(--color-brand-light);
  border-bottom-color: var(--color-brand-light);
}

/* Tooltip va dropdown placeholder */
[data-theme="dark"] ::placeholder {
  color: var(--color-text-light);
  opacity: 0.7;
}

/* Notification dropdown */
[data-theme="dark"] .notif-dropdown,
[data-theme="dark"] .notification-panel,
[data-theme="dark"] .notif-panel {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .notif-panel-header {
  border-bottom-color: var(--color-border) !important;
  background: var(--color-bg);
}
[data-theme="dark"] .notif-panel-header h3,
[data-theme="dark"] .notif-panel-header * {
  color: var(--color-text) !important;
}
[data-theme="dark"] .notif-panel-header button,
[data-theme="dark"] .notif-mark-all-btn,
[data-theme="dark"] .notif-panel-header .btn-link,
[data-theme="dark"] #notifMarkAllBtn,
[data-theme="dark"] .btn-link {
  background: transparent !important;
  color: var(--color-brand-light) !important;
  border-color: transparent !important;
}
[data-theme="dark"] .notif-panel-header button:hover,
[data-theme="dark"] .btn-link:hover {
  background: rgba(96, 165, 250, 0.15) !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .notif-panel-list {
  background: var(--color-surface);
}
[data-theme="dark"] .notif-item {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-bottom-color: var(--color-border) !important;
}
[data-theme="dark"] .notif-item:hover {
  background: var(--color-bg) !important;
}
[data-theme="dark"] .notif-item.unread {
  background: rgba(59, 130, 246, 0.1) !important;
}
[data-theme="dark"] .notif-item-title {
  color: var(--color-text) !important;
}
[data-theme="dark"] .notif-item-message {
  color: var(--color-text-muted) !important;
}
[data-theme="dark"] .notif-item-time {
  color: var(--color-text-light) !important;
}
[data-theme="dark"] .notif-empty {
  background: var(--color-surface) !important;
  color: var(--color-text-muted) !important;
}
[data-theme="dark"] .notif-dropdown *,
[data-theme="dark"] .notification-panel *,
[data-theme="dark"] .notif-panel * {
  border-color: var(--color-border) !important;
}

/* Login form */
[data-theme="dark"] .login-card {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Cabinet - "Mening murojaatlarim" kartochkalari */
[data-theme="dark"] .request-card {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}
[data-theme="dark"] .request-card * {
  color: var(--color-text) !important;
}
[data-theme="dark"] .request-card .text-muted,
[data-theme="dark"] .request-card .text-light {
  color: var(--color-text-muted) !important;
}
[data-theme="dark"] .request-card:hover {
  background: var(--color-bg) !important;
}

/* Inline style override - cabinet.js da style="color:#475569" */
[data-theme="dark"] .request-card div[style*="#475569"],
[data-theme="dark"] .request-card div[style*="color"] {
  color: var(--color-text) !important;
}

/* Bajaruvchi hisoboti - modal ichidagi textarea va boxlar */
[data-theme="dark"] textarea,
[data-theme="dark"] textarea.form-textarea {
  background: var(--color-bg) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}
[data-theme="dark"] textarea::placeholder,
[data-theme="dark"] input::placeholder {
  color: var(--color-text-light) !important;
  opacity: 0.6;
}

/* "Hal qilgan" va metadata matnlari - inline style bilan kelgan */
[data-theme="dark"] [class*="bg-gray"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background: #f3f4f6"],
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"] {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
}

/* Inline color matnlari - text-muted, text-light analoglari */
[data-theme="dark"] [style*="color:#475569"],
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#334155"],
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#1e293b"],
[data-theme="dark"] [style*="color: #1e293b"] {
  color: var(--color-text) !important;
}

/* Section card / info-card stillari - hisobot ko'rinishi uchun */
[data-theme="dark"] .info-card,
[data-theme="dark"] .info-section,
[data-theme="dark"] .section-card,
[data-theme="dark"] .resolution-box,
[data-theme="dark"] .report-card {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}

/* Border classes - light versions */
[data-theme="dark"] .border-t,
[data-theme="dark"] .border-b,
[data-theme="dark"] .border {
  border-color: var(--color-border) !important;
}

/* Table hover - dark mode (qator hover) */
[data-theme="dark"] .data-table tr:hover td,
[data-theme="dark"] table tr:hover td,
[data-theme="dark"] tbody tr:hover {
  background: rgba(96, 165, 250, 0.1) !important;
  color: var(--color-text) !important;
}

/* Table tbody dark */
[data-theme="dark"] .data-table tbody td,
[data-theme="dark"] table tbody td {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

/* Striped table rows */
[data-theme="dark"] .data-table tbody tr:nth-child(even) td,
[data-theme="dark"] table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Dark mode toggle button */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 18px;
  margin-left: 8px;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.2); }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  line-height: 1.5;
}

/* =============================================================
 * Layout
 * ============================================================= */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: 720px; }
.container-form { max-width: 480px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'Courier New', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.brand-blue { color: var(--color-brand); }

/* =============================================================
 * RESPONSIVE - Telefon, Planshet, Desktop
 * ============================================================= */

/* ===== TABLET (768px va undan kichik) ===== */
@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .container { padding: 0 12px; }
  
  /* Header */
  .app-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .app-header h1 { font-size: 18px !important; line-height: 1.3; }
  .app-header p { font-size: 13px !important; }
  .app-logo { width: 40px; height: 40px; }
  
  /* Header controls (tugmalar qatori) */
  .header-controls,
  .app-header .flex.items-center.gap-3,
  .app-header .flex.items-center.gap-4 + .flex {
    flex-wrap: wrap;
    gap: 8px !important;
    width: 100%;
  }
  .header-controls > *,
  .app-header .flex.items-center.gap-3 > * {
    flex-shrink: 0;
  }
  .header-btn, .lang-select {
    font-size: 13px !important;
    padding: 8px 12px !important;
  }
  
  /* Tabs - horizontal scroll */
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .tab { font-size: 14px; padding: 10px 14px; flex-shrink: 0; }
  
  /* KPI kartochkalar */
  .stat-card { padding: 16px !important; }
  .stat-value { font-size: 28px !important; }
  .stat-label { font-size: 12px !important; }
  
  /* Filter panel */
  .grid-cols-4 > * { margin-bottom: 8px; }
  
  /* Cards va data-card */
  .card { padding: 16px !important; border-radius: 12px; }
  .data-card { padding: 14px !important; }
  
  /* Modal */
  .modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 92vh;
    margin: 8px;
    border-radius: 12px;
  }
  .modal-content, #detailContent { padding: 4px !important; }
  
  /* Modal footer - tugmalar vertical */
  .modal .flex.justify-end,
  .modal .flex.justify-between,
  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }
  .modal .flex.justify-end > *,
  .modal .flex.justify-between > div,
  .modal-footer > * {
    width: 100%;
  }
  .modal .btn { width: 100%; }
  
  /* Forma elementlar */
  .form-input, .form-select, .form-textarea {
    font-size: 16px !important; /* iOS Safari zoom oldini olish uchun */
    padding: 10px 12px;
  }
  
  /* Jadval - horizontal scroll */
  .table-wrapper, table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 600px; }
  
  /* Notification panel - to'liq ekran */
  .notif-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100% !important;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }
  
  /* Dropdown - to'liq ekran */
  .searchable-select .options-list,
  .dropdown-options {
    max-height: 50vh;
  }
  
  /* Map */
  .uz-map-container svg {
    width: 100% !important;
    height: auto !important;
  }
  
  /* Murojaat kartochkalari */
  .request-card { padding: 14px; }
  .request-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  
  /* Tugmalar */
  .btn { padding: 10px 16px; font-size: 14px; }
  .btn-block { display: block; width: 100%; }
}

/* ===== TELEFON (480px va undan kichik) ===== */
@media (max-width: 480px) {
  .container { padding: 0 10px; }
  
  /* Header yanada kichikroq */
  .app-header h1 { font-size: 15px !important; }
  .app-header p { font-size: 11px !important; }
  .app-logo { width: 36px; height: 36px; }
  
  /* Header tugmalari yanada kichik */
  .header-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  .header-btn-text { display: none; } /* faqat ikonkalar */
  
  /* Tab nomlari kichik */
  .tab { font-size: 13px; padding: 8px 10px; }
  
  /* KPI */
  .stat-value { font-size: 24px !important; }
  
  /* Form input ham */
  .form-input, .form-select, .form-textarea {
    padding: 9px 10px;
  }
  
  /* Login forma */
  .login-card { padding: 20px !important; }
  .login-card h1, .login-card h2 { font-size: 20px !important; }
  
  /* Badge va tag'lar */
  .badge { font-size: 11px; padding: 3px 8px; }
  
  /* Toast */
  .toast {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-width: 100% !important;
  }
}

/* ===== EKSTRA KICHIK TELEFON (360px va undan kichik) ===== */
@media (max-width: 360px) {
  .app-header h1 { font-size: 14px !important; }
  .stat-value { font-size: 22px !important; }
  .tab { font-size: 12px; padding: 8px 8px; }
  .btn { font-size: 13px; padding: 9px 12px; }
}

/* ===== Touch device uchun ===== */
@media (hover: none) and (pointer: coarse) {
  .btn, .tab, .header-btn {
    min-height: 40px; /* Touch uchun yetarli o'lcham */
  }
  
  /* Hover effektlar kamaytirilgan */
  .request-card:hover { transform: none; }
}

/* ===== Landscape orientatsiya - kichik telefon ===== */
@media (max-width: 900px) and (orientation: landscape) {
  .app-header .container { padding-top: 8px; padding-bottom: 8px; }
  .app-header h1 { font-size: 16px !important; }
  .modal { max-height: 95vh; }
}

/* =============================================================
 * Header
 * ============================================================= */
.app-header {
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}
.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}
.app-logo {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
  flex-shrink: 0;
}
.app-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-logo {
  width: 96px; height: 96px;
  background: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.login-logo img { width: 100%; height: 100%; object-fit: contain; }
.app-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.app-subtitle { font-size: 14px; color: rgba(255, 255, 255, 0.85); margin: 2px 0 0 0; }

.header-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.header-btn:hover { background: rgba(255, 255, 255, 0.2); }

.lang-select {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.lang-select option { color: var(--color-text); background: white; }
.lang-select:focus { outline: none; border-color: white; }

/* =============================================================
 * Cards
 * ============================================================= */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card-compact { padding: 20px; }
.card-tight { padding: 16px; }

/* =============================================================
 * Forms
 * ============================================================= */
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.form-label .required { color: var(--color-danger); margin-left: 4px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  font-size: 15px;
  color: var(--color-text);
  transition: var(--transition);
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.form-input:disabled, .form-select:disabled {
  background: var(--color-border-lighter);
  cursor: not-allowed;
  color: var(--color-text-light);
}
.form-textarea { resize: vertical; min-height: 80px; }

.phone-input-group { display: flex; align-items: stretch; }
.phone-prefix {
  background: var(--color-border-lighter);
  border: 1.5px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
}
.phone-input-group .form-input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  flex: 1;
}

.field-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 6px; }

/* Searchable select */
.searchable-select { position: relative; }
.searchable-select .options-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1.5px solid var(--color-brand);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: var(--shadow-md);
}
.searchable-select.open .options-list { display: block; }
.searchable-select.open .form-input { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.option-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border-lighter);
}
.option-item:hover { background: #eff6ff; }
.option-item.disabled { color: var(--color-text-light); cursor: default; }
.option-item.disabled:hover { background: transparent; }

/* =============================================================
 * Buttons
 * ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
}
.btn-primary { background: var(--color-brand); color: white; }
.btn-primary:hover { background: var(--color-brand-light); }
.btn-primary:disabled { background: var(--color-text-light); cursor: not-allowed; }
.btn-secondary { background: white; color: var(--color-brand); border: 1.5px solid var(--color-brand); }
.btn-secondary:hover { background: #eff6ff; }
.btn-danger { background: var(--color-danger); color: white; padding: 8px 16px; font-size: 14px; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #047857; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* =============================================================
 * Stepper (forma uchun)
 * ============================================================= */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}
.step-active { background: var(--color-brand); color: white; }
.step-completed { background: var(--color-success); color: white; }
.step-pending { background: var(--color-border-light); color: var(--color-text-muted); }
.step-line {
  height: 2px;
  flex: 1;
  background: var(--color-border-light);
  margin: 0 8px;
  transition: background 0.3s;
}
.step-line-active { background: var(--color-success); }

/* =============================================================
 * Tables
 * ============================================================= */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: var(--color-brand);
  color: white;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-lighter);
  font-size: 14px;
}
.data-table tr:hover td { background: #f8fafc; }

.table-scroll { overflow-x: auto; max-height: 65vh; }

/* =============================================================
 * Badges
 * ============================================================= */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processed { background: #dbeafe; color: #1e40af; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-info { background: #e0e7ff; color: #3730a3; font-size: 11px; }

/* =============================================================
 * Modal
 * ============================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0;
}
.modal-close:hover { color: var(--color-text); }

/* =============================================================
 * Stats cards
 * ============================================================= */
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  border-left: 4px solid var(--color-brand);
}
.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--color-brand);
  margin-top: 4px;
}

/* =============================================================
 * Tabs
 * ============================================================= */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border-light);
  margin-bottom: 24px;
  gap: 4px;
  flex-wrap: wrap;
}
.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab:hover { color: var(--color-brand); }
.tab.active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
  font-weight: 600;
}

/* =============================================================
 * Toast notifications
 * ============================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-brand);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-danger); }

/* =============================================================
 * Animations
 * ============================================================= */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-border-lighter); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-light); }

/* Utilities */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.pt-4 { padding-top: 16px; }
.pt-6 { padding-top: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.border-t { border-top: 1px solid var(--color-border-lighter); }

.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }

/* =============================================================
 * Notifications
 * ============================================================= */
.notif-bell {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}
.notif-bell:hover { background: rgba(255, 255, 255, 0.2); }
.notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  border: 2px solid var(--color-brand);
}
.notif-panel {
  position: absolute;
  top: 60px;
  right: 24px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  width: 380px;
  max-height: 480px;
  overflow: hidden;
  z-index: 200;
  display: none;
  border: 1px solid var(--color-border-light);
}
.notif-panel.active { display: flex; flex-direction: column; }
.notif-panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-lighter);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-panel-list {
  overflow-y: auto;
  flex: 1;
}
.notif-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-lighter);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread {
  background: #eff6ff;
  border-left: 3px solid var(--color-brand);
}
.notif-item-title { font-weight: 600; font-size: 14px; color: var(--color-text); }
.notif-item-message { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.notif-item-time { font-size: 11px; color: var(--color-text-light); margin-top: 6px; }
.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
}
