@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg: #eef7f7;
  --panel: #ffffff;
  --panel-soft: #f5fbfb;
  --ink: #07262a;
  --ink-2: #244a4f;
  --muted: #577b80;
  --line: #d4e8e7;
  --teal-950: #02181b;
  --teal-900: #042c31;
  --teal-800: #07454a;
  --teal-700: #0a7874;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --cyan-glow: #38e8d8;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 4px 16px rgba(4, 44, 49, 0.05);
  --shadow-md: 0 12px 32px rgba(4, 44, 49, 0.08);
  --shadow-glow: 0 10px 26px rgba(13, 148, 136, 0.3);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 262px;
  --rail-w: 74px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 13.5px/1.58 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.03em;
  margin: 0;
}

a { color: inherit; }
img { max-width: 100%; }

/* Admin Shell */
.admin-body {
  background:
    radial-gradient(circle at 95% 4%, rgba(20, 184, 166, 0.09), transparent 34%),
    radial-gradient(circle at 8% 92%, rgba(56, 232, 216, 0.07), transparent 32%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Futuristic Teal Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background:
    radial-gradient(circle at 18% 8%, rgba(45, 212, 191, 0.16), transparent 38%),
    linear-gradient(180deg, var(--teal-950) 0%, var(--teal-900) 58%, #063b40 100%);
  color: #d6f4f1;
  padding: 16px 14px 16px;
  display: flex;
  flex-direction: column;
  z-index: 60;
  border-right: 1px solid rgba(94, 234, 212, 0.14);
  box-shadow: 12px 0 38px rgba(2, 24, 27, 0.16);
  transition: width 0.28s var(--ease), transform 0.28s var(--ease), padding 0.28s var(--ease), box-shadow 0.28s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(94, 234, 212, 0.2); border-radius: 99px; }

.sidebar-top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.sidebar-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: #9be8e0;
  font: 700 10.5px 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  white-space: nowrap;
}
.sidebar-pin:hover,
.sidebar-pin[aria-pressed="true"] {
  background: rgba(20, 184, 166, 0.24);
  border-color: var(--teal-400);
  color: #fff;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #fff;
  font: 700 13.5px 'Space Grotesk', sans-serif;
  letter-spacing: 0.04em;
  padding: 4px 8px 18px;
  border-bottom: 1px solid rgba(94, 234, 212, 0.14);
  white-space: nowrap;
}
.brand-symbol {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500) 62%, var(--cyan-glow));
  font: 700 22px 'Space Grotesk', sans-serif;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.38);
}
.admin-logo {
  width: 42px;
  height: 42px;
  max-width: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
}
.admin-brand small {
  display: block;
  color: #79cbc4;
  font: 700 8.5px 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.2em;
  margin-top: 2px;
}

.side-label {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: #5ca8a2;
  font-weight: 800;
  padding: 18px 10px 8px;
  white-space: nowrap;
}

.side-nav {
  display: grid;
  gap: 3px;
}
.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #b4dfdc;
  font-size: 12.8px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
}
.side-nav a i {
  font-style: normal;
  font-size: 15px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--teal-300);
  transition: transform 0.22s var(--ease);
}
.side-nav a:hover {
  background: rgba(45, 212, 191, 0.12);
  color: #fff;
  transform: translateX(3px);
}
.side-nav a.active {
  background: linear-gradient(120deg, rgba(13, 148, 136, 0.92), rgba(20, 184, 166, 0.85));
  color: #fff;
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.34);
}
.side-nav a.active i { color: #fff; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(94, 234, 212, 0.14);
}
.admin-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
}
.admin-mini > span {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--teal-950);
  background: linear-gradient(135deg, var(--teal-300), var(--cyan-glow));
}
.admin-mini b { display: block; font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 165px; }
.admin-mini small { display: block; font-size: 10.5px; color: #7ecac3; }
.logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: #fecdd3;
  background: rgba(225, 29, 72, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.24);
  transition: background 0.2s, color 0.2s;
}
.logout-link:hover { background: rgba(225, 29, 72, 0.3); color: #fff; }

.sidebar-backdrop { display: none; }

/* Main Content Area */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.28s var(--ease);
}

