/* HOLD 2F PRO — executive operational interface, no external dependencies */
:root {
  --font: Inter, ui-sans-serif, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sidebar-width: 268px;
  --sidebar-compact: 84px;
  --topbar-height: 72px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --ease: 180ms cubic-bezier(.2, .8, .2, 1);
  --accent: #5d83ff;
  --accent-bright: #84a0ff;
  --accent-soft: rgba(93, 131, 255, .14);
  --cyan: #38d4e5;
  --cyan-soft: rgba(56, 212, 229, .13);
  --success: #28d39d;
  --success-soft: rgba(40, 211, 157, .13);
  --warning: #f4b74a;
  --warning-soft: rgba(244, 183, 74, .14);
  --danger: #ff7378;
  --danger-soft: rgba(255, 115, 120, .14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .14);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .38);
  --shadow-md: 0 16px 45px rgba(0, 0, 0, .24);
}

:root[data-theme="dark"] {
  --bg: #07101f;
  --bg-deep: #050b16;
  --sidebar: #091425;
  --panel: #0d192c;
  --panel-raised: #11213a;
  --panel-muted: #0a1628;
  --line: #1b2d48;
  --line-strong: #29425f;
  --text: #f0f5ff;
  --text-soft: #c7d3e7;
  --muted: #8ca1be;
  --faint: #617590;
  --glass: rgba(7, 16, 31, .88);
  --hover: rgba(255, 255, 255, .045);
  --input: #091426;
  --white: #fff;
}

:root[data-theme="light"] {
  --bg: #eef3fa;
  --bg-deep: #e4ebf5;
  --sidebar: #f9fbff;
  --panel: #fff;
  --panel-raised: #f7faff;
  --panel-muted: #f1f5fb;
  --line: #dbe5f2;
  --line-strong: #c3d2e5;
  --text: #102039;
  --text-soft: #364b67;
  --muted: #647b99;
  --faint: #8da0b8;
  --glass: rgba(249, 251, 255, .9);
  --hover: rgba(16, 32, 57, .045);
  --input: #f5f8fd;
  --white: #fff;
  --shadow-lg: 0 28px 80px rgba(31, 54, 84, .18);
  --shadow-md: 0 14px 38px rgba(31, 54, 84, .1);
}

