/* /css/admin.css */

/* =========================
   THEME TOKENS (Asterlyx)
========================= */
:root{
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;

  /* Mauritius-inspired accents */
  --ax-red:  #e11d48;
  --ax-blue: #2563eb;
  --ax-green:#16a34a;

  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --shadow-soft: 0 8px 18px rgba(0,0,0,.06);

  /* Slight rounding (NOT bubble pills) */
  --r-sm: 10px;
  --r-md: 14px;

  --focus: 0 0 0 3px rgba(37,99,235,.22);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

/* =========================
   TYPE
========================= */
.h1{ font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.h2{ font-size: 15px; font-weight: 800; margin:0 0 10px; }
.h3{ font-size: 13px; font-weight: 800; margin:0 0 10px; }
.small{ font-size: 12px; }
.muted{ color: var(--muted); }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* =========================
   ACCESSIBILITY
========================= */
:focus{ outline:none; }
:focus-visible{ box-shadow: var(--focus); border-radius: 8px; }
a{ color: inherit; }
a:hover{ color: var(--ax-blue); }

/* =========================
   CARD / PANELS
========================= */
.card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
}
.hr{
  border:0;
  height:1px;
  background: var(--line);
  margin: 14px 0;
}

/* =========================
   BUTTONS
========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 12px; /* slight */
  border: 1px solid transparent;
  cursor:pointer;
  text-decoration:none;
  user-select:none;
  line-height:1;
}

.btn-primary{
  background: linear-gradient(90deg, rgba(225,29,72,.95), rgba(37,99,235,.95));
  color: #fff;
  box-shadow: 0 10px 18px rgba(37,99,235,.18);
}
.btn-primary:hover{ filter: brightness(1.02); }
.btn-primary:active{ transform: translateY(1px); }

.btn-ghost{
  background: #fff;
  border-color: var(--line);
  color: #111827;
}
.btn-ghost:hover{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 10px 20px rgba(37,99,235,.10);
}

.btn-danger{
  background:#fff;
  border-color: rgba(225,29,72,.30);
  color: var(--ax-red);
}
.btn-danger:hover{
  border-color: rgba(225,29,72,.55);
  box-shadow: 0 12px 24px rgba(225,29,72,.10);
}

.btn[disabled],
.btn.is-disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none !important;
  box-shadow:none !important;
}

/* =========================
   INPUTS (NO BUBBLES)
========================= */
label{
  display:block;
  font-size: 12px;
  font-weight: 800;
  color: #374151;
  margin: 10px 0 6px;
}
input, select, textarea{
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  background:#fff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(0,0,0,.02);
}
input::placeholder{ color:#9ca3af; }
textarea{ min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus{ box-shadow: var(--focus); border-color: rgba(37,99,235,.55); }

/* keep filters from going “100% across the universe” */
.filters input{ width: 180px; }
.filters input[name="q"]{ width: 240px; }
.filters select{ width: 170px; }

/* =========================
   TOASTS
========================= */
.toast{
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 320px;
  max-width: 720px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 9999;
}
.toast ul{ margin:8px 0 0; padding-left:18px; }
.toast-ok{
  border-color: rgba(22,163,74,.30);
}
.toast-ok::before{
  content:"";
  display:block;
  height:3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ax-green), rgba(22,163,74,.25));
  margin: 0 0 10px;
}
.toast-error{
  border-color: rgba(225,29,72,.30);
}
.toast-error::before{
  content:"";
  display:block;
  height:3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ax-red), rgba(225,29,72,.25));
  margin: 0 0 10px;
}

/* =========================
   LOGIN (CENTERED MODAL)
========================= */
body.login{
  overflow:hidden;
}

.login-bg{
  position:fixed;
  inset:0;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(37,99,235,.15), transparent 60%),
    radial-gradient(900px 500px at 80% 20%, rgba(225,29,72,.14), transparent 60%),
    radial-gradient(900px 600px at 40% 90%, rgba(22,163,74,.10), transparent 60%),
    linear-gradient(180deg, #f7f8fb, #eef1f6);
  z-index:0;
}