.admin-top {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 70px;
  padding: 12px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(13, 148, 136, 0.12);
}
.side-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.side-toggle:hover {
  background: #e6f8f6;
  border-color: var(--teal-500);
  color: var(--teal-700);
  transform: scale(1.04);
}
.crumb {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--teal-700);
  margin-bottom: 2px;
}
.admin-top h1 { font-size: clamp(1.18rem, 2vw, 1.55rem); color: var(--ink); }

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-actions a {
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-800);
  background: #e3f7f5;
  border: 1px solid rgba(13, 148, 136, 0.2);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  white-space: nowrap;
}
.top-actions a:hover { background: var(--teal-600); color: #fff; transform: translateY(-1px); }
.top-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--teal-800), var(--teal-500));
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28);
}

.admin-content {
  flex: 1;
  padding: 24px 26px 36px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}
.admin-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--teal-800);
}
.admin-footer span { font-weight: 500; color: var(--muted); }

/* Eyebrow */
.eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal-700);
  margin-bottom: 6px;
}
.eyebrow.light { color: var(--teal-300); }

/* Welcome Banner */
.welcome-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(56, 232, 216, 0.34), transparent 40%),
    linear-gradient(120deg, var(--teal-950) 0%, var(--teal-900) 48%, var(--teal-700) 100%);
  box-shadow: 0 18px 42px rgba(4, 44, 49, 0.2);
  margin-bottom: 22px;
  overflow: hidden;
  animation: fadeSlideUp 0.45s var(--ease) both;
}
.welcome-panel h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); margin-bottom: 6px; }
.welcome-panel p { margin: 0; color: #bfe8e4; font-size: 13.5px; }
.welcome-mark {
  font: 700 28px/1 'Space Grotesk', sans-serif;
  color: var(--teal-300);
  text-align: right;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.24);
  backdrop-filter: blur(10px);
}
.welcome-mark span {
  display: block;
  font: 700 9.5px 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.2em;
  color: #d7f8f4;
  margin-top: 5px;
}

/* Metric Cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.metric-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s;
  animation: fadeSlideUp 0.5s var(--ease) both;
}
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-600), var(--cyan-glow));
}
.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 184, 166, 0.45);
  box-shadow: var(--shadow-md);
}
.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.metric-top span { font-size: 12px; font-weight: 700; color: var(--muted); }
.metric-top i {
  font-style: normal;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e3f7f5;
  color: var(--teal-700);
  font-size: 15px;
}
.metric-card strong {
  display: block;
  font: 700 clamp(1.7rem, 2.5vw, 2.25rem)/1.05 'Space Grotesk', sans-serif;
  color: var(--ink);
  margin-bottom: 6px;
}
.metric-card small { font-size: 11.5px; color: var(--muted); }

/* Panels & Grids */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.95fr);
  gap: 20px;
  margin-bottom: 22px;
}
.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.38fr);
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  min-width: 0;
  animation: fadeSlideUp 0.52s var(--ease) both;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel-head h3 { font-size: 1.15rem; color: var(--ink); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.panel-head > a {
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-700);
  padding: 6px 12px;
  border-radius: 999px;
  background: #e7f8f6;
  transition: background 0.2s, color 0.2s;
}
.panel-head > a:hover { background: var(--teal-600); color: #fff; }

/* Resolution Ring */
.resolution-ring {
  width: 164px;
  height: 164px;
  margin: 14px auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal-500) var(--rate, 0%), #dff2f0 0);
  box-shadow: inset 0 0 20px rgba(4, 44, 49, 0.08);
}
.resolution-ring > div {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
}
.resolution-ring strong { font: 700 28px/1 'Space Grotesk', sans-serif; color: var(--ink); }
.resolution-ring small { font-size: 9px; font-weight: 800; letter-spacing: 0.14em; color: var(--muted); margin-top: 4px; }
.ring-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}
.ring-legend span { display: inline-flex; align-items: center; gap: 7px; }
.green-dot, .amber-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.green-dot { background: var(--teal-500); }
.amber-dot { background: var(--amber); }

/* Tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid #e2f1ef;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e8f3f2;
  vertical-align: top;
  font-size: 12.8px;
}
th {
  background: #eff9f8;
  color: var(--teal-800);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr { transition: background 0.18s; }
tbody tr:hover { background: #f5fcfb; }
td small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.table-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.table-search input {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font: inherit;
  min-width: 200px;
}
.table-action, .table-danger {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  background: #e4f7f5;
  color: var(--teal-800);
  transition: background 0.2s, color 0.2s;
}
.table-action:hover { background: var(--teal-600); color: #fff; }
.table-danger { background: #fff1f2; color: #be123c; }
.table-danger:hover { background: #e11d48; color: #fff; }

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #e2f6f4;
  color: var(--teal-800);
  white-space: nowrap;
}
.pill.green { background: #d1fae5; color: #065f46; }
.pill.amber { background: #fef3c7; color: #92400e; }
.pill.red { background: #ffe4e6; color: #9f1239; }

/* Forms & Buttons */
.admin-form label, .case-form label, .settings-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 13px;
}
.admin-form input, .admin-form select, .admin-form textarea,
.case-form input, .case-form select, .case-form textarea,
.settings-form input, .settings-form select, .settings-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid #cce2e0;
  background: #f9fdfd;
  font: 500 13px 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus,
