/* Monday-like Pro Board Theme (2025) — LIGHT version
   Drop-in replacement (same class names).
   Author: ChatGPT (GPT-5 Thinking)
*/

/* ---------- Reset & Variables ---------- */
:root{
  /* Light palette */
  --bg:#ffffff;
  --surface:#ffffff;
  --panel:#ffffff;
  --card:#ffffff;

  --text:#0f172a;       /* main text (very dark) */
  --subtext:#64748b;    /* secondary text */
  --muted:#64748b;

  --primary:#5b8cff;    /* brand blue */
  --primary-600:#3b6ef0;
  --accent:#1f6feb;

  --danger:#e53935;
  --warn:#fb8c00;
  --ok:#1aa374;

  --border: rgba(15,23,42,.10);     /* light border */
  --radius:14px;
  --radius-sm:10px;
  --shadow: 0 10px 24px rgba(2,6,23,.08);
  --shadow-sm: 0 2px 10px rgba(2,6,23,.06);

  --grid-header:#f3f6fc;            /* light header bg */
  --row-bg:#ffffff;
  --row-bg-alt:#fbfdff;
  --row-hover: rgba(91,140,255,.10);
  --pill-bg: rgba(2,6,23,.06);
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg); /* pure white as requested */
  color:var(--text);
  line-height:1.45;
}

