/* ======= Tokens ======= */
:root{
  --bg: #f6f7f8;
  --bg-elev: #ffffff;
  --bg-elev-weak: #f9fafb;
  --bg-dark-weak: rgba(16,25,34,.5);

  --text: #1f2937;
  --text-weak: #6b7280;
  --text-inv: #ffffff;

  --primary: #137fec;
  --primary-10: color-mix(in oklab, var(--primary) 10%, #fff);
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --green: #16a34a;
  --amber: #f59e0b;
  --red: #ef4444;

  --card-border: #e5e7eb;
  --header-shadow: 0 1px 0 rgba(0,0,0,.06);

  --radius: 12px;
  --radius-lg: 16px;

  --sidebar-w: 256px;
  --sidebar-w-collapsed: 80px;

  --shadow-1: 0 10px 24px -14px rgba(0,0,0,.18);
}

.dark{
  --bg: #101922;
  --bg-elev: #0f1720;
  --bg-elev-weak: #111b25;

  --text: #e5e7eb;
  --text-weak: #9ca3af;

  --border: #223041;
  --border-strong: #2b3a4d;

  --card-border: #213142;
}

/* ======= Base ======= */
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body.page{
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* a11y */
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.skiplink{
  position: fixed; inset: 12px auto auto 12px; z-index: 100;
  background: var(--bg-elev); color: var(--text); border:1px solid var(--border);
  padding:.5rem .75rem; border-radius:10px; box-shadow: var(--shadow-1);
  transform: translateY(-150%); transition: transform .2s ease;
}
.skiplink:focus{ transform: translateY(0); outline:2px solid var(--primary); outline-offset:2px; }

/* ======= Layout ======= */
.app{
  position:relative; display:flex; min-height: 100vh; width: 100%;
}
.overlay{
  position: fixed; inset:0; background: rgba(0,0,0,.4); z-index: 40;
}

/* Sidebar */
.sidebar{
  position: fixed; top:0; left:0; z-index:50;
  width: var(--sidebar-w); height: 100%;
  transform: translateX(-100%); /* hidden on mobile by default */
  background: var(--bg-elev); border-right:1px solid var(--border);
  transition: transform .3s ease, width .3s ease;
}
.sidebar.is-open{ transform: translateX(0); }
@media (min-width:1024px){
  .sidebar{ transform: none; }
}

.sidebar__inner{ display:flex; flex-direction:column; height:100%; }

.brand{
  display:flex; align-items:center; gap:12px;
  padding: 16px 24px; border-bottom:1px solid var(--border);
  color: inherit;
}
.brand__icon{ width:32px; height:32px; color: var(--primary); }
.brand__icon svg{ width:100%; height:100%; display:block; }
.brand__name{ font-weight:800; font-size: 20px; letter-spacing: -.01em; }

.nav{ padding: 16px; overflow-y:auto; }
.nav--footer{ margin-top:auto; border-top:1px solid var(--border); }
.nav__item{
  display:flex; align-items:center; gap:12px;
  padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none;
}
.nav__item:hover{ background: color-mix(in oklab, var(--primary) 8%, transparent); }
.nav__item--active{
  background: color-mix(in oklab, var(--primary) 14%, transparent);
  color: var(--primary); font-weight: 600;
}
.nav__text{ white-space: nowrap; }
.material-symbols-outlined{ font-variation-settings:'OPSZ' 24; }

/* Sidebar collapsed (desktop only) */
.sidebar-collapsed .sidebar{ width: var(--sidebar-w-collapsed); }
.sidebar-collapsed .nav__text,
.sidebar-collapsed .brand__name{ opacity:0; visibility:hidden; }
.sidebar-collapsed .brand{ justify-content: center; }

/* Content area */
.content{
  display:flex; flex-direction:column; width:100%;
  min-height:100vh; transition: padding-left .3s ease;
}
@media (min-width:1024px){
  .content--expanded{ padding-left: var(--sidebar-w); }
  .content--collapsed{ padding-left: var(--sidebar-w-collapsed); }
}

/* Header */
.header{
  position: sticky; top:0; z-index:30;
  display:flex; align-items:center; justify-content:space-between;
  background: var(--bg-elev); border-bottom:1px solid var(--border);
  padding: 10px 16px; box-shadow: var(--header-shadow);
}
.header__left{ display:flex; align-items:center; gap:8px; }
.header__right{ display:flex; align-items:center; gap:12px; margin-left:auto; }

.icon-btn{
  width:40px; height:40px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:10px; border:1px solid var(--border);
  background: var(--bg-elev-weak); color:#374151;
  position: relative; /* for notify badge */
}
.dark .icon-btn{ background:#111b25; color:#cbd5e1; }
.icon-btn:hover{ background: color-mix(in oklab, var(--primary) 10%, transparent); }

/* Search */
.search{ display:flex; align-items:center; height:40px; min-width:220px; max-width: 320px; background: var(--bg-elev-weak); border:1px solid var(--border); border-radius: 10px; }
.search__icon{ padding-left:10px; color: var(--text-weak); }
.search__input{
  flex:1; height:100%; border:none; background: transparent; color: var(--text);
  padding: 0 12px; outline:none;
}


.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); }






/* =========================
   Quick View Modal Styling
   ========================= */
:root{
  --qv-bg: #ffffff;
  --qv-fg: #0f172a;            /* slate-900 */
  --qv-muted: #6b7280;         /* gray-500 */
  --qv-border: #e5e7eb;        /* gray-200 */
  --qv-shadow: 0 10px 30px rgba(2, 6, 23, 0.12); /* deep soft */
  --qv-card: #f8fafc;          /* slate-50 */
  --qv-card-border: #e2e8f0;   /* slate-200 */
  --qv-accent-1: #2563eb;      /* blue-600 */
  --qv-accent-2: #16a34a;      /* green-600 */
  --qv-accent-3: #f59e0b;      /* amber-500 */
  --qv-accent-4: #ef4444;      /* red-500 */
  --qv-accent-5: #8b5cf6;      /* violet-500 */
  --qv-accent-6: #06b6d4;      /* cyan-500 */
}

.dark{
  --qv-bg: #0b1220;
  --qv-fg: #e5e7eb;
  --qv-muted: #94a3b8;
  --qv-border: #1f2937;
  --qv-shadow: 0 12px 36px rgba(0,0,0,0.45);
  --qv-card: #0f172a;
  --qv-card-border: #1e293b;
}

/* Modal shell (reuse your existing classes) */
.modal-scrim{
  backdrop-filter: blur(6px);
}

.modal.modal--panel{
  background: var(--qv-bg);
  color: var(--qv-fg);
  border: 1px solid var(--qv-border);
  border-radius: 16px;
  box-shadow: var(--qv-shadow);
  max-width: 760px;
  width: min(92vw, 760px);
  overflow: hidden;
}

/* Head */
.modal__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--qv-border);
}
.modal__title{
  font-size: 1.05rem;
  font-weight: 700;
}

