/* ═══════════════════════════════════════
   ADMIN PORTAL DASHBOARD STYLES (admin-style.css)
   ═══════════════════════════════════════ */
:root {
  /* Jalili Luxury Gold & Minimalist Daylight */
  --bg-primary:    #fbfaf8;  /* Soft Warm Linen Paper */
  --bg-secondary:  #ffffff;  /* Pure Card White */
  --bg-sidebar:    #14100d;  /* Deep Bronze Ebony */
  --sidebar-text:  #f5f0e6;
  --text-main:     #1a1512;  /* Deep Ink */
  --text-muted:    #756b5e;  /* Warm Muted Taupe */
  --border-color:  #eadecb;  /* Refined Gold Outline */
  --border-subtle: rgba(200, 160, 78, 0.16);
  --accent-color:  #c8a04e;  /* Pure Royal Persian Gold */
  --accent-hover:  #b38b3a;
  --accent-light:  #fdf8ee;
  --table-header:  #f6f2ea;
  --shadow-sm:     0 4px 14px rgba(20, 16, 13, 0.04);
  --shadow-md:     0 12px 32px rgba(20, 16, 13, 0.07);
  --card-glow:     rgba(200, 160, 78, 0.15);
  --mode-indicator:#1a1512;
  --white:         #ffffff;
  
  --transition:    all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --font-fa:       'Vazirmatn', sans-serif;
  --font-en:       'Jost', sans-serif;
}

body.dark {
  /* Jalili Luxury Gold & Onyx Night Mode */
  --bg-primary:    #0d0a08;  /* Deepest Onyx */
  --bg-secondary:  #181310;  /* Rich Dark Card */
  --bg-sidebar:    #0a0806;  /* Inky Ebony */
  --sidebar-text:  #f5f0e6;
  --text-main:     #f7f4ed;  /* Warm Ivory Text */
  --text-muted:    #a3988b;  /* Soft Cashmere */
  --border-color:  rgba(200, 160, 78, 0.2);
  --border-subtle: rgba(200, 160, 78, 0.12);
  --accent-color:  #e5c57b;  /* Shimmering Gold */
  --accent-hover:  #f7dfa3;
  --accent-light:  rgba(200, 160, 78, 0.1);
  --table-header:  #211a15;
  --shadow-sm:     0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md:     0 14px 36px rgba(0, 0, 0, 0.55);
  --card-glow:     rgba(229, 197, 123, 0.14);
  --mode-indicator:#ffffff;
}

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

