/* Corvane app workspace */
[data-theme="light"] { --bg: #F3F1EB; --panel: #FFFFFF; --panel-2: #F7F6F2; --tx: #0A0C11; --mu: rgba(10,12,17,.56); --ln: rgba(10,12,17,.09); --pri: #0A0C11; --pri-tx: #F3F1EB; --acc: #4F5DFF; --hi: #D2FF3D; --side: #0A0C11; }
[data-theme="dark"]  { --bg: #0A0C11; --panel: #12151D; --panel-2: #181C26; --tx: #F3F1EB; --mu: rgba(243,241,235,.56); --ln: rgba(255,255,255,.08); --pri: #D2FF3D; --pri-tx: #0A0C11; --acc: #8D97FF; --hi: #D2FF3D; --side: #06070A; }
body { background: var(--bg); color: var(--tx); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.squares i { background: var(--volt); }

/* ============ LOGIN ============ */
.login { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center end; padding: 24px clamp(16px, 6vw, 90px); background: #000; color: var(--paper); overflow-y: auto; }
.login-bg { position: absolute; inset: 0; }
.login-bg video { width: 100%; height: 100%; opacity: .75; }
.login-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,12,17,.1), rgba(10,12,17,.85) 70%); }
.login-card { position: relative; width: min(460px, 100%); padding: clamp(26px, 4vw, 40px); border-radius: 26px; background: rgba(18,21,29,.62);
  backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 50px 100px -30px rgba(0,0,0,.7); }
.login-card .logo { margin-bottom: 30px; }
.login-card h1 { font-size: clamp(38px, 5vw, 54px); font-weight: 500; letter-spacing: -.04em; line-height: 1; margin: 0 0 10px; }
.login-card h1 em { font-family: var(--serif); font-weight: 400; color: var(--volt); }
.login-card > p { color: var(--mute-d); margin: 0 0 22px; font-size: 15px; }
.roles { display: grid; gap: 8px; margin-bottom: 20px; }
.roles button { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); text-align: left; transition: border-color .3s, background .3s; }
.roles button:hover { background: rgba(255,255,255,.05); }
.roles button.is-on { border-color: var(--volt); background: rgba(210,255,61,.08); }
.roles img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.roles span { flex: 1; font-size: 12.5px; color: var(--mute-d); line-height: 1.3; }
.roles b { display: block; color: var(--paper); font-size: 15px; font-weight: 500; }
.roles i { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--mute-d); }
.roles .is-on i { color: var(--volt); }
.fld { display: block; margin-bottom: 10px; }
.fld span { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute-d); margin-bottom: 6px; }
.fld input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); color: var(--paper); padding: 0 14px; font: inherit; }
.login .go { width: 100%; justify-content: center; margin-top: 10px; }
.fine { font-size: 12px; color: var(--mute-d); text-align: center; margin: 16px 0 0; }
body.in .login { visibility: hidden; }
@media (max-width: 700px) { .login { place-items: center; } .login-bg::after { background: rgba(10,12,17,.6); } }