.login-wrap{
  position:relative;
  z-index:1;
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
}

.login-card{
  width: 420px;
  max-width: 92vw;
  padding: 18px 18px 16px;
}

.login-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom: 6px;
}

.brand-dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ax-red), var(--ax-blue), var(--ax-green));
  box-shadow: 0 10px 18px rgba(0,0,0,.12);
}

/* =========================
   TOP BAR
========================= */
.topbar-global{
  position: sticky;
  top: 0;
  z-index: 50;
  display:grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 12px;
  align-items:center;

  padding: 12px 14px;
  background: rgba(245,246,248,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229,231,235,.85);
}

.titleblock .title{
  font-weight: 900;
  letter-spacing: -.01em;
}
.titleblock{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.filters{
  display:flex;
  gap: 10px;
  align-items:flex-end;
  justify-content:center;
  flex-wrap: nowrap;
}

.topbar-right{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  align-items:center;
}

/* =========================
   APP LAYOUT (3 columns + framed sidebar)
   NOTE: this is “defensive CSS” so it works even if your HTML
   uses slightly different wrappers.
========================= */

/* Common wrappers seen in your build */
.main-grid,
.layout-3col,
.shell,
.app-shell{
  display:grid;
  grid-template-columns: 260px minmax(520px, 1fr) 360px;
  gap: 14px;
  padding: 14px;
  align-items:start;
}

/* If your page uses <main> directly, still get spacing */
main{
  padding: 14px;
}

/* Sidebar */
.sidebar,
.aside,
.leftcol,
#sidebar{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  min-height: 260px;
}

/* Center & Right columns */
.centercol, .middlecol, .human-col, .col-center,
.rightcol, .ai-col, .col-right{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

/* Section headings as subtle “pills” */
.section-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 900;
  font-size: 12px;
}
.section-pill.human{ border-color: rgba(37,99,235,.25); }
.section-pill.ai{ border-color: rgba(225,29,72,.25); }

/* Applicant items */
.applicant-item,
.sidebar a,
.sidebar .item{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration:none;
}
.applicant-item:hover,
.sidebar a:hover,
.sidebar .item:hover{
  background: rgba(37,99,235,.04);
  border-color: rgba(37,99,235,.18);
}