body {
  font-family: var(--font-fa);
  background-color: var(--bg-primary);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.en {
  font-family: var(--font-en);
  direction: ltr;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Language elements */
.lang-fa { display: inline; }
.lang-en { display: none !important; }
body.en .lang-fa { display: none !important; }
body.en .lang-en { display: inline !important; }

/* ═══════════ SIDEBAR NAVIGATION ═══════════ */
aside.admin-sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  transition: var(--transition);
  border-left: 1px solid rgba(200, 160, 78, 0.18);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

body.en aside.admin-sidebar {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(200, 160, 78, 0.18);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  padding: 26px 24px;
  border-bottom: 1px solid rgba(200, 160, 78, 0.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 800;
  color: #f5d77f;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.sidebar-sub {
  font-size: 11.5px;
  opacity: 0.7;
  letter-spacing: 0.3px;
  color: #e0d5c1;
}

.sidebar-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 24px;
  text-decoration: none;
}
.sidebar-logo-img {
  width: 56px;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-secondary);
}

.sidebar-menu {
  list-style: none;
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(245, 240, 230, 0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: var(--transition);
}

.sidebar-menu li a svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  stroke-width: 2;
  stroke: currentColor;
  transition: var(--transition);
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
  color: #ffffff;
  background: rgba(200, 160, 78, 0.16);
  border: 1px solid rgba(200, 160, 78, 0.3);
}

.sidebar-menu li a:hover svg,
.sidebar-menu li.active a svg {
  opacity: 1;
  stroke: #f5d77f;
  transform: scale(1.1);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(200, 160, 78, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ═══════════ MAIN CONTENT ═══════════ */
main.admin-main {
  flex: 1;
  margin-right: 260px;
  padding: 36px 40px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

body.en main.admin-main {
  margin-right: 0;
  margin-left: 260px;
}

/* Header bar */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.admin-header-title h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.admin-header-title p {
  font-size: 13.5px;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background: var(--table-header);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* ═══════════ STATS STRIP ═══════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-color);
  opacity: 0.6;
}
body.en .stat-card::before {
  right: auto;
  left: 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.stat-info h3 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-en);
  line-height: 1.1;
}

.stat-icon {
  background-color: var(--table-header);
  color: var(--accent-color);
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.stat-card:hover .stat-icon {
  background-color: var(--accent-color);
  color: var(--white);
  transform: scale(1.05);
}

/* ═══════════ DATA PANELS ═══════════ */
.data-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 30px;
  transition: var(--transition);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Search bar inputs */
.search-box {
  position: relative;
}

/* ═══════════ ADMIN DASHBOARD DAY / NIGHT REFINEMENTS ═══════════ */
/* Ensure key dashboard components use theme tokens for reliable contrast */
.admin-header {
  background-color: transparent;
  padding: 8px 0 20px;
}

main.admin-main {
  background-color: var(--bg-primary);
}

/* Sidebar subtle border and shadow variations per mode */
aside.admin-sidebar { border-color: var(--border-color); }
body.dark aside.admin-sidebar { box-shadow: -4px 0 30px rgba(0,0,0,0.6); }

.sidebar-logo { color: var(--accent-color); text-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.sidebar-logo-img { background: var(--bg-secondary); }
body.dark .sidebar-logo-img { box-shadow: 0 8px 26px rgba(0,0,0,0.6); }

/* Panels and cards */
.data-panel, .stat-card, .panel, .card {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}
body.dark .data-panel, body.dark .stat-card {
  background-color: var(--bg-secondary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

/* Primary CTA and controls in admin */
.btn-cta-admin, .admin-action-btn {
  background: var(--accent-color);
  color: var(--white);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.btn-cta-admin:hover { background: var(--accent-hover); }
body.dark .btn-cta-admin { box-shadow: 0 10px 28px rgba(0,0,0,0.45); }

/* Small UI tweaks for readability */
.stat-info h3, .panel-title { color: var(--text-muted); }
.stat-number, .panel-title strong { color: var(--text-main); }

/* Theme toggle visual balance */
.theme-toggle-btn { background: var(--bg-secondary); color: var(--text-main); border-color: var(--border-color); }
body.dark .theme-toggle-btn { background: rgba(255,255,255,0.02); border-color: rgba(229,197,123,0.06); color: var(--text-main); }

@media (prefers-color-scheme: dark) {
  :root { }
}

/* ═══════════ AUTH / LOGIN CARD (REFINED) ═══════════ */
.auth-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
}
.auth-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: 14px;
  padding: 28px;
  color: var(--text-main);
}
.auth-header { text-align: center; margin-bottom: 14px; }
.auth-header h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.auth-header p { color: var(--text-muted); font-size: 14px; }

.fg { margin-bottom: 14px; }
.fg label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight:700; }
.fg input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-subtle); background: transparent; color: var(--text-main); font-size: 15px; }
.fg input::placeholder { color: var(--text-muted); opacity: 0.9; }
.password-input-wrapper { position: relative; }
.password-input-wrapper .toggle-password-btn { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; cursor: pointer; padding: 6px; color: var(--text-muted); }
.password-input-wrapper .toggle-password-btn:hover { color: var(--accent-color); }
.checkbox-row { margin-top: 6px; }

.alert { display: none; padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-weight:700; }
.alert.alert-danger { background: rgba(235, 87, 87, 0.08); color: #b34b4b; border: 1px solid rgba(235,87,87,0.12); }
.alert.alert-success { background: rgba(76, 175, 80, 0.08); color: #2d7a2d; border: 1px solid rgba(76,175,80,0.12); }

.auth-footer { margin-top: 8px; }
.theme-toggle-btn { border-radius: 8px; padding: 8px; }

@media (max-width: 640px) {
  .auth-card { padding: 20px; border-radius: 12px; }
  .auth-header h1 { font-size: 18px; }
}

/* Buttons and interactive elements for auth page using theme tokens */
.btn-cta {
  display: inline-block;
  padding: 12px 16px;
  background: var(--accent-color);
  color: var(--white);
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  font-family: var(--font-en);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
  transition: var(--transition);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.auth-footer a { color: var(--accent-color); }

/* Make inputs use subtle background in both modes for contrast */
.fg input { background: var(--accent-light); }

/* Dark mode tweaks for alerts and buttons */
body.dark .alert.alert-danger { background: rgba(235,87,87,0.04); color: #f6c6c6; border-color: rgba(235,87,87,0.06); }
body.dark .alert.alert-success { background: rgba(76,175,80,0.04); color: #dff0df; border-color: rgba(76,175,80,0.06); }
body.dark .btn-cta { box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

/* Ensure icons and small controls read well in dark mode */
body.dark .password-input-wrapper .toggle-password-btn { color: var(--text-muted); }
body.dark .auth-card { border-color: var(--border-color); }

.search-box input {
  padding: 9px 38px 9px 14px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  border-radius: 8px;
  outline: none;
  min-width: 220px;
  transition: var(--transition);
}
body.en .search-box input {
  padding: 9px 14px 9px 38px;
}

.search-box input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--card-glow);
  background-color: var(--bg-secondary);
}

.search-box svg {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
body.en .search-box svg {
  right: auto;
  left: 12px;
}

/* CSV Export Buttons */
.btn-export {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-export:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-export svg {
  width: 15px;
  height: 15px;
}

/* ═══════════ DATA TABLES WITH TOUCH MOMENTUM ═══════════ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
  position: relative;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13.5px;
  min-width: 650px;
}

body.en table.data-table {
  text-align: left;
}

table.data-table th {
  background-color: var(--table-header);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
}

table.data-table th:hover {
  color: var(--accent-color);
}

table.data-table th .sort-indicator {
  display: inline-block;
  margin-right: 4px;
  font-size: 11px;
  opacity: 0.6;
}
body.en table.data-table th .sort-indicator {
  margin-right: 0;
  margin-left: 4px;
}

table.data-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

table.data-table tbody tr {
  transition: background-color 0.15s ease;
}

table.data-table tbody tr:hover {
  background-color: rgba(200, 160, 78, 0.04);
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

.no-records {
  text-align: center !important;
  color: var(--text-muted);
  padding: 36px !important;
  font-style: italic;
}

/* Table Actions Cell */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.btn-action {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-action:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: var(--table-header);
}

.btn-action-view {
  background: rgba(200, 160, 78, 0.1);
  color: var(--accent-color);
  border-color: rgba(200, 160, 78, 0.25);
}
.btn-action-view:hover {
  background: var(--accent-color);
  color: var(--white);
}

.btn-action-delete {
  background: rgba(239, 68, 68, 0.06);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.18);
}
.btn-action-delete:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-action-add {
  background: var(--accent-color);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--card-glow);
  transition: var(--transition);
}
.btn-action-add:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Status Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: var(--transition);
}
.filter-tab:hover {
  color: var(--text-main);
  border-color: var(--accent-color);
}
.filter-tab.active {
  background: var(--accent-color);
  color: var(--white);
  border-color: var(--accent-color);
}

/* Badges */
.badge-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.badge-status.new {
  background: rgba(3, 105, 161, 0.1);
  color: #0284c7;
  border: 1px solid rgba(3, 105, 161, 0.22);
}
body.dark .badge-status.new {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
}

.badge-status.in-progress {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.22);
}
body.dark .badge-status.in-progress {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}

.badge-status.completed {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.22);
}
body.dark .badge-status.completed {
  background: rgba(74, 222, 128, 0.14);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.25);
}

/* ═══════════ PAGINATION ═══════════ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-en);
  font-weight: 600;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.page-btn.active {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--white);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-muted);
}

/* ═══════════ MODALS ═══════════ */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.admin-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.admin-modal-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px;
  box-shadow: var(--shadow-md);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.admin-modal-overlay.active .admin-modal-card {
  transform: scale(1);
}
.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}
.admin-modal-header h3 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
}
.admin-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* Clickable scroll controls (visible on mobile; appear on hover desktop) */
.scroll-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: var(--shadow-sm);
  font-size: 18px;
}
.scroll-control:hover { border-color: var(--accent-color); transform: translateY(-50%) scale(1.03); }
.scroll-control.visible { display: inline-flex; }