/* ---------- Links / Buttons ---------- */
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
.btn{
  background:linear-gradient(180deg, var(--primary), var(--primary-600));
  color:#fff;border:0;border-radius:12px;padding:10px 14px;cursor:pointer;
  font-weight:600; box-shadow: var(--shadow-sm); transition:.18s ease;
}
.btn:hover{transform:translateY(-1px);box-shadow:var(--shadow)}
.btn:active{transform:translateY(0) scale(.99)}
.btn.secondary{background:#fff;border:1px solid var(--border);color:var(--text)}
.btn-icon{
  border:1px solid var(--border);
  background:rgba(2,6,23,.04);
  border-radius:10px;cursor:pointer;padding:6px 8px;font-size:13px;line-height:1
}
.btn-icon:hover{background:rgba(2,6,23,.06)}

/* ---------- Layout ---------- */
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 16px;background:rgba(255,255,255,.85);
  backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:50;
}
.brand{display:flex;align-items:center;gap:12px}
.brand a{font-weight:800;color:#0f172a;letter-spacing:.3px}
.brand .dot{width:10px;height:10px;border-radius:50%;background:var(--primary);box-shadow:0 0 0 6px rgba(91,140,255,.18)}
.nav a{margin-right:14px;color:var(--muted)}
.nav a.active{color:#0f172a}
.user{display:flex;align-items:center;gap:10px}
.user .avatar{width:28px;height:28px;border-radius:50%;background:linear-gradient(180deg,#6aa3ff,#5b8cff);color:#0b1020;display:flex;align-items:center;justify-content:center;font-weight:800}

.container{max-width:unset;margin:0;padding:0}
.app-wrap{display:flex;flex-direction:column;min-height:calc(100vh - 0px)}
.app-main{flex:1;display:flex;flex-direction:column;padding:18px 18px 40px}

/* ---------- Cards / Panels ---------- */
.card{
  background:#fff;
  border:1px solid var(--border);border-radius:var(--radius);
  box-shadow: var(--shadow-sm);
  padding:16px;margin-bottom:16px;
}

/* ---------- Board ---------- */
.board{
  background:#fff;
  border:1px solid var(--border);border-radius:var(--radius);
  overflow:hidden;box-shadow: var(--shadow-sm);
}
.board + .board{margin-top:18px}
.board-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 14px;
  background:linear-gradient(180deg, #f9fbff, #eef4ff);
  border-bottom:1px solid var(--border);
}
.board-head .title{display:flex;align-items:center;gap:10px;font-weight:800;color:#0f172a}
.board-head .meta{color:var(--subtext);font-size:12px}

.board-toolbar{display:flex;align-items:center;gap:8px;margin:10px 0}

/* Grid */
.board-grid{overflow:auto;background:#fff}
.grid-header,.row{
  display:grid;
  grid-template-columns: 300px repeat(auto-fit,minmax(160px, 1fr)) 80px;
  align-items:center;
  min-width:900px;
}
.grid-header{
  background:var(--grid-header);
  border-bottom:1px solid var(--border);
  font-weight:700;color:#0f172a;
}
.grid-header .cell{padding:12px 10px}

.row{
  border-bottom:1px solid var(--border);
  background:var(--row-bg);
}
.row:nth-child(even){background:var(--row-bg-alt)}
.row:hover{background:var(--row-hover)}
.row.dragging{opacity:.75;outline:2px dashed var(--primary)}

/* Cells */
.cell{padding:10px;border-right:1px solid var(--border);min-height:48px;display:flex;align-items:center;gap:8px}
.cell:last-child{border-right:0;justify-content:center}
.cell--name{display:flex;align-items:center;gap:12px;font-weight:600}
.cell .avatar{width:28px;height:28px;border-radius:50%;background:linear-gradient(180deg,#6aa3ff,#5b8cff);color:#0b1020;display:flex;align-items:center;justify-content:center;font-weight:800}
.cell .sub{font-size:12px;color:var(--subtext);font-weight:500}

/* Pills (status, priority) */
.pill{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border-radius:999px;background:var(--pill-bg);font-weight:700;font-size:12px;color:#0f172a}
.pill .dot{width:8px;height:8px;border-radius:50%}
/* status colors */
.pill.green{background:rgba(26,163,116,.12);color:#0a5f47}
.pill.green .dot{background:#1aa374}
.pill.blue{background:rgba(91,140,255,.14);color:#224191}
.pill.blue .dot{background:#5b8cff}
.pill.orange{background:rgba(251,140,0,.14);color:#7a4a00}
.pill.orange .dot{background:#fb8c00}
.pill.red{background:rgba(229,57,53,.14);color:#7a1d1b}
.pill.red .dot{background:#e53935}
.pill.gray{background:rgba(2,6,23,.08);color:#334155}
.pill.gray .dot{background:#94a3b8}

/* People */
.people{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.badge{
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(2,6,23,.06);
  color:#0f172a;padding:4px 8px;border-radius:999px;font-size:12px
}

/* Icons */
.icon{width:16px;height:16px;opacity:.9}
.icon-btn{display:inline-flex;align-items:center;gap:6px;font-weight:600;color:var(--muted)}
.icon-btn:hover{color:#0f172a}

/* Add-row & dropzones */
.add-student-row{
  padding:12px;background:#fafcff;border-top:1px dashed var(--border);
}
.dropzone{min-height:36px}

/* Sidepanel */
.sidepanel{
  position:fixed;top:0;right:-460px;width:460px;height:100vh;
  background:#ffffff;border-left:1px solid var(--border);
  box-shadow: -16px 0 40px rgba(2,6,23,.08);
  transition:right .25s ease;display:flex;flex-direction:column;z-index:9999
}
.sidepanel.open{right:0}
.sidepanel-header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--border);background:#f8fafc}
.sidepanel-body{flex:1;overflow:auto;padding:16px;background:#fff}
.sidepanel-footer{border-top:1px solid var(--border);padding:12px;background:#f8fafc}

/* Mentions dropdown */
.mentions-wrap{position:relative}
.mentions-dropdown{
  position:absolute;bottom:54px;left:12px;right:12px;max-height:220px;overflow:auto;
  background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);z-index:10000;display:none
}
.mentions-dropdown.open{display:block}
.mentions-item{padding:10px 12px;cursor:pointer;display:flex;align-items:center;gap:8px}
.mentions-item:hover,.mentions-item.active{background:#f1f5f9}
.mentions-item .badge{background:rgba(2,6,23,.06)}

/* Tables (generic) */
.table{width:100%;border-collapse:collapse}
.table th,.table td{border-bottom:1px solid var(--border);padding:10px;text-align:left;color:var(--text)}

/* Alerts */
.alert{padding:12px;border-radius:12px}
.alert-error{background:rgba(229,57,53,.08);border:1px solid rgba(229,57,53,.28);color:#7a1d1b}

/* AI output (logs) */
#ai-output{
  background:#f6f8ff;color:#0f172a;padding:12px;border-radius:12px;max-height:320px;overflow:auto;border:1px solid var(--border)
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px){
  .grid-header,.row{grid-template-columns: 240px repeat(auto-fit,minmax(160px, 1fr)) 68px;min-width:780px}
}

@media (max-width: 900px){
  .app-main{padding:12px}
  .board-head{padding:12px 12px}
  .grid-header{display:none}
  /* Card mode for rows */
  .row{
    display:block;border:1px solid var(--border);border-radius:12px;margin-bottom:10px;overflow:hidden;background:#fff;
  }
  .row .cell{display:flex;justify-content:space-between;border-right:0;border-bottom:1px solid var(--border);padding:12px}
  .row .cell:last-child{border-bottom:0;justify-content:flex-start}
  .row .cell::before{
    content:attr(data-col);
    color:var(--subtext);
    font-size:12px;font-weight:600;margin-right:12px;
  }
  .cell--name{font-size:16px}
}

/* ---------- Utilities ---------- */
.inline>*{margin-right:8px}
.hidden{display:none !important}
.shadow{box-shadow:var(--shadow)}
.round{border-radius:var(--radius)}
.text-muted{color:var(--muted)}
.text-sub{color:var(--subtext)}
.w-100{width:100%}
.h-100{height:100%}
.p-2{padding:8px}
.p-3{padding:12px}
.mt-2{margin-top:8px}
.mt-3{margin-top:14px}
.gap-1{gap:6px}
.gap-2{gap:10px}
.center{display:flex;align-items:center;justify-content:center}

/* Focus ring */
:where(button, [role="button"], a, input, select, textarea):focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;border-radius:10px;
}

/* Status UI */
.status-btn{
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  cursor:pointer;
  background:#fff;
}
.status-menu, .status-manage{
  position:absolute; z-index:10050; min-width:220px; max-height:280px; overflow:auto;
  background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); padding:8px;
  display:none;
}

.status-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid rgba(15,23,42,.10);border-radius:999px;background:#fff;cursor:pointer}
.status-dot{width:10px;height:10px;border-radius:999px;display:inline-block}
.status-name{font-weight:600}
.status-menu{position:absolute;z-index:10000;background:#fff;border:1px solid rgba(15,23,42,.10);border-radius:10px;box-shadow:0 12px 28px rgba(0,0,0,.12);padding:6px;display:none;min-width:220px}
.status-menu.open{display:block}
.status-item{display:flex;align-items:center;gap:8px;padding:8px;border-radius:8px;cursor:pointer}
.status-item:hover{background:#f3f4f6}
.status-manage{position:fixed;inset:auto 24px 24px auto;width:420px;background:#fff;border:1px solid rgba(15,23,42,.10);border-radius:12px;box-shadow:0 12px 28px rgba(0,0,0,.14);padding:12px;display:none;z-index:10001}
.status-manage.open{display:block}
.status-row{display:grid;grid-template-columns:20px 1fr 110px 90px 70px 70px;gap:8px;align-items:center}
.status-row input[type="text"]{padding:6px 8px;border:1px solid rgba(15,23,42,.10);border-radius:8px}

/* ==== Sidebar PRO (Left) — WHITE, 2025-10-31 ==== */
/* Scoped to avoid conflicts */
body.layout-sidebar {
  --sbw: 260px;

  /* White sidebar palette */
  --sb-bg: #ffffff;          /* sidebar background (white) */
  --sb-fg: #0f172a;          /* main text (dark) */
  --sb-fg-dim: #6b7280;      /* sub text (muted gray) */
  --sb-accent: #5b9cff;      /* brand accent/active */
  --sb-border: #e5e7eb;      /* light border */

  /* Main content area */
  --content-bg: #ffffff;
  --surface: #ffffff;

  --radius: 14px;
}

/* Grid frame */
body.layout-sidebar .page{
  display:grid;
  grid-template-columns: var(--sbw) 1fr;
  min-height:100vh;
  overflow:hidden;
}

/* Sidebar block (white) */
body.layout-sidebar .sidebar{
  background: var(--sb-bg);
  color: var(--sb-fg);
  border-right: 1px solid var(--sb-border);
  display:flex; flex-direction:column; gap:12px;
  padding:18px 14px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,.02);
}

/* Brand */
.sidebar__brand{ font-weight:800; font-size:18px; margin-bottom:8px; }
.sidebar__brand .brand-link{ color:var(--sb-fg); text-decoration:none; }
.sidebar__brand .brand-link:hover{ color:var(--sb-accent); }

/* User card (subtle gray) */
.sidebar__user{
  background: #fafafa;
  border: 1px solid var(--sb-border);
  border-radius: var(--radius);
  padding: 12px;
}
.sidebar__user .user-name{ font-weight:600; color:var(--sb-fg); }
.sidebar__user .user-role{ color:var(--sb-fg-dim); font-size:12px; }

/* Nav */
.sidebar__nav{ display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.sidebar .nav-link{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:10px;
  color: var(--sb-fg); text-decoration:none;
  border:1px solid transparent; background:transparent;
  transition: background .15s ease, border .15s ease, transform .05s ease, color .15s ease;
  font-weight:600;
}
.sidebar .nav-link:hover{
  background: #f3f4f6;        /* light hover */
}
.sidebar .nav-link.active{
  background: #eef4ff;        /* soft blue */
  border-color: #cfe0ff;
  box-shadow: inset 0 0 0 1px rgba(91,156,255,0.15);
  color:#173c8c;
}

/* Logout button */
.btn.btn-logout{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 12px; width:100%;
  text-decoration:none; background:#ef4444; color:#fff;
  border-radius:10px; border:1px solid #b91c1c; font-weight:700;
}
.btn.btn-logout:hover{ filter:brightness(1.05); }

/* Push footer to bottom */
.sidebar__footer{ margin-top:auto; }

/* Content area */
body.layout-sidebar .content{
  display:grid; grid-template-rows:auto 1fr; min-width:0; min-height:100vh; overflow:hidden;
  background: var(--content-bg);
}
body.layout-sidebar .container{
  padding:18px; overflow:auto; height:calc(100vh - 0px);
  background: var(--surface);
}

/* Mobile header (appears on small screens) */
.topbar-mobile{
  display:none; align-items:center; gap:12px;
  padding:12px 16px; background:#ffffff; border-bottom:1px solid var(--sb-border);
}
.brand-mobile{ color:#0f172a; text-decoration:none; font-weight:700; }

/* Burger */
.burger{
  width:40px; height:36px; border:1px solid #d1d5db; border-radius:8px;
  background:#ffffff; display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
}
.burger span{ display:block; width:20px; height:2px; background:#111827; margin:2px 0; }

/* Overlay */
.overlay{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:20; }
.overlay[hidden]{ display:none !important; }

/* Responsive behavior */
@media (max-width: 1024px){
  body.layout-sidebar .page{ grid-template-columns: 0 1fr; }
  body.layout-sidebar .sidebar{
    position:fixed; left:0; top:0; height:100vh; width: var(--sbw);
    transform: translateX(-100%); transition: transform .2s ease; z-index:30;
    box-shadow: 0 12px 28px rgba(0,0,0,.10);
  }
  body.layout-sidebar .sidebar.open{ transform: translateX(0); }
  .topbar-mobile{ display:flex; }
}

/* Hide any legacy topbar */
body.layout-sidebar .topbar{ display:none !important; }

/* Small icon helper (from layout) */
.nav-ico{ width:16px; height:16px; opacity:.9; flex:0 0 16px; display:inline-flex; align-items:center; justify-content:center; }

/* ==== Sidebar sublist (Groups) ==== */
.sidebar .nav-item { list-style: none; }
.sidebar .nav-link { width:100%; text-align:left; }
.sidebar .nav-link .chev{
  margin-left:auto; width:16px; height:16px; transition: transform .15s ease;
}
.sidebar .nav-link.open .chev{ transform: rotate(90deg); }

.nav-sublist{
  display:flex; flex-direction:column; gap:4px;
  padding:6px 0 6px 28px;
  border-left: 2px solid var(--sb-border);
  margin-left: 10px;
  max-height: 360px; overflow:auto;
}
.nav-sublink{
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius:8px;
  color: var(--sb-fg-dim); text-decoration:none;
  transition: background .15s ease, color .15s ease;
}
.nav-sublink:hover{ background:#f3f4f6; color: var(--sb-fg); }
.nav-sublink.active{
  background:#eef4ff; color:#173c8c; font-weight:700;
  box-shadow: inset 0 0 0 1px rgba(91,156,255,0.15);
}
.nav-sublink .dot{
  width:6px; height:6px; border-radius:999px;
  background:#cbd5e1; flex:0 0 6px;
}
.nav-subempty{
  color: var(--sb-fg-dim);
  padding:8px 10px; font-size:12px;
}
/* ensure the submenu actually hides when [hidden] is present */
.nav-sublist[hidden]{ display:none !important; }


/* =====================
   HOTFIX: Remove extra vertical scroll / blank space
   Paste at VERY END of the CSS file
   ===================== */

/* Global safety */
html, body { height: 100%; }
body { overflow-x: hidden; }

/* If you're using the left sidebar layout (most common cause) */
body.layout-sidebar{
  height: 100dvh;
  overflow: hidden; /* prevent body scroll (the container will scroll) */
}

/* Make the grid container fill the viewport correctly */
body.layout-sidebar .page{
  height: 100dvh;
}

/* Critical: allow inner scrolling without forcing extra height */
body.layout-sidebar .content{
  height: 100dvh;
  min-height: 0;  /* IMPORTANT for CSS Grid children */
}

body.layout-sidebar .container{
  height: auto !important;   /* overrides the old calc(100vh...) */
  min-height: 0 !important;  /* allows proper shrinking */
  overflow: auto;            /* single scroll area */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Optional: reduce bottom padding if it looks like empty space */
.app-main{ padding-bottom: 16px !important; }
