/* EYVA Desk — styled to the EYVA 2025 brand guidelines
   Primary typeface: Poppins · Secondary typeface: Space Grotesk
   Colours: #FFFFFF, #333333, gradient #B75CFF → #671AE4, night gradient #000428 / #250048 / #13005F, #300156 */
:root {
  --white: #ffffff; --ink: #333333; --ink-2: #1f1630;
  --violet: #b75cff; --purple: #671ae4; --purple-dark: #5214c0; --plum: #300156;
  --night-1: #000428; --night-2: #250048; --night-3: #13005f;
  --grad: linear-gradient(135deg, #b75cff 0%, #671ae4 100%);
  --night: linear-gradient(180deg, #000428 0%, #250048 55%, #13005f 100%);
  --bg: #f6f4fb; --panel: #ffffff; --line: #e8e3f2; --line-2: #f0edf7; --muted: #6e6680; --hover: #f5f0ff;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(48, 1, 86, .16); --shadow-sm: 0 1px 2px rgba(48, 1, 86, .06), 0 2px 8px rgba(48, 1, 86, .04);
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-2: "Space Grotesk", "Poppins", -apple-system, "Segoe UI", sans-serif;
  /* status colours (kept semantic, tuned to sit with the palette) */
  --red: #fde7ec; --red-t: #b4234a; --yellow: #fff3d1; --yellow-t: #8a5a00; --green: #ddf6e8; --green-t: #13784a;
  --blue: #e5e9ff; --blue-t: #2f3fb8; --cyan: #dcf3fb; --cyan-t: #0b6680; --teal: #d8f4ef; --teal-t: #0c6a5e;
  --orange: #ffe8d6; --orange-t: #9a4a00; --violet-bg: #f1e6ff; --violet-t: #5a16c8; --gray: #efedf3; --gray-t: #4a4458;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--purple); }
h1, h2, h3 { font-weight: 600; color: var(--ink-2); letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, .num, .tnum { font-family: var(--font-2); font-variant-numeric: tabular-nums; }
::selection { background: #e6d2ff; }

/* ---------- brand mark ---------- */
.mark { width: 30px; height: 30px; flex: none; display: block; }
.wordmark { font-weight: 400; letter-spacing: .42em; margin-right: -.42em; color: #fff; font-size: 15px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 18px 18px; }
.brand .sub { font-family: var(--font-2); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #b9a8d9; margin-top: 2px; }
.brand-dark .wordmark { color: var(--ink-2); }
.brand-dark .sub { color: var(--muted); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--night); position: relative; overflow: hidden; padding: 16px; }
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.login::before { width: 520px; height: 520px; background: #671ae4; top: -160px; right: -120px; }
.login::after { width: 420px; height: 420px; background: #b75cff; bottom: -200px; left: -120px; opacity: .3; }
.login-card { position: relative; z-index: 1; background: #fff; padding: 36px 32px 30px; border-radius: 20px; width: min(400px, 100%); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); display: grid; gap: 14px; }
.login-card .brand { padding: 0 0 4px; }
.login-card h2 { margin: 4px 0 0; font-size: 22px; }
.login-card label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar { background: var(--night); color: #d6cce8; display: flex; flex-direction: column; overflow-y: auto; }
#nav { flex: 1; padding: 0 10px 12px; }
.nav-section { font-family: var(--font-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: #8c7bb0; padding: 18px 12px 6px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: #d6cce8; text-decoration: none; cursor: pointer; font-size: 13.5px; transition: background .12s, color .12s; }
.nav-link:hover { background: rgba(183, 92, 255, .12); color: #fff; }
.nav-link.active { background: rgba(183, 92, 255, .2); color: #fff; font-weight: 500; }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-link .count { margin-left: auto; font-family: var(--font-2); font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .1); color: #fff; padding: 1px 8px; border-radius: 10px; }
.nav-link.active .count { background: var(--grad); }
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.me { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 16px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.me .who { flex: 1; min-width: 0; }
.me .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who .role { color: #a796c9; font-size: 11.5px; text-transform: capitalize; }
.me button { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); color: #e7defa; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.me button:hover { background: rgba(255, 255, 255, .12); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 64px; }
.topbar h1 { font-size: 19px; margin: 0; white-space: nowrap; }
.topbar .crumb { font-family: var(--font-2); font-size: 12px; color: var(--muted); margin-left: 2px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.menu-btn { display: none; }
.view { flex: 1; overflow: auto; padding: 20px 24px 48px; }

/* ---------- controls ---------- */
.btn { text-decoration: none; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: 13px; color: var(--ink); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--hover); border-color: #d9ccf0; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(103, 26, 228, .28); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(103, 26, 228, .35); }
.btn.danger { color: #b4234a; }
.btn.danger:hover { background: #fff1f4; border-color: #f5c6d2; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn.wide { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.icon-btn { border: none; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--hover); color: var(--ink-2); }
.icon-btn svg { width: 18px; height: 18px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: #fff; width: 100%; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #d9ccf0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(183, 92, 255, .18); }
input:disabled, select:disabled, textarea:disabled { background: #faf9fc; color: var(--muted); }
input[type=checkbox] { accent-color: var(--purple); }
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.error { color: #b4234a; font-size: 13px; min-height: 1em; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; padding: 2px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 5px 12px; cursor: pointer; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--grad); color: #fff; font-weight: 500; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { position: relative; width: 260px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }

/* ---------- pills / chips ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--gray); color: var(--gray-t); line-height: 1.5; }
.c-red { background: var(--red); color: var(--red-t); } .c-yellow { background: var(--yellow); color: var(--yellow-t); }
.c-green { background: var(--green); color: var(--green-t); } .c-blue { background: var(--blue); color: var(--blue-t); }
.c-cyan { background: var(--cyan); color: var(--cyan-t); } .c-teal { background: var(--teal); color: var(--teal-t); }
.c-orange { background: var(--orange); color: var(--orange-t); } .c-purple { background: var(--violet-bg); color: var(--violet-t); }
.pill.tag { font-family: var(--font-2); background: #f3eefc; color: var(--plum); }
/* Status picker in the grid: looks like the status pill, opens a dropdown in place. */
.pill-pick { position: relative; display: inline-block; }
.pill-pick select.pill { appearance: none; -webkit-appearance: none; border: 0; font-family: inherit; cursor: pointer; padding-right: 24px; outline: none; }
.pill-pick::after { content: ''; position: absolute; right: 9px; top: 50%; width: 5px; height: 5px; margin-top: -4px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .55; pointer-events: none; color: var(--ink-2); }
.pill-pick select.pill:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.pill-pick select.pill:focus-visible { box-shadow: 0 0 0 2px var(--violet); }
.pill-pick select.pill:disabled { opacity: .6; cursor: progress; }
.pill-pick select option { background: #fff; color: #333; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 600; flex: none; letter-spacing: .02em; }

/* ---------- grid ---------- */
.grid-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 186px); box-shadow: var(--shadow-sm); }
table.grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.grid th, .grid td { border-bottom: 1px solid var(--line-2); padding: 9px 12px; text-align: left; vertical-align: top; max-width: 320px; }
.grid th { position: sticky; top: 0; background: #faf8fd; z-index: 2; font-weight: 500; font-size: 12px; color: #5d5470; cursor: pointer; user-select: none; white-space: nowrap; border-bottom: 1px solid var(--line); }
.grid th:hover { color: var(--purple); }
.grid th .ftype { color: #b3a8c8; margin-right: 6px; font-family: var(--font-2); font-size: 11px; }
.grid th.sorted { color: var(--purple); }
.grid td:first-child, .grid th:first-child { position: sticky; left: 0; z-index: 1; }
.grid th:first-child { z-index: 3; }
.grid td.primary, .grid th.primary { position: sticky; left: 46px; z-index: 1; box-shadow: 1px 0 0 var(--line-2); }
.grid th.primary { z-index: 3; }
.grid tbody tr { background: #fff; cursor: pointer; transition: background .08s; }
.grid tbody tr td { background: inherit; }
.grid tbody tr:hover { background: var(--hover); }
.grid td.num, .grid th.num { color: #a39bb5; width: 46px; min-width: 46px; text-align: right; font-size: 12px; }
.grid td.primary { font-weight: 500; color: var(--ink-2); min-width: 170px; }
.grid td.mono { font-size: 13px; }
.cell-long { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 240px; color: #4a4458; }
.thumbs { display: flex; gap: 4px; align-items: center; }
.thumbs img, .thumbs .file { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: #f4f1fa; display: grid; place-items: center; font-size: 9px; color: var(--muted); font-family: var(--font-2); text-transform: uppercase; }
.grid-foot { padding: 10px 4px; color: var(--muted); font-size: 12px; font-family: var(--font-2); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .mark { width: 44px; height: 44px; margin: 0 auto 12px; opacity: .9; }
.empty b { display: block; color: var(--ink-2); font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.overdue { color: #b4234a; font-weight: 500; }
.check-cell { color: var(--purple); font-weight: 700; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.kcol { background: #efebf7; border-radius: var(--radius); width: 296px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 190px); transition: outline-color .1s; outline: 2px dashed transparent; }
.kcol.drop { outline-color: var(--violet); background: #ebe2fb; }
.kcol h3 { margin: 0; font-size: 13px; padding: 12px 14px; display: flex; gap: 8px; align-items: center; }
.kcol h3 .tnum { color: var(--muted); font-weight: 500; }
.kcol .kcards { overflow-y: auto; padding: 0 10px 10px; display: grid; gap: 8px; min-height: 40px; }
.kcard { background: #fff; border-radius: 12px; padding: 12px; border: 1px solid var(--line); cursor: grab; display: grid; gap: 7px; box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: 0 6px 18px rgba(48, 1, 86, .1); transform: translateY(-1px); }
.kcard .t { font-weight: 500; color: var(--ink-2); }
.kcard .d { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- drawer ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(19, 0, 95, .28); backdrop-filter: blur(2px); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(740px, 100vw); background: var(--panel); z-index: 21; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.drawer-head .kicker { font-family: var(--font-2); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); }
.drawer-head h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-head .titles { flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 36px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 18px; }
.tabs button { border: none; background: none; padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--purple); border-bottom-color: var(--purple); font-weight: 500; }
.tabs .tnum { font-size: 11.5px; background: var(--gray); border-radius: 8px; padding: 0 6px; margin-left: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-section { grid-column: 1 / -1; font-family: var(--font-2); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); padding-top: 8px; border-top: 1px solid var(--line-2); margin-top: 4px; }
.form-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.field { display: grid; gap: 5px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 12px; font-weight: 500; color: #5d5470; display: flex; gap: 6px; align-items: center; }
.field > label .req { color: var(--purple); }
.field > label .auto { font-family: var(--font-2); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; background: #f3eefc; color: var(--plum); padding: 0 6px; border-radius: 6px; font-weight: 500; }
.field .help { font-size: 11.5px; color: var(--muted); }
.field .ro { padding: 8px 0; min-height: 36px; }
.check { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; }
.check:hover { background: var(--hover); }
.check input { width: 17px; height: 17px; flex: none; }
.check.plain { border: none; padding: 4px 0; }
.check.plain:hover { background: none; }
.multi { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 0; }
.multi label { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; }
.multi label:has(input:checked) { border-color: var(--violet); background: var(--violet-bg); color: var(--violet-t); }
.attach-zone { border: 1.5px dashed #d9ccf0; border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: #fcfbfe; }
.attach-zone.drag { border-color: var(--violet); background: var(--violet-bg); }
.attach-list { display: flex; flex-wrap: wrap; gap: 10px; }
.attach-list:empty { display: none; }
.attach { position: relative; width: 96px; display: grid; gap: 4px; font-size: 11px; }
.attach img, .attach .file { width: 96px; height: 74px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f4f1fa; display: grid; place-items: center; color: var(--plum); font-family: var(--font-2); font-weight: 500; }
.attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.attach .rm { position: absolute; top: 4px; right: 4px; background: rgba(19, 0, 95, .7); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; font-size: 14px; }
.saved-flash { color: var(--green-t); font-size: 12px; font-weight: 500; }
.meta-line { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-2); }

.feed { display: grid; gap: 12px; }
.feed-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.feed-item .body { background: #faf8fd; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; margin-top: 3px; }
.feed-item.comment .body { background: #fff; border-color: #dccff3; }
.feed-item .when { font-size: 11.5px; color: var(--muted); }
.feed-item .when b { color: var(--ink-2); font-weight: 500; }
.change-row { font-size: 12.5px; }
.change-row b { font-weight: 500; }
.linked { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.linked a { text-decoration: none; border: 1px solid #dccff3; background: #faf7ff; border-radius: 10px; padding: 7px 12px; display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 13px; }
.linked a:hover { border-color: var(--violet); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(19, 0, 95, .32); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal-card { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.modal-card h3 { margin: 0; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ---------- dashboard ---------- */
.hero { background: var(--night); color: #fff; border-radius: 18px; padding: 22px 24px; margin-bottom: 16px; display: flex; align-items: center; gap: 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -80px; top: -180px; border-radius: 50%; background: #671ae4; filter: blur(70px); opacity: .6; }
.hero > * { position: relative; z-index: 1; }
.hero h2 { color: #fff; margin: 0; font-size: 20px; font-weight: 500; }
.hero p { margin: 4px 0 0; color: #cdbfeb; font-size: 13px; }
.hero .mark { width: 46px; height: 46px; }
.hero .btn { margin-left: auto; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.hero .btn:hover { background: rgba(255,255,255,.18); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.card .k { color: var(--muted); font-size: 12.5px; }
.card .v { font-family: var(--font-2); font-size: 30px; font-weight: 600; margin-top: 4px; color: var(--ink-2); line-height: 1.1; }
.card .v.bad { color: #b4234a; }
.card .v.accent { color: var(--purple); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel h3 { margin: 0 0 14px; font-size: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 36px; gap: 10px; align-items: center; margin-bottom: 9px; font-size: 13px; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: #f0ecf7; border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 6px; }
.bar-row .n { text-align: right; font-family: var(--font-2); font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 500; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 8px; align-items: center; cursor: pointer; flex-wrap: wrap; }
.list-plain li:last-child { border-bottom: none; }
.list-plain li:hover b { color: var(--purple); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- automations ---------- */
.intro { color: var(--muted); max-width: 820px; margin: 0 0 16px; }
.auto-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.auto-card.off { opacity: .72; }
.auto-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto-head h3 { margin: 0; font-size: 15px; flex: 1; min-width: 200px; }
.flow { display: grid; grid-template-columns: 88px 1fr; gap: 6px 12px; margin: 12px 0 8px; font-size: 13px; }
.flow b { color: var(--purple); font-family: var(--font-2); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; padding-top: 2px; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d7d0e3; border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span:before { transform: translateX(18px); }
.switch input:disabled + span { cursor: default; }
details summary { cursor: pointer; color: var(--purple); font-size: 13px; font-weight: 500; }
pre.mail { white-space: pre-wrap; background: #faf8fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 13px/1.6 var(--font); margin: 8px 0 0; }
code { font-family: var(--font-2); background: #f3eefc; color: var(--plum); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--night-3); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 40; box-shadow: var(--shadow); font-size: 13px; }
.toast.err { background: #b4234a; }
.notice { background: #f7f0ff; border: 1px solid #e3d1fb; color: #4b1a8f; padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; }
.notice.warn { background: #fff8e8; border-color: #f6dfa6; color: #7a4d00; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 25; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .app.nav-open .sidebar { transform: none; }
  .icon-btn.menu-btn { display: inline-grid; }
  .form-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .view { padding: 14px; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .grid td.primary, .grid th.primary { position: static; box-shadow: none; }
  .hero .btn { display: none; }
}

input[type=file] { font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 7px 14px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--hover); border-color: #d9ccf0; }
.outbox-tools { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.outbox-tools select { width: auto; }

/* ---------- notifications ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--grad); color: #fff; font: 600 10px/17px var(--font-2); text-align: center; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 15; }
.bell-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; }
.bell-head b { flex: 1; font-weight: 600; }
.notif { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px; }
.notif:hover { background: var(--hover); }
.notif.unread { background: #faf5ff; }
.notif.unread .t::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--purple); margin-right: 6px; vertical-align: 1px; }
.notif .b { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.notif .w { color: #a39bb5; font-size: 11.5px; margin-top: 3px; }

/* ---------- comments / mentions ---------- */
.composer { position: relative; display: grid; gap: 8px; margin-bottom: 16px; }
.composer-row { display: flex; gap: 8px; align-items: center; }
.mention-menu { position: absolute; left: 0; top: 100%; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 240px; max-height: 220px; overflow-y: auto; padding: 4px; margin-top: -40px; }
.mention-menu button { display: flex; gap: 8px; align-items: center; width: 100%; border: none; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.mention-menu button.on, .mention-menu button:hover { background: var(--violet-bg); }
.mention-menu .tm { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.mention { color: var(--violet-t); background: var(--violet-bg); border-radius: 6px; padding: 0 4px; font-weight: 500; }
.follow-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.follow-bar .stack { display: flex; }
.follow-bar .stack .avatar { margin-left: -6px; border: 2px solid #fff; }
.follow-bar .stack .avatar:first-child { margin-left: 0; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .12s, transform .12s; }
.gcard:hover { box-shadow: 0 8px 22px rgba(48, 1, 86, .12); transform: translateY(-2px); }
.gcover { height: 150px; background: var(--night); display: grid; place-items: center; overflow: hidden; }
.gcover img { width: 100%; height: 100%; object-fit: cover; }
.gcover .mark { width: 42px; height: 42px; opacity: .9; }
.gbody { padding: 12px 14px; display: grid; gap: 6px; }
.gbody .t { font-weight: 500; color: var(--ink-2); }
.gbody .d { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gbody .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.nav-arrows { display: inline-flex; gap: 2px; }