.scroll-prev { right: 8px; }
.scroll-next { left: 8px; }
body.en .scroll-prev { right: auto; left: 8px; }
body.en .scroll-next { left: auto; right: 8px; }

@media (max-width: 992px) {
  .scroll-control { display: inline-flex; }
}

/* Compact Mobile Stats Bar */
.admin-mobile-stats {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 103;
  padding: 8px 12px;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.02);
}
.admin-mobile-stats .mob-stat-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(200,160,78,0.06);
  color: var(--text-main);
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
}
.admin-mobile-stats .mob-stat-ico { font-size: 16px; }
.admin-mobile-stats .mob-stat-num { font-family: var(--font-en); font-size: 14px; }

@media (max-width: 992px) {
  /* Mobile stats hidden by request */
  .admin-mobile-stats { display: none !important; }
  /* restore main content padding used by the responsive layout */
  main.admin-main { padding-top: 76px !important; }
  /* Hide header day/night toggle on mobile to avoid duplicate controls */
  .admin-header .theme-toggle-btn, #themeToggle { display: none !important; }

  /* Small mobile stat boxes (removed) */
}

@media (max-width: 640px) {
  .admin-mobile-stats { display: none !important; }
  main.admin-main { padding-top: 76px !important; }
  .admin-header .theme-toggle-btn, #themeToggle { display: none !important; }
  /* Small mobile stat boxes (removed) */
}
.admin-modal-close:hover {
  background: var(--table-header);
  color: var(--accent-color);
}

