/* ==========================================================================
   VenueBook NM-AIST — Design System
   ========================================================================== */

:root {
  --brand-900: #061a38;
  --brand-800: #0a2a57;
  --brand-700: #0d3a75;
  --brand-600: #124a94;
  --brand-500: #1d5fb3;
  --brand-400: #5a8fd6;
  --brand-100: #dce8f7;
  --brand-50:  #eef4fb;
  --maroon-900: #4a0a1f;
  --maroon-800: #5f0c27;
  --maroon-700: #7a0c2e;
  --maroon-600: #9b1b3a;
  --maroon-500: #b8294a;
  --maroon-100: #f6dfe5;
  --maroon-50: #fbf1f3;
  --gold: #c9a227;
  --accent:    #7a0c2e;
  --accent-soft: #fbf1f3;

  --bg:        #f5f7fa;
  --bg-elev:   #ffffff;
  --bg-sunken: #eef1f8;
  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #8391a7;
  --border:    #e3e8f2;
  --border-2:  #d3dae8;
  --ring:      rgba(29, 95, 179, .25);

  --green: #12a150;  --green-bg: #e4f7ec;
  --red:   #e5484d;  --red-bg:   #fdecec;
  --amber: #c27c0e;  --amber-bg: #fff3d6;
  --blue:  #2563eb;  --blue-bg:  #e6eeff;
  --violet:#7a0c2e;  --violet-bg:#fbeaee;
  --slate: #475569;  --slate-bg: #eceff4;
  --gray:  #6b7280;  --gray-bg:  #f1f2f4;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(15, 37, 87, .14);
  --sidebar-w: 264px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg:        #08101f;
  --bg-elev:   #0f1a2e;
  --bg-sunken: #0f1627;
  --text:      #e7ecf6;
  --text-2:    #a6b2c8;
  --text-3:    #6f7d96;
  --border:    #1f2a44;
  --border-2:  #2a3655;
  --brand-50:  #131d36;
  --brand-100: #1a2747;
  --accent-soft: #2a1119;
  --maroon-100: #3a1420;
  --maroon-50: #261018;
  --green-bg: #0f2a1d; --red-bg: #321519; --amber-bg: #2e2410; --blue-bg: #14213f;
  --violet-bg:#2e1219; --slate-bg:#1b2337; --gray-bg: #1a2131;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
[data-theme="dark"] a { color: var(--brand-400); }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .82rem; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.icon { flex-shrink: 0; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
::selection { background: var(--brand-100); }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, var(--brand-800) 0%, var(--brand-900) 100%);
  color: #c9d5f2; display: flex; flex-direction: column; padding: 18px 14px;
  transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: #fff; padding: 3px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: .7rem; color: #9fb6d9; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #7186bb; font-weight: 700; margin: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: #c9d5f2; font-weight: 550; font-size: .9rem; position: relative;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 #d23a5b; }
.nav .count {
  margin-left: auto; background: #c8243f; color: #fff; font-size: .7rem; font-weight: 800;
  min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px;
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 8px; }
.sidebar-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 11px; border-radius: 12px; background: linear-gradient(180deg, var(--maroon-600), var(--maroon-700)); color: #fff !important; font-weight: 750;
  box-shadow: 0 8px 20px rgba(122,12,46,.35); margin-bottom: 10px;
}
.sidebar-cta:hover { text-decoration: none; filter: brightness(1.05); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 66px; display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-search { flex: 1; max-width: 440px; position: relative; }
.topbar-search input { padding-left: 38px; background: var(--bg-elev); }
.topbar-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; position: relative;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); text-decoration: none; }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg);
}
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; background: none; color: inherit; font: inherit; }
.user-chip:hover { background: var(--bg-elev); border-color: var(--border); }
.avatar {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500)); color: #fff; font-weight: 800; font-size: .8rem;
}
.avatar.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who b { display: block; font-size: .86rem; }
.user-chip .who span { font-size: .72rem; color: var(--text-3); }

.content { padding: 28px; max-width: 1400px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--text-2); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-3); }
.footer { padding: 18px 28px; color: var(--text-3); font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 60;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none; animation: pop .15s ease;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 9px;
  color: var(--text); font: inherit; font-size: .88rem; background: none; border: 0; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-sunken); text-decoration: none; }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; }