/* Body – loader & content */
.modal__body{
  padding: 18px;
}

/* Loader row */
.modal__body.row{
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--qv-muted);
  min-height: 80px;
}

/* Footer */
.modal__foot{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--qv-border);
}

/* ============== Quick View Cards Grid ============== */
/* Your quick view injects: <div class="kv"> … <p>…</p> … </div>
   We make each <p> look like a small info card with an accent stripe.
*/
.modal .kv{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px){
  .modal .kv{
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px){
  .modal .kv{
    grid-template-columns: 1fr 1fr;
  }
}

.modal .kv p{
  margin: 0;
  padding: 12px 12px 12px 14px;
  background: var(--qv-card);
  border: 1px solid var(--qv-card-border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(2,6,23,0.04);
  position: relative;
  line-height: 1.35;
  overflow: hidden;
}

/* Accent stripe (cycling colors for variety) */
.modal .kv p::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--qv-accent-1);
}
.modal .kv p:nth-child(2n)::before{ background: var(--qv-accent-2); }
.modal .kv p:nth-child(3n)::before{ background: var(--qv-accent-3); }
.modal .kv p:nth-child(4n)::before{ background: var(--qv-accent-4); }
.modal .kv p:nth-child(5n)::before{ background: var(--qv-accent-5); }
.modal .kv p:nth-child(6n)::before{ background: var(--qv-accent-6); }

/* Labels (your <strong> in each <p>) */
.modal .kv p > strong{
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--qv-muted);
  margin-bottom: 6px;
}

/* Body text */
.modal .kv p br + *{
  display: block;
  margin-top: 4px;
}
.modal .kv p span,
.modal .kv p em,
.modal .kv p i{
  color: var(--qv-fg);
}

/* Make the description card span full width on small screens */
.modal .kv p:has(> strong:contains("Description")),
.modal .kv p:has(> strong:contains("Description:")){
  grid-column: 1 / -1;
}

/* Small helper for the tiny note at the bottom of the modal content */
.muted.xs{
  font-size: 0.75rem;
  color: var(--qv-muted);
}

/* Row of actions injected under cards */
.modal .row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Subtle hover */
.modal .kv p:hover{
  transform: translateY(-1px);
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
}

/* ============== Buttons inside modal ============== */
.btn{
  --btn-bg: #f1f5f9;
  --btn-fg: #0f172a;
  --btn-bd: #e2e8f0;
  appearance: none;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover{ filter: brightness(0.98); }
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{ outline: 2px solid var(--qv-accent-1); outline-offset: 2px; }

.btn--primary{
  --btn-bg: #2563eb;
  --btn-fg: #fff;
  --btn-bd: #1d4ed8;
}
.dark .btn{ --btn-bg: #0b1220; --btn-fg: #e5e7eb; --btn-bd: #1f2937; }
.dark .btn--primary{ --btn-bg: #1d4ed8; --btn-bd: #1e40af; }

/* =========================
   Loader (SVG) Polish
   ========================= */
.spin{
  width: 24px; height: 24px;
  animation: qv-rotate 1s linear infinite;
}
.size-6{ width: 24px; height: 24px; }

.spin .dim{
  opacity: .25;
}
.spin .bold{
  transform-origin: 12px 12px;
  animation: qv-dash 1.2s ease-in-out infinite;
}

/* Larger spinner option (if needed) */
.modal__body .spin.lg{ width: 36px; height: 36px; }

@keyframes qv-rotate{
  100%{ transform: rotate(360deg); }
}
@keyframes qv-dash{
  0%{ stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
  50%{ stroke-dasharray: 90, 200; stroke-dashoffset: -35; }
  100%{ stroke-dasharray: 90, 200; stroke-dashoffset: -124; }
}

/* =========================
   Quick View action button
   ========================= */
.btn-quick{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--qv-card-border);
  background: linear-gradient(180deg, var(--qv-bg), color-mix(in oklab, var(--qv-bg) 85%, #000 15%));
  color: var(--qv-fg);
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.btn-quick:hover{ box-shadow: 0 4px 12px rgba(2,6,23,.08); transform: translateY(-1px); }
.btn-quick .material-symbols-outlined{ font-size: 18px; }

/* If button sits inside a card header, keep spacing tidy */
.card__actions{ display:flex; gap:8px; align-items:center; }