.fg {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fg label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.fg input, .fg select, .fg textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  border-radius: 8px;
  outline: none;
  transition: var(--transition);
}

.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--card-glow);
  background-color: var(--bg-secondary);
}

.btn-cta {
  width: 100%;
  background: var(--accent-color);
  color: var(--white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px var(--card-glow);
}

.btn-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  display: none;
}
.alert-danger {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Eye Password Toggle inside Admin forms */
.password-input-wrapper {
  position: relative;
  width: 100%;
}
.password-input-wrapper input {
  padding-left: 40px !important;
}
body.en .password-input-wrapper input {
  padding-left: 14px !important;
  padding-right: 40px !important;
}
.toggle-password-btn {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  z-index: 2;
}
body.en .toggle-password-btn {
  left: auto;
  right: 10px;
}
.toggle-password-btn:hover {
  color: var(--accent-color);
}
.toggle-password-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Mobile swipe hint */
.mobile-swipe-hint {
  display: none;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--table-header);
  border-radius: 6px;
  width: fit-content;
}

/* ═══════════ MOBILE RESPONSIVE ARCHITECTURE ═══════════ */
.admin-mobile-nav {
  display: none;
  background-color: rgba(20, 16, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--sidebar-text);
  padding: 12px 18px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 102;
  border-bottom: 1px solid rgba(200, 160, 78, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.mobile-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-action-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 160, 78, 0.2);
  color: #f5d77f;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.mobile-action-icon-btn:hover {
  background: rgba(200, 160, 78, 0.2);
}
.mobile-action-icon-btn svg {
  width: 17px;
  height: 17px;
}

.drawer-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 160, 78, 0.2);
  color: #f5d77f;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
}

/* Prevent background scrolling when drawer is open */
body.no-scroll {
  overflow: hidden;
  touch-action: none;
}

/* ═══════════ FLOATING BOTTOM NAVIGATION BAR FOR MOBILE ═══════════ */
.admin-mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 16, 13, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(200, 160, 78, 0.25);
  padding: 8px 16px max(10px, env(safe-area-inset-bottom, 10px));
  z-index: 110;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.4);
}