/* ============ SHELL ============ */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; min-height: 100svh; visibility: hidden; }
body.in .app { visibility: visible; }
.side { position: sticky; top: 0; height: 100vh; height: 100svh; background: var(--side); color: var(--paper); display: flex; flex-direction: column; padding: 22px 14px; }
.side .logo { padding: 0 10px 26px; font-size: 20px; }
.side-nav { display: grid; gap: 2px; }
.side-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; font-size: 14.5px; color: rgba(243,241,235,.66); position: relative; transition: color .3s, background .3s; }
.side-nav button svg { width: 19px; height: 19px; flex: none; }
.side-nav button:hover { color: var(--paper); background: rgba(255,255,255,.05); }
.side-nav button.is-on { color: var(--ink); background: var(--volt); }
.side-nav button .ct { margin-left: auto; font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.1); }
.side-nav button.is-on .ct { background: rgba(10,12,17,.12); }
.side-nav button.locked { opacity: .32; cursor: not-allowed; }
.side-nav button.locked::after { content: ''; width: 12px; height: 12px; margin-left: auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat; }
.side-foot { margin-top: auto; display: grid; gap: 4px; }
.side-foot button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; color: rgba(243,241,235,.66); }
.side-foot button:hover { color: var(--paper); background: rgba(255,255,255,.05); }
.theme-btn i { width: 34px; height: 20px; border-radius: 99px; background: rgba(255,255,255,.15); position: relative; transition: background .3s; }
.theme-btn i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); transition: transform .4s var(--ease); }
[data-theme="dark"] .theme-btn i { background: var(--volt); }
[data-theme="dark"] .theme-btn i::after { transform: translateX(14px); background: var(--ink); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 16px clamp(16px, 2.6vw, 34px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--ln); }
.crumb small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--mu); }
.view-title { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.search { margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(360px, 32vw); height: 42px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--ln); color: var(--mu); font-size: 14px; }
.search svg { width: 17px; height: 17px; }
.search kbd, .palette kbd { margin-left: auto; font-family: var(--mono); font-size: 10.5px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--ln); }
.top-r { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; width: 42px; height: 42px; border-radius: 12px; background: var(--panel); border: 1px solid var(--ln); display: grid; place-items: center; }
.bell svg { width: 18px; height: 18px; }
.bell b { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 10.5px; display: grid; place-items: center; }
.me { display: flex; align-items: center; gap: 10px; }
.me img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.me span { font-size: 12px; color: var(--mu); line-height: 1.25; }
.me b { display: block; color: var(--tx); font-size: 14px; font-weight: 500; }
.notes { position: absolute; right: clamp(16px, 2.6vw, 34px); top: 72px; width: min(340px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--ln); border-radius: 16px; padding: 16px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.3); }
.notes h4 { margin: 0 0 8px; font-size: 13px; font-family: var(--mono); font-weight: 400; color: var(--mu); text-transform: uppercase; letter-spacing: .08em; }
.notes p { margin: 0; padding: 10px 0; border-top: 1px solid var(--ln); font-size: 13.5px; }
.notes em { font-family: var(--serif); font-size: 15px; }
.notes small { display: block; color: var(--mu); font-size: 11.5px; margin-top: 2px; }

.stage { position: relative; flex: 1; padding: clamp(16px, 2.6vw, 34px); min-width: 0; }
.wipe { position: fixed; z-index: 30; inset: 0; background: var(--volt); pointer-events: none; visibility: hidden; }
.view { display: none; }
.view.is-on { display: block; }

