/* ===========================
   Super Admin UI Theme (Modern Light)
   Matches mobile app style
   =========================== */

:root {
  --bg: #f6f8fc;
  --card: #ffffff;

  /* ✅ softer text colors */
  --text: #0b1220;
  --muted: rgba(15, 23, 42, 0.62);
  --line: rgba(148, 163, 184, 0.22);

  --primary: #2e6de7;
  --primary-10: rgba(46, 109, 231, 0.1);
  --primary-15: rgba(46, 109, 231, 0.15);

  --success: #16a34a;
  --success-10: rgba(22, 163, 74, 0.1);

  --warning: #ea580c;
  --warning-10: rgba(234, 88, 12, 0.12);

  --danger: #ef4444;
  --danger-10: rgba(239, 68, 68, 0.1);

  /* ✅ Softer shadow (more premium) */
  --shadow: 0 18px 45px rgba(2, 6, 23, 0.07);
  --shadow-sm: 0 12px 22px rgba(2, 6, 23, 0.06);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;

  --sidebar-w: 280px;

  /* ✅ Typography weights system */
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-black: 800; /* only for big headings */
}

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

/* ✅ Modern font rendering */
html,
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.12px;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* smooth */
a,
button {
  transition: 200ms ease;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* =====================
   Layout
   ===================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
  padding: 18px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 252, 0.82);
  backdrop-filter: blur(16px);
}

.footer {
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  color: rgba(100, 116, 139, 0.85);
  font-size: 12px;
  font-weight: var(--w-medium);
  background: rgba(246, 248, 252, 0.65);
}

/* =====================
   Sidebar
   ===================== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 18px;
}

.brand .logo {
  height: 42px;
  width: 42px;
  border-radius: 14px;
  background: var(--primary);
  box-shadow: 0 16px 26px rgba(46, 109, 231, 0.22);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: var(--w-black);
  letter-spacing: -0.2px;
}

.brand .title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand .title strong {
  font-size: 14px;
  font-weight: var(--w-bold);
}

.brand .title span {
  font-size: 12px;
  font-weight: var(--w-medium);
  color: var(--muted);
}

.nav-group {
  margin-top: 8px;
}

.nav-label {
  font-size: 10.5px;
  letter-spacing: 2px;
  font-weight: var(--w-semibold);
  color: rgba(148, 163, 184, 0.95);
  margin: 14px 10px 8px;
}

.nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 46px;
  padding: 0 12px;
  border-radius: 16px;
  font-weight: var(--w-semibold);
  font-size: 13px;
  color: rgba(51, 65, 85, 0.96);
}

.nav-item i {
  font-size: 18px;
}

.nav-item:hover {
  background: rgba(46, 109, 231, 0.06);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-10);
  border: 1px solid rgba(46, 109, 231, 0.22);
  color: var(--primary);
}

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 8px;
}

.user-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  height: 42px;
  width: 42px;
  border-radius: 999px;
  background: var(--primary-10);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: var(--w-bold);
}

.user-meta strong {
  font-size: 13px;
  font-weight: var(--w-bold);
}

.user-meta span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: var(--w-medium);
}

.user-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: var(--w-semibold);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.btn i {
  font-size: 18px;
}

.btn.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 18px 30px rgba(46, 109, 231, 0.20);
}

.btn.primary:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.btn.ghost {
  background: rgba(241, 245, 249, 0.8);
  color: rgba(51, 65, 85, 0.96);
}

.btn.ghost:hover {
  background: rgba(226, 232, 240, 0.95);
}

/* =====================
   Topbar
   ===================== */
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 42px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  font-weight: var(--w-medium);
  font-size: 13px;
  outline: none;
}

.search input:focus {
  border-color: rgba(46, 109, 231, 0.35);
  box-shadow: 0 0 0 4px rgba(46, 109, 231, 0.12);
}

.search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.9);
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  height: 44px;
  width: 44px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.05);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn i {
  font-size: 20px;
  color: rgba(11, 18, 32, 0.92);
}

.icon-btn:hover {
  transform: translateY(-1px);
}

/* =====================
   Dashboard UI
   ===================== */