body:not(.dark) .admin-mobile-bottom-bar {
  background: rgba(251, 250, 248, 0.94);
  border-top: 1px solid rgba(200, 160, 78, 0.25);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(245, 240, 230, 0.7);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

body:not(.dark) .mobile-nav-item {
  color: #756b5e;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.mobile-nav-item.active,
.mobile-nav-item:active {
  color: #f5d77f;
}

body:not(.dark) .mobile-nav-item.active {
  color: #9e7c34;
}

.mobile-nav-item.active svg {
  transform: translateY(-2px);
}

.mobile-nav-item.mobile-nav-add {
  background: linear-gradient(135deg, #e5c57b 0%, #c8a04e 100%);
  color: #14100d;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(200, 160, 78, 0.45);
  transform: translateY(-12px);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.mobile-nav-item.mobile-nav-add:active {
  transform: translateY(-10px) scale(0.95);
}

.mobile-nav-item.mobile-nav-add svg {
  width: 24px;
  height: 24px;
  stroke: #14100d;
}

/* ═══════════ RESPONSIVE BREAKPOINTS (MODERN MOBILE UX) ═══════════ */
@media (max-width: 992px) {
  .admin-mobile-nav {
    display: flex;
    height: 58px;
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: rgba(20, 16, 13, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(200, 160, 78, 0.22);
    align-items: center;
    justify-content: space-between;
  }

  body:not(.dark) .admin-mobile-nav {
    background: rgba(251, 250, 248, 0.94);
    border-bottom: 1px solid rgba(200, 160, 78, 0.22);
  }

  .mobile-action-icon-btn,
  .drawer-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(200, 160, 78, 0.1);
    border: 1px solid rgba(200, 160, 78, 0.25);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
  }

  .mobile-action-icon-btn:active,
  .drawer-toggle-btn:active {
    transform: scale(0.92);
  }

  .admin-mobile-bottom-bar {
    display: flex;
  }

  aside.admin-sidebar {
    transform: translateX(100%);
    top: 58px;
    height: calc(100vh - 58px);
    z-index: 130;
  }
  body.en aside.admin-sidebar {
    transform: translateX(-100%);
  }
  aside.admin-sidebar.open {
    transform: translateX(0);
  }
  body.en aside.admin-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }

  main.admin-main {
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding: 72px 14px 92px !important;
  }

  /* 2x2 Modern Luxury Metric Grid on Mobile */
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .stat-card {
    width: 100% !important;
    max-width: none !important;
    padding: 14px 12px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    cursor: pointer !important;
    text-align: right !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  }
  body.en .stat-card {
    text-align: left !important;
  }

  .stat-card:active {
    transform: scale(0.96) !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--accent-light) !important;
    flex-shrink: 0 !important;
  }

  .stat-info h3 {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .stat-number {
    font-size: 20px !important;
    font-weight: 800 !important;
    font-family: var(--font-en) !important;
    color: var(--text-main) !important;
    line-height: 1.1 !important;
  }

  /* Admin Header */
  .admin-header {
    margin-bottom: 16px;
  }
  .admin-header-title h1 {
    font-size: 19px;
  }
  .admin-header-title p {
    font-size: 12.5px;
  }

  /* Data Panels */
  .data-panel {
    padding: 16px 14px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .panel-title {
    font-size: 15.5px;
    font-weight: 800;
  }

  .panel-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .search-box {
    width: 100%;
  }
  .search-box input {
    width: 100%;
    min-width: 100%;
    height: 42px;
    font-size: 13.5px;
    border-radius: 10px;
  }

  .btn-action-add, .btn-export {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
    min-height: 40px;
    border-radius: 10px;
  }

  /* Filter Tabs */
  .filter-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  .filter-tab {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Table Touch Momentum */
  .table-wrapper {
    margin-left: -4px;
    margin-right: -4px;
    width: calc(100% + 8px);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th {
    padding: 11px 12px;
    font-size: 11.5px;
    white-space: nowrap;
  }
  .data-table td {
    padding: 11px 12px;
    font-size: 13px;
  }

  .actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .btn-action {
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: 8px;
    min-height: 34px;
    white-space: nowrap;
  }

  /* Modals Mobile Bottom Sheet */
  .admin-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .admin-modal-card {
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    padding: 22px 18px calc(24px + env(safe-area-inset-bottom, 12px));
    width: 100%;
    margin: 0;
  }
  .admin-modal-header h3 {
    font-size: 16.5px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .stat-card {
    padding: 12px 10px !important;
    gap: 8px !important;
  }
  .stat-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
  }
  .stat-number {
    font-size: 18px !important;
  }
  .stat-info h3 {
    font-size: 10px !important;
  }
}