* { box-sizing: border-box; }
html { height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.has-overlay { overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
table { border-collapse: collapse; }
canvas { display: block; max-width: 100%; }
::selection { color: var(--text); background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: var(--line-strong); background-clip: padding-box; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.is-hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 2000; padding: 9px 13px; border-radius: 9px; color: #fff; background: var(--accent); transform: translateY(-160%); transition: transform var(--ease); }
.skip-link:focus { transform: none; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.danger-text { color: var(--danger) !important; }
.success-text { color: var(--success) !important; }
.warning-text { color: var(--warning) !important; }
.accent-text { color: var(--accent-bright) !important; }
.right { margin-left: auto; }

/* Login */
.login-shell { position: relative; min-height: 100vh; overflow: hidden; background: var(--bg-deep); }
.login-shell::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(93, 131, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(93, 131, 255, .035) 1px, transparent 1px); background-size: 54px 54px; mask-image: radial-gradient(circle at 34% 50%, #000 15%, transparent 72%); }
.login-ambient, .login-ambient span { position: absolute; pointer-events: none; }
.login-ambient { inset: 0; overflow: hidden; }
.orb { width: 460px; height: 460px; border-radius: 50%; filter: blur(10px); opacity: .32; }
.orb-one { left: -180px; top: -180px; background: radial-gradient(circle, rgba(38, 96, 224, .65), transparent 68%); }
.orb-two { right: -180px; bottom: -220px; background: radial-gradient(circle, rgba(132, 77, 233, .48), transparent 68%); }
.market-line { width: 580px; height: 160px; left: 5%; top: 58%; border-top: 1px solid rgba(56, 212, 229, .18); border-radius: 50%; transform: rotate(-8deg); }
.line-two { left: 14%; top: 63%; border-color: rgba(93, 131, 255, .12); transform: rotate(7deg); }
.login-layout { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr); align-items: center; gap: 8vw; width: min(1180px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; padding: 64px 0; }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .17); border-radius: 13px; color: #fff; background: linear-gradient(145deg, #4c8cf9 0%, #657bff 49%, #9976f3 100%); box-shadow: 0 10px 30px rgba(93, 131, 255, .34), inset 0 1px rgba(255, 255, 255, .24); font-size: 15px; font-weight: 850; letter-spacing: -.5px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { color: var(--text); font-size: 15px; letter-spacing: .02em; }
.brand-lockup small { margin-top: 1px; color: var(--faint); font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.brand-lockup-large { gap: 14px; margin-bottom: 70px; }
.brand-lockup-large .brand-mark { width: 50px; height: 50px; border-radius: 15px; font-size: 18px; }
.brand-lockup-large strong { font-size: 17px; }
.brand-lockup-large small { font-size: 9.5px; }
.eyebrow { margin-bottom: 16px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .19em; }
.login-story h1 { max-width: 680px; color: #f3f7ff; font-size: clamp(40px, 5vw, 68px); font-weight: 760; line-height: 1.01; letter-spacing: -.055em; }
.login-story h1 span { color: transparent; background: linear-gradient(92deg, #7b9bff, #51d1e4 62%, #6ce3be); -webkit-background-clip: text; background-clip: text; }
.login-copy { max-width: 610px; margin-top: 25px; color: #93a6c1; font-size: 17px; line-height: 1.65; }
.login-proof { display: flex; flex-wrap: wrap; gap: 18px 30px; margin-top: 42px; color: #b7c5d8; font-size: 12px; font-weight: 600; }
.login-proof span { display: inline-flex; align-items: center; gap: 9px; }
.login-proof i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.login-card-wrap { width: min(100%, 450px); justify-self: end; }
.login-card { padding: 34px; border: 1px solid rgba(118, 148, 202, .21); border-radius: 24px; background: linear-gradient(150deg, rgba(18, 32, 57, .95), rgba(9, 20, 38, .96)); box-shadow: var(--shadow-lg), inset 0 1px rgba(255, 255, 255, .04); backdrop-filter: blur(24px); }
.login-card-head { margin-bottom: 27px; }
.secure-chip { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 5px 9px; border: 1px solid rgba(40, 211, 157, .22); border-radius: 30px; color: #82e9c7; background: rgba(40, 211, 157, .06); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.secure-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 9px var(--success); }
.login-card h2 { color: #f2f6ff; font-size: 23px; letter-spacing: -.025em; }
.login-card-head p { margin-top: 7px; color: #8094b1; font-size: 12.5px; }
.form-field { display: grid; gap: 7px; margin-top: 16px; }
.form-field > label, .field-label { color: var(--text-soft); font-size: 11px; font-weight: 700; letter-spacing: .015em; }
.input-shell { position: relative; display: flex; align-items: center; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(4, 12, 25, .55); transition: border-color var(--ease), box-shadow var(--ease), background var(--ease); }
.input-shell:focus-within { border-color: var(--accent); background: rgba(8, 18, 34, .92); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-glyph { display: grid; place-items: center; width: 42px; color: #6f86a7; font-family: var(--mono); font-size: 10px; font-weight: 800; }
.input-shell input { width: 100%; height: 44px; padding: 0 10px 0 0; border: 0; outline: 0; color: #eff5ff; background: transparent; }
.input-shell input::placeholder { color: #576b88; }
.field-action { align-self: stretch; padding: 0 13px; color: #6f86a7; background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.field-action:hover { color: var(--cyan); }
.form-message { min-height: 20px; margin: 11px 0 3px; color: var(--danger); font-size: 11.5px; }
.initial-access-note { display: flex; gap: 10px; margin-top: 20px; padding: 12px; border: 1px solid rgba(244, 183, 74, .17); border-radius: 12px; color: #8295af; background: rgba(244, 183, 74, .045); font-size: 10.5px; line-height: 1.45; }
.initial-access-note strong { display: block; margin-bottom: 1px; color: #c9d5e5; }
.note-icon { display: grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; color: var(--warning); background: var(--warning-soft); font-size: 11px; font-weight: 900; }
.login-footer { margin-top: 17px; color: #556a87; text-align: center; font-size: 9.5px; font-weight: 650; letter-spacing: .09em; }

/* App shell */
.app-shell { display: flex; height: 100vh; min-height: 580px; overflow: hidden; }
.sidebar { position: relative; z-index: 80; display: flex; flex: 0 0 var(--sidebar-width); flex-direction: column; width: var(--sidebar-width); min-width: 0; border-right: 1px solid var(--line); background: var(--sidebar); transition: flex-basis var(--ease), width var(--ease), transform var(--ease); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-height); padding: 0 17px 0 20px; border-bottom: 1px solid var(--line); }
.sidebar-collapse { width: 30px !important; height: 30px !important; font-size: 21px !important; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 20px 12px; }
.nav-section-label { margin: 19px 13px 7px; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .16em; white-space: nowrap; }
.nav-section-label:first-child { margin-top: 1px; }
.nav-link { position: relative; display: flex; align-items: center; min-height: 43px; margin: 2px 0; padding: 6px 11px; border-radius: 11px; color: var(--muted); transition: color var(--ease), background var(--ease); }
.nav-link:hover { color: var(--text); background: var(--hover); }
.nav-link.is-active { color: var(--text); background: linear-gradient(90deg, rgba(93, 131, 255, .18), rgba(56, 212, 229, .06)); }
.nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); box-shadow: 0 0 12px rgba(93, 131, 255, .7); }
.nav-icon { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; margin-right: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--faint); background: var(--panel-muted); font-family: var(--mono); font-size: 8px; font-weight: 800; letter-spacing: -.04em; }
.nav-link.is-active .nav-icon { border-color: rgba(93, 131, 255, .28); color: var(--accent-bright); background: var(--accent-soft); }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 620; }
.nav-counter { display: grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 10px; color: #fff; background: var(--danger); font-size: 9px; font-weight: 800; }
.sidebar-foot { padding: 14px 17px; border-top: 1px solid var(--line); }
.system-status { display: flex; align-items: center; gap: 10px; padding: 9px 7px; }
.system-status strong, .system-status small { display: block; }
.system-status strong { color: var(--text-soft); font-size: 10.5px; }
.system-status small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.status-online { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft), 0 0 12px rgba(40, 211, 157, .5); }
.sidebar-version { margin: 6px 7px 0; color: var(--faint); font-size: 9px; letter-spacing: .08em; }
.sidebar-version span { color: var(--accent-bright); }
.app-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.topbar { position: relative; z-index: 55; display: flex; align-items: center; flex: 0 0 var(--topbar-height); gap: 14px; height: var(--topbar-height); padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); }
.workspace { flex: 1; min-width: 0; overflow: auto; padding: 25px 28px 60px; background: var(--bg); }
.sidebar.is-compact { flex-basis: var(--sidebar-compact); width: var(--sidebar-compact); }
.sidebar.is-compact .brand-name, .sidebar.is-compact .nav-label, .sidebar.is-compact .nav-section-label, .sidebar.is-compact .nav-counter { display: none; }
.sidebar.is-compact .sidebar-head { justify-content: center; padding: 0; }
.sidebar.is-compact .sidebar-collapse { position: absolute; right: -15px; border-color: var(--line-strong); background: var(--panel); transform: rotate(180deg); }
.sidebar.is-compact .nav-link { justify-content: center; padding-inline: 0; }
.sidebar.is-compact .nav-icon { margin-right: 0; }
.sidebar.is-compact .system-status { justify-content: center; }
.sidebar.is-compact .brand-mark { width: 40px; height: 40px; }
.sidebar-scrim { display: none; }

/* Top bar */
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--panel); cursor: pointer; transition: color var(--ease), border-color var(--ease), background var(--ease), transform var(--ease); }
.icon-button:hover { border-color: var(--line-strong); color: var(--text); background: var(--panel-raised); }
.icon-button:active { transform: scale(.96); }
.mobile-menu { display: none; font-size: 20px; }
.global-search { display: flex; align-items: center; gap: 10px; width: min(440px, 42vw); height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--faint); background: var(--panel-muted); cursor: pointer; text-align: left; transition: border-color var(--ease), background var(--ease); }
.global-search:hover { border-color: var(--line-strong); background: var(--panel); }
.search-glyph { position: relative; display: inline-block; flex: 0 0 auto; width: 14px; height: 14px; border: 1.7px solid currentColor; border-radius: 50%; }
.search-glyph::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 6px; height: 1.7px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.search-placeholder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
kbd { padding: 3px 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--faint); background: var(--panel); box-shadow: inset 0 -1px var(--line); font-family: var(--mono); font-size: 8.5px; }
.global-search kbd { margin-left: auto; }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.quick-create { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border: 1px solid rgba(93, 131, 255, .3); border-radius: 11px; color: var(--accent-bright); background: var(--accent-soft); cursor: pointer; font-size: 11px; font-weight: 750; }
.quick-create:hover { border-color: var(--accent); }
.theme-icon { position: relative; display: block; width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 50%; }
:root[data-theme="dark"] .theme-icon { border-width: 0; background: currentColor; box-shadow: -5px -2px 0 0 var(--panel); }
.connection-chip { display: flex; align-items: center; gap: 7px; height: 32px; margin: 0 3px; padding: 0 10px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); font-size: 9.5px; font-weight: 650; }
.connection-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px rgba(40, 211, 157, .6); }
.user-menu-button { display: flex; align-items: center; gap: 9px; min-width: 150px; height: 45px; padding: 3px 5px 3px 10px; border-radius: 13px; color: var(--text); background: transparent; cursor: pointer; text-align: right; }
.user-menu-button:hover, .user-menu-button[aria-expanded="true"] { background: var(--hover); }
.user-copy { min-width: 0; margin-left: auto; }
.user-copy strong, .user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { max-width: 130px; font-size: 11.5px; }
.user-copy small { margin-top: 2px; color: var(--accent-bright); font-size: 8.5px; font-weight: 800; letter-spacing: .09em; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 11px; color: #fff; background: linear-gradient(145deg, #4d84ec, #806cde); box-shadow: 0 7px 18px rgba(93, 131, 255, .2); font-size: 10px; font-weight: 800; }
.avatar.avatar-0 { background: linear-gradient(145deg, #4d84ec, #806cde); }
.avatar.avatar-1 { background: linear-gradient(145deg, #28a3bc, #3f79da); }
.avatar.avatar-2 { background: linear-gradient(145deg, #2aa878, #4e87c8); }
.avatar.avatar-3 { background: linear-gradient(145deg, #d27b52, #ad5f9b); }
.avatar.avatar-4 { background: linear-gradient(145deg, #8a68d9, #447fce); }
.avatar.avatar-sm { width: 29px; height: 29px; border-radius: 9px; font-size: 8.5px; }
.avatar.avatar-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 14px; }
.chevron { color: var(--faint); font-size: 11px; }
.user-menu { position: absolute; top: 54px; right: 0; z-index: 150; width: 230px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel-raised); box-shadow: var(--shadow-md); }
.user-menu-summary { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); }
.user-menu-summary strong, .user-menu-summary span { display: block; }
.user-menu-summary strong { font-size: 12px; }
.user-menu-summary span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-menu button { width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--text-soft); background: transparent; cursor: pointer; text-align: left; font-size: 11px; }
.user-menu button:hover { background: var(--hover); }

/* Shared page surfaces */
.page { width: min(100%, 1660px); margin: 0 auto; animation: page-in 240ms ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.page-heading { min-width: 0; }
.page-eyebrow { margin-bottom: 5px; color: var(--accent-bright); font-size: 9px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.page-head h1 { font-size: clamp(22px, 2vw, 29px); font-weight: 740; line-height: 1.16; letter-spacing: -.035em; }
.page-description { max-width: 720px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 37px; padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text-soft); background: var(--panel-raised); cursor: pointer; font-size: 10.5px; font-weight: 720; white-space: nowrap; transition: filter var(--ease), border-color var(--ease), color var(--ease), transform var(--ease), background var(--ease); }
.button:hover { border-color: var(--accent); color: var(--text); }
.button:active { transform: translateY(1px); }
.button:disabled, .button.is-disabled { opacity: .48; cursor: not-allowed; filter: grayscale(.2); }
.button:disabled:hover { border-color: var(--line-strong); }
.button-primary { border-color: var(--accent); color: #fff; background: linear-gradient(135deg, #527df4, #6d7df5); box-shadow: 0 8px 20px rgba(93, 131, 255, .22); }
.button-primary:hover { filter: brightness(1.08); }
.button-success { border-color: rgba(40, 211, 157, .45); color: #8cebd0; background: var(--success-soft); }
.button-danger { border-color: rgba(255, 115, 120, .45); color: #ffabb0; background: var(--danger-soft); }
.button-ghost { background: transparent; }
.button-sm { min-height: 31px; padding: 5px 10px; font-size: 9.5px; }
.button-lg { min-height: 48px; border-radius: 12px; font-size: 11.5px; }
.button-block { width: 100%; }
.button-spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.button.is-loading .button-spinner { display: block; }
.button.is-loading .button-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-arrow { margin-left: auto; font-size: 16px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 0 1px rgba(255, 255, 255, .015); }
.panel-pad { padding: 18px; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; min-height: 56px; padding: 16px 18px 13px; border-bottom: 1px solid var(--line); }
.panel-title { min-width: 0; }
.panel-title h2, .panel-title h3 { font-size: 12.5px; font-weight: 760; letter-spacing: -.01em; }
.panel-title p { margin-top: 3px; color: var(--muted); font-size: 9.5px; }
.panel-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.panel-body { padding: 17px 18px; }
.panel-body.no-pad { padding: 0; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 25px 0 12px; }
.section-title:first-child { margin-top: 0; }
.section-title h2, .section-title h3 { font-size: 13px; font-weight: 760; }
.section-title p { color: var(--muted); font-size: 10px; }
.section-title::before { content: ""; width: 3px; height: 15px; border-radius: 3px; background: linear-gradient(var(--accent), var(--cyan)); }
.grid { display: grid; gap: 14px; }
.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-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); }
.grid-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack { display: grid; gap: 14px; }

/* KPI and dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi-card { position: relative; min-height: 125px; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.kpi-card::after { content: ""; position: absolute; right: -42px; bottom: -58px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 68%); pointer-events: none; }
.kpi-card.kpi-risk::after { background: radial-gradient(circle, var(--danger-soft), transparent 68%); }
.kpi-card.kpi-recovery::after { background: radial-gradient(circle, var(--success-soft), transparent 68%); }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-label { overflow: hidden; color: var(--muted); font-size: 8.5px; font-weight: 800; letter-spacing: .1em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.kpi-symbol { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-bright); background: var(--accent-soft); font-family: var(--mono); font-size: 7px; font-weight: 850; }
.kpi-value { margin-top: 13px; overflow: hidden; color: var(--text); font-size: clamp(21px, 2vw, 28px); font-weight: 780; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--faint); font-size: 9px; }
.delta { font-weight: 780; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.neutral { color: var(--warning); }
.chart-wrap { position: relative; min-height: 275px; }
.chart-wrap canvas { width: 100%; height: 245px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.legend-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.legend-item:nth-child(2) i { background: var(--success); }
.legend-item:nth-child(3) i { background: var(--danger); }
.alert-list, .priority-list, .insight-list { display: grid; gap: 8px; }
.alert-item, .priority-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-muted); cursor: pointer; transition: border-color var(--ease), transform var(--ease); }
.alert-item:hover, .priority-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.alert-marker { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.alert-item.is-critical .alert-marker { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.alert-item.is-success .alert-marker { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.alert-content, .priority-content { min-width: 0; flex: 1; }
.alert-content strong, .priority-content strong { display: block; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.alert-content span, .priority-content span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.alert-value { margin-left: auto; color: var(--text-soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
.priority-rank { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-bright); background: var(--accent-soft); font-family: var(--mono); font-size: 9px; font-weight: 800; }
.insight-item { position: relative; padding: 14px 14px 14px 17px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(120deg, var(--panel-muted), var(--panel)); }
.insight-item::before { content: ""; position: absolute; left: -1px; top: 13px; bottom: 13px; width: 3px; border-radius: 3px; background: var(--cyan); }
.insight-item strong { display: block; font-size: 10.5px; }
.insight-item p { margin-top: 5px; color: var(--muted); font-size: 9.5px; line-height: 1.55; }
.insight-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--faint); font-size: 8.5px; }
.scope-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 13px; border: 1px solid rgba(93, 131, 255, .18); border-radius: 12px; color: var(--muted); background: linear-gradient(90deg, var(--accent-soft), transparent); font-size: 10px; }
.scope-banner strong { color: var(--text-soft); }
.scope-pill { margin-left: auto; padding: 4px 8px; border: 1px solid rgba(93, 131, 255, .22); border-radius: 20px; color: var(--accent-bright); font-size: 8px; font-weight: 800; letter-spacing: .08em; }

/* Filters, inputs and segmented controls */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 13px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-group.push { margin-left: auto; }
.filter-search { position: relative; flex: 1 1 250px; max-width: 410px; }
.filter-search .search-glyph { position: absolute; left: 12px; top: 12px; z-index: 1; color: var(--faint); width: 12px; height: 12px; }
.control, input.control, select.control, textarea.control { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--text); background: var(--input); font-size: 10.5px; transition: border-color var(--ease), box-shadow var(--ease); }
.filter-search .control { padding-left: 34px; }
.control:hover { border-color: var(--faint); }
.control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.control::placeholder { color: var(--faint); }
select.control { width: auto; min-width: 130px; padding-right: 30px; cursor: pointer; }
textarea.control { min-height: 92px; resize: vertical; line-height: 1.5; }
.control[type="date"], .control[type="datetime-local"] { color-scheme: dark; }
:root[data-theme="light"] .control[type="date"], :root[data-theme="light"] .control[type="datetime-local"] { color-scheme: light; }
.segmented { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-muted); }
.segment { min-height: 29px; padding: 5px 9px; border-radius: 7px; color: var(--faint); background: transparent; cursor: pointer; font-size: 8.5px; font-weight: 780; letter-spacing: .04em; }
.segment:hover { color: var(--text-soft); }
.segment.is-active { color: var(--text); background: var(--panel-raised); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .form-field { margin-top: 0; }
.form-field.span-2 { grid-column: 1 / -1; }
.field-help { color: var(--faint); font-size: 9px; }
.required::after { content: " *"; color: var(--danger); }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.toggle { position: relative; width: 36px; height: 20px; appearance: none; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-muted); cursor: pointer; transition: background var(--ease); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); transition: transform var(--ease), background var(--ease); }
.toggle:checked { border-color: var(--success); background: var(--success-soft); }
.toggle:checked::after { background: var(--success); transform: translateX(16px); }

/* Tables */
.table-shell { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 830px; }
.data-table th { height: 41px; padding: 0 13px; border-bottom: 1px solid var(--line); color: var(--faint); background: var(--panel-muted); font-size: 8px; font-weight: 820; letter-spacing: .095em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 58px; padding: 8px 13px; border-bottom: 1px solid var(--line); color: var(--text-soft); font-size: 10.5px; vertical-align: middle; }
.data-table tbody tr { transition: background var(--ease); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table tbody tr.is-clickable:hover { background: var(--hover); }
.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-copy { min-width: 0; }
.cell-copy strong, .cell-copy span { display: block; overflow: hidden; max-width: 230px; text-overflow: ellipsis; white-space: nowrap; }
.cell-copy strong { color: var(--text); font-size: 10.5px; }
.cell-copy span { margin-top: 2px; color: var(--faint); font-size: 8.5px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-action { display: inline-grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.row-action:hover { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-soft); }
.table-foot { display: flex; align-items: center; min-height: 52px; padding: 9px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; }
.pagination { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.page-button { display: grid; place-items: center; min-width: 29px; height: 29px; padding: 0 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel-muted); cursor: pointer; font-size: 9px; }
.page-button:hover:not(:disabled), .page-button.is-current { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-soft); }
.page-button:disabled { opacity: .4; cursor: not-allowed; }

/* Statuses, metadata */
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: var(--panel-muted); font-size: 8.5px; font-weight: 750; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-success, .status-won, .status-gained, .status-closed, .status-completed, .status-approved, .status-active, .status-ativo { border-color: rgba(40, 211, 157, .21); color: var(--success); background: var(--success-soft); }
.badge-danger, .status-lost, .status-overdue, .status-critical, .status-inactive, .status-inativo, .status-blocked { border-color: rgba(255, 115, 120, .22); color: var(--danger); background: var(--danger-soft); }
.badge-warning, .status-new, .status-novo, .status-triage, .status-pending, .status-pendente, .status-review { border-color: rgba(244, 183, 74, .22); color: var(--warning); background: var(--warning-soft); }
.badge-accent, .status-evidence, .status-ready, .status-submitted, .status-open, .status-em_analise { border-color: rgba(93, 131, 255, .22); color: var(--accent-bright); background: var(--accent-soft); }
.badge-violet, .status-pre_arbitration, .status-accepted, .status-vip { border-color: rgba(167, 139, 250, .22); color: var(--violet); background: var(--violet-soft); }
.priority-critical, .priority-urgent { color: var(--danger); }
.priority-high, .priority-alta { color: #ff9e6f; }
.priority-medium, .priority-media { color: var(--warning); }
.priority-low, .priority-baixa { color: var(--muted); }
.risk-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--muted); }
.risk-high { background: var(--danger); }
.risk-medium { background: var(--warning); }
.risk-low { background: var(--success); }
.score { display: inline-flex; align-items: center; gap: 7px; }
.score progress, .progress-row progress { overflow: hidden; height: 5px; border: 0; border-radius: 6px; background: var(--line); }
.score progress { width: 48px; }
progress::-webkit-progress-bar { border-radius: 6px; background: var(--line); }
progress::-webkit-progress-value { border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
progress::-moz-progress-bar { border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.score strong { font-family: var(--mono); font-size: 9px; }
.money { color: var(--text); font-weight: 720; font-variant-numeric: tabular-nums; white-space: nowrap; }
.identifier { color: var(--muted); font-family: var(--mono); font-size: 9px; }
.deadline { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deadline.is-danger { color: var(--danger); }
.deadline.is-warning { color: var(--warning); }

/* Client cards / pipeline */
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 12px; }
.client-card { display: grid; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); cursor: pointer; transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease); }
.client-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.client-card-head { display: flex; align-items: center; gap: 10px; }
.client-card-name { min-width: 0; }
.client-card-name strong, .client-card-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-name strong { font-size: 11.5px; }
.client-card-name span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.client-card-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stat { min-width: 0; padding: 9px; border-radius: 10px; background: var(--panel-muted); }
.mini-stat span, .mini-stat strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stat span { color: var(--faint); font-size: 7.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mini-stat strong { margin-top: 4px; font-size: 10px; }
.client-card-foot { display: flex; align-items: center; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8.5px; }
.kanban { display: grid; grid-auto-columns: minmax(270px, 1fr); grid-auto-flow: column; gap: 11px; overflow-x: auto; padding-bottom: 9px; scroll-snap-type: x proximity; }
.kanban-column { min-height: 430px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel-muted); scroll-snap-align: start; }
.kanban-head { display: flex; align-items: center; min-height: 38px; padding: 2px 4px 10px; }
.kanban-head strong { font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.kanban-count { display: grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; border-radius: 10px; color: var(--muted); background: var(--panel); font-size: 8.5px; font-weight: 800; }
.kanban-stack { display: grid; gap: 8px; }
.kanban-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; transition: border-color var(--ease), transform var(--ease); }
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.kanban-card-top { display: flex; align-items: center; gap: 7px; }
.kanban-card h3 { overflow: hidden; margin-top: 9px; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card p { margin-top: 4px; color: var(--muted); font-size: 8.5px; }
.kanban-card-meta { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8px; }

/* Chargeback */
.case-id { color: var(--accent-bright); font-family: var(--mono); font-size: 9px; font-weight: 750; }
.case-risk-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.case-hero { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--panel-raised), var(--panel)); }
.case-hero-main { display: flex; align-items: flex-start; gap: 14px; }
.case-hero-copy { min-width: 0; flex: 1; }
.case-hero-copy h3 { margin-top: 7px; font-size: 18px; letter-spacing: -.025em; }
.case-hero-copy p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.case-amount { color: var(--text); font-size: 20px; font-weight: 780; letter-spacing: -.03em; text-align: right; font-variant-numeric: tabular-nums; }
.case-amount small { display: block; margin-top: 3px; color: var(--faint); font-size: 8px; font-weight: 650; letter-spacing: .05em; }
.case-action-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.checklist { display: grid; gap: 7px; }
.check-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-muted); }
.check-item input { margin-top: 2px; accent-color: var(--success); }
.check-copy { min-width: 0; flex: 1; }
.check-copy strong { display: block; font-size: 9.5px; }
.check-copy span { display: block; margin-top: 3px; color: var(--faint); font-size: 8.5px; }
.evidence-list { display: grid; gap: 8px; }
.evidence-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-muted); }
.file-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 38px; border: 1px solid rgba(93, 131, 255, .25); border-radius: 9px; color: var(--accent-bright); background: var(--accent-soft); font-family: var(--mono); font-size: 8px; font-weight: 850; }
.evidence-copy { min-width: 0; flex: 1; }
.evidence-copy strong, .evidence-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-copy strong { font-size: 9.5px; }
.evidence-copy span { margin-top: 3px; color: var(--faint); font-family: var(--mono); font-size: 7.5px; }
.upload-zone { position: relative; display: grid; place-items: center; min-height: 120px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--muted); background: var(--panel-muted); text-align: center; cursor: pointer; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-soft); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone strong { display: block; color: var(--text-soft); font-size: 10px; }
.upload-zone span { display: block; margin-top: 4px; font-size: 8.5px; }
.progress-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; color: var(--muted); font-size: 8.5px; }
.progress-row progress { flex: 1; }
.narrative { padding: 13px; border-left: 3px solid var(--accent); border-radius: 0 11px 11px 0; color: var(--text-soft); background: var(--panel-muted); font-size: 10px; line-height: 1.65; white-space: pre-wrap; }

/* Detail drawer */
.drawer-overlay, .overlay, .command-overlay { position: fixed; inset: 0; z-index: 500; }
.overlay, .command-overlay { display: grid; place-items: center; padding: 22px; background: rgba(2, 7, 15, .72); backdrop-filter: blur(8px); animation: overlay-in var(--ease) both; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.modal { display: flex; flex-direction: column; width: min(620px, 100%); max-height: min(86vh, 860px); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--panel); box-shadow: var(--shadow-lg); animation: modal-in var(--ease) both; }
.modal.modal-wide { width: min(850px, 100%); }
.modal.modal-narrow { width: min(460px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.overlay-head { display: flex; align-items: flex-start; gap: 14px; min-height: 71px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.overlay-head > div { min-width: 0; }
.overlay-kicker { margin-bottom: 3px; color: var(--accent-bright); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.overlay-head h2 { overflow: hidden; font-size: 16px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.overlay-close { margin-left: auto; font-size: 19px; }
.overlay-body { flex: 1; overflow: auto; padding: 18px 19px; }
.overlay-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 64px; padding: 12px 19px; border-top: 1px solid var(--line); background: var(--panel-muted); }
.drawer-overlay { display: flex; justify-content: flex-end; background: rgba(2, 7, 15, .56); backdrop-filter: blur(4px); }
.drawer-scrim { position: absolute; inset: 0; width: 100%; background: transparent; cursor: default; }
.drawer { position: relative; display: flex; flex-direction: column; width: min(760px, 94vw); height: 100%; border-left: 1px solid var(--line-strong); background: var(--bg); box-shadow: -24px 0 70px rgba(0,0,0,.28); animation: drawer-in 220ms cubic-bezier(.2,.8,.2,1) both; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { flex: 0 0 auto; background: var(--glass); backdrop-filter: blur(14px); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 20px 50px; }
.drawer-tabs { position: sticky; top: -18px; z-index: 8; display: flex; gap: 4px; overflow-x: auto; margin: 0 -20px 16px; padding: 9px 20px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); }
.drawer-tab { flex: 0 0 auto; padding: 7px 10px; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 8.5px; font-weight: 750; }
.drawer-tab:hover { color: var(--text); background: var(--hover); }
.drawer-tab.is-active { color: var(--accent-bright); background: var(--accent-soft); }
.entity-hero { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--panel-raised), var(--panel)); }
.entity-hero-copy { min-width: 0; flex: 1; }
.entity-hero-copy h3 { overflow: hidden; font-size: 17px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.entity-hero-copy p { margin-top: 4px; color: var(--muted); font-size: 9.5px; }
.entity-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.detail-field { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-muted); }
.detail-field span, .detail-field strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.detail-field span { color: var(--faint); font-size: 7.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.detail-field strong { margin-top: 4px; color: var(--text-soft); font-size: 9.5px; overflow-wrap: anywhere; }
.detail-field.detail-span-2 { grid-column: span 2; }
.detail-field.detail-span-3 { grid-column: span 3; }
.timeline { position: relative; display: grid; gap: 0; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 9px; bottom: 9px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; padding: 0 0 16px 10px; }
.timeline-item::before { content: ""; position: absolute; left: -17px; top: 5px; width: 7px; height: 7px; border: 2px solid var(--panel); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item strong { display: block; font-size: 9.5px; }
.timeline-item p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.timeline-item time { display: block; margin-top: 4px; color: var(--faint); font-size: 8px; }

/* Tasks, analytics and team */
.task-list { display: grid; gap: 8px; }
.task-card { display: flex; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.task-check { display: grid; place-items: center; flex: 0 0 auto; width: 21px; height: 21px; margin-top: 1px; border: 1px solid var(--line-strong); border-radius: 7px; color: transparent; background: var(--panel-muted); cursor: pointer; }
.task-check:hover { border-color: var(--success); }
.task-card.is-completed .task-check { border-color: var(--success); color: #fff; background: var(--success); }
.task-card.is-completed .task-copy h3 { color: var(--faint); text-decoration: line-through; }
.task-copy { min-width: 0; flex: 1; }
.task-copy h3 { overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.task-copy p { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; color: var(--faint); font-size: 8px; }
.analytics-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.dimension-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.dimension-button { min-height: 29px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel-muted); cursor: pointer; font-size: 8px; font-weight: 750; }
.dimension-button:hover, .dimension-button.is-active { border-color: var(--accent); color: var(--accent-bright); background: var(--accent-soft); }
.matrix { display: grid; grid-template-columns: repeat(5, minmax(70px, 1fr)); gap: 5px; }
.matrix-cell { display: grid; place-items: center; min-height: 57px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-muted); text-align: center; }
.matrix-cell.is-high { border-color: rgba(255,115,120,.25); background: var(--danger-soft); }
.matrix-cell.is-medium { border-color: rgba(244,183,74,.22); background: var(--warning-soft); }
.matrix-cell.is-low { border-color: rgba(40,211,157,.2); background: var(--success-soft); }
.matrix-cell strong { font-size: 10px; }
.matrix-cell span { margin-top: 3px; color: var(--muted); font-size: 7.5px; }
.team-cards { display: grid; grid-template-columns: repeat(3, minmax(230px, 1fr)); gap: 11px; }
.agent-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.agent-head { display: flex; align-items: center; gap: 10px; }
.agent-name { min-width: 0; }
.agent-name strong, .agent-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-name strong { font-size: 10.5px; }
.agent-name span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.agent-rank { margin-left: auto; color: var(--accent-bright); font-family: var(--mono); font-size: 11px; font-weight: 850; }
.agent-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.goal-row { margin-top: 12px; }
.goal-copy { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); font-size: 8px; }
.goal-row progress { width: 100%; height: 6px; }

/* Admin */
.admin-tabs { display: flex; gap: 5px; margin-bottom: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.admin-tab { flex: 1; min-height: 34px; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.admin-tab.is-active { color: var(--text); background: var(--panel-raised); box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 14px; }
.setting-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy { min-width: 0; flex: 1; }
.setting-copy strong { display: block; font-size: 10.5px; }
.setting-copy p { margin-top: 3px; color: var(--muted); font-size: 8.5px; }
.connector-list { display: grid; gap: 7px; }
.connector { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-muted); }
.connector-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--accent-bright); background: var(--accent-soft); font-family: var(--mono); font-size: 8px; font-weight: 850; }
.connector-copy { min-width: 0; flex: 1; }
.connector-copy strong, .connector-copy span { display: block; }
.connector-copy strong { font-size: 9.5px; }
.connector-copy span { margin-top: 2px; color: var(--faint); font-size: 8px; }
.danger-zone { border-color: rgba(255, 115, 120, .26); background: linear-gradient(140deg, var(--panel), rgba(255, 115, 120, .035)); }
.danger-zone .panel-head { border-color: rgba(255, 115, 120, .18); }

/* Empty, error, loading */
.empty-state, .error-state, .restricted-state { display: grid; place-items: center; min-height: 260px; padding: 30px; text-align: center; }
.empty-symbol, .error-symbol { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--accent-bright); background: var(--accent-soft); font-family: var(--mono); font-size: 11px; font-weight: 850; }
.error-symbol { color: var(--danger); background: var(--danger-soft); }
.empty-state h2, .empty-state h3, .error-state h2, .error-state h3 { font-size: 13px; }
.empty-state p, .error-state p, .restricted-state p { max-width: 420px; margin-top: 5px; color: var(--muted); font-size: 9.5px; line-height: 1.55; }
.empty-state .button, .error-state .button { margin-top: 14px; }
.view-loading, .page-skeleton { display: grid; gap: 13px; }
.view-loading { width: min(100%, 1660px); margin: 0 auto; color: var(--muted); font-size: 10px; }
.skeleton { position: relative; overflow: hidden; border-radius: 12px; background: var(--panel); }
.skeleton::after, .skeleton-grid i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.055) 46%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.35s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-title { width: 280px; height: 46px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skeleton-grid i { position: relative; overflow: hidden; height: 120px; border-radius: 16px; background: var(--panel); }
.skeleton-panel { height: 330px; }

/* Toasts and command palette */
.toast-region { position: fixed; z-index: 900; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(370px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--text-soft); background: var(--panel-raised); box-shadow: var(--shadow-md); animation: toast-in 240ms ease both; pointer-events: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.is-leaving { animation: toast-out 200ms ease both; }
@keyframes toast-out { to { opacity: 0; transform: translateX(15px); } }
.toast-mark { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.toast-success .toast-mark { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.toast-danger .toast-mark { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.toast-warning .toast-mark { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.toast-copy { min-width: 0; flex: 1; }
.toast-copy strong { display: block; font-size: 10.5px; }
.toast-copy p { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.toast-close { color: var(--faint); background: transparent; cursor: pointer; }
.command-overlay { align-items: start; padding-top: min(12vh, 110px); }
.command-palette { width: min(680px, 100%); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow-lg); animation: modal-in var(--ease) both; }
.command-input-wrap { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); color: var(--muted); }
.command-input-wrap input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; }
.command-input-wrap input::placeholder { color: var(--faint); }
.command-results { max-height: 430px; overflow-y: auto; padding: 8px; }
.command-group-label { padding: 9px 10px 5px; color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.command-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 49px; padding: 8px 10px; border-radius: 10px; color: var(--text-soft); background: transparent; cursor: pointer; text-align: left; }
.command-item:hover, .command-item.is-active { background: var(--accent-soft); }
.command-icon { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-bright); background: var(--panel-muted); font-family: var(--mono); font-size: 8px; font-weight: 800; }
.command-copy { min-width: 0; flex: 1; }
.command-copy strong, .command-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-copy strong { font-size: 10px; }
.command-copy span { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.command-type { color: var(--faint); font-size: 8px; }
.command-foot { display: flex; gap: 15px; min-height: 44px; padding: 10px 15px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8px; }
.command-foot span:last-child { margin-left: auto; }

/* Responsive */
@media (max-width: 1440px) {
  .workspace { padding-inline: 22px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-grid, .team-cards { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 240px; }
  .connection-chip { display: none; }
  .global-search { width: min(340px, 37vw); }
  .grid-main, .analytics-hero, .admin-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-risk-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(var(--sidebar-width), 82vw); transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  .sidebar.is-mobile-open { transform: none; }
  .sidebar.is-compact { flex-basis: var(--sidebar-width); width: min(var(--sidebar-width), 82vw); }
  .sidebar.is-compact .brand-name, .sidebar.is-compact .nav-label, .sidebar.is-compact .nav-section-label, .sidebar.is-compact .nav-counter { display: block; }
  .sidebar.is-compact .sidebar-head { justify-content: space-between; padding: 0 17px 0 20px; }
  .sidebar.is-compact .sidebar-collapse { position: static; transform: none; }
  .sidebar.is-compact .nav-link { justify-content: flex-start; padding: 6px 11px; }
  .sidebar.is-compact .nav-icon { margin-right: 9px; }
  .sidebar.is-compact .system-status { justify-content: flex-start; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 70; display: block; background: rgba(2, 7, 15, .6); opacity: 0; pointer-events: none; transition: opacity var(--ease); }
  .sidebar-scrim.is-visible { opacity: 1; pointer-events: auto; }
  .mobile-menu { display: inline-grid; }
  .quick-create span:last-child, .global-search kbd { display: none; }
  .global-search { flex: 1; width: auto; max-width: 420px; }
  .topbar { padding-inline: 15px; }
  .user-menu-button { min-width: 0; padding-left: 4px; }
  .user-copy, .chevron { display: none; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}

@media (max-width: 768px) {
  :root { --topbar-height: 64px; }
  .workspace { padding: 18px 14px 46px; }
  .page-head { align-items: stretch; flex-direction: column; margin-bottom: 16px; }
  .page-actions { justify-content: flex-start; margin-left: 0; }
  .page-actions .button { flex: 1; }
  .kpi-grid, .grid-3, .grid-4, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-split { grid-template-columns: 1fr; }
  .client-grid, .team-cards { grid-template-columns: 1fr; }
  .filter-search { min-width: 100%; max-width: none; }
  .toolbar { align-items: stretch; }
  .toolbar-group, .toolbar-group.push { width: 100%; margin-left: 0; }
  .toolbar-group .control, .toolbar-group select.control { flex: 1; min-width: 0; }
  .toolbar-group .segmented { margin-left: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.span-2 { grid-column: auto; }
  .drawer { width: 100vw; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-field.detail-span-3 { grid-column: span 2; }
  .login-layout { grid-template-columns: 1fr; gap: 46px; width: min(600px, calc(100% - 34px)); padding: 46px 0; }
  .login-card-wrap { justify-self: stretch; width: 100%; }
  .brand-lockup-large { margin-bottom: 42px; }
  .login-story h1 { font-size: clamp(37px, 10vw, 55px); }
  .login-copy { font-size: 15px; }
  .login-proof { margin-top: 28px; }
  .login-card { padding: 27px; }
  .matrix { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
}

@media (max-width: 560px) {
  .global-search { width: 40px; flex: 0 0 40px; justify-content: center; padding: 0; }
  .search-placeholder { display: none; }
  .quick-create { width: 38px; justify-content: center; padding: 0; }
  .topbar-actions { gap: 5px; }
  .topbar { gap: 7px; padding-inline: 10px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-card { min-height: 112px; padding: 13px; }
  .kpi-value { font-size: 21px; }
  .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .case-hero-main { flex-wrap: wrap; }
  .case-amount { width: 100%; text-align: left; }
  .case-risk-strip { grid-template-columns: 1fr 1fr; }
  .entity-hero { flex-wrap: wrap; }
  .entity-actions { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field.detail-span-2, .detail-field.detail-span-3 { grid-column: auto; }
  .overlay { padding: 0; align-items: end; }
  .modal, .modal.modal-wide, .modal.modal-narrow { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .command-overlay { padding: 12px; padding-top: 8vh; }
  .command-foot span:last-child { display: none; }
  .login-layout { width: min(100% - 24px, 520px); }
  .login-card { padding: 23px 19px; border-radius: 20px; }
  .login-proof { gap: 12px 18px; }
  .login-story h1 { font-size: 38px; }
  .brand-lockup-large { margin-bottom: 34px; }
  .client-card-body { grid-template-columns: repeat(2, 1fr); }
  .matrix { grid-template-columns: repeat(2, minmax(70px, 1fr)); }
}

@media (max-width: 390px) {
  .workspace { padding-inline: 10px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-label { font-size: 7.5px; }
  .page-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .page-actions .button { min-width: 0; }
  .panel-head, .panel-body { padding-inline: 13px; }
  .toolbar { padding: 8px; }
  .toolbar-group { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-group .segmented { grid-column: 1 / -1; width: 100%; }
  .segmented .segment { flex: 1; }
  .login-story h1 { font-size: 34px; }
  .login-copy { font-size: 13px; }
  .login-proof { display: grid; }
  .login-card h2 { font-size: 20px; }
  .drawer-body { padding-inline: 13px; }
  .drawer-tabs { margin-inline: -13px; padding-inline: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .toolbar, .page-actions, .toast-region { display: none !important; }
  .app-shell { display: block; height: auto; overflow: visible; }
  .workspace { overflow: visible; padding: 0; }
  .panel, .kpi-card { break-inside: avoid; border-color: #cbd5e1; box-shadow: none; }
}