.page {
  padding: 18px 20px 30px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h1 {
  font-size: 22px;
  font-weight: var(--w-black);
  letter-spacing: -0.45px;
}

.page-head p {
  font-size: 13px;
  font-weight: var(--w-medium);
  color: var(--muted);
  margin-top: 6px;
}

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

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title strong {
  font-size: 14px;
  font-weight: var(--w-bold);
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: var(--w-semibold);
  font-size: 11px;
  letter-spacing: 1px;
}

.badge.success {
  background: var(--success-10);
  color: var(--success);
}

.badge.warning {
  background: var(--warning-10);
  color: var(--warning);
}

.badge.primary {
  background: var(--primary-10);
  color: var(--primary);
}

.metric {
  font-size: 26px;
  font-weight: var(--w-black);
  letter-spacing: -0.55px;
}

.mini {
  font-size: 12px;
  font-weight: var(--w-medium);
  color: var(--muted);
  margin-top: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 1.6px;
  font-weight: var(--w-semibold);
  color: rgba(148, 163, 184, 0.95);
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 14px 10px;
  font-weight: var(--w-medium);
  font-size: 13px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
}

.row-muted {
  color: rgba(71, 85, 105, 0.8);
  font-weight: var(--w-regular);
  font-size: 12px;
}

.status-pill {
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: var(--w-semibold);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-pill i {
  font-size: 16px;
}

.status-pill.success {
  background: var(--success-10);
  color: var(--success);
}

.status-pill.warning {
  background: var(--warning-10);
  color: var(--warning);
}

.status-pill.danger {
  background: var(--danger-10);
  color: var(--danger);
}

.skeleton {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(241, 245, 249, 1) 0%,
    rgba(226, 232, 240, 1) 50%,
    rgba(241, 245, 249, 1) 100%
  );
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  from { background-position: 0% 0; }
  to { background-position: 200% 0; }
}

/* =====================
   Responsive
   ===================== */
.mobile-toggle {
  display: none;
}

@media (max-width: 980px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99;
    transform: translateX(-110%);
    transition: 250ms ease;
  }

  .sidebar.open {
    transform: translateX(0%);
  }

  .mobile-toggle {
    display: grid;
  }
}
/* =====================
   AUTH / LOGIN SCREEN
   ===================== */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

/* -------------------
   Left Visual Panel
   ------------------- */
.auth-visual {
  padding: 18px;
  display: flex;
  align-items: stretch;
}

.auth-visual-card {
  flex: 1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(46, 109, 231, 0.22);

  /* modern premium gradient */
  background: radial-gradient(
      900px 500px at 20% 20%,
      rgba(255, 255, 255, 0.22),
      transparent 60%
    ),
    linear-gradient(150deg, rgba(46, 109, 231, 1), rgba(46, 109, 231, 0.78));

  box-shadow: 0 50px 85px rgba(46, 109, 231, 0.20);
  padding: 26px;
  color: #fff;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 44px;
  width: 44px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-weight: var(--w-black);
  letter-spacing: -0.3px;
}

.brand-title strong {
  display: block;
  font-size: 14px;
  font-weight: var(--w-bold);
}

.brand-title span {
  display: block;
  font-size: 12px;
  opacity: 0.82;
  font-weight: var(--w-medium);
  margin-top: 2px;
}

.visual-copy {
  margin-top: 26px;
  max-width: 420px;
}

.visual-copy h2 {
  font-size: 32px;
  font-weight: var(--w-black);
  letter-spacing: -0.6px;
}

.visual-copy p {
  margin-top: 10px;
  font-weight: var(--w-medium);
  opacity: 0.88;
  line-height: 1.55;
  font-size: 13px;
}

.visual-stats {
  margin-top: 26px;
  display: grid;
  gap: 12px;
  max-width: 440px;
}

.vstat {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.vstat i {
  font-size: 22px;
  opacity: 0.96;
}

.vstat strong {
  display: block;
  font-size: 13px;
  font-weight: var(--w-bold);
}

.vstat span {
  display: block;
  font-size: 12px;
  opacity: 0.85;
  font-weight: var(--w-medium);
  margin-top: 2px;
}

/* subtle wave */
.auth-wave {
  position: absolute;
  inset: auto -26% -40% -26%;
  height: 58%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(2px);
}

/* -------------------
   Right Form Panel
   ------------------- */
.auth-form {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 92vw);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-head {
  padding-bottom: 10px;
}

.auth-head .chip {
  width: fit-content;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-10);
  border: 1px solid rgba(46, 109, 231, 0.22);
  color: var(--primary);
  font-weight: var(--w-semibold);
  font-size: 12px;
}

.auth-head .chip i {
  font-size: 16px;
}

.auth-head h1 {
  margin-top: 12px;
  font-size: 26px;
  font-weight: var(--w-black);
  letter-spacing: -0.5px;
}

.auth-head p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: var(--w-medium);
  line-height: 1.55;
}

/* -------------------
   Form Fields
   ------------------- */
.form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.field label {
  font-size: 12px;
  font-weight: var(--w-semibold);
  color: rgba(15, 23, 42, 0.78);
  margin-bottom: 7px;
  display: block;
}

.input {
  position: relative;
}

.input i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(148, 163, 184, 0.92);
  font-size: 18px;
}

