:root {
  --black: #090b13;
  --surface: #111520;
  --surface-2: #151a27;
  --surface-3: #1b2130;
  --line: #2a3142;
  --line-soft: #202638;
  --text: #f6f7fb;
  --muted: #9aa3b7;
  --dim: #687188;
  --lime: #168bff;
  --blue: #168bff;
  --violet: #8b5cf6;
  --lavender: #b9a7ff;
  --red: #ff5c5c;
  --green: #92a500;
  --sidebar: 224px;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --pill: 999px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--black); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% 15%, rgba(70,58,180,.15), transparent 34%), var(--black); color: var(--text); font-family: Inter, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(145deg, var(--blue), var(--violet)); color: white; font-size: 11px; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 0 28px rgba(72,98,255,.3); }
.brand-lockup { display: flex; align-items: center; gap: 11px; color: var(--text); font-size: 14px; font-weight: 800; letter-spacing: .13em; }
.brand-word { letter-spacing: -.01em; font-size: 15px; text-transform: none; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, .8fr); }
.auth-copy { position: relative; overflow: hidden; padding: 68px clamp(40px, 7vw, 120px); display: flex; flex-direction: column; justify-content: center; border-right: 1px solid rgba(91,109,181,.25); background: radial-gradient(circle at 22% 60%, rgba(22,139,255,.2), transparent 38%), radial-gradient(circle at 76% 22%, rgba(139,92,246,.18), transparent 32%), linear-gradient(145deg, #080b16, #0d1020 58%, #090b13); }
.auth-copy::after { content: ""; position: absolute; right: -170px; bottom: -220px; width: 560px; height: 560px; border: 1px solid rgba(96,165,250,.2); border-radius: 50%; box-shadow: inset 0 0 80px rgba(79,70,229,.12), 0 0 100px rgba(37,99,235,.12); background: repeating-radial-gradient(circle, rgba(96,165,250,.18) 0 1px, transparent 1px 14px); opacity: .72; pointer-events: none; }
.auth-copy .brand-lockup { position: absolute; top: 36px; }
.auth-copy h1 { position: relative; z-index: 1; max-width: 650px; margin: 8px 0 20px; font-size: clamp(42px, 5vw, 76px); line-height: .98; letter-spacing: -.065em; font-weight: 600; }
.auth-copy > p:last-child { max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.auth-panel { display: grid; place-content: center; padding: 40px; background: radial-gradient(circle at 50% 42%, rgba(76,65,170,.13), transparent 42%), #090b13; }
.config-error { max-width: 430px; padding: 24px; border: 1px solid rgba(255,92,92,.35); border-radius: 14px; background: rgba(71,23,35,.32); color: #ffd8df; line-height: 1.6; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: flex; flex-direction: column; padding: 20px 14px; border-right: 1px solid var(--line); background: #070707; }
.sidebar-brand { height: 42px; padding: 0 8px; }
.workspace-pill { display: flex; align-items: center; gap: 8px; margin: 20px 6px 24px; padding: 9px 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(53,167,255,.65); }
.nav-label { margin: 0 10px 8px; color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.side-nav { display: grid; gap: 3px; }
.nav-item { position: relative; width: 100%; min-height: 40px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; cursor: pointer; transition: .15s ease; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { border-color: #2b2b2b; background: #111; color: var(--text); }
.nav-item.active::before { content: ""; position: absolute; left: -15px; top: 8px; width: 2px; height: 22px; background: var(--lime); }
.nav-icon { color: var(--dim); font-size: 15px; }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-count { min-width: 20px; padding: 2px 5px; border-radius: 20px; background: #1d1d1d; color: var(--muted); font-size: 9px; text-align: center; }
.side-filter { margin: 28px 6px 0; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.side-filter label { display: block; margin-bottom: 8px; color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.side-filter select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 11px; outline: none; }
.sidebar-footer { margin-top: auto; display: grid; gap: 7px; padding: 16px 8px 2px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.system-line { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 15; height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(5,5,5,.94); backdrop-filter: blur(14px); }
.topbar .eyebrow { margin-bottom: 3px; }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 550; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.search-box { width: min(370px, 34vw); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #0b0b0b; color: var(--dim); }
.search-box:focus-within { border-color: #444; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.search-box input::placeholder { color: #656560; }
kbd { padding: 3px 5px; border: 1px solid #2a2a2a; border-radius: 3px; color: var(--dim); background: #101010; font: 9px inherit; }
.user-button { min-width: 34px; min-height: 34px; }
.search-wrap { position: relative; }
.search-results { position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; right: 0; max-height: 380px; overflow-y: auto; padding: 6px; border: 1px solid rgba(96,115,175,.32); border-radius: 16px; background: rgba(17,21,33,.97); box-shadow: 0 26px 70px rgba(0,0,0,.5); backdrop-filter: blur(14px); }
.search-result { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.search-result:hover, .search-result.active { background: rgba(22,139,255,.12); border-color: rgba(76,135,255,.32); }
.search-result-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #20283b; color: #74b6ff; font-size: 12px; }
.search-result-text { min-width: 0; }
.search-result-text strong { display: block; color: #e9ecf4; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-text small { display: block; margin-top: 2px; color: #7f8aa2; font-size: 9px; }
.search-result-type { color: #66718c; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.search-empty { padding: 16px; color: #6f7a92; font-size: 10px; text-align: center; }

.view { display: none; padding: 26px 28px 56px; }
.view.active { display: block; }
.overview-titlebar { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 4px 4px 20px; }
.overview-titlebar h2 { margin: 0; font-size: clamp(28px, 3vw, 42px); font-weight: 520; letter-spacing: -.045em; }
.overview-hero { display: grid; grid-template-columns: minmax(430px, .88fr) minmax(560px, 1.12fr); align-items: stretch; gap: 20px; background: radial-gradient(circle at 76% 50%, rgba(22,139,255,.07), transparent 44%); }
.hero-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero-left .data-panel { margin-top: 0; }
.hero-left .table-scroll { max-height: 268px; overflow-y: auto; }
.hero-meta { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.globe-wrap { position: relative; min-height: 460px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: radial-gradient(circle at 62% 50%, rgba(22,139,255,.06), transparent 55%), #080808; }
#globe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.globe-label { position: absolute; z-index: 3; padding: 5px 7px; border: 1px solid #303510; background: rgba(5,5,5,.8); color: var(--lime); font-size: 8px; letter-spacing: .1em; }
.globe-label-one { left: 31%; top: 31%; }
.globe-label-two { right: 13%; bottom: 24%; }

.kpi-grid { z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.kpi-card { min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(13,13,13,.92); backdrop-filter: blur(16px); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: auto; }
.icon-badge { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid #333; border-radius: 5px; background: #141414; color: var(--lime); font-size: 13px; }
.live-tag { color: var(--dim); font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.kpi-card > p { margin: 0 0 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.kpi-card strong { display: block; min-height: 38px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1; letter-spacing: -.05em; font-weight: 550; }
.kpi-card strong.is-error { color: var(--red); font-size: 18px; }
.kpi-card small { display: block; margin-top: 9px; color: var(--dim); font-size: 9px; }

.data-panel, .subsection, .soft-panel { margin-top: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); }
.section-heading { min-height: 69px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { margin: 0; font-size: 14px; font-weight: 550; }
.result-count { padding: 5px 8px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { height: 38px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 8px; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
td { height: 57px; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #0c0c0c; }
.cell-primary { display: block; margin-bottom: 3px; color: var(--text); font-size: 11px; font-weight: 600; }
.cell-secondary { color: var(--dim); font-size: 9px; }
.stage-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #303030; border-radius: 20px; color: #bdbdb7; background: #111; font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.stage-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.loading-cell { height: 110px; text-align: center; color: var(--dim); }

.section-intro { max-width: 760px; padding: 18px 0 6px; }
.section-intro h2 { margin: 0 0 10px; font-size: clamp(28px, 3.5vw, 44px); letter-spacing: -.045em; font-weight: 500; }
.section-intro > p:last-child { color: var(--muted); font-size: 12px; }
.stack-list { display: grid; gap: 10px; margin-top: 20px; }
.action-card, .order-card, .loading-card, .empty-state { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.action-card { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(420px, 1.2fr); gap: 20px; align-items: center; }
.single-action { max-width: 920px; margin-top: 24px; }
.action-identity { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.action-identity h3 { margin: 1px 0 5px; font-size: 13px; font-weight: 600; }
.action-identity p { margin: 0; color: var(--dim); font-size: 10px; line-height: 1.5; }
.action-fields { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 9px; align-items: end; }
.single-action .action-fields { grid-template-columns: 1fr auto; }
.single-action .completed-fields { grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto; }
.single-field { grid-template-columns: minmax(180px, 1fr) auto; }
label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
input, select { width: 100%; height: 38px; margin-top: 7px; padding: 0 10px; border: 1px solid #2b2b2b; border-radius: 4px; outline: 0; background: #0c0c0c; color: var(--text); font-size: 11px; text-transform: none; letter-spacing: 0; }
input:focus, select:focus { border-color: var(--lime); box-shadow: 0 0 0 1px rgba(22,139,255,.13); }
input::placeholder { color: #555; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: 4px; font-size: 10px; font-weight: 750; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
.primary-button { border: 1px solid var(--lime); background: var(--lime); color: #080808; }
.primary-button:hover { background: #edff4f; }
.primary-button:disabled { opacity: .45; cursor: wait; }
.secondary-button { border: 1px solid var(--line); background: #111; color: var(--muted); }
.form-status { grid-column: 1 / -1; min-height: 0; margin: -6px 0 0; color: var(--muted); font-size: 10px; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--lime); }
.form-status.error { color: var(--red); }
.deal-meta { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 9px; color: var(--dim); font-size: 9px; }
.subsection { padding-bottom: 18px; }
.subsection .stack-list { padding: 0 16px; }
.invoice-create-fields { grid-template-columns: minmax(180px, 1fr) minmax(120px, .65fr) auto; }
.custom-fields { display: contents; }
.custom-fields[hidden] { display: none; }
.order-card { padding: 0; }
.order-summary { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.order-summary h3 { margin: 0 0 6px; font-size: 12px; }
.order-summary p { margin: 0; color: var(--dim); font-size: 10px; }
.order-details { padding: 0 18px 16px; border-top: 1px solid var(--line); }
.video-row { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(180px, .8fr) minmax(190px, 1fr) minmax(190px, 1fr); gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; line-height: 1.55; }
.video-row:last-child { border-bottom: 0; }
.video-row strong { color: var(--text); }
.video-row a { color: var(--lime); text-decoration: none; }
.loading-card, .empty-state { min-height: 90px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--dim); font-size: 10px; }
.spinner { width: 13px; height: 13px; display: inline-block; border: 1px solid #333; border-top-color: var(--lime); border-radius: 50%; animation: spin .7s linear infinite; }
.toast-region { position: fixed; z-index: 50; right: 20px; top: 88px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 14px; border: 1px solid #3b3b3b; background: #111; color: var(--text); font-size: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.toast.error { border-color: #5b2525; }

/* Soft, Apple-like control surface: every interactive or grouped element is
   intentionally rounded and visually separated by air instead of hard grids. */
.brand-mark { border-radius: 12px; }
.workspace-pill, .result-count, .live-tag { border-radius: var(--pill); }
.nav-item { min-height: 44px; padding-inline: 12px; border-radius: var(--radius-md); }
.side-filter select, .search-box, input, select { border-radius: 13px; }
.search-box { height: 42px; padding-inline: 14px; border-radius: var(--pill); }
.user-button, .user-button > * { border-radius: 50%; }
.icon-badge, .soft-icon { border-radius: 11px; }
.soft-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); background: #151515; color: var(--lime); font-size: 13px; }
.primary-button, .secondary-button { min-height: 42px; padding-inline: 18px; border-radius: var(--pill); }
.stage-badge { border-radius: var(--pill); }
.section-heading { padding: 18px 22px; }
.table-scroll { margin: 0 10px 10px; overflow: hidden auto; border-radius: 16px; }
thead { background: #0d0d0d; }
.stack-list { gap: 13px; }
.subsection .stack-list { padding: 2px 16px 18px; }
.email-layout { display: grid; gap: 16px; }
.email-layout .soft-panel { margin-top: 18px; }
.email-compose-panel .action-card { margin: 16px; background: #0c0c0c; }
.email-ready-panel .stack-list { padding: 2px 16px 18px; }
.order-card { overflow: hidden; border-radius: var(--radius-lg); }
.order-summary { padding: 20px 22px; }
.order-details { margin: 0 10px 10px; padding: 4px 14px 14px; border: 0; border-radius: 16px; background: #0c0c0c; }
.customer-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 16px 0; }
.info-tile { min-height: 76px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 14px; background: #101010; }
.info-tile span { display: block; margin-bottom: 7px; color: var(--dim); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.info-tile strong, .info-tile p { margin: 0; color: var(--text); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.rights-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 14px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--pill); background: #111; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.status-pill.ok { border-color: #3c4510; color: var(--lime); }
.status-pill.warn { border-color: #594316; color: #e7bf60; }
.invoice-editor { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 22px; }
.invoice-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.invoice-lines { display: grid; gap: 8px; }
.invoice-line { display: grid; grid-template-columns: minmax(200px, 1.8fr) 80px 120px auto; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--line-soft); border-radius: 15px; background: #0d0d0d; }
.invoice-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.invoice-email { width: min(290px, 100%); }
.approval-control { display: flex; align-items: center; gap: 9px; margin-right: auto; color: var(--muted); font-size: 10px; text-transform: none; letter-spacing: 0; cursor: pointer; }
.approval-control input { width: 18px; height: 18px; margin: 0; accent-color: var(--lime); }
.invoice-state { display: inline-flex; padding: 6px 10px; border-radius: var(--pill); background: rgba(22,139,255,.14); color: #7db8ff; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .overview-hero { grid-template-columns: .9fr 1.1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-card { min-height: 196px; }
  .action-card { grid-template-columns: 1fr; }
  .customer-overview, .invoice-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-line { grid-template-columns: 1fr 90px 120px; }
  .invoice-line button { grid-column: 1 / -1; }
}

@media (max-width: 899px) {
  :root { --sidebar: 0px; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; padding: 10px 14px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar-brand { flex: 0 0 auto; }
  .workspace-pill, .side-filter, .sidebar-footer, .nav-label, .nav-count { display: none; }
  .side-nav { display: flex; margin-left: 18px; }
  .nav-item { width: auto; min-width: max-content; grid-template-columns: 20px auto; }
  .workspace { margin-left: 0; }
  .topbar { top: 63px; height: auto; min-height: 72px; padding: 12px 18px; }
  .topbar > div:first-child { display: none; }
  .topbar-actions { width: 100%; }
  .search-box { width: 100%; }
  .view { padding: 18px 16px 44px; }
  .overview-titlebar { padding-inline: 2px; }
  .overview-hero { grid-template-columns: 1fr; }
  .kpi-grid { margin: 18px; }
  .globe-wrap { min-height: 410px; }
  .action-fields, .invoice-create-fields, .single-action .completed-fields { grid-template-columns: 1fr; }
  .customer-overview, .invoice-summary, .invoice-line { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-copy { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .video-row { grid-template-columns: 1fr; }
  .globe-label { display: none; }
}

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

/* 2026 blue/violet operations surface */
.sidebar { background: linear-gradient(180deg, #0c0f1b 0%, #090b14 100%); box-shadow: 18px 0 70px rgba(0,0,0,.22); }
.topbar { background: rgba(12,15,25,.86); border-color: rgba(116,128,170,.2); }
.nav-item.active { border-color: rgba(75,125,255,.35); background: linear-gradient(90deg, rgba(22,139,255,.2), rgba(139,92,246,.08)); }
.nav-item.active::before { background: linear-gradient(var(--blue), var(--violet)); box-shadow: 0 0 14px rgba(22,139,255,.7); }
.nav-item.active .nav-icon, .icon-badge, .soft-icon { color: #75b9ff; }
.status-dot { background: #35a7ff; box-shadow: 0 0 10px rgba(53,167,255,.78); }
.workspace-pill, .search-box, input, select { background-color: rgba(19,24,38,.9); }
.primary-button { border-color: #258fff; background: linear-gradient(135deg, #168bff, #3567f4); color: white; box-shadow: 0 8px 24px rgba(22,139,255,.18); }
.primary-button:hover { background: linear-gradient(135deg, #36a0ff, #735cf5); transform: translateY(-1px); }
.secondary-button { background: #171c2a; border-color: #30384d; color: #c4cad8; }
.secondary-button:hover { border-color: #5066a4; background: #1d2436; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,139,255,.13); }
.kpi-card, .data-panel, .soft-panel, .subsection, .action-card, .order-card { background: linear-gradient(155deg, rgba(25,30,45,.96), rgba(14,17,28,.98)); border-color: rgba(98,110,150,.25); box-shadow: 0 24px 70px rgba(0,0,0,.2); }
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; inset: auto -30% -55% 20%; height: 80%; background: radial-gradient(circle, rgba(79,70,229,.16), transparent 66%); pointer-events: none; }
.stage-badge::before { background: #5fa8ff; }
.form-status.ok, .status-pill.ok { color: #51d7c7; }

.globe-wrap { min-height: 560px; border-color: rgba(83,104,190,.3); background: radial-gradient(circle at 62% 52%, rgba(30,83,255,.18), transparent 42%), radial-gradient(circle at 65% 50%, rgba(139,92,246,.12), transparent 60%), #080b17; box-shadow: inset 0 0 90px rgba(41,58,145,.13), 0 30px 90px rgba(0,0,0,.28); cursor: grab; }
.globe-wrap:active { cursor: grabbing; }
#globe-canvas { touch-action: none; }
.globe-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.globe-label { position: absolute; top: 0; left: 0; display: none; padding: 5px 9px; border: 1px solid rgba(113,151,255,.42); border-radius: 999px; background: rgba(7,11,25,.82); box-shadow: 0 0 18px rgba(59,105,255,.28); color: #cfe5ff; font-size: 9px; letter-spacing: .06em; white-space: nowrap; backdrop-filter: blur(8px); }
.globe-label.visible { display: block; }
.globe-label.hub { border-color: rgba(185,167,255,.7); color: #e5ddff; box-shadow: 0 0 24px rgba(139,92,246,.4); font-weight: 800; }
.globe-caption { position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid rgba(91,110,173,.3); border-radius: 999px; background: rgba(8,11,23,.76); color: #aab6d2; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(12px); }
.globe-status { position: absolute; inset: 0; display: grid; place-items: center; color: #71809e; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }

.pipeline-intro { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pipeline-tools { display: flex; align-items: center; gap: 12px; }
.toggle-control { display: flex; align-items: center; gap: 9px; text-transform: none; letter-spacing: 0; }
.toggle-control input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.pipeline-board { display: flex; gap: 14px; min-height: 580px; padding: 8px 2px 24px; overflow-x: auto; scroll-snap-type: x proximity; }
.pipeline-column { width: 286px; min-width: 286px; padding: 10px; border: 1px solid rgba(86,100,144,.22); border-radius: 20px; background: rgba(15,19,31,.72); scroll-snap-align: start; transition: .18s ease; }
.pipeline-column.drag-over { border-color: rgba(62,141,255,.78); background: rgba(22,139,255,.08); box-shadow: inset 0 0 40px rgba(22,139,255,.08); }
.pipeline-column > header { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 5px 10px; color: #9da7bc; font-size: 10px; }
.pipeline-column > header > div { display: flex; align-items: center; gap: 8px; }
.pipeline-column > header strong { color: #e6e9f1; font-size: 11px; }
.stage-dot { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #37a5ff, #9b6cff); box-shadow: 0 0 10px rgba(76,125,255,.72); }
.pipeline-dropzone { display: grid; align-content: start; gap: 9px; min-height: 500px; }
.deal-card { padding: 15px; border: 1px solid rgba(91,105,145,.28); border-radius: 16px; background: linear-gradient(145deg, #1b2131, #121725); box-shadow: 0 14px 35px rgba(0,0,0,.18); cursor: grab; outline: none; transition: .18s ease; }
.deal-card:hover, .deal-card:focus-visible, .deal-card.expanded { border-color: rgba(76,135,255,.55); transform: translateY(-2px); box-shadow: 0 18px 40px rgba(8,18,48,.34); }
.deal-card.dragging { opacity: .45; transform: rotate(2deg); }
.deal-card-top, .deal-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.deal-card-company { color: #77b9ff; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.deal-card h3 { margin: 12px 0 6px; font-size: 13px; line-height: 1.35; }
.deal-card > p, .deal-card-details p { margin: 0; color: #78839a; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.deal-card-meta { margin-top: 13px; padding-top: 11px; border-top: 1px solid rgba(83,95,130,.2); color: #647089; font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.deal-card-details { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(83,95,130,.2); }
.deal-card-details a { display: inline-block; margin-top: 8px; color: #68b1ff; font-size: 9px; text-decoration: none; }
.card-action { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 12px; padding: 9px 12px; border: 1px solid rgba(66,140,255,.4); border-radius: 11px; background: rgba(22,139,255,.1); color: #91caff; font-size: 9px; font-weight: 800; cursor: pointer; }
.card-action:hover { background: rgba(22,139,255,.2); }
.pipeline-empty { display: grid; place-items: center; min-height: 90px; border: 1px dashed rgba(91,105,145,.22); border-radius: 14px; color: #556079; font-size: 9px; }

.invoice-tabs { display: flex; gap: 7px; margin: 22px 0 14px; padding: 5px; width: max-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #101521; }
.invoice-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #7f899f; font-size: 10px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.invoice-tab span { margin-left: 6px; color: #5e6a84; }
.invoice-tab.active { background: linear-gradient(135deg, rgba(22,139,255,.25), rgba(139,92,246,.18)); color: white; box-shadow: inset 0 0 0 1px rgba(90,140,255,.28); }
.invoice-workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; gap: 14px; }
.invoice-intro { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.invoice-list-text { min-width: 0; }
.invoice-list-text strong, .invoice-list-text small { display: block; }
.invoice-hint { margin: 0 0 2px; color: #7f8aa2; font-size: 10px; line-height: 1.55; }
.manual-line { grid-template-columns: minmax(140px, 1fr) 80px 110px 34px; }
.line-remove { align-self: end; width: 34px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #171c2a; color: #9aa4b7; font-size: 16px; line-height: 1; cursor: pointer; }
.line-remove:hover { border-color: #5066a4; color: #fff; }
.add-manual-line { margin-top: 10px; }
.invoice-master, .invoice-detail { overflow: hidden; border: 1px solid rgba(93,107,148,.26); border-radius: 22px; background: rgba(16,20,32,.9); }
.invoice-master { align-self: start; display: grid; gap: 7px; padding: 9px; }
.invoice-list-item { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid transparent; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; }
.invoice-list-item:hover { background: #171d2c; }
.invoice-list-item.active { border-color: rgba(76,135,255,.4); background: linear-gradient(135deg, rgba(22,139,255,.13), rgba(139,92,246,.08)); }
.invoice-list-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #20283b; color: #72b5ff; }
.invoice-list-item strong, .invoice-list-item small { display: block; }
.invoice-list-item strong { margin-bottom: 4px; color: #e9ecf4; font-size: 10px; }
.invoice-list-item small { color: #6f7a92; font-size: 8px; }
.invoice-list-amount { color: #aeb7ca; font-size: 9px; }
.invoice-detail { padding: 20px; }
.invoice-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.invoice-detail-head h2 { margin: 0 0 6px; font-size: 24px; }
.invoice-detail-head p:last-child { margin: 0; color: #7d879d; font-size: 10px; }
.invoice-state.approved { background: rgba(139,92,246,.14); color: #c4b5fd; }
.invoice-state.sent { background: rgba(45,212,191,.12); color: #5eead4; }
.invoice-state.sync-pending { border-color: rgba(245,158,11,.38); background: rgba(245,158,11,.12); color: #fbbf24; }
.invoice-detail-grid { display: grid; grid-template-columns: minmax(440px, .9fr) minmax(420px, 1.1fr); gap: 16px; padding-top: 18px; }
.invoice-detail-form, .create-invoice-detail { min-width: 0; }
.invoice-form-section { margin-bottom: 12px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 16px; background: #111725; }
.invoice-form-section h3 { margin: 0 0 14px; color: #dfe3ed; font-size: 11px; }
.form-grid { display: grid; gap: 10px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
.invoice-detail-form .invoice-line { grid-template-columns: minmax(150px, 1fr) 70px 100px; padding: 10px; }
.invoice-detail-form .invoice-line .status-pill { display: none; }
.detail-actionbar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 14px 0 2px; background: linear-gradient(transparent, rgba(16,20,32,.97) 30%); }
.sent-note { color: #68cfc2; font-size: 10px; }
.pdf-preview-panel { min-height: 620px; overflow: hidden; border: 1px solid rgba(91,106,151,.28); border-radius: 16px; background: #090c14; }
.pdf-preview-head { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line-soft); color: #dfe3ee; font-size: 10px; }
.pdf-preview-head small { color: #69758e; font-size: 8px; }
.pdf-preview-empty { min-height: 568px; display: grid; place-items: center; padding: 30px; color: #59647d; font-size: 10px; text-align: center; }
.pdf-preview-panel iframe { width: 100%; height: 568px; border: 0; background: white; }
.ready-summary { min-height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 13px; color: #7e899f; }
.ready-summary strong { color: white; font-size: 20px; }

.app-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; border: 1px solid rgba(96,115,175,.38); border-radius: 24px; background: linear-gradient(145deg, #171d2c, #0e121d); color: var(--text); box-shadow: 0 35px 110px rgba(0,0,0,.62), 0 0 50px rgba(72,63,190,.13); }
.app-dialog::backdrop { background: rgba(3,5,10,.76); backdrop-filter: blur(8px); }
.dialog-panel { display: grid; gap: 15px; padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.dialog-head h2 { margin: 0; font-size: 24px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #171d2b; color: #9aa4b7; font-size: 20px; line-height: 1; cursor: pointer; }
.icon-button:hover { border-color: #5066a4; color: #dfe4ef; }
.dialog-context { margin: 0; color: #8b96ac; font-size: 11px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.compact-dialog { min-height: 220px; align-content: center; }

@media (max-width: 1250px) {
  .invoice-detail-grid { grid-template-columns: 1fr; }
  .pdf-preview-panel { min-height: 520px; }
  .pdf-preview-panel iframe, .pdf-preview-empty { height: 468px; min-height: 468px; }
}

@media (max-width: 899px) {
  .pipeline-intro { align-items: flex-start; flex-direction: column; }
  .pipeline-board { min-height: 480px; }
  .pipeline-column { min-width: min(82vw, 300px); }
  .invoice-workspace { grid-template-columns: 1fr; }
  .invoice-master { display: flex; overflow-x: auto; }
  .invoice-list-item { min-width: 260px; }
  .invoice-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .globe-wrap { min-height: 420px; }
  .pipeline-tools { width: 100%; justify-content: space-between; }
  .invoice-detail { padding: 13px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .invoice-detail-form .invoice-line { grid-template-columns: 1fr; }
  .detail-actionbar { align-items: stretch; flex-direction: column; }
  .detail-actionbar button { width: 100%; }
}