/* ============ shared bits ============ */
.card { background: var(--panel); border: 1px solid var(--ln); border-radius: 18px; padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 small { font-weight: 400; color: var(--mu); font-size: 12.5px; }
.sub { color: var(--mu); font-size: 13px; margin: 0 0 16px; }
.grid { display: grid; gap: 16px; }
.b { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; background: var(--pri); color: var(--pri-tx); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: transform .2s, opacity .2s; }
.b svg { width: 16px; height: 16px; }
.b:hover { opacity: .88; }
.b:active { transform: scale(.97); }
.b.ghost { background: transparent; color: var(--tx); border: 1px solid var(--ln); }
.pill { display: inline-block; font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--ln); white-space: nowrap; }
.pill.green { background: rgba(48,190,110,.14); color: #1E9A55; border-color: transparent; }
.pill.blue { background: rgba(79,93,255,.13); color: var(--acc); border-color: transparent; }
.pill.amber { background: rgba(255,170,40,.16); color: #B9740A; border-color: transparent; }
.pill.red { background: rgba(255,90,60,.14); color: #E0482B; border-color: transparent; }
.pill.volt { background: var(--hi); color: var(--ink); border-color: transparent; }
[data-theme="dark"] .pill.green { color: #5EE095; } [data-theme="dark"] .pill.amber { color: #FFC35C; } [data-theme="dark"] .pill.red { color: #FF8A70; }
.av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--acc); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { font-size: 13px; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--ln); background: var(--panel); transition: background .25s, color .25s; }
.chips button.is-on { background: var(--pri); color: var(--pri-tx); border-color: var(--pri); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.inp { height: 38px; border-radius: 10px; border: 1px solid var(--ln); background: var(--panel); color: var(--tx); padding: 0 12px; font: inherit; font-size: 14px; }

/* ============ DASHBOARD ============ */
.kpis { grid-template-columns: repeat(4, 1fr); }
.kpi { position: relative; overflow: hidden; }
.kpi small { color: var(--mu); font-size: 13px; }
.kpi b { display: block; font-size: clamp(26px, 2.4vw, 36px); font-weight: 600; letter-spacing: -.04em; margin: 6px 0 4px; }
.kpi em { font-style: normal; font-family: var(--mono); font-size: 11.5px; color: #1E9A55; }
[data-theme="dark"] .kpi em { color: var(--hi); }
.kpi svg { position: absolute; right: 14px; bottom: 14px; width: 90px; height: 34px; }
.kpi.feature { background: var(--side); color: var(--paper); border-color: transparent; }
.kpi.feature small { color: var(--mute-d); }
.kpi.feature em { color: var(--volt); }
.dash-a { grid-template-columns: 1.7fr 1fr; margin-top: 16px; }
.dash-b { grid-template-columns: 1fr 1fr 1fr; margin-top: 16px; }
.chart { width: 100%; height: 240px; margin-top: 8px; overflow: visible; }
.chart text { fill: var(--mu); font-size: 11px; font-family: var(--mono); }
.chart .gl { stroke: var(--ln); }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--ln); font-size: 14px; }
.tasks li:first-child { border-top: 0; }
.tasks input { width: 18px; height: 18px; accent-color: var(--acc); flex: none; }
.tasks li.done span { text-decoration: line-through; color: var(--mu); }
.tasks small { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--mu); white-space: nowrap; }
.tasks small.late { color: #E0482B; }
.stagebars { display: grid; gap: 12px; margin-top: 8px; }
.sb { font-size: 13px; }
.sb div { display: flex; justify-content: space-between; margin-bottom: 5px; }
.sb div span { color: var(--mu); font-family: var(--mono); font-size: 11.5px; }
.sb i { display: block; height: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.sb i::after { content: ''; display: block; height: 100%; width: var(--w); background: var(--c, var(--acc)); border-radius: inherit; transform-origin: left; animation: grow 1.2s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ln); font-size: 13.5px; line-height: 1.4; }
.feed li:first-child { border-top: 0; }
.feed small { display: block; color: var(--mu); font-size: 11.5px; margin-top: 2px; }
.feed .av.wf { background: var(--hi); color: var(--ink); }
.hello { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.hello h1 { margin: 0; font-size: clamp(30px, 3.4vw, 46px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.hello h1 em { font-family: var(--serif); font-weight: 400; color: var(--acc); }
.hello p { margin: 8px 0 0; color: var(--mu); }

/* ============ CONTACTS ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); font-weight: 400; padding: 10px 12px; border-bottom: 1px solid var(--ln); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--ln); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .2s; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .who { display: flex; align-items: center; gap: 10px; }
.tbl .who b { display: block; font-weight: 500; }
.tbl .who small { color: var(--mu); font-size: 12px; }
.tbl .num { font-family: var(--mono); font-size: 13px; text-align: right; }
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.empty { padding: 40px; text-align: center; color: var(--mu); }

.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); border-left: 1px solid var(--ln); box-shadow: -40px 0 80px -30px rgba(0,0,0,.35); overflow-y: auto; padding: 0 0 30px; }
.dr-hero { position: relative; height: 150px; background: linear-gradient(120deg, var(--cobalt), #9B5BFF 60%, var(--coral)); }
.dr-hero button { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.3); color: #fff; font-size: 18px; }
.dr-body { padding: 0 24px; }
.dr-body .big { width: 88px; height: 88px; border-radius: 22px; border: 4px solid var(--panel); margin-top: -44px; object-fit: cover; font-size: 28px; }
.dr-body h3 { margin: 14px 0 2px; font-size: 24px; font-weight: 500; letter-spacing: -.03em; }
.dr-body > p { margin: 0; color: var(--mu); font-size: 14px; }
.dr-acts { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.dr-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 0; border-block: 1px solid var(--ln); font-size: 13.5px; }
.dr-facts small { display: block; color: var(--mu); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.timeline { list-style: none; margin: 18px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--ln); }
.timeline li { position: relative; padding: 0 0 18px 8px; font-size: 13.5px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--acc); }
.timeline li.k-won::before { background: var(--hi); border-color: var(--hi); }
.timeline small { display: block; color: var(--mu); font-size: 11.5px; }

/* ============ PIPELINE ============ */
.pipe-sum { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13.5px; color: var(--mu); }
.pipe-sum b { color: var(--tx); font-size: 18px; letter-spacing: -.02em; display: block; }
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--panel-2); border: 1px solid var(--ln); border-radius: 16px; padding: 12px; min-height: 380px; transition: background .25s, border-color .25s; }
.col.over { background: color-mix(in srgb, var(--acc) 10%, var(--panel-2)); border-color: var(--acc); }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 12px; }
.col-h b { font-size: 14px; font-weight: 600; }
.col-h b i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--mu); margin-left: 6px; }
.col-h span { font-family: var(--mono); font-size: 11.5px; color: var(--mu); }
.col[data-stage="won"] .col-h b::before { content: '● '; color: #2BB673; }
.col[data-stage="lost"] .col-h b::before { content: '● '; color: #E0482B; }
.deal { background: var(--panel); border: 1px solid var(--ln); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: grab; user-select: none; touch-action: manipulation; transition: box-shadow .25s, transform .25s; }
.deal:hover { box-shadow: 0 10px 30px -14px rgba(0,0,0,.3); }
.deal.dragging { position: fixed; z-index: 60; pointer-events: none; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); cursor: grabbing; }
.deal.ghost { opacity: .35; }
.deal b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.deal small { color: var(--mu); font-size: 12.5px; }
.deal .row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.deal .val { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.deal .ow { width: 24px; height: 24px; font-size: 10px; }
.deal.won-flash { animation: flash 1s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(210,255,61,.9); } 100% { box-shadow: 0 0 0 18px rgba(210,255,61,0); } }
.confetti { position: fixed; z-index: 70; pointer-events: none; width: 9px; height: 9px; border-radius: 2px; }

/* ============ QUOTES ============ */
.q-layout { grid-template-columns: 1fr 1.05fr; align-items: start; }
.qi { width: 100%; border-collapse: collapse; font-size: 14px; }
.qi th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); font-weight: 400; padding: 8px 6px; border-bottom: 1px solid var(--ln); }
.qi td { padding: 10px 6px; border-bottom: 1px solid var(--ln); }
.qi td small { display: block; color: var(--mu); font-size: 12px; }
.qi input { width: 64px; height: 34px; border-radius: 8px; border: 1px solid var(--ln); background: var(--panel-2); color: var(--tx); text-align: center; font: inherit; }
.q-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.q-ctl label { font-size: 12.5px; color: var(--mu); display: grid; gap: 6px; }
.q-ctl select, .q-ctl input { height: 38px; border-radius: 10px; border: 1px solid var(--ln); background: var(--panel-2); color: var(--tx); padding: 0 10px; font: inherit; font-size: 14px; }
.q-steps { display: flex; gap: 6px; margin: 18px 0 0; flex-wrap: wrap; }
.q-steps span { font-size: 12px; padding: 6px 12px; border-radius: 99px; border: 1px dashed var(--ln); color: var(--mu); }
.q-steps span.done { border-style: solid; background: var(--hi); color: var(--ink); border-color: transparent; }
.q-acts { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

.paper { background: #fff; color: #111; border-radius: 6px; padding: clamp(22px, 3vw, 38px); box-shadow: 0 40px 80px -30px rgba(0,0,0,.35); font-size: 13px; position: relative; overflow: hidden; transform-origin: 50% 0; }
.paper-h { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid #111; }
.paper-h .logo { font-size: 19px; color: #111; }
.paper-h .doc { text-align: right; }
.paper-h .doc b { display: block; font-size: 26px; letter-spacing: -.03em; font-weight: 600; }
.paper-h .doc small { font-family: var(--mono); font-size: 11px; color: #666; }
.paper-to { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; font-size: 12.5px; color: #444; }
.paper-to small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #888; margin-bottom: 4px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #888; font-weight: 400; padding: 6px 0; border-bottom: 1px solid #ddd; }
.paper td { padding: 8px 0; border-bottom: 1px solid #eee; }
.paper .r { text-align: right; font-family: var(--mono); }
.tot { margin: 16px 0 0 auto; width: min(260px, 100%); display: grid; gap: 6px; font-size: 13px; }
.tot div { display: flex; justify-content: space-between; }
.tot div span:last-child { font-family: var(--mono); }
.tot .grand { border-top: 2px solid #111; padding-top: 8px; font-size: 17px; font-weight: 600; }
.stamp { position: absolute; left: clamp(22px, 3vw, 38px); bottom: 110px; padding: 8px 16px; border: 3px solid #2BB673; color: #2BB673; font-weight: 700; letter-spacing: .12em; font-size: 18px; border-radius: 8px; transform: rotate(-12deg); opacity: 0; font-family: var(--mono); }
.paper.accepted .stamp { opacity: 1; }
.paper.invoice .stamp { border-color: var(--cobalt); color: var(--cobalt); }
.sig { margin-top: 24px; display: flex; justify-content: space-between; align-items: end; font-size: 11.5px; color: #666; }
.sig svg { width: 150px; height: 46px; }
.sig path { stroke: #1a2b8f; stroke-width: 2; fill: none; stroke-dasharray: 400; stroke-dashoffset: 400; }
.paper.accepted .sig path { animation: sign 1.6s .3s ease forwards; }
@keyframes sign { to { stroke-dashoffset: 0; } }

/* ============ TICKETS ============ */
.tix { display: grid; gap: 10px; }
.tk { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 16px; align-items: center; padding: 14px 18px; }
.tk .id { font-family: var(--mono); font-size: 12px; color: var(--mu); }
.tk b { font-weight: 500; display: block; }
.tk small { color: var(--mu); font-size: 12.5px; }
.slaw { width: 150px; }
.slaw div { display: flex; justify-content: space-between; font-size: 11.5px; font-family: var(--mono); color: var(--mu); margin-bottom: 4px; }
.slaw i { display: block; height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.slaw i::after { content: ''; display: block; height: 100%; width: var(--w); background: var(--c); transition: width 1s linear; }
.tk.resolved { opacity: .5; }
.tk.resolved b { text-decoration: line-through; }
.canned { display: grid; gap: 8px; }
.canned button { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ln); font-size: 13.5px; background: var(--panel-2); }
.canned button:hover { border-color: var(--acc); }
.tix-layout { grid-template-columns: 1fr 300px; align-items: start; }

/* ============ AUTOMATIONS ============ */
.flow { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px; padding: 30px 10px; }
.flow svg.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.flow svg.wires path { fill: none; stroke: var(--acc); stroke-width: 2; stroke-dasharray: 6 6; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }
.node { position: relative; z-index: 1; background: var(--panel); border: 1px solid var(--ln); border-radius: 16px; padding: 16px; box-shadow: 0 16px 40px -24px rgba(0,0,0,.3); }
.node small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mu); }
.node b { display: block; font-size: 15px; font-weight: 600; margin: 6px 0 4px; }
.node p { margin: 0; font-size: 13px; color: var(--mu); }
.node.trig { border-top: 4px solid var(--hi); }
.node.cond { border-top: 4px solid var(--acc); }
.node.act { border-top: 4px solid var(--coral); }
.node + .node { margin-top: 12px; }
.node.pulse { animation: pulse 1s var(--ease); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 60%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.wf-list { display: grid; gap: 8px; }
.wf { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ln); font-size: 14px; cursor: pointer; }
.wf.is-on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 7%, transparent); }
.wf span { flex: 1; }
.wf small { display: block; color: var(--mu); font-size: 12px; }
.sw { width: 36px; height: 21px; border-radius: 99px; background: var(--ln); position: relative; flex: none; transition: background .3s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .3s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sw.on { background: #2BB673; }
.sw.on::after { transform: translateX(15px); }
.auto-layout { grid-template-columns: 300px 1fr; align-items: start; }

/* ============ REPORTS ============ */
.rep-layout { grid-template-columns: 1.2fr 1fr; }
.hbars { display: grid; gap: 14px; margin-top: 10px; }
.donut-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.donut { width: 190px; height: 190px; }
.donut circle { fill: none; stroke-width: 26; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray 1.2s var(--ease); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; font-family: var(--mono); font-weight: 500; padding-left: 16px; }
.builder { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.builder label { font-size: 12px; color: var(--mu); display: grid; gap: 6px; }
.builder select { height: 38px; border-radius: 10px; border: 1px solid var(--ln); background: var(--panel-2); color: var(--tx); padding: 0 10px; font: inherit; font-size: 14px; }

/* ============ overlays ============ */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(10,12,17,.55); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-card { width: min(420px, 100%); background: var(--panel); border-radius: 20px; padding: 26px; border: 1px solid var(--ln); }
.modal-card h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.modal-card p { margin: 0 0 16px; color: var(--mu); font-size: 14px; }
.modal-card .chips { margin-bottom: 20px; }
.modal-card .acts { display: flex; gap: 8px; justify-content: flex-end; }
.palette { position: fixed; inset: 0; z-index: 90; background: rgba(10,12,17,.5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pal-card { width: min(620px, 100%); background: var(--panel); border-radius: 18px; border: 1px solid var(--ln); box-shadow: 0 50px 100px -30px rgba(0,0,0,.5); overflow: hidden; }
.pal-card input { width: 100%; height: 60px; border: 0; border-bottom: 1px solid var(--ln); background: transparent; color: var(--tx); font: inherit; font-size: 17px; padding: 0 20px; outline: none; }
.pal-card ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.pal-card li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.pal-card li.is-on { background: var(--panel-2); }
.pal-card li small { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--mu); text-transform: uppercase; letter-spacing: .06em; }
.pal-card > p { margin: 0; padding: 10px 16px; border-top: 1px solid var(--ln); font-size: 12px; color: var(--mu); display: flex; gap: 6px; align-items: center; }
.pal-card > p kbd { margin: 0; }
.toasts { position: fixed; z-index: 95; right: 16px; bottom: 16px; display: grid; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 20px 40px -16px rgba(0,0,0,.5); max-width: min(360px, calc(100vw - 32px)); }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--volt); flex: none; }

/* ============ responsive ============ */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-b { grid-template-columns: 1fr 1fr; }
  .dash-b > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .dash-a, .q-layout, .tix-layout, .auto-layout, .rep-layout { grid-template-columns: 1fr; }
  .search span, .me span { display: none; }
  .search { width: 42px; padding: 0; justify-content: center; }
  .search kbd { display: none; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 35; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .side .logo, .side-foot { display: none; }
  .side-nav { display: flex; overflow-x: auto; gap: 2px; width: 100%; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav button { flex-direction: column; gap: 4px; font-size: 10.5px; padding: 8px 10px; min-width: 66px; }
  .side-nav button .ct, .side-nav button.locked { display: none; }
  .stage { padding-bottom: 96px; }
  .top { gap: 10px; }
  .view-title { font-size: 21px; }
  .crumb small { display: none; }
  .dash-b { grid-template-columns: 1fr; }
  .kpi svg { display: none; }
  .tk { grid-template-columns: 1fr auto; }
  .tk .id, .tk .slaw { grid-column: 1 / -1; }
  .tk .id { order: -1; }
  .slaw { width: 100%; }
  .flow { grid-template-columns: 1fr; gap: 26px; }
  .tbl .hide-m { display: none; }
  .paper-to { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .top-r .me { display: none; }
}
