/* ===== Root / Theme ===== */
:root {
  --primary: #137fec;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 0 0 rgba(0,0,0,0.06);
  --radius: 12px;
}

.dark {
  --surface: #0f1720;
  --surface-2: #101922;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --border: #1f2937;
  --shadow: 0 1px 0 0 rgba(255,255,255,0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.page {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background: var(--surface-2);
  color: var(--text);
}

/* ===== Utilities ===== */
.hide-sm { display: none; }
@media (min-width: 640px){ .hide-sm { display: inline-flex; } }
.hide-md { display: none; }
@media (min-width: 768px){ .hide-md { display: initial; } }
.muted { color: var(--muted); }
.xs { font-size: 12px; }
.w-full { width: 100%; }

/* ===== Skip link ===== */
.skiplink {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skiplink:focus {
  left: 12px; top: 12px; width: auto; height: auto; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; z-index: 9999;
}

/* ===== App shell ===== */
.app { position: relative; min-height: 100vh; display: flex; }
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: none;
}



/* remove this line */
/* [ x-show="sidebarOpen" ] ~ .overlay { display: block; } */

/* add this instead */
.overlay.is-on { display: block; }
/* keeps header/brand tidy when collapsed */
.sidebar-collapsed .brand { justify-content:center; }




/* Sidebar */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 256px;
  background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .25s ease, width .25s ease; z-index: 50;
}
.sidebar.is-open { transform: translateX(0); }
@media (min-width: 1024px) { .sidebar { transform: none; } }
.sidebar-collapsed .sidebar { width: 80px; }
.sidebar__inner { display: flex; flex-direction: column; height: 100%; }

.brand { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.brand__icon { width: 32px; height: 32px; color: var(--primary); }
.brand__icon svg { width: 100%; height: 100%; }
.brand__name { font-size: 18px; font-weight: 800; margin: 0; }

.nav { padding: 16px 12px; }
.nav--footer { margin-top: auto; border-top: 1px solid var(--border); }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none;
}
.nav__item:hover { background: rgba(19,127,236,.10); }
.nav__item--active { background: rgba(19,127,236,.10); color: var(--primary); }
.nav__text { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sidebar-collapsed .nav__text, .sidebar-collapsed .brand__name { opacity: 0; visibility: hidden; width: 0; }

/* Content */
.content { flex: 1 1 auto; min-width: 0; transition: padding-left .25s ease; }
.content--expanded { padding-left: 256px; }
.content--collapsed { padding-left: 80px; }
@media (max-width: 1023.98px) { .content { padding-left: 0 !important; } }

/* Header */
.header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.header__left { display: flex; align-items: center; gap: 8px; }
.header__title { margin: 0 0 0 4px; font-weight: 600; }
.header__right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 0; cursor: pointer;
  background: #eef2f6; color: var(--text);
}
.dark .icon-btn { background: #0f2434; }
.icon-btn.ghost { background: transparent; }
.icon-btn:hover { background: rgba(19,127,236,.12); }
.material-symbols-outlined { font-variation-settings: 'OPSZ' 24; }

.search { display: inline-flex; align-items: center; background: #eef2f6; border-radius: 10px; height: 40px; overflow: hidden; }
.dark .search { background: #0f2434; }
.search__icon { padding-left: 10px; color: var(--muted); }
.search__input {
  border: 0; outline: 0; padding: 0 12px; height: 100%; min-width: 220px;
  color: var(--text); background: transparent;
}
.avatar {
  width: 40px; height: 40px; border-radius: 9999px; background: center/cover no-repeat var(--surface);
  background-image: var(--avatar);
  border: 1px solid var(--border);
}

/* Main */
.main { padding: 20px 16px 28px; }
.container { max-width: 1400px; margin: 0 auto; }

/* Toolbar */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px;
}
.toolbar__left, .toolbar__right { display: flex; align-items: center; gap: 8px;}

/* Controls */
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(19,127,236,.6); box-shadow: 0 0 0 3px rgba(19,127,236,.15); }
.textarea { resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) calc(1em + 2px), calc(100% - 13px) calc(1em + 2px); background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* Buttons */
.btn {
  height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #eef2f6; color: var(--text); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.dark .btn { background: #0f2434; border-color: #183247; }
.btn:hover { filter: brightness(1.05); }
.btn--primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn--ghost { background: var(--surface); }
.btn--flat { background: #eef2f6; border-color: var(--border); width: 100%; }
.dark .btn--flat { background: #0f2434; }
.btn--danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.dark .btn--danger { background: rgba(190,18,60,0.2); color: #fecaca; border-color: rgba(190,18,60,0.35); }

.btn .material-symbols-outlined.sm { font-size: 18px; line-height: 0; }

/* Grid helpers */
.grid { display: grid; }
.grid.two { grid-template-columns: 1fr; }
.grid.gap { gap: 12px; }
@media (min-width: 640px){ .grid.two { grid-template-columns: 1fr 1fr; } }

/* Board */
.board {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px){ .board { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px){ .board { grid-template-columns: repeat(4, 1fr); } }

.lane {
  display: flex; flex-direction: column; max-height: 78vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02);
}
.lane__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.lane__title { margin: 0; font-weight: 700; }
.lane__meta { font-size: 12px; color: var(--muted); }

.lane__body {
  flex: 1 1 auto; overflow-y: auto; padding: 12px; display: grid; gap: 12px;
}
.lane__body.is-drop-target { outline: 2px dashed rgba(19,127,236,.5); outline-offset: -6px; border-radius: 12px; }

.lane__foot { padding: 10px; border-top: 1px solid var(--border); }

/* Task card */
.task {
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05); transition: box-shadow .15s ease, transform .1s ease;
  backdrop-filter: blur(2px);
}
.task:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-1px); }
.task__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task__title { margin: 0; font-weight: 600; line-height: 1.25; }
.task__desc { margin: 6px 0 0; font-size: 14px; color: var(--text); opacity: .9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task__meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: 9999px;
  background: #e5e7eb; color: #374151;
}
.dark .badge { background: #1f2937; color: #e5e7eb; }
.badge--slate { background: #e5e7eb; color: #374151; }
.badge--pri { background: #fee2e2; color: #b91c1c; }
.badge--sec { background: #fef3c7; color: #92400e; }
.badge--low { background: #dcfce7; color: #166534; }

/* ===== Modal (panel) ===== */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.4);
}
[x-show="openCreate"] { display: flex; } /* Alpine will toggle visibility */

.modal {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.20), 0 2px 10px rgba(0,0,0,.08);
}
.modal--panel { width: min(640px, 100%); padding: 16px; }

.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.modal__title { margin: 0; font-size: 18px; font-weight: 800; }
.modal__foot {
  margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.modal__foot .actions { display: inline-flex; gap: 8px; }

/* Form */
.form.grid.gap { gap: 12px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 12px; font-weight: 600; color: var(--muted); }





/* Header right cluster — tidy spacing & sizing */
.header__right{
  display:flex;
  align-items:center;
  gap:12px;                /* space between bell, theme, avatar */
}

/* Compact, consistent icon buttons */
.icon-btn{
  inline-size:40px;
  block-size:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  background:var(--surface-2, #eef2f6);
  color:var(--text-2, #4b5563);
  border:1px solid var(--border, #e5e7eb);
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover{ background:var(--surface-3, #e7edf3); }
.icon-btn:focus-visible{ outline:2px solid #137fec; outline-offset:2px; }

/* Material icon size inside the icon button */
.icon-btn .material-symbols-outlined{
  font-size:22px;
  line-height:1;
}

/* Avatar: same visual weight as buttons */
.avatar{
  inline-size:36px;
  block-size:36px;
  border-radius:9999px;
  background-image:var(--avatar);
  background-size:cover;
  background-position:center;
  border:2px solid var(--surface-1, #fff);
  box-shadow:0 0 0 1px var(--border, #e5e7eb);
}

/* Search height to match 40px buttons */
.search{
  display:inline-flex;
  align-items:center;
  gap:8px;
  inline-size:min(320px, 40vw);
  block-size:40px;
  padding-inline:12px;
  border-radius:12px;
  background:var(--surface-2, #eef2f6);
  border:1px solid var(--border, #e5e7eb);
}
.search__icon{ font-size:18px; color:var(--text-3, #6b7280); }
.search__input{
  flex:1;
  min-width:0;
  border:0;
  outline:0;
  font:inherit;
  background:transparent;
  color:var(--text-1, #111827);
}
.search__input::placeholder{ color:var(--text-3, #6b7280); }

/* Dark theme tweaks (optional) */
:root.dark .icon-btn{ background:#111827; color:#cbd5e1; border-color:#1f2937; }
:root.dark .icon-btn:hover{ background:#0f172a; }
:root.dark .avatar{ border-color:#0b1220; box-shadow:0 0 0 1px #1f2937; }
:root.dark .search{ background:#0f172a; border-color:#1f2937; }
:root.dark .search__input{ color:#e5e7eb; }
:root.dark .search__input::placeholder{ color:#94a3b8; }




/* --- Quick View button (card-aligned) ----------------------------------- */
.card__actions {
  display: flex;
  justify-content: flex-end;  /* push button to the right edge of the card */
  align-items: center;
  margin-top: 0px;
}

.btn-quick {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface-2, #f3f5f7);
  color: var(--text-2, #475569);
  font: 500 12px/1.2 "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: .01em;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  cursor: pointer;
}

.btn-quick:hover {
  background: var(--surface-3, #e8ecf1);
  border-color: var(--border-strong, #d2d6db);
}

.btn-quick:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 127, 236, .25);
  border-color: #137fec;
}

.btn-quick:active {
  transform: translateY(0.5px);
}

.btn-quick .material-symbols-outlined {
  font-size: 18px;
  line-height: 0;
}

/* Dark mode tweaks */
.dark .btn-quick {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}
.dark .btn-quick:hover {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.32);
}
.dark .btn-quick:focus-visible {
  box-shadow: 0 0 0 3px rgba(19, 127, 236, .35);
  border-color: #3b82f6;
}







/* hide only until Alpine boots */
[x-cloak] { display: none !important; }

/* overlay + modal */
.modal-scrim {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.45);
}

.modal {
  width: 100%; max-width: 640px;
  background: var(--surface, #fff);
  color: var(--text, #111);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  padding: 16px;
}

.modal__head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.modal__title { font-size: 1.125rem; font-weight: 700; }
.modal__foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; }

.icon-btn.ghost { background: transparent; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; }
.icon-btn.ghost:hover { background: rgba(0,0,0,.06); }












/* ===============================
   Staff Cards — page polish
   (append after your existing CSS)
   =============================== */

/* --- Light theme contrast tweaks --- */
:root{
  --surface-3: #e9eef3;            /* subtle hover for light theme */
  --text-strong: #0f172a;          /* darker body text */
}
body.page { color: var(--text-strong); }
.nav__item { color: var(--text-strong); }
.search { background: #eef2f6; }
.icon-btn { background: #eef2f6; color: var(--text-strong); }
.btn { background: #eef2f6; color: var(--text-strong); }

/* Headings in cards/lists: ensure dark text in light theme */
.card__title, .lane__title, h3, h4 { color: var(--text-strong); }

/* --- Generic card & micro-layout helpers --- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.card__head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom: 8px;
}
.card__title{ margin:0; font-weight:800; font-size:1rem; }
.row{ display:flex; gap:8px; }
.semibold{ font-weight:700; }

/* --- Pills & dots (used on task/user stats) --- */
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px; border-radius:9999px;
  background: var(--surface-2); border:1px solid var(--border);
  font-size:12px; font-weight:600; color: var(--text-strong);
}
.dot{ width:8px; height:8px; border-radius:999px; background:#94a3b8; }
.dot--slate{ background:#64748b; }
.dot--green{ background:#10b981; }
.dot--amber{ background:#f59e0b; }
.dot--red{ background:#ef4444; }

/* --- Chip switch (Only active) --- */
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:9999px;
  background: var(--surface-2); border:1px solid var(--border);
  font-weight:600; color: var(--text-strong);
  width: 500px;
}
.switch{
  appearance:none; inline-size:36px; block-size:20px; border-radius:9999px;
  background:#cbd5e1; position:relative; outline:0; cursor:pointer; border:1px solid var(--border);
}
.switch:before{
  content:""; position:absolute; inset:2px auto 2px 2px;
  inline-size:16px; block-size:16px; border-radius:9999px; background:#fff;
  transition: transform .18s ease;
}
.switch:checked{ background:#60a5fa; border-color:#3b82f6; }
.switch:checked:before{ transform: translateX(16px); }

/* --- Loading / Empty / Pager --- */
.table-loading{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; padding:18px; border:1px dashed var(--border); border-radius:12px; background: color-mix(in oklab, var(--surface) 92%, transparent);
}
.spinner{
  inline-size:22px; block-size:22px; border-radius:9999px;
  border:3px solid rgba(0,0,0,.1); border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.empty-row{
  padding:18px; border-radius:12px; text-align:center;
  background: var(--surface); border:1px solid var(--border); color: var(--muted);
}

.pager{
  display:flex; align-items:center; justify-content:center; gap:.6rem;
  padding:12px 6px 4px; border-top:1px solid var(--border);
}

/* --- Grid used by the staff card list --- */
.grid{
  display:grid; gap:12px;
}
.grid.auto-fill-240{
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* --- Hover treatment for clickable staff cards --- */
.card[data-clickable="true"]{ cursor:pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.card[data-clickable="true"]:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
}

/* --- Light/Dark small tweaks --- */
.dark .pill{ background:#0f2434; color:#e5e7eb; }
.dark .chip{ background:#0f2434; color:#e5e7eb; }
.dark .spinner{ border-color: rgba(255,255,255,.12); border-top-color: var(--primary); }

/* --- Buttons: stronger focus + clear hover in light theme --- */
.btn:hover{ background: var(--surface-3); }
.btn:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }
.btn--ghost{ background: var(--surface); }
.btn--primary:hover{ filter: brightness(1.03); }

/* --- Inputs/selects: clearer boundaries & focus --- */
.input, .select, .textarea{
  border:1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
}
.input:focus, .select:focus, .textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19,127,236,.15);
}

/* --- Search control: harmonize colors in light theme --- */
.search{
  background:#eef2f6; border:1px solid var(--border);
}
.search__input{ color: var(--text-strong); }
.search__input::placeholder{ color: var(--muted); }

/* --- Avatar placeholder ring contrast --- */
.avatar{
  border:2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

/* --- Card meta rows inside staff cards --- */
.card .row.stats{
  justify-content:space-between; margin-top:10px;
}

/* Optional: responsive tightening on tiny screens */
@media (max-width: 480px){
  .toolbar{ flex-wrap:wrap; }
  .toolbar__right{ width:100%; justify-content:flex-end; }
}






/* BEFORE */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: none;
}

/* AFTER */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40;
}
/* optional: only hide before Alpine boots */
.overlay[x-cloak] { display: none !important; }