.notif-menu .dropdown-head { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 12px 14px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text) !important; }
.notif-item:hover { background: var(--bg-sunken); text-decoration: none; }
.notif-item.unread { background: var(--brand-50); }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-100); color: var(--brand-600); flex-shrink: 0; }
.notif-item b { display: block; font-size: .85rem; }
.notif-item p { margin: 2px 0; font-size: .8rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item time { font-size: .72rem; color: var(--text-3); }

/* ---------------------------------------------------------------- cards & grids */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 9px; }
.card-head p { margin: 2px 0 0; color: var(--text-3); font-size: .8rem; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-sunken); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.grid-main-lg { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-right { text-align: right; } .text-center { text-align: center; }
.w-100 { width: 100%; }
.hide { display: none !important; }

/* Stat cards */
.stat {
  position: relative; overflow: hidden; padding: 20px; border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 6px;
}
.stat .label { color: var(--text-2); font-weight: 600; font-size: .82rem; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .trend { font-size: .78rem; color: var(--text-3); }
.stat .stat-ic { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.stat.stat-hero { background: linear-gradient(135deg, var(--brand-800), var(--brand-600)); color: #fff; border: 0; box-shadow: 0 12px 30px rgba(13,58,117,.3); }
.stat.stat-hero .label, .stat.stat-hero .trend { color: rgba(255,255,255,.82); }
.stat.stat-hero .stat-ic { background: rgba(255,255,255,.16); color: #fff; }
.tone-blue   { background: var(--blue-bg);   color: var(--blue); }
.tone-green  { background: var(--green-bg);  color: var(--green); }
.tone-amber  { background: var(--amber-bg);  color: var(--amber); }
.tone-red    { background: var(--red-bg);    color: var(--red); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-slate  { background: var(--slate-bg);  color: var(--slate); }

/* Queue tiles */
.queue { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text) !important; transition: transform .15s, box-shadow .15s; }
.queue:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.queue .q-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; }
.queue b { font-size: 1.5rem; font-weight: 800; line-height: 1; display: block; }
.queue span { font-size: .8rem; color: var(--text-2); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 11px; border: 1px solid var(--border-2); background: var(--bg-elev); color: var(--text);
  font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, var(--brand-500), var(--brand-600)); border-color: var(--brand-600); color: #fff !important; box-shadow: 0 4px 14px rgba(18,74,148,.28); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--brand-600); }
.btn-accent { background: linear-gradient(180deg, var(--maroon-600), var(--maroon-700)); border-color: var(--maroon-700); color: #fff !important; box-shadow: 0 6px 18px rgba(122,12,46,.3); }
.btn-accent:hover { filter: brightness(1.08); border-color: var(--maroon-700); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff !important; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff !important; }
.btn-danger-soft { background: var(--red-bg); border-color: transparent; color: var(--red) !important; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-sunken); border-color: transparent; color: var(--text); }
.btn-soft { background: var(--brand-50); border-color: transparent; color: var(--brand-600) !important; }
.btn-soft:hover { background: var(--brand-100); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: .8rem; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-slate  { background: var(--slate-bg);  color: var(--slate); }
.badge-gray   { background: var(--gray-bg);   color: var(--gray); }
.badge-outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; background: var(--bg-sunken); color: var(--text-2); font-size: .76rem; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-dual { background: #fff1e6; color: #c2410c; }
.pill-event { background: var(--blue-bg); color: var(--blue); }
[data-theme="dark"] .pill-dual { background: #331d10; color: #fb923c; }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 650; font-size: .84rem; color: var(--text); }
.field .hint { font-size: .76rem; color: var(--text-3); }
.req::after { content: " *"; color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--border-2);
  background: var(--bg-elev); color: var(--text); font: inherit; font-size: .9rem; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238391a7' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.is-invalid { border-color: var(--red) !important; }
.is-invalid:focus { box-shadow: 0 0 0 4px rgba(229,72,77,.2) !important; }
.field-error { color: var(--red); font-size: .78rem; font-weight: 600; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.check-tile { position: relative; }
.check-tile input { position: absolute; opacity: 0; }
.check-tile span {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border-2); border-radius: 10px;
  cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--text-2); transition: all .15s; user-select: none;
}
.check-tile span::before { content: ""; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-2); flex-shrink: 0; transition: all .15s; }
.check-tile input:checked + span { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-600); }
.check-tile input:checked + span::before { background: var(--brand-500) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat; border-color: var(--brand-500); }
.check-tile input:focus-visible + span { box-shadow: 0 0 0 4px var(--ring); }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card label, .radio-card > span {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1.5px solid var(--border-2); border-radius: 14px; cursor: pointer; height: 100%; transition: all .15s;
}
.radio-card label:hover { border-color: var(--brand-400); }
.radio-card input:checked + label { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 4px var(--ring); }
.radio-card .rc-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.radio-card b { font-size: .9rem; }
.radio-card small { color: var(--text-3); line-height: 1.35; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .86rem; }
.switch input { width: 38px; height: 22px; appearance: none; background: var(--border-2); border-radius: 11px; position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand-500); }
.switch input:checked::after { transform: translateX(16px); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .87rem; }
.table th {
  text-align: left; font-weight: 700; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  padding: 12px 16px; background: var(--bg-sunken); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 12px; } .table th:last-child { border-top-right-radius: 12px; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--brand-50); }
.table tr:last-child td { border-bottom: 0; }
.table .t-main { font-weight: 700; color: var(--text); display: block; }
.table .t-sub { font-size: .78rem; color: var(--text-3); }
.table a.t-main:hover { color: var(--brand-600); }
.row-link { cursor: pointer; }

/* ---------------------------------------------------------------- alerts & toasts */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; font-size: .88rem; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert b { display: block; margin-bottom: 2px; }
.alert p { margin: 0; }
.alert-info { background: var(--blue-bg); color: var(--text); border-color: color-mix(in srgb, var(--blue) 20%, transparent); }
.alert-info > .icon { color: var(--blue); }
.alert-warn { background: var(--amber-bg); color: var(--text); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert-warn > .icon { color: var(--amber); }
.alert-error { background: var(--red-bg); color: var(--text); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-error > .icon { color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--text); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-success > .icon { color: var(--green); }

.toasts { position: fixed; top: 78px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px; border-radius: 14px; background: var(--bg-elev);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 550; animation: slideIn .3s ease;
  border-left: 4px solid var(--brand-500);
}
.toast.success { border-left-color: var(--green); } .toast.success .icon { color: var(--green); }
.toast.error { border-left-color: var(--red); } .toast.error .icon { color: var(--red); }
.toast.info .icon { color: var(--brand-500); }
.toast .close { margin-left: auto; background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 0; }
.toast.leaving { animation: slideOut .3s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .3s ease both; }

/* ---------------------------------------------------------------- modal */
dialog.modal {
  border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(10, 20, 45, .5); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .2s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------------------------------------------------------- empty state */
.empty { text-align: center; padding: 48px 24px; color: var(--text-2); }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-50); color: var(--brand-500); }
.empty h3 { color: var(--text); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-sunken); border-radius: 12px; overflow-x: auto; width: fit-content; max-width: 100%; }
.tabs a, .tabs button {
  padding: 7px 13px; border-radius: 9px; font-weight: 650; font-size: .82rem; color: var(--text-2); white-space: nowrap;
  border: 0; background: none; cursor: pointer; font-family: inherit; display: inline-flex; gap: 6px; align-items: center;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs a.active, .tabs button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs .n { font-size: .7rem; background: var(--border); color: var(--text-2); padding: 0 6px; border-radius: 6px; }
.tabs .active .n { background: var(--brand-100); color: var(--brand-600); }

/* ---------------------------------------------------------------- workflow stepper */
.stepper { display: flex; gap: 0; padding: 6px 4px; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: 1; min-width: 82px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; gap: 8px; }
.step::before { content: ""; position: absolute; top: 18px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.step:first-child::before { display: none; }
.step .s-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-3); border: 3px solid var(--bg-elev); position: relative; z-index: 1; box-shadow: 0 0 0 1px var(--border); }
.step b { font-size: .8rem; }
.step small { color: var(--text-3); font-size: .72rem; line-height: 1.3; }
.step.done::before, .step.current::before { background: var(--green); }
.step.done .s-dot { background: var(--green); color: #fff; box-shadow: none; }
.step.current .s-dot { background: var(--brand-500); color: #fff; box-shadow: 0 0 0 6px var(--ring); }
.step.failed .s-dot { background: var(--red); color: #fff; box-shadow: none; }
.step.skipped .s-dot { background: var(--bg-sunken); opacity: .6; }

/* ---------------------------------------------------------------- timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .t-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-sunken); color: var(--text-2); }
.timeline b { font-size: .85rem; }
.timeline p { margin: 2px 0; font-size: .82rem; color: var(--text-2); }
.timeline time { font-size: .74rem; color: var(--text-3); }

/* ---------------------------------------------------------------- definition list */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: .88rem; margin: 0; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text-2); }
.kv b { text-align: right; }

/* ---------------------------------------------------------------- venue cards */
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.venue-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; color: var(--text) !important; }
.venue-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.venue-cover { height: 160px; background-size: cover; background-position: center; position: relative; display: flex; align-items: flex-end; padding: 14px; color: #fff; }
.venue-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.45)); }
.venue-cover > * { position: relative; z-index: 1; }
.venue-cover .vc-ic { position: absolute; right: 14px; top: 14px; width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.22); display: grid; place-items: center; z-index: 1; }
.venue-cover .badge { background: rgba(255,255,255,.92); color: var(--brand-900); }
.venue-cover .code { font-weight: 800; letter-spacing: .04em; font-size: .82rem; background: rgba(0,0,0,.3); padding: 3px 9px; border-radius: 7px; }
.venue-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.venue-body h3 { margin: 0; }
.venue-meta { display: flex; gap: 14px; color: var(--text-2); font-size: .82rem; flex-wrap: wrap; }
.venue-meta span { display: inline-flex; align-items: center; gap: 5px; }
.venue-price { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); }
.venue-price b { font-size: 1.05rem; }
.venue-price small { color: var(--text-3); }
.venue-hero { height: 280px; border-radius: var(--radius-lg); background-size: cover; background-position: center; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 28px; color: #fff; }
.venue-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.6)); }
.venue-hero > * { position: relative; z-index: 1; }
.venue-hero h1 { color: #fff; font-size: 2.2rem; margin: 6px 0 4px; }
.venue-hero .big-ic { position: absolute; right: 30px; top: 30px; opacity: .25; z-index: 1; }

/* ---------------------------------------------------------------- week grid (venue availability) */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { background: var(--bg-sunken); border-radius: 12px; padding: 10px; min-height: 140px; display: flex; flex-direction: column; gap: 6px; }
.week-day.today { box-shadow: inset 0 0 0 2px var(--brand-500); }
.week-day.past { opacity: .55; }
.week-day header { font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.week-day header b { display: block; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.slot { border-radius: 8px; padding: 6px 8px; font-size: .74rem; line-height: 1.3; border-left: 3px solid; }
.slot b { display: block; font-size: .72rem; }
.slot.class { background: #fff1e6; border-color: #f97316; color: #9a3412; }
.slot.event { background: var(--blue-bg); border-color: var(--blue); color: var(--blue); }
.slot.pending { background: var(--amber-bg); border-color: var(--amber); color: var(--amber); border-left-style: dashed; }
[data-theme="dark"] .slot.class { background: #331d10; color: #fdba74; }
.slot a { color: inherit; }
.free-day { margin-top: auto; font-size: .72rem; color: var(--green); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------------------------------------------------------------- month calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-h { padding: 10px; font-size: .72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-sunken); }
.cal-d { min-height: 118px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-d.other { background: var(--bg-sunken); }
.cal-d.other .n { color: var(--text-3); }
.cal-d .n { font-weight: 700; font-size: .82rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-d.today .n { background: var(--brand-500); color: #fff; }
.cal-ev { display: block; font-size: .72rem; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-ev:hover { text-decoration: none; filter: brightness(.96); }
.cal-ev.s-confirmed, .cal-ev.s-completed { background: var(--green-bg); color: var(--green); }
.cal-ev.s-awaiting_payment { background: var(--violet-bg); color: var(--violet); }
.cal-ev.s-allocated { background: var(--blue-bg); color: var(--blue); }
.cal-ev.s-pending_review { background: var(--amber-bg); color: var(--amber); }
.cal-more { font-size: .7rem; color: var(--text-3); font-weight: 600; padding-left: 4px; }

/* ---------------------------------------------------------------- charts */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--brand-400), var(--brand-600)); position: relative; min-height: 4px; transition: height .8s cubic-bezier(.2,.8,.2,1); }
.bar.alt { background: linear-gradient(180deg, var(--maroon-500), var(--maroon-700)); }
.bar .tip { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.bar-col span { font-size: .74rem; color: var(--text-3); font-weight: 600; }
.hbar { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 120px 1fr 64px; gap: 12px; align-items: center; font-size: .84rem; }
.hbar-row .track { height: 10px; background: var(--bg-sunken); border-radius: 6px; overflow: hidden; }
.hbar-row .fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand-600), var(--brand-400)); }
.hbar-row b { text-align: right; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--bg-elev); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.donut .center b { font-size: 1.6rem; font-weight: 800; display: block; line-height: 1; }
.donut .center small { color: var(--text-3); }
.legend-list { display: flex; flex-direction: column; gap: 8px; font-size: .84rem; flex: 1; min-width: 160px; }
.legend-list div { display: flex; align-items: center; gap: 8px; }
.legend-list i { width: 10px; height: 10px; border-radius: 3px; }
.legend-list b { margin-left: auto; }
.progress { height: 8px; border-radius: 6px; background: var(--bg-sunken); overflow: hidden; }
.progress > div { height: 100%; border-radius: 6px; background: var(--green); }

/* ---------------------------------------------------------------- list items */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--border); color: var(--text) !important; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--brand-50); text-decoration: none; }
.date-tile { width: 50px; height: 54px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }
.date-tile small { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.date-tile b { font-size: 1.25rem; font-weight: 800; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main span { font-size: .8rem; color: var(--text-3); }

/* ---------------------------------------------------------------- availability panel */
.avail { border-radius: 16px; padding: 16px; border: 1px solid var(--border); background: var(--bg-sunken); }
.avail-status { display: flex; align-items: center; gap: 12px; }
.avail-status .a-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.avail.available { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.avail.available .a-ic { background: var(--green); color: #fff; }
.avail.provisional { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.avail.provisional .a-ic { background: var(--amber); color: #fff; }
.avail.unavailable { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.avail.unavailable .a-ic { background: var(--red); color: #fff; }
.avail ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.avail li { display: flex; gap: 8px; font-size: .82rem; }
.suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.suggest button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--bg-elev); cursor: pointer; font: inherit; text-align: left; color: var(--text); transition: all .15s; }
.suggest button:hover { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--ring); }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--border-2); border-top-color: var(--brand-500); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Resolution cards */
.res-card { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg-elev); }
.res-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--bg-sunken); flex-wrap: wrap; }
.res-body { padding: 18px; }
.option-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.option-grid .radio-card label { align-items: flex-start; }
.realloc { display: none; margin-top: 14px; }
.realloc.show { display: block; animation: fadeUp .25s ease; }
.room-opt { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- auth & landing */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(70% 55% at 0% 0%, rgba(29,95,179,.55) 0%, transparent 60%), radial-gradient(60% 50% at 100% 100%, rgba(155,27,58,.55) 0%, transparent 60%), linear-gradient(160deg, var(--brand-800), var(--brand-900));
}
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 85%); }
.auth-art > * { position: relative; }
.auth-art h1 { font-size: 2.6rem; color: #fff; max-width: 520px; }
.auth-art p { color: #c3d0f0; max-width: 460px; font-size: 1.02rem; }
.auth-points { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.auth-points div { display: flex; gap: 12px; align-items: center; color: #dbe5ff; font-weight: 550; }
.auth-points .icon { background: rgba(255,255,255,.12); padding: 7px; border-radius: 10px; width: 34px; height: 34px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg-elev); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.7rem; }
.demo-accounts { margin-top: 22px; border: 1px dashed var(--border-2); border-radius: 14px; padding: 14px; }
.demo-accounts h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 10px; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.demo-grid button { padding: 7px 6px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-sunken); font: inherit; font-size: .74rem; font-weight: 650; cursor: pointer; color: var(--text-2); }
.demo-grid button:hover { border-color: var(--brand-500); color: var(--brand-600); }

/* ---------------------------------------------------------------- error page */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.error-code { font-size: 6rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(135deg, var(--brand-600), var(--maroon-600)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------- print slip */
.slip { max-width: 800px; margin: 30px auto; background: #fff; color: #111; padding: 44px; border-radius: 12px; box-shadow: var(--shadow); }
.slip-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--brand-700); padding-bottom: 18px; margin-bottom: 22px; }
.slip table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.slip td { padding: 9px 0; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.slip td:first-child { color: #6b7280; width: 200px; }
.slip .stamp { display: inline-block; border: 3px solid; padding: 6px 16px; border-radius: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; transform: rotate(-4deg); }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .slip { box-shadow: none; margin: 0; padding: 0; }
}

/* ---------------------------------------------------------------- responsive */
.backdrop { display: none; }
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-main-lg { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(3, 1fr); }
  .option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(10,20,45,.45); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero .container, .feature { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .site-links { display: none; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-chip .who { display: none; }
}
@media (max-width: 640px) {
  .grid-2, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .cal-d { min-height: 70px; padding: 4px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .hbar-row { grid-template-columns: 80px 1fr 50px; }
  .cta-band { padding: 32px 20px; }
  h1 { font-size: 1.45rem; }
  .page-head { align-items: flex-start; }
  .site-actions .btn-ghost { display: none; }
}

/* ---------------------------------------------------------------- NM-AIST logo */
.brand-mark { width: 44px; height: 44px; border-radius: 50%; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.logo-disc { background: #fff; border-radius: 50%; display: grid; place-items: center; overflow: hidden; box-shadow: 0 10px 30px rgba(6,26,56,.25); }
.logo-disc img { width: 92%; height: 92%; object-fit: contain; }
.nav a.active { background: rgba(255,255,255,.1); }
.sidebar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--brand-500), var(--maroon-600)); }
.topbar::after { content: none; }

/* ================================================================ dashboard v2 */
.welcome {
  position: relative; overflow: hidden; border-radius: 24px; padding: 30px 32px; color: #fff; margin-bottom: 22px;
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  background: radial-gradient(50% 120% at 100% 0%, rgba(155,27,58,.65), transparent 60%), radial-gradient(40% 90% at 0% 0%, rgba(29,95,179,.5), transparent 60%), linear-gradient(135deg, #0a2a57, #061a38);
  box-shadow: 0 18px 40px rgba(6,26,56,.22);
}
.welcome::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%); }
.welcome > * { position: relative; z-index: 1; }
.welcome .mtn { position: absolute; right: 0; bottom: -2px; width: 62%; height: 90px; z-index: 0; opacity: .9; pointer-events: none; }
.welcome .chip-date { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); font-size: .78rem; font-weight: 700; color: #d6e2f3; }
.welcome h1 { color: #fff; font-size: 1.9rem; margin: 14px 0 6px; }
.welcome p { color: #c3d1e8; margin: 0; max-width: 620px; font-size: .98rem; }
.welcome p b { color: #fff; }
.welcome .actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.welcome .btn-glass { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #fff !important; }
.welcome .btn-glass:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }
.today-tile { width: 190px; border-radius: 20px; padding: 18px; text-align: center; background: rgba(255,255,255,.96); color: var(--text); box-shadow: 0 14px 30px rgba(0,0,0,.25); }
[data-theme="dark"] .today-tile { background: var(--bg-elev); }
.today-tile .mo { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--maroon-700); border-radius: 9px; padding: 4px 0; }
.today-tile .d { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; margin: 10px 0 2px; color: var(--brand-800); }
[data-theme="dark"] .today-tile .d { color: #fff; }
.today-tile .wd { color: var(--text-2); font-weight: 650; font-size: .86rem; }
.today-tile .mini { display: flex; justify-content: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-2); font-size: .74rem; color: var(--text-2); font-weight: 650; }
.today-tile .mini b { display: block; font-size: 1.1rem; color: var(--text); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { position: relative; overflow: hidden; padding: 18px 20px; border-radius: 20px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi::after { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--kpi, var(--brand-600)); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .k-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.kpi .k-label { color: var(--text-2); font-weight: 650; font-size: .82rem; margin-top: 14px; }
.kpi .k-val { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--text); }
.kpi .k-foot { margin-top: 6px; font-size: .76rem; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.trend-up, .trend-down, .trend-flat { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-weight: 750; font-size: .72rem; }
.trend-up { background: var(--green-bg); color: var(--green); }
.trend-down { background: var(--red-bg); color: var(--red); }
.trend-flat { background: var(--slate-bg); color: var(--slate); }

.actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.action-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text) !important; transition: all .15s; }
.action-card:hover { text-decoration: none; border-color: var(--brand-400); box-shadow: var(--shadow); }
.action-card .a-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; position: relative; }
.action-card .a-ic .n { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #c8243f; color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg-elev); }
.action-card b { display: block; font-size: .92rem; }
.action-card span.s { font-size: .78rem; color: var(--text-3); }
.action-card .go { margin-left: auto; color: var(--text-3); }
.action-card.clear .a-ic { background: var(--green-bg) !important; color: var(--green) !important; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.section-title h3 { margin: 0; display: flex; align-items: center; gap: 8px; }

/* today timeline */
.tl { --tl-cols: 14; }
.tl-head, .tl-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; }
.tl-hours { display: grid; grid-template-columns: repeat(var(--tl-cols), 1fr); font-size: .7rem; color: var(--text-3); font-weight: 700; }
.tl-hours span { border-left: 1px solid var(--border); padding-left: 5px; }
.tl-row { padding: 6px 0; border-top: 1px solid var(--border); }
.tl-venue { display: flex; align-items: center; gap: 9px; min-width: 0; padding-right: 10px; }
.tl-venue .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: .62rem; background-size: cover; }
.tl-venue b { display: block; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-venue small { color: var(--text-3); font-size: .7rem; }
.tl-track { position: relative; height: 36px; border-radius: 10px; background: repeating-linear-gradient(90deg, var(--bg-sunken) 0, var(--bg-sunken) calc(100% / var(--tl-cols) - 1px), var(--border) calc(100% / var(--tl-cols) - 1px), var(--border) calc(100% / var(--tl-cols))); }
.tl-block { position: absolute; top: 4px; bottom: 4px; border-radius: 8px; padding: 0 8px; display: flex; align-items: center; font-size: .72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 6px; color: #fff !important; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.tl-block:hover { text-decoration: none; filter: brightness(1.08); z-index: 2; }
.tl-block.class { background: linear-gradient(135deg, #ea7a2b, #c2410c); }
.tl-block.event { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); }
.tl-block.pending { background: repeating-linear-gradient(45deg, #b8294a, #b8294a 6px, #9b1b3a 6px, #9b1b3a 12px); }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #e5484d; z-index: 3; border-radius: 2px; }
.tl-now::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; }
.tl-free { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 12px; font-size: .72rem; color: var(--green); font-weight: 700; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .f-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-50); color: var(--brand-600); }
.feed b { font-size: .84rem; }
.feed p { margin: 1px 0 0; font-size: .8rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed time { font-size: .72rem; color: var(--text-3); }

/* chart v2 */
.chart2 { position: relative; height: 230px; display: flex; gap: 10px; padding-left: 44px; }
.chart2 .grid-lines { position: absolute; left: 44px; right: 0; top: 0; bottom: 26px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart2 .grid-lines div { border-top: 1px dashed var(--border); position: relative; }
.chart2 .grid-lines span { position: absolute; left: -44px; top: -8px; width: 38px; text-align: right; font-size: .68rem; color: var(--text-3); font-weight: 600; }
.chart2 .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; position: relative; z-index: 1; }
.chart2 .pair { display: flex; align-items: flex-end; gap: 5px; height: calc(100% - 26px); width: 100%; justify-content: center; }
.chart2 .b1, .chart2 .b2 { width: 18px; border-radius: 6px 6px 2px 2px; min-height: 3px; transition: height .8s cubic-bezier(.2,.8,.2,1); position: relative; }
.chart2 .b1 { background: linear-gradient(180deg, var(--brand-400), var(--brand-700)); }
.chart2 .b2 { background: linear-gradient(180deg, var(--maroon-500), var(--maroon-700)); }
.chart2 .col > span { font-size: .74rem; color: var(--text-3); font-weight: 650; height: 18px; }
.chart2 .b1:hover::after, .chart2 .b2:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg-elev); font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }

@media (max-width: 1200px) { .kpis, .actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .welcome { grid-template-columns: 1fr; padding: 24px 20px; }
  .today-tile { display: none; }
  .tl-head, .tl-row { grid-template-columns: 90px 1fr; }
  .tl-venue small, .tl-venue .avatar { display: none; }
  .tl-hours span:nth-child(even) { visibility: hidden; }
}
@media (max-width: 560px) { .kpis, .actions-grid { grid-template-columns: 1fr; } .welcome h1 { font-size: 1.5rem; } }
.ic-navy { background: var(--brand-50); color: var(--brand-600); }
.ic-maroon { background: var(--maroon-50); color: var(--maroon-700); }
[data-theme="dark"] .ic-maroon { color: #e48aa0; }
[data-theme="dark"] .ic-navy { color: var(--brand-400); }
.ic-teal { background: #e3f3f6; color: #1f7085; }
[data-theme="dark"] .ic-teal { background: #0f2a31; color: #6cc3d6; }
.ic-green { background: var(--green-bg); color: var(--green); }