.case-form input:focus, .case-form select:focus, .case-form textarea:focus,
.settings-form input:focus, .settings-form select:focus, .settings-form textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.inline-form, .inline-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action-stack { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 700 12.8px/1 'Plus Jakarta Sans', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), background 0.22s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary, .btn-secondary {
  color: #fff;
  background: linear-gradient(120deg, var(--teal-700), var(--teal-500));
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover, .btn-secondary:hover { box-shadow: 0 12px 28px rgba(13, 148, 136, 0.42); }
.btn-outline { background: #fff; color: var(--teal-800); border-color: var(--line); }
.btn-outline:hover { border-color: var(--teal-500); background: #effaf9; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: #edf7f6; }

.mini-btn {
  padding: 6px 11px;
  border-radius: 9px;
  border: 0;
  font: 700 11.5px 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  background: #e4f7f5;
  color: var(--teal-800);
}
.mini-btn.approve { background: #d1fae5; color: #065f46; }
.mini-btn.approve:hover { background: #059669; color: #fff; }
.mini-btn.reject { background: #ffe4e6; color: #9f1239; }
.mini-btn.reject:hover { background: #e11d48; color: #fff; }

/* Settings, Media, Alerts */
.content-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-stat { font-size: 12.5px; font-weight: 700; color: var(--teal-800); background: #e3f7f5; padding: 7px 14px; border-radius: 999px; }
.media-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.edit-thumb { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 10px; }
.empty-admin { padding: 34px 18px; text-align: center; color: var(--muted); font-weight: 600; background: var(--panel-soft); border-radius: 14px; border: 1px dashed var(--line); }

.settings-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 14px 0; }
.settings-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.current-branding img {
  display: block;
  width: 140px !important;
  height: 140px !important;
  max-width: 140px !important;
  max-height: 140px !important;
  object-fit: contain !important;
  background: #f5fbfb;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  margin-top: 8px;
}
.current-branding img.favicon-preview { width: 48px !important; height: 48px !important; max-width: 48px !important; max-height: 48px !important; }

.alert {
  padding: 13px 16px;
  border-radius: 13px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  background: #e6f9f6;
  color: var(--teal-900);
  border: 1px solid #a7e8df;
}
.alert-danger { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.notice { padding: 14px 16px; border-radius: 13px; background: #eaf8f6; border-left: 4px solid var(--teal-600); color: var(--ink-2); font-size: 12.8px; }

/* Futuristic Admin Login Screen */
.login-body {
  min-height: 100vh;
  background: var(--teal-950);
}
.login-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.login-brand {
  position: relative;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(20, 184, 166, 0.34), transparent 45%),
    radial-gradient(circle at 82% 82%, rgba(56, 232, 216, 0.24), transparent 44%),
    linear-gradient(145deg, var(--teal-950) 0%, var(--teal-900) 58%, var(--teal-800) 100%);
  overflow: hidden;
}
.login-brand .admin-brand { border: 0; padding: 0; margin-bottom: 34px; }
.login-brand h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; margin: 10px 0 14px; }
.login-brand h1 em {
  font-style: normal;
  background: linear-gradient(95deg, var(--teal-300), #a7f3d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-brand p { color: #b7e2de; max-width: 460px; font-size: 15px; }
.login-orb {
  position: absolute;
  right: -90px;
  bottom: -90px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(94, 234, 212, 0.3);
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 70%);
  pointer-events: none;
}
.login-side {
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}
.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(26px, 4vw, 38px);
  box-shadow: var(--shadow-md);
}
.login-card h2 { font-size: 1.8rem; margin-bottom: 6px; }
.login-card p { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.login-card label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 14px; }
.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cce2e0;
  background: #f9fdfd;
  font: inherit;
}
.login-card input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16); background: #fff; }
.login-card .btn { width: 100%; padding: 13px; margin-top: 6px; }
.login-card > a { display: inline-block; margin-top: 18px; font-size: 12.5px; font-weight: 700; color: var(--teal-700); text-decoration: none; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   DESKTOP AUTO-HIDE ICON RAIL + HOVER EXPAND + FULL TOGGLE
   ========================================================= */
@media (min-width: 901px) {
  body.sidebar-collapsed .sidebar {
    width: var(--rail-w);
    padding-left: 10px;
    padding-right: 10px;
  }
  body.sidebar-collapsed .admin-main { margin-left: var(--rail-w); }

  body.sidebar-collapsed:not(.sidebar-hover) .admin-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  body.sidebar-collapsed:not(.sidebar-hover) .admin-brand > span:last-child,
  body.sidebar-collapsed:not(.sidebar-hover) .side-label,
  body.sidebar-collapsed:not(.sidebar-hover) .side-nav a > span,
  body.sidebar-collapsed:not(.sidebar-hover) .sidebar-bottom .admin-mini div,
  body.sidebar-collapsed:not(.sidebar-hover) .logout-link,
  body.sidebar-collapsed:not(.sidebar-hover) .sidebar-pin span {
    display: none;
  }
  body.sidebar-collapsed:not(.sidebar-hover) .side-nav a { justify-content: center; padding: 11px 6px; }
  body.sidebar-collapsed:not(.sidebar-hover) .side-nav a i { font-size: 17px; }
  body.sidebar-collapsed:not(.sidebar-hover) .sidebar-top-actions { justify-content: center; }
  body.sidebar-collapsed:not(.sidebar-hover) .sidebar-pin { padding: 6px 9px; }

  /* Floating expand on hover */
  body.sidebar-collapsed.sidebar-hover .sidebar {
    width: var(--sidebar-w);
    padding-left: 14px;
    padding-right: 14px;
    box-shadow: 20px 0 54px rgba(2, 24, 27, 0.36);
  }

  /* Full hide when user clicks toggle button */
  body.sidebar-hidden .sidebar { transform: translateX(-108%); }
  body.sidebar-hidden .admin-main { margin-left: 0; }
}

/* =========================================================
   TABLET & MOBILE ULTRA-RESPONSIVE BREAKPOINTS
   ========================================================= */
@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .admin-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(290px, 86vw);
    transform: translateX(-108%);
    z-index: 100;
    box-shadow: 24px 0 60px rgba(2, 24, 27, 0.45);
  }
  .sidebar.show { transform: translateX(0); }
  .admin-main { margin-left: 0 !important; }
  .sidebar-top-actions { display: none; }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 24, 27, 0.62);
    backdrop-filter: blur(5px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s;
  }
  .sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }

  .admin-top { padding: 10px 14px; }
  .admin-content { padding: 18px 14px 30px; }
  .login-grid { grid-template-columns: 1fr; }
  .login-brand { padding: 34px 22px; }
  .settings-upload-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .metric-grid, .metric-grid.compact, .form-row { grid-template-columns: 1fr; }
  .welcome-panel { padding: 20px; }
  .welcome-mark { width: 100%; text-align: left; }
  .top-actions a { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* Drag & Drop Ordering + QR Modal in Admin */
.drag-row { cursor: grab; }
.drag-row.dragging { opacity: 0.45; background: #dff7f4; }
.order-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.drag-handle { font-size: 15px; color: var(--teal-700); cursor: grab; user-select: none; }
.rank-num { font: 800 12px 'Space Grotesk', sans-serif; color: var(--teal-900); min-width: 24px; }
.order-arrows { display: inline-flex; flex-direction: column; gap: 2px; }
.arrow-btn { border: 1px solid var(--line); background: #fff; color: var(--teal-800); font-size: 8px; line-height: 1; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
.arrow-btn:hover { background: var(--teal-600); color: #fff; border-color: var(--teal-600); }

.qr-modal-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(2, 24, 27, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px; }
.qr-modal-backdrop[hidden] { display: none; }
.qr-modal { width: min(440px, 100%); background: #fff; border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(0,0,0,0.35); overflow: hidden; }
.qr-modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.qr-close { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 16px; }
.qr-modal-body { padding: 22px 20px; text-align: center; }
.qr-modal-body img { margin: 0 auto 14px; border-radius: 14px; border: 1px solid var(--line); padding: 8px; background: #fff; }
.qr-meta { margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.qr-link-note { margin: 0 0 18px; font-size: 12px; color: var(--muted); }
.qr-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