.input input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  background: rgba(255, 255, 255, 0.96);
  font-size: 13px;
  font-weight: var(--w-medium);
}

.input input::placeholder {
  color: rgba(100, 116, 139, 0.70);
}

.input input:focus {
  border-color: rgba(46, 109, 231, 0.35);
  box-shadow: 0 0 0 4px rgba(46, 109, 231, 0.12);
}

/* Show/Hide password button */
.eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  cursor: pointer;
  height: 36px;
  width: 36px;
  border-radius: 14px;
  background: rgba(241, 245, 249, 0.96);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.eye i {
  font-size: 18px;
  color: rgba(11, 18, 32, 0.86);
}

/* -------------------
   Remember + Forgot Row
   ------------------- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.remember {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: var(--w-medium);
  color: rgba(15, 23, 42, 0.75);
}

.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.link {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: var(--w-semibold);
  color: var(--primary);
}

.link:hover {
  opacity: 0.85;
}

/* -------------------
   Login Button
   ------------------- */
.btn-login {
  height: 52px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-weight: var(--w-bold);
  letter-spacing: -0.1px;
  box-shadow: 0 26px 44px rgba(46, 109, 231, 0.24);
  display: grid;
  place-items: center;
}

.btn-login span {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.btn-login i {
  font-size: 18px;
}

.btn-login:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

.btn-login:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

/* loader dots */
.loading {
  display: inline-flex;
  gap: 8px;
}

.loading .dot {
  height: 8px;
  width: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  animation: bounce 800ms infinite ease-in-out;
}

.loading .dot:nth-child(2) {
  animation-delay: 120ms;
}
.loading .dot:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* errors */
.err {
  margin-top: 7px;
  display: inline-flex;
  color: var(--danger);
  font-size: 12px;
  font-weight: var(--w-medium);
}

/* hint info */
.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(46, 109, 231, 0.08);
  border: 1px solid rgba(46, 109, 231, 0.16);
  color: rgba(15, 23, 42, 0.74);
  font-size: 12px;
  font-weight: var(--w-medium);
  line-height: 1.45;
}

.hint i {
  font-size: 18px;
  color: var(--primary);
  margin-top: 1px;
}

/* footer inside card */
.auth-foot {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(100, 116, 139, 0.9);
  font-weight: var(--w-medium);
}

.auth-foot .sep {
  opacity: 0.55;
}

.auth-foot .muted {
  opacity: 0.8;
}

/* -------------------
   Responsive
   ------------------- */
@media (max-width: 980px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
}
/* =========================================================
   ✅ GLOBAL MOBILE PATCH (Fix right-side overflow)
   Paste at END of style.css
   ========================================================= */

/* ✅ 1) Hard stop horizontal overflow */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#app, .app-shell, .main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ✅ Prevent any element from pushing layout */
* {
  max-width: 100%;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   ✅ MOBILE rules
   ========================================================= */
@media (max-width: 980px) {
  /* Page padding smaller */
  .page {
    padding: 14px 14px 22px !important;
  }

  .topbar {
    padding: 12px 14px !important;
  }

  .footer {
    padding: 16px 14px !important;
  }

  /* ✅ Sidebar drawer already fixed, just ensure it never creates overflow */
  .sidebar {
    max-width: 86vw !important;
    width: min(var(--sidebar-w), 86vw) !important;
  }

  /* ✅ Topbar inner wrap */
  .topbar-inner {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* Search full width (avoid overflow) */
  .search {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .search input {
    width: 100% !important;
  }

  /* ✅ Metrics grid responsive */
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* ✅ Any grid that accidentally overflow */
  .grid {
    width: 100% !important;
  }

  /* ✅ Cards should not overflow */
  .card {
    width: 100% !important;
    overflow: hidden !important;
  }

  /* ✅ Table overflow fix globally */
  .table {
    width: 100% !important;
    border-collapse: collapse;
  }

  /* If tables are wide, allow scroll */
  .table-wrap,
  .table-scroll {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* In case table is direct inside card */
  .card > table.table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  /* force min-width for tables so scroll appears */
  .card > table.table,
  .table-wrap table.table {
    min-width: 760px !important;
  }

  /* ✅ Buttons don't push width */
  .btn {
    white-space: nowrap;
  }

  /* ✅ Fix select/input causing overflow */
  input, select, textarea {
    max-width: 100% !important;
  }
}

/* ✅ extra small devices */
@media (max-width: 520px) {
  .grid.cols-4 {
    grid-template-columns: 1fr !important;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .icon-btn {
    height: 42px;
    width: 42px;
  }
}

/* =========================================================
   ✅ SAFETY: debug helper (optional remove)
   ========================================================= */
/*
* { outline: 1px solid rgba(255,0,0,0.06); }
*/
