@charset "UTF-8";
/* ===========================================================
   SAC Admin UI — Unified (Auth + App Shell)
   Theme: Burgundy / Dark Red + Clean White Main
   - Mobile-first responsive header + sidebar drawer
   - Card-first main content
=========================================================== */

*{ box-sizing:border-box; }
html, body{ height:100%; }

:root{
  /* Sizes */
  --hdr-h: 58px;
  --sb-w: 276px;

  /* Primary theme (dark red) */
  --red:    #4b0f14;   /* dark red */
  --red-2:  #2f070b;   /* deeper */
  --red-3:  #6a1a21;   /* hover / accents */

  /* Main surfaces */
  --bg: #ffffff;       /* IMPORTANT: main is white */
  --soft: #f6f7fb;     /* subtle page background (optional zones) */
  --card: #ffffff;
  --card-border:#e5e7eb;

  /* Text */
  --ink:#111827;
  --muted:#6b7280;

  /* Borders/shadows */
  --line: rgba(255,255,255,.12);   /* shell line */
  --shadow: 0 12px 30px rgba(17,24,39,.12);
  --shadow2: 0 1px 2px rgba(0,0,0,.05);

  /* Radii */
  --r10: 10px;
  --r12: 12px;
  --r14: 14px;

  /* UI */
  --btn-border: rgba(255,255,255,.18);
  --focus: rgba(106,26,33,.18);    /* focus ring */
}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

/* ===========================================================
   Small atoms
=========================================================== */
.card{
  background: var(--card);
  border:1px solid var(--card-border);
  border-radius: var(--r14);
  box-shadow: var(--shadow2);
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius: var(--r10);
  border:1px solid #d1d5db;
  background:#fff;
  color: var(--ink);
  cursor:pointer;
  text-decoration:none;
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1;
}
.btn:hover{ background:#f9fafb; }
.btn.primary{
  background: linear-gradient(180deg, var(--red-3), var(--red));
  border-color: rgba(75,15,20,.45);
  color:#fff;
  box-shadow: 0 10px 22px rgba(75,15,20,.18);
}
.btn.primary:hover{ filter: brightness(1.03); }
.btn.ghost{
  background:#f3f4f6;
  border-color:#e5e7eb;
  color:#111827;
}
.input, .select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius: var(--r12);
  background:#fff;
  font-size: 14.5px;
  color:#111827;
  outline:none;
}
.input:focus, .select:focus, textarea:focus{
  border-color: rgba(106,26,33,.55);
  box-shadow: 0 0 0 3px var(--focus);
}
label{
  display:block;
  margin: 10px 0 6px;
  font-weight: 900;
  font-size: 13.5px;
  color:#374151;
}

