:root {
  --bg: #100e15;
  --sidebar: #15121b;
  --surface: #1b1722;
  --surface-2: #221d2b;
  --surface-3: #2a2334;
  --line: #342b40;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f8f3f7;
  --muted: #a9a0ae;
  --accent: #ff667d;
  --accent-strong: #ff4967;
  --accent-soft: rgba(255, 102, 125, 0.13);
  --gold: #ffd76a;
  --purple: #a78bfa;
  --green: #52d39a;
  --danger: #ff6b6b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 0.92fr) 1.08fr; }
.login-panel { padding: 52px clamp(34px, 7vw, 116px); display: flex; flex-direction: column; justify-content: center; background: var(--sidebar); position: relative; z-index: 2; }
.brand-lockup, .sidebar-brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: -0.02em; }
.login-panel .brand-lockup { position: absolute; top: 42px; left: clamp(34px, 7vw, 116px); font-size: 1.1rem; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, var(--accent), #bb4d82); color: white; box-shadow: 0 10px 26px rgba(255, 73, 103, 0.25); }
.login-copy { max-width: 520px; margin-bottom: 34px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem; font-weight: 800; margin: 0 0 8px; }
.login-copy h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); line-height: 0.98; letter-spacing: -0.055em; margin: 0 0 22px; }
.login-copy p { color: var(--muted); max-width: 460px; font-size: 1.06rem; }
.stack { display: grid; gap: 18px; max-width: 480px; }
label { display: grid; gap: 8px; color: #d9d2dc; font-size: 0.88rem; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; min-height: 48px; padding: 11px 13px; outline: none; transition: border-color .18s, box-shadow .18s; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 102, 125, 0.13); }
.button { min-height: 42px; border: 0; border-radius: 12px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 750; cursor: pointer; transition: transform .18s, background .18s, opacity .18s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: white; box-shadow: 0 10px 24px rgba(255, 73, 103, 0.19); }
.button-secondary { background: var(--surface-3); border: 1px solid var(--line); }
.button-danger { background: rgba(255, 107, 107, .13); color: #ff9696; border: 1px solid rgba(255, 107, 107, .22); }
.button-wide { width: 100%; margin-top: 4px; justify-content: space-between; padding-inline: 18px; }
.login-footnote { color: #796f7e; font-size: .78rem; max-width: 480px; }
.login-footnote code { color: #b9aebd; }
.inline-message { margin-top: 14px; max-width: 480px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 107, 107, .1); color: #ffb1b1; font-size: .88rem; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(circle at 62% 28%, rgba(255, 102, 125, .16), transparent 34%), radial-gradient(circle at 20% 84%, rgba(167, 139, 250, .15), transparent 38%), linear-gradient(135deg, #17101e, #241728 52%, #15111d); }
.login-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 54px 54px; mask-image: linear-gradient(to bottom, black, transparent 90%); }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.orbit-one { width: 560px; height: 560px; top: 6%; left: 14%; }
.orbit-two { width: 360px; height: 360px; top: 22%; left: 28%; border-color: rgba(255, 102, 125, .18); }
.constellation { position: absolute; inset: 0; display: grid; place-items: center; font-family: Georgia, serif; }
.heart-outline { font-size: 13rem; line-height: 1; color: rgba(255, 102, 125, .55); transform: rotate(-7deg); text-shadow: 0 0 50px rgba(255, 102, 125, .24); }
.star { position: absolute; color: var(--gold); }
.star-one { top: 24%; left: 24%; font-size: 2rem; }
.star-two { right: 18%; top: 36%; font-size: 1rem; }
.quote-card { position: absolute; z-index: 2; bottom: 10%; left: 10%; right: 10%; max-width: 460px; padding: 24px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(24, 18, 31, .72); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.quote-card strong { display: block; font-family: Georgia, serif; font-size: 1.55rem; line-height: 1.25; font-weight: 500; }
.quote-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; font-weight: 800; }
.quote-meta { margin-top: 18px; color: var(--muted); font-size: .8rem; display: flex; gap: 8px; align-items: center; }
.quote-meta span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(82,211,154,.12); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line-soft); position: sticky; top: 0; height: 100vh; padding: 25px 17px 18px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { padding: 0 9px 25px; }
.sidebar-brand div { display: grid; }
.sidebar-brand small { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.main-nav { display: grid; gap: 4px; overflow-y: auto; }
.nav-item { width: 100%; min-height: 44px; display: flex; gap: 12px; align-items: center; padding: 0 13px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: .88rem; font-weight: 650; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.is-active { color: white; background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.nav-item svg, .icon-button svg { width: 19px; height: 19px; stroke-width: 1.8; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line-soft); padding-top: 18px; display: flex; align-items: center; gap: 8px; }
.admin-chip { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.admin-chip > span { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--accent); font-weight: 800; font-size: .77rem; }
.admin-chip div { min-width: 0; display: grid; }
.admin-chip strong, .admin-chip small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-chip strong { font-size: .82rem; }
.admin-chip small { color: var(--muted); font-size: .68rem; }
.icon-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-button:hover { color: white; border-color: #51435f; }
.app-main { min-width: 0; }
.topbar { min-height: 94px; padding: 22px clamp(22px, 4vw, 54px); display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line-soft); background: rgba(16, 14, 21, .83); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 15; }
.topbar h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.035em; }
.topbar .eyebrow { margin-bottom: 1px; font-size: .61rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.status-pill { min-height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.mobile-menu { display: none; }
.content { padding: 34px clamp(22px, 4vw, 54px) 60px; max-width: 1600px; margin: 0 auto; outline: none; }
.demo-banner { margin: 20px clamp(22px, 4vw, 54px) 0; padding: 11px 14px; border-radius: 11px; background: rgba(255, 215, 106, .1); border: 1px solid rgba(255, 215, 106, .18); color: #f4d984; font-size: .83rem; }

.welcome-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.welcome-row h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; letter-spacing: -.025em; }
.welcome-row p { margin: 5px 0 0; color: var(--muted); }
.date-stamp { color: var(--muted); font-size: .83rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface), #19151f); min-height: 144px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card-top { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.stat-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon svg { width: 18px; }
.stat-value { font-size: 2rem; line-height: 1; font-weight: 800; letter-spacing: -.05em; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-header { min-height: 68px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: .98rem; }
.panel-header p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.panel-body { padding: 20px; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); }
.activity-row:last-child { border-bottom: 0; }
.activity-avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--purple); font-size: .72rem; font-weight: 800; }
.activity-row strong { display: block; font-size: .84rem; }
.activity-row p { margin: 2px 0 0; color: var(--muted); font-size: .76rem; }
.activity-row time { color: #766e7d; font-size: .7rem; }
.quick-actions { display: grid; gap: 10px; }
.quick-action { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--surface-2); padding: 13px; cursor: pointer; }
.quick-action:hover { border-color: rgba(255, 102, 125, .3); }
.quick-action > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.quick-action svg { width: 17px; }
.quick-action strong { display: block; font-size: .8rem; }
.quick-action small { color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.search-box { max-width: 390px; flex: 1; position: relative; }
.search-box input { padding-left: 42px; }
.search-box svg { position: absolute; left: 14px; top: 15px; width: 18px; color: var(--muted); }
.toolbar-note { color: var(--muted); margin-left: auto; font-size: .78rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: 13px 18px; text-align: left; background: rgba(255,255,255,.018); color: #83798a; text-transform: uppercase; letter-spacing: .08em; font-size: .64rem; }
td { padding: 15px 18px; border-top: 1px solid var(--line-soft); font-size: .82rem; color: #ded7e1; }
td strong { display: block; color: var(--text); }
.cell-sub { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: .68rem; font-weight: 750; background: var(--surface-3); color: var(--muted); }
.badge.success { background: rgba(82,211,154,.11); color: #78e1b3; }
.badge.warning { background: rgba(255,215,106,.1); color: #f4d984; }
.badge.danger { background: rgba(255,107,107,.1); color: #ff9b9b; }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.row-action { border: 1px solid var(--line); background: transparent; color: var(--muted); min-height: 32px; border-radius: 9px; padding: 0 10px; cursor: pointer; font-size: .72rem; font-weight: 700; }
.row-action:hover { color: white; border-color: #574763; }
.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.idea-card { min-height: 225px; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--line-soft); background: linear-gradient(145deg, var(--surface), #18141e); border-radius: var(--radius); }
.idea-card-top { display: flex; justify-content: space-between; align-items: center; }
.idea-card h3 { margin: 22px 0 8px; font-family: Georgia, serif; font-size: 1.3rem; font-weight: 500; }
.idea-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.idea-card-meta { margin-top: auto; padding-top: 20px; display: flex; justify-content: space-between; color: #817888; font-size: .72rem; }
.idea-card-actions { display: flex; gap: 7px; }
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.category-card { padding: 18px; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--surface); }
.category-swatch { width: 40px; height: 40px; border-radius: 13px; margin-bottom: 26px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.category-card h3 { margin: 0 0 3px; font-size: .96rem; }
.category-card p { margin: 0 0 18px; color: var(--muted); font-size: .74rem; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid .full { grid-column: 1 / -1; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row strong { display: block; font-size: .86rem; }
.toggle-row small { color: var(--muted); }
.switch { width: 46px; height: 26px; border: 0; border-radius: 999px; padding: 3px; background: #42394c; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform .2s; }
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(20px); }
.dropzone { min-height: 210px; border: 1px dashed #50425c; border-radius: var(--radius); display: grid; place-items: center; text-align: center; background: linear-gradient(145deg, rgba(255,102,125,.035), rgba(167,139,250,.035)); cursor: pointer; padding: 30px; }
.dropzone:hover { border-color: var(--accent); }
.dropzone input { display: none; }
.dropzone svg { width: 34px; color: var(--accent); margin-bottom: 12px; }
.dropzone strong { display: block; }
.dropzone span { color: var(--muted); font-size: .78rem; }
.image-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.image-card { border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; background: var(--surface); }
.image-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.image-card div { padding: 11px; }
.image-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.image-card button { margin-top: 8px; }
.empty-state { padding: 70px 24px; text-align: center; color: var(--muted); }
.empty-state span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px; background: var(--surface-3); color: var(--accent); }
.empty-state h3 { color: var(--text); margin: 0 0 6px; }
.empty-state p { margin: 0; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 14px; height: 140px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(5,4,7,.78); backdrop-filter: blur(7px); }
.dialog { width: min(590px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 20px; background: #1a1620; box-shadow: var(--shadow); }
.dialog-header { padding: 21px 22px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.dialog-header h2 { margin: 0; font-size: 1.12rem; }
.dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.dialog-body { padding: 22px; }
.dialog-actions { padding: 17px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 10px; }
.toast { width: min(360px, calc(100vw - 40px)); padding: 13px 15px; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: #24202b; box-shadow: var(--shadow); font-size: .82rem; animation: toast-in .2s ease-out; }
.toast.success { border-color: rgba(82,211,154,.25); }
.toast.error { border-color: rgba(255,107,107,.28); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .image-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding-top: 110px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .22s; width: 264px; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topbar { min-height: 80px; padding-inline: 16px; }
  .topbar-actions .status-pill { display: none; }
  .content { padding: 24px 16px 50px; }
  .demo-banner { margin-inline: 16px; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .stats-grid, .cards-grid, .category-grid, .image-grid, .form-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-note { margin-left: 0; }
  .topbar h1 { font-size: 1.25rem; }
  .button { padding-inline: 13px; }
  .activity-row { grid-template-columns: 36px minmax(0, 1fr); }
  .activity-row time { grid-column: 2; }
}

/* User directory/detail components; existing dashboard sections retain their styles. */
.user-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; padding:20px; align-items:end; }
.user-filters label { display:grid; gap:6px; }
.user-note { color:var(--muted); font-size:.85rem; line-height:1.6; }
.user-identity { display:flex; align-items:center; gap:12px; }
.user-avatar { position:relative; display:inline-grid; place-items:center; flex-shrink:0; width:44px; height:44px; border-radius:50%; background:var(--panel); border:1px solid var(--border); overflow:hidden; }
.user-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.user-pagination,.user-tabs { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:18px 0; }
.user-tabs [aria-pressed=true] { outline:2px solid var(--accent); }
.user-profile-header,.user-detail-panel { padding:24px; margin-top:20px; overflow-wrap:anywhere; }
.user-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; }
.user-fields dt { font-size:.8rem; color:var(--muted); margin-bottom:4px; }
.user-fields dd { margin:0; overflow-wrap:anywhere; }

/* Integrated operational workspace */
.workspace-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:18px}.workspace-filters label,.stack label{display:grid;gap:6px}.workspace-record{padding:16px 0;border-bottom:1px solid var(--border)}.feedback-message{white-space:pre-wrap;overflow-wrap:anywhere;font-size:1.05rem}.panel-body dd{margin:0 0 14px;overflow-wrap:anywhere}.panel-body dt{font-weight:600}.metric-bars{display:grid;gap:16px;margin:24px 0}.metric-bars>div{display:grid;grid-template-columns:minmax(140px,1fr) 2fr 70px;gap:12px;align-items:center}.metric-bars meter{width:100%}.panel-body textarea{min-height:90px}.panel-body p{overflow-wrap:anywhere} @media(max-width:600px){.metric-bars>div{grid-template-columns:1fr}.workspace-filters{grid-template-columns:1fr}}