/* Pills / badges */
.pill{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.pill.red{ border-color: rgba(225,29,72,.25); color: var(--ax-red); }
.pill.blue{ border-color: rgba(37,99,235,.25); color: var(--ax-blue); }
.pill.green{ border-color: rgba(22,163,74,.25); color: var(--ax-green); }

/* Mini cards for answers */
.mini-card{
  background: #fbfcfe;
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.mini-card .q{
  font-weight: 900;
  margin-bottom: 6px;
}
.mini-card .k{
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

/* Tables (if still used anywhere) */
table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
}
th, td{
  text-align:left;
  padding: 10px 10px;
  border-bottom: 1px solid rgba(229,231,235,.85);
  vertical-align: top;
}
thead th{
  font-size: 12px;
  color: #374151;
  background: #fbfcfe;
}

/* =========================
   FORCE 3-COLUMN LAYOUT
   (matches your exact HTML)
========================= */

.layout{
  display: grid;
  grid-template-columns: 260px minmax(520px, 1fr) 360px;
  gap: 14px;
  padding: 14px;
  align-items: start;
}

/* Ensure children don't shrink weirdly */
.layout > .sidebar,
.layout > main.center,
.layout > aside.right{
  min-width: 0;
}

/* Make sidebar + panels look framed consistently */
.sidebar{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

/* Your center and right already use .panel, so style that class directly */
.panel{
  background: transparent; /* cards inside hold the white surface */
  border: 0;
  padding: 0;
}

/* Make the main/right cards full height feel (optional but nice) */
.center .card,
.right .card{
  width: 100%;
}

.layout{ display:grid !important; }

/* =========================
   PANEL SPACING (match sidebar vibe)
========================= */

/* Give center/right their own framed “container” like the sidebar */
.panel.center,
.panel.right{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

/* The big card inside those panels should NOT add extra “double padding” */
.panel.center > .card,
.panel.right  > .card{
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* Consistent section spacing inside human/AI */
.panel .h2{ margin: 0 0 10px !important; }
.panel .h3{ margin: 14px 0 8px !important; }
.panel .hr{ margin: 12px 0 !important; }

/* Key-value rows: more breathable + aligned like sidebar items */
.kvs{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
}
.kvs .k{ font-weight: 600; }
.kvs .v{ line-height: 1.35; }

/* Answers blocks: tighten & card them like applicant items */
.qa{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 10px 0;
}
.qa-label{
  font-weight: 700;
  margin-bottom: 2px;
}
.qa-value{
  margin-top: 8px;
  line-height: 1.45;
}

/* AI blocks: make them “cards” with consistent spacing */
.ai-summary{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.ai-card{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 10px 0;
}

/* Lists inside AI follow-ups should breathe */
.panel.right ul{
  margin: 8px 0 0;
  padding-left: 18px;
}
.panel.right li{
  margin: 6px 0;
}

/* =========================
   TOPBAR USERBOX POLISH
========================= */

.topbar .userbox{
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* Pills should look like part of the UI, not random badges */
.topbar .pill{
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;         /* subtle, not bubble */
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
}

/* Strong pill gets a tiny emphasis */
.topbar .pill-strong{
  border-color: rgba(0,0,0,.12);
}

/* Logout should align and not look like a floating chip */
.topbar .btn.btn-danger{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;         /* subtle corners */
  font-weight: 700;
}

/* Optional: keep Filter/Reset button heights matching */
.topbar .filters .btn{
  height: 34px;
  border-radius: 10px;
}

/* =========================
   CENTER PANEL SCROLL
========================= */

/* Make layout fill viewport below topbar */
body{
  min-height: 100vh;
}

/* Topbar height reference (adjust if needed) */
:root{
  --topbar-h: 86px;
}

/* Main 3-column layout should take remaining height */
.layout{
  height: calc(100vh - var(--topbar-h));
  overflow: hidden; /* prevent page scroll */
}

/* Sidebar & AI panel stay static */
.sidebar,
.panel.right{
  height: 100%;
  overflow: auto;
}

/* CENTER COLUMN SCROLLS */
.panel.center{
  height: 100%;
  overflow-y: auto;
  padding-right: 6px; /* breathing room for scrollbar */
}

/* Smooth, modern scrollbar (WebKit) */
.panel.center::-webkit-scrollbar{
  width: 10px;
}
.panel.center::-webkit-scrollbar-track{
  background: transparent;
}
.panel.center::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.18);
  border-radius: 10px;
}
.panel.center::-webkit-scrollbar-thumb:hover{
  background: rgba(0,0,0,.28);
}

/* Firefox */
.panel.center{
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.3) transparent;
}

/* Desktop: keep columns */
@media (min-width: 1101px){
  .layout{
    grid-template-columns: 260px minmax(520px, 1fr) 360px;
  }
}

/* Tablet + mobile: stack */
@media (max-width: 1100px){
  .layout{
    grid-template-columns: 1fr;
  }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px){
  .topbar-global{
    grid-template-columns: 1fr;
  }
  .filters{
    justify-content:flex-start;
    flex-wrap: wrap;
  }
  .filters input{ width: 160px; }
  .filters input[name="q"]{ width: 220px; }

  .main-grid,
  .layout-3col,
  .shell,
  .app-shell{
    grid-template-columns: 1fr;
  }
  .sidebar, .centercol, .rightcol,
  .aside, .leftcol, .middlecol{
    padding: 12px;
  }
}