/* CineFlow-style design: white sidebar, fixed top bar, slate neutrals, indigo accent, compact bordered cards */
:root {
  --bg: #f8fafc; --card: #ffffff; --ink: #0f172a; --muted: #64748b; --faint: #94a3b8;
  --line: #e2e8f0; --line-soft: #f1f5f9; --soft: #f8fafc;
  --brand: #4f46e5; --brand-d: #4338ca; --brand-50: #eef2ff; --brand-100: #e0e7ff;
  --green: #059669; --green-50: #ecfdf5; --green-200: #a7f3d0;
  --amber: #b45309; --amber-50: #fffbeb; --amber-200: #fde68a;
  --red: #be123c; --red-50: #fff1f2; --red-200: #fecdd3;
  --sky: #0369a1; --sky-50: #f0f9ff; --sky-200: #bae6fd;
  --purple: #7e22ce; --purple-50: #faf5ff; --purple-200: #e9d5ff;
  --shadow: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 4px 14px rgba(15,23,42,.08);
  --r: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--ink); font-size: 13px; line-height: 20px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-d); }
::-webkit-scrollbar { height: 8px; width: 8px; } ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.material-symbols-outlined { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; vertical-align: middle; font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga'; user-select: none; }

/* ---------- Sidebar ---------- */
.layout { min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 256px; background: #fff; border-right: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; z-index: 50; }
.brand { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.brand .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.brand .logo .material-symbols-outlined { font-size: 19px; }
.brand > div:last-child span { color: var(--brand); }
.brand .logo .material-symbols-outlined { color: #fff; }
.nav { padding: 12px; }
.nav .sec, .side-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--faint); padding: 10px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: #475569; font-weight: 500; font-size: 12.5px; margin-bottom: 2px; border: 1px solid transparent; transition: all .15s; }
.nav a .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.nav a:hover { background: #f1f5f9; color: var(--ink); }
.nav a.active { background: var(--brand-50); color: var(--brand-d); font-weight: 600; border-color: var(--brand-100); }
.nav a.active .material-symbols-outlined { color: var(--brand); }
.side-bottom { padding: 12px; border-top: 1px solid var(--line-soft); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.side-user .av { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand-d); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .n { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 16px; }
.side-user .r { font-size: 11px; color: var(--muted); line-height: 14px; }
.side-user form { margin: 0; }
.iconbtn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 7px; display: inline-flex; }
.iconbtn:hover { background: #e2e8f0; color: var(--ink); }
.live { margin-top: 10px; padding: 8px 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); font-weight: 500; }
.live i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- Top header ---------- */
.header { position: fixed; top: 0; left: 256px; right: 0; height: 64px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; }
.search { position: relative; flex: 1; max-width: 520px; margin: 0; }
.search .material-symbols-outlined { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--faint); }
.search input { width: 100%; padding: 8px 12px 8px 36px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 12.5px; }
.header-r { display: flex; align-items: center; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #f1f5f9; border: 1px solid var(--line); border-radius: 8px; color: #334155; font-weight: 600; font-size: 12px; white-space: nowrap; }
.chip .material-symbols-outlined { font-size: 17px; color: var(--muted); }
.bell { position: relative; display: inline-flex; padding: 6px; border-radius: 8px; color: var(--muted); }
.bell:hover { background: #f1f5f9; color: var(--ink); }
.bell .cnt { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red-50); color: var(--red); border: 1px solid var(--red-200); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.vsep { width: 1px; height: 24px; background: var(--line); }
.userchip { display: flex; align-items: center; gap: 9px; }
.userchip .av { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.userchip .n { font-weight: 600; font-size: 12px; line-height: 15px; }
.userchip .r { color: var(--muted); font-size: 11px; line-height: 14px; }

.main { margin-left: 256px; padding: 88px 24px 40px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 24px; line-height: 32px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 15px; line-height: 22px; margin: 0 0 14px; font-weight: 600; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 12.5px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; }
.eyebrow .ok { color: var(--green); display: inline-flex; align-items: center; gap: 5px; }
.eyebrow .ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #10b981; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.g2 { grid-template-columns: 2fr 1fr; align-items: start; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; height: 100%; }
a:hover > .stat, .stat:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); }
.stat .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat .lb { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--muted); }
.stat .ico { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand); }
.stat .ico .material-symbols-outlined { font-size: 18px; }
.stat .v { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.c-sky .ico { background: var(--sky-50); border-color: var(--sky-200); color: var(--sky); }
.stat.c-green .ico { background: var(--green-50); border-color: var(--green-200); color: var(--green); }
.stat.c-amber .ico { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber); }
.stat.red { border-color: var(--red-200); }
.stat.red .ico { background: var(--red-50); border-color: var(--red-200); color: var(--red); }
.stat.red .v, .stat.red .lb { color: var(--red); }

.bar { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.g > i { background: #10b981; }
.wl { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.wl:last-child { border-bottom: 0; }
.wl .r1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.wl .pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--brand-50); color: var(--brand-d); border: 1px solid var(--brand-100); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--brand); color: #fff; padding: 7px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 12.5px; font-family: inherit; box-shadow: var(--shadow); transition: background .15s; }
.btn:hover { background: var(--brand-d); color: #fff; }
.btn .material-symbols-outlined { font-size: 18px; }
.btn.ghost { background: #fff; color: #334155; border-color: var(--line); }
.btn.ghost:hover { background: #f1f5f9; color: var(--ink); }
.btn.danger { background: var(--red-50); color: var(--red); border-color: var(--red-200); box-shadow: none; }
.btn.danger:hover { background: #ffe4e6; color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; background: var(--soft); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: #fafbfd; }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.card.scroll { padding: 0; }
.card.scroll .pager { padding: 0 16px 16px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.b-pending { background: #f1f5f9; color: #475569; border-color: var(--line); }
.b-in_progress { background: var(--sky-50); color: var(--sky); border-color: var(--sky-200); }
.b-in_progress::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #0ea5e9; animation: pulse 1.6s infinite; }
.b-review { background: var(--amber-50); color: var(--amber); border-color: var(--amber-200); }
.b-revision { background: var(--red-50); color: var(--red); border-color: var(--red-200); }
.b-completed { background: var(--green-50); color: var(--green); border-color: var(--green-200); }
.p-low { background: #f1f5f9; color: #475569; border-color: var(--line); }
.p-medium { background: var(--sky-50); color: var(--sky); border-color: var(--sky-200); }
.p-high { background: var(--amber-50); color: var(--amber); border-color: var(--amber-200); }
.p-urgent { background: var(--red-50); color: var(--red); border-color: var(--red-200); }
.overdue { color: var(--red); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }

.avatar { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-100); color: var(--brand-d); font-size: 10.5px; font-weight: 700; align-items: center; justify-content: center; margin-right: 8px; vertical-align: middle; border: 1px solid #c7d2fe; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #475569; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; background: var(--soft); color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #cbd5e1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.err { color: var(--red); font-size: 12px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 12.5px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.flash.ok { background: var(--green-50); color: #047857; border-color: var(--green-200); }
.flash.bad { background: var(--red-50); color: var(--red); border-color: var(--red-200); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-end; padding: 14px 16px; }
.filters > div { min-width: 140px; }
.filters .grow { flex: 1; min-width: 200px; }

.link-row { display: grid; grid-template-columns: 1fr 2fr 1.2fr auto; gap: 8px; margin-bottom: 8px; }
.linkitem { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--soft); }
.linkitem .k { font-size: 10.5px; color: var(--brand-d); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.linkitem a { word-break: break-all; font-weight: 500; }

.comment { padding: 10px 12px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line-soft); margin-bottom: 8px; }
.comment .h { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.comment.sys { background: transparent; border: 0; padding: 3px 2px; color: var(--muted); font-size: 12.5px; }
.meta dt { color: var(--muted); font-size: 11px; margin-top: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.meta dd { margin: 2px 0 0; font-weight: 600; }
.pre { white-space: pre-wrap; }
.pager { margin-top: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 500; }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.login-art { background: var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; background: rgba(255,255,255,.08); right: -110px; top: -100px; }
.login-art::after { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.07); left: -90px; bottom: -110px; }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand { padding: 0; height: auto; border: 0; color: #fff; font-size: 20px; }
.login-art .brand .logo { background: #fff; color: var(--brand); }
.login-art .brand > div:last-child span { color: #c7d2fe; }
.login-art .brand .logo .material-symbols-outlined { color: var(--brand); }
.login-art h2 { font-size: 36px; line-height: 42px; letter-spacing: -.02em; font-weight: 700; margin: 0 0 14px; }
.login-art p { color: rgba(255,255,255,.8); font-size: 15px; line-height: 24px; max-width: 420px; margin: 0; }
.login-art ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.login-art li { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.92); }
.login-art li::before { content: '\2713'; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-top: 20px; box-shadow: var(--shadow-md); }
.hint { background: var(--brand-50); border: 1px dashed #c7d2fe; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #475569; margin-top: 16px; line-height: 1.7; }

@media (max-width: 960px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .sidebar { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 12px; box-shadow: none; }
  .brand { border: 0; height: auto; padding: 0 8px; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; }
  .nav a { margin: 0; }
  .nav .sec, .side-sec, .live { display: none; }
  .side-bottom { border: 0; padding: 0; margin-left: auto; }
  .side-user { margin: 0; padding: 4px 8px; }
  .side-user .who { display: none; }
  .header { position: static; height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .header-r .chip, .userchip { display: none; }
  .main { margin-left: 0; padding: 18px 14px 40px; }
  .g2 { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: 1fr; }
  h1 { font-size: 20px; line-height: 28px; }
}

/* ===== Search (header) ===== */
.search { transition: max-width .2s; }
.search input { padding-right: 34px; background: #fff; border-color: #cbd5e1; box-shadow: var(--shadow); }
.search input:focus { box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px/1 'Inter', sans-serif; color: var(--muted); background: #f1f5f9; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.search:focus-within kbd { display: none; }
.chip.warn { background: var(--red-50); border-color: var(--red-200); color: var(--red); }
.chip.warn .material-symbols-outlined { color: var(--red); }

/* ===== Status tabs ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: #475569; font-weight: 600; font-size: 12.5px; transition: all .15s; }
.tab span { background: #f1f5f9; color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.tab:hover { border-color: #cbd5e1; color: var(--ink); }
.tab.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.25); }
.tab.on span { background: rgba(255,255,255,.22); color: #fff; }

/* ===== Filter bar ===== */
.filterbar { padding: 16px; display: block; }
.fb-search { position: relative; margin-bottom: 14px; }
.fb-search > .material-symbols-outlined { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 22px; }
.fb-search input { padding: 12px 40px 12px 46px; font-size: 14px; border-radius: 10px; background: #fff; border: 1.5px solid #cbd5e1; }
.fb-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: inline-flex; padding: 4px; border-radius: 6px; color: var(--muted); }
.fb-clear:hover { background: #f1f5f9; color: var(--ink); }
.fb-clear .material-symbols-outlined { font-size: 18px; }
.fb-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.fb-row > div:not(.fb-actions) { min-width: 160px; flex: 1; max-width: 240px; }
.fb-actions { display: flex; gap: 8px; margin-left: auto; }
.switch { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 6px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: #334155; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 34px; height: 20px; background: #cbd5e1; border-radius: 99px; position: relative; transition: background .15s; flex-shrink: 0; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--red); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(79,70,229,.2); }
.empty { text-align: center; padding: 44px 16px !important; color: var(--muted); }
.empty .material-symbols-outlined { font-size: 38px; color: #cbd5e1; margin-bottom: 6px; }

/* ===== Bell + notification panel ===== */
.notif { position: relative; }
.bell { border: 0; background: transparent; cursor: pointer; }
.bell .cnt { background: var(--red); color: #fff; border-color: #fff; }
.bell.ring .material-symbols-outlined { animation: ring .6s ease; }
@keyframes ring { 20%,60% { transform: rotate(14deg); } 40%,80% { transform: rotate(-14deg); } }
.notif-panel { position: absolute; right: -8px; top: 44px; width: 380px; max-width: 92vw; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(15,23,42,.18); overflow: hidden; z-index: 60; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--soft); }
.linkbtn { border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.np-list { max-height: 420px; overflow-y: auto; }
.np-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.np-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink); position: relative; }
.np-item:hover { background: #f8fafc; color: var(--ink); }
.np-item.unread { background: #f5f7ff; }
.np-item.unread::after { content: ''; position: absolute; right: 14px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.np-body { min-width: 0; padding-right: 14px; }
.np-title { font-weight: 600; font-size: 12.5px; line-height: 17px; }
.np-msg { color: #475569; font-size: 12px; line-height: 17px; margin-top: 1px; }
.np-time { color: var(--faint); font-size: 11px; margin-top: 3px; }

/* ===== Popup toasts ===== */
.toasts { position: fixed; top: 76px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 12px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--brand)); border-radius: 12px; padding: 14px 36px 16px 14px; box-shadow: 0 18px 50px rgba(15,23,42,.22); overflow: hidden; animation: toast-in .35s cubic-bezier(.2,.8,.2,1); }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }
.toast-ic { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--tb, var(--brand-50)); color: var(--tc, var(--brand)); }
.toast-body { min-width: 0; }
.toast-title { font-weight: 700; font-size: 13.5px; line-height: 18px; }
.toast-msg { color: #475569; font-size: 12.5px; margin-top: 2px; word-wrap: break-word; }
.toast-actions { display: flex; gap: 8px; margin-top: 10px; }
.toast-x { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; }
.toast-x:hover { background: #f1f5f9; color: var(--ink); }
.toast-x .material-symbols-outlined { font-size: 18px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--tc, var(--brand)); opacity: .5; transform-origin: left; animation: bar 12s linear forwards; }
@keyframes bar { to { transform: scaleX(0); } }
.tone-indigo { --tc: #4f46e5; --tb: #eef2ff; }
.tone-green  { --tc: #059669; --tb: #ecfdf5; }
.tone-amber  { --tc: #b45309; --tb: #fffbeb; }
.tone-red    { --tc: #be123c; --tb: #fff1f2; }

@media (max-width: 960px) {
  .search kbd { display: none; }
  .toasts { top: 12px; right: 12px; }
  .fb-actions { margin-left: 0; }
}

/* =====================================================================
   PREMIUM POLISH: search bar, sidebar, member form
   ===================================================================== */

/* ---------- Header search (pill) ---------- */
.header .search { max-width: 540px; }
.header .search > .material-symbols-outlined { left: 16px; font-size: 20px; color: #94a3b8; transition: color .15s; z-index: 1; }
.header .search:focus-within > .material-symbols-outlined { color: var(--brand); }
.header .search input {
  height: 42px; padding: 0 54px 0 46px; border-radius: 99px; background: #f1f5f9;
  border: 1px solid transparent; box-shadow: none; font-size: 13px; color: var(--ink);
}
.header .search input::placeholder { color: #94a3b8; }
.header .search input:hover { background: #e9edf4; }
.header .search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79,70,229,.12), 0 6px 18px rgba(15,23,42,.08); }
.header .search kbd { right: 14px; background: #fff; border-radius: 6px; box-shadow: 0 1px 0 #cbd5e1; }

/* ---------- Sidebar ---------- */
.sidebar { width: 264px; background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%); border-right: 1px solid #e6e9f5; box-shadow: 4px 0 24px rgba(79,70,229,.05); }
.header { left: 264px; }
.main { margin-left: 264px; }
.brand { height: 68px; padding: 0 22px; border-bottom: 1px solid #eceffa; font-size: 17px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #4f46e5, #8b5cf6); box-shadow: 0 6px 16px rgba(79,70,229,.38), inset 0 1px 0 rgba(255,255,255,.3); }
.nav { padding: 14px 14px 8px; }
.nav .sec { display: flex; align-items: center; gap: 8px; padding: 14px 10px 8px; font-size: 10.5px; letter-spacing: .1em; color: #a0a9bd; }
.nav .sec::after { content: ''; flex: 1; height: 1px; background: #e8ebf5; }
.nav a { position: relative; gap: 11px; padding: 7px 10px; margin-bottom: 4px; border-radius: 12px; font-size: 13px; font-weight: 500; color: #475569; border: 1px solid transparent; }
.nav a .material-symbols-outlined { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #eef1f8; color: #64748b; font-size: 18px; transition: all .18s; }
.nav a:hover { background: #fff; color: var(--ink); border-color: #e6e9f5; box-shadow: 0 2px 8px rgba(15,23,42,.05); }
.nav a:hover .material-symbols-outlined { background: var(--brand-50); color: var(--brand); }
.nav a.active { background: #fff; color: var(--brand-d); font-weight: 600; border-color: #dfe3f7; box-shadow: 0 6px 18px rgba(79,70,229,.12); }
.nav a.active::before { content: ''; position: absolute; left: -15px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #4f46e5, #8b5cf6); }
.nav a.active .material-symbols-outlined { background: linear-gradient(135deg, #4f46e5, #8b5cf6); color: #fff; box-shadow: 0 4px 10px rgba(79,70,229,.35); }

.side-bottom { padding: 14px; border-top: 1px solid #eceffa; }
.side-card { padding: 14px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #4338ca 0%, #6d5dfc 55%, #8b5cf6 100%); box-shadow: 0 10px 24px rgba(79,70,229,.3); position: relative; overflow: hidden; }
.side-card::after { content: ''; position: absolute; right: -28px; top: -28px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.12); }
.sc-top { display: flex; gap: 10px; align-items: center; position: relative; z-index: 1; }
.sc-ic { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sc-ic .material-symbols-outlined { font-size: 18px; color: #fff; }
.sc-t { font-weight: 700; font-size: 12.5px; line-height: 16px; }
.sc-s { font-size: 11px; line-height: 15px; color: rgba(255,255,255,.8); }
.sc-bar { height: 6px; background: rgba(255,255,255,.25); border-radius: 99px; margin-top: 12px; overflow: hidden; position: relative; z-index: 1; }
.sc-bar i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .6s; }
.sc-pct { font-size: 11px; font-weight: 700; text-align: right; margin-top: 4px; color: rgba(255,255,255,.9); position: relative; z-index: 1; }
.live { background: transparent; border: 0; padding: 10px 4px 0; }
.side-user { background: #fff; border: 1px solid #e6e9f5; border-radius: 14px; padding: 10px; margin-top: 8px; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.side-user .av { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, #4f46e5, #8b5cf6); color: #fff; box-shadow: 0 4px 10px rgba(79,70,229,.3); }

/* ---------- Member form ---------- */
.uf { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.uf-sec { padding: 22px; }
.uf-h { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.uf-h h2 { margin: 0 0 1px; font-size: 15px; }
.uf-n { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-d); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.inp { position: relative; }
.inp > .material-symbols-outlined { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 19px; color: #94a3b8; pointer-events: none; transition: color .15s; }
.inp:focus-within > .material-symbols-outlined { color: var(--brand); }
.inp input { height: 42px; padding-left: 40px; background: #fff; border-color: #dbe0ec; border-radius: 10px; }
.inp.has-act input { padding-right: 126px; }
.inp-act { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; padding: 6px; font: inherit; }
.inp-act:hover { background: #f1f5f9; color: var(--ink); }
.inp-act .material-symbols-outlined { position: static; transform: none; font-size: 19px; color: inherit; }
#togglePw { right: 82px; }
.inp-act.txt { right: 8px; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-50); padding: 5px 10px; }
.inp-act.txt:hover { background: var(--brand-100); color: var(--brand-d); }
.meter { height: 4px; background: #e8ebf3; border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; transition: all .25s; }

.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.opt { margin: 0; text-transform: none; letter-spacing: 0; cursor: pointer; display: block; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt-in { position: relative; height: 100%; padding: 16px; border: 1.5px solid #e2e6f0; border-radius: 12px; background: #fff; transition: all .16s; display: flex; flex-direction: column; gap: 3px; }
.opt-in b { font-size: 13.5px; color: var(--ink); text-transform: none; }
.opt-in small { font-size: 11.5px; color: var(--muted); line-height: 16px; font-weight: 400; }
.opt-ic { width: 36px; height: 36px; border-radius: 10px; background: #f1f5f9; color: #64748b; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; transition: all .16s; }
.opt-tick { position: absolute; right: 12px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; display: none; align-items: center; justify-content: center; }
.opt-tick .material-symbols-outlined { font-size: 14px; }
.opt:hover .opt-in { border-color: #c7d2fe; box-shadow: 0 4px 14px rgba(79,70,229,.08); }
.opt input:checked + .opt-in { border-color: var(--brand); background: linear-gradient(180deg, #f5f6ff, #fff); box-shadow: 0 0 0 3px rgba(79,70,229,.1), 0 8px 20px rgba(79,70,229,.12); }
.opt input:checked + .opt-in .opt-ic { background: linear-gradient(135deg, #4f46e5, #8b5cf6); color: #fff; }
.opt input:checked + .opt-in .opt-tick { display: flex; }
.opt input:focus-visible + .opt-in { box-shadow: 0 0 0 3px rgba(79,70,229,.25); }
.opt.locked { opacity: .6; cursor: not-allowed; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-opt { margin: 0; text-transform: none; letter-spacing: 0; cursor: pointer; }
.pill-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pill-opt > span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1.5px solid #e2e6f0; border-radius: 99px; background: #fff; font-weight: 600; font-size: 12.5px; color: #475569; transition: all .15s; }
.pill-opt > span .material-symbols-outlined { font-size: 17px; color: #94a3b8; }
.pill-opt:hover > span { border-color: #c7d2fe; }
.pill-opt input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-d); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.pill-opt input:checked + span .material-symbols-outlined { color: var(--brand); }
.pill-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(79,70,229,.25); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); cursor: pointer; text-transform: none; letter-spacing: 0; }
.switch-row b { font-size: 13px; color: var(--ink); }
.switch-row .switch { margin: 0; }
.switch-row .switch input:checked + i { background: #10b981; }

.uf-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 0 20px; }
.uf-actions .btn { padding: 10px 20px; font-size: 13px; }

.uf-side { position: sticky; top: 84px; }
.preview { padding: 0; text-align: center; overflow: hidden; margin: 0; }
.pv-cover { height: 84px; background: linear-gradient(135deg, #4338ca, #6d5dfc 55%, #8b5cf6); position: relative; }
.pv-cover::after { content: ''; position: absolute; right: -20px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.14); }
.pv-av { width: 76px; height: 76px; border-radius: 22px; margin: -38px auto 0; background: linear-gradient(135deg, #4f46e5, #8b5cf6); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 10px 24px rgba(79,70,229,.35); position: relative; }
.pv-name { font-size: 16px; font-weight: 700; margin-top: 12px; padding: 0 16px; word-break: break-word; }
.pv-mail { color: var(--muted); font-size: 12.5px; padding: 0 16px; word-break: break-all; }
.pv-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; padding: 0 16px; }
.pv-note { font-size: 11px; color: #a0a9bd; padding: 10px 16px 16px; border-top: 1px dashed var(--line); margin-top: 14px; }

@media (max-width: 960px) {
  .main { margin-left: 0; }
  .nav a.active::before { display: none; }
  .side-card { display: none; }
  .uf { grid-template-columns: 1fr; }
  .uf-side { position: static; order: -1; }
  .header .search { max-width: none; }
}