.flash{
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--r12);
  border: 1px solid var(--card-border);
  background:#fff;
  box-shadow: var(--shadow2);
  font-size: 14.5px;
  line-height: 1.35;
}
.flash.danger{ border-color:#fecaca; background:#fef2f2; color:#991b1b; }
.flash.info{ border-color:#e5e7eb; background:#fff; color:#111827; }
.flash.warn{ border-color:#fed7aa; background:#fff7ed; color:#9a3412; }

.muted{ color: var(--muted); }

/* ===========================================================
   AUTH PAGES (kept compatible)
=========================================================== */
.auth-page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px 12px;
  background: var(--soft);
}
.auth-shell{ width:100%; max-width:460px; }
.auth-card{ padding:0; overflow:hidden; }
.auth-banner{
  width:100%;
  border-bottom:1px solid #e5e7eb;
  display:flex;
  justify-content:center;
  padding:10px 12px;
  background:#fff;
}
.auth-banner img{
  width:min(600px, 100%);
  height:auto;
  display:block;
  border-radius:10px;
}
.auth-head{ padding:14px 16px 0; }
.auth-title{ margin:0; font-size:18px; font-weight:950; }
.auth-sub{ margin:6px 0 0; color:#6b7280; font-size:13px; }
.auth-body{ padding:14px 16px 16px; }

.lang-switch{
  display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; margin-top:10px;
}
.lang-switch a{
  text-decoration:none;
  font-weight:900;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#111;
}
.lang-switch a.active{
  border-color: rgba(106,26,33,.55);
  background: rgba(106,26,33,.08);
  color: var(--red);
}

/* ===========================================================
   APP SHELL (Header + Sidebar + Main)
=========================================================== */

/* Header */
.topbar{
  position: sticky;
  top:0;
  z-index: 1000;
  height: var(--hdr-h);
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--red), var(--red-2));
  color:#fff;
  border-bottom: 1px solid var(--line);
}

/* Make header robust on mobile: allow wrapping cleanly */
.topbar{
  flex-wrap: wrap;
  height: auto; /* critical for mobile wrap */
  min-height: var(--hdr-h);
}
.brand{
  font-weight: 950;
  letter-spacing: .2px;
  white-space: nowrap;
}
.spacer{ flex: 1 1 auto; min-width: 0; }

.burger{
  width: 42px;
  height: 42px;
  border-radius: var(--r10);
  border: 1px solid var(--btn-border);
  background: rgba(255,255,255,.10);
  color:#fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.burger:hover{ background: rgba(255,255,255,.14); }

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border:1px solid var(--btn-border);
  background: rgba(255,255,255,.08);
  color:#fff;
  font-weight: 850;
  max-width: 56vw;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

/* Header buttons (white outline) */
.topbar .btn{
  border-color: var(--btn-border);
  background: rgba(255,255,255,.08);
  color:#fff;
}
.topbar .btn:hover{ background: rgba(255,255,255,.12); }
.topbar .btn.primary{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
  box-shadow: none;
}

/* Layout */
.wrap{
  display:flex;
  min-height: calc(100vh - var(--hdr-h));
}

/* Sidebar */
.sidebar{
  width: var(--sb-w);
  min-width: var(--sb-w);
  background: linear-gradient(180deg, var(--red-2), #1f0508);
  color:#fff;
  border-right: 1px solid var(--line);
  padding: 12px;
  overflow:auto;
}
.sideCard{
  padding: 12px;
  border-radius: var(--r14);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  margin-bottom: 10px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  color:#fff;
  text-decoration:none;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 850;
  font-size: 14.5px;
}
.nav a:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
.nav a.active{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

/* Main */
.main{
  flex: 1 1 auto;
  min-width:0;
  padding: 18px;
  background: var(--bg);  /* white */
}
.container{
  max-width: 1200px;
  margin: 0 auto;
}

/* Profile dropdown */
.profile{ position:relative; }
.profileBtn{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
  max-width: 52vw;
}
.profileAv{ width:32px; height:32px; border-radius:12px; object-fit:cover; border:1px solid rgba(255,255,255,.25); }
.profileTxt{ display:flex; flex-direction:column; min-width:0; line-height:1.05; }
.profileName{ font-weight:950; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profileRole{ font-weight:800; font-size:11px; opacity:.85; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profileCar{ font-weight:950; opacity:.9; }

.profileMenu{
  position:absolute;
  right:0; top: calc(100% + 10px);
  width: min(320px, 86vw);
  background:#fff;
  border:1px solid rgba(17,24,39,.12);
  border-radius:14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  padding: 8px;
  z-index: 2000;
}
.profileMeta{ padding:10px 10px 8px; }
.pmName{ font-weight:950; color:#111827; }
.pmEmail{ font-size:12px; color:#6b7280; margin-top:2px; word-break:break-word; }
.pmSep{ height:1px; background: rgba(17,24,39,.08); margin: 6px 0; }
.profileMenu a{
  display:block;
  padding:10px 10px;
  border-radius:12px;
  text-decoration:none;
  font-weight:900;
  color:#111827;
}
.profileMenu a:hover{ background:#f3f4f6; }
.profileMenu a.danger{ color:#7f1d1d; }
.profileMenu a.danger:hover{ background: rgba(127,29,29,.10); }

@media (max-width: 560px){
  .brand{ font-size: 14px; }
  .profileBtn{ max-width: 48vw; padding:7px 8px; gap:8px; }
  .profileAv{ width:28px; height:28px; border-radius:10px; }
  .profileRole{ display:none; } /* reduce header height */
}


/* Page header */
.pagehead{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.pagehead h1{
  margin:0;
  font-size: 20px;
  font-weight: 950;
}
.pagehead .sub{
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--muted);
}
.pagehead .right{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

/* Card-first content helpers */
.grid{ display:grid; gap: 14px; }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }

.cardHead{
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  background: #fff;
}
.cardTitle{
  font-weight: 950;
  font-size: 15.5px;
}
.cardBody{ padding: 14px; }

/* Tables */
.tableWrap{ overflow:auto; }
table{ width:100%; border-collapse: collapse; }
th, td{
  padding: 11px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align:left;
  font-size: 14.5px;
  white-space: nowrap;
}
th{
  background: #f8fafc;
  font-weight: 950;
  color:#374151;
}

/* Mobile sidebar drawer + overlay */
.overlay{
  display:none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1100;
}
.overlay.show{ display:block; }

@media (max-width: 980px){
  .wrap{ display:block; }

  .sidebar{
    position: fixed;
    top: 0;               /* sidebar covers from top on mobile */
    left: 0;
    height: 100vh;
    width: min(84vw, 330px);
    min-width: 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 1200;
  }
  .sidebar.open{ transform: translateX(0); }

  .main{ padding: 14px; }

  .chip{ max-width: 86vw; }
  .grid.cols-2, .grid.cols-3{ grid-template-columns: 1fr; }
}
