:root {
  --bg: #f7f7fa;
  --surface: #ffffff;
  --surface-2: #f1f1f5;
  --surface-3: #e9e9ef;
  --text: #19171d;
  --text-2: #6f6b76;
  --text-3: #96919f;
  --border: #e5e2e9;
  --brand-950: #24102f;
  --brand-900: #35104a;
  --brand-800: #4b1764;
  --brand-700: #612081;
  --brand-600: #782aa0;
  --brand-soft: rgba(90,34,117,.09);
  --success: #247a52;
  --success-soft: rgba(36,122,82,.10);
  --warning: #9a691c;
  --warning-soft: rgba(154,105,28,.10);
  --danger: #b13b52;
  --shadow: 0 20px 70px rgba(30,20,38,.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

[data-theme="dark"] {
  --bg: #09090c;
  --surface: #111116;
  --surface-2: #17171d;
  --surface-3: #202027;
  --text: #f8f7fb;
  --text-2: #aaa6b2;
  --text-3: #77727f;
  --border: #292730;
  --brand-950: #2c103b;
  --brand-900: #4a1762;
  --brand-800: #68258a;
  --brand-700: #8750b4;
  --brand-600: #a878d0;
  --brand-soft: rgba(168,120,208,.10);
  --success: #6dc69a;
  --success-soft: rgba(109,198,154,.09);
  --warning: #e1b764;
  --warning-soft: rgba(225,183,100,.08);
  --danger: #f07b91;
  --shadow: 0 28px 90px rgba(0,0,0,.32);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-600) 55%, transparent); outline-offset: 2px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-160%); background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; transition: .18s; }
.skip-link:focus { transform: translateY(0); }
.is-hidden { display: none !important; }

.app-loader { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 18px; background: var(--bg); color: var(--text-2); }
.app-loader p { margin: 0; font-size: 14px; }
.fox-mark { width: 50px; height: 50px; position: relative; animation: foxPulse 1.2s var(--ease) infinite alternate; }
.fox-mark span { position: absolute; width: 22px; height: 22px; background: var(--brand-700); transform: rotate(45deg); border-radius: 5px; }
.fox-mark span:nth-child(1) { left: 14px; top: 2px; }
.fox-mark span:nth-child(2) { left: 2px; top: 22px; opacity: .6; }
.fox-mark span:nth-child(3) { right: 2px; top: 22px; opacity: .35; }
@keyframes foxPulse { to { transform: translateY(-4px) scale(1.03); } }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: white; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(145deg, var(--brand-900), var(--brand-600)); box-shadow: 0 9px 28px rgba(74,23,98,.22); }
.brand > div:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 15px; }
.brand span { font-size: 11px; color: var(--text-3); margin-top: 4px; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; display: grid; place-items: center; cursor: pointer; transition: .2s var(--ease); }
.icon-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand-600) 35%, var(--border)); }
.status-pill { display: inline-flex; min-height: 32px; align-items: center; gap: 7px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-neutral { background: var(--surface-2); color: var(--text-2); }
.status-success { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }

.main-stage { min-height: calc(100vh - 76px); }
.view { min-height: calc(100vh - 76px); animation: viewIn .32s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.split-layout, .auth-layout, .login-shell { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(390px, .75fr); }
.hero-panel, .auth-intro, .login-visual { padding: clamp(48px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.hero-panel::after, .login-visual::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand-700) 14%, transparent), transparent 66%); right: -180px; bottom: -190px; pointer-events: none; }
.eyebrow { color: var(--brand-700); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(42px, 5.7vw, 76px); line-height: .98; letter-spacing: -.055em; max-width: 780px; margin: 18px 0 24px; }
.lead { max-width: 700px; color: var(--text-2); font-size: clamp(17px, 2vw, 21px); line-height: 1.55; }

.system-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 42px; max-width: 760px; }
.system-card { min-height: 96px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-md); display: flex; align-items: center; gap: 13px; padding: 18px; box-shadow: 0 8px 30px rgba(25,20,30,.03); }
.system-card > div:last-child { display: grid; gap: 4px; }
.system-card span { color: var(--text-3); font-size: 12px; }
.system-card strong { font-size: 14px; }
.system-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.system-icon.ok { background: var(--success-soft); color: var(--success); }
.system-icon.waiting { background: var(--warning-soft); color: var(--warning); }
.soft-note { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; color: var(--text-2); font-size: 13px; }
.soft-note strong { color: var(--text); }

.action-panel { background: var(--surface); border-left: 1px solid var(--border); padding: clamp(38px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; }
.panel-heading { display: flex; gap: 16px; align-items: center; margin-bottom: 28px; }
.panel-heading > div { display: grid; gap: 4px; }
.panel-heading span:not(.step-number), .form-header span, .panel-title span { color: var(--text-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.panel-heading h2, .form-header h2 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.step-number { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); font-weight: 800; }
.deployment-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 9px; }
.deployment-list li { display: grid; grid-template-columns: 32px 1fr; align-items: start; gap: 12px; padding: 13px; border-radius: 14px; background: var(--surface-2); }
.deployment-list li > span { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--brand-700); font-size: 12px; font-weight: 800; border: 1px solid var(--border); }
.deployment-list p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.helper-text { min-height: 20px; color: var(--text-3); font-size: 12px; margin: 12px 0 0; }

.button { min-height: 48px; border: 0; border-radius: 14px; padding: 0 18px; font-weight: 750; cursor: pointer; transition: .18s var(--ease); display: inline-flex; justify-content: center; align-items: center; gap: 9px; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .65; cursor: wait; }
.button-primary { color: white; background: linear-gradient(145deg, var(--brand-900), var(--brand-700)); box-shadow: 0 12px 30px rgba(76,30,99,.20); }
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(76,30,99,.27); }
.button-full { width: 100%; }

.auth-layout { grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.auth-intro { background: linear-gradient(145deg, var(--brand-950), #120b17); color: white; }
.auth-intro .eyebrow { color: #c8a6dc; }
.auth-intro .lead { color: rgba(255,255,255,.7); }
.security-note { margin-top: 34px; display: grid; grid-template-columns: 42px 1fr; gap: 12px; max-width: 650px; padding: 18px; border-radius: 18px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); }
.security-note > span { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.security-note p { margin: 0; color: rgba(255,255,255,.72); line-height: 1.55; font-size: 14px; }
.form-card { align-self: center; justify-self: center; width: min(470px, calc(100% - 48px)); padding: clamp(28px, 4vw, 44px); border-radius: 26px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.form-header { display: grid; gap: 5px; margin-bottom: 27px; }
.form-card label { display: grid; gap: 8px; margin-bottom: 17px; font-size: 12px; font-weight: 750; color: var(--text-2); }
.form-card input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg); color: var(--text); transition: .18s var(--ease); }
.form-card input:hover { border-color: color-mix(in srgb, var(--brand-600) 32%, var(--border)); }
.form-card input:focus { border-color: var(--brand-600); background: var(--surface); }
.form-card small { color: var(--text-3); font-weight: 500; }
.form-message { min-height: 22px; margin: 14px 0 0; font-size: 12px; color: var(--text-2); }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

.login-shell { grid-template-columns: 1.08fr .92fr; }
.login-visual { background: var(--bg); }
.login-visual p { max-width: 670px; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.login-card { margin: auto; }
.orbit { width: 230px; height: 230px; position: absolute; right: 8%; bottom: 8%; opacity: .55; }
.orbit::before, .orbit::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--border); border-radius: 50%; }
.orbit::after { inset: 40px; }
.orbit span { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-700); }
.orbit span:nth-child(1) { top: 8px; left: 108px; }
.orbit span:nth-child(2) { right: 24px; top: 75px; opacity: .75; }
.orbit span:nth-child(3) { bottom: 30px; left: 49px; opacity: .5; }
.orbit span:nth-child(4) { top: 98px; left: 103px; width: 24px; height: 24px; box-shadow: 0 0 60px color-mix(in srgb, var(--brand-700) 50%, transparent); }

.dashboard-view { display: block; min-height: 100dvh; }
.dashboard-view ~ * {}
#dashboardView { margin-top: 0; min-height: 100dvh; }
#dashboardView .topbar { display: none; }
.sidebar { background: #100b13; color: #ede8f0; border-right: 1px solid rgba(255,255,255,.07); padding: 22px 14px; display: flex; flex-direction: column; position: fixed; z-index: 40; inset: 0 auto 0 0; width: 246px; height: 100dvh; overflow: hidden; box-shadow: 16px 0 40px rgba(16,11,19,.04); }
.sidebar-brand { flex: 0 0 auto; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-brand .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.sidebar-brand strong { font-size: 14px; }
.sidebar nav { flex: 1 1 auto; align-content: start; display: grid; gap: 5px; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 2px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.sidebar nav::-webkit-scrollbar { width: 5px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; }
.nav-item { width: 100%; min-height: 45px; border: 0; background: transparent; color: #a9a0af; border-radius: 12px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; text-align: left; padding: 0 10px; cursor: pointer; transition: .18s var(--ease); }
.nav-item span { font-size: 16px; }
.nav-item b { font-size: 12px; font-weight: 650; }
.nav-item em { font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: #716777; }
.nav-item:hover { background: rgba(255,255,255,.045); color: white; }
.nav-item.active { background: linear-gradient(120deg, rgba(123,48,156,.25), rgba(123,48,156,.08)); color: white; box-shadow: inset 2px 0 0 #9d5cbc; }
.sidebar-footer { flex: 0 0 auto; margin-top: auto; border-top: 1px solid rgba(255,255,255,.07); padding-top: 12px; }
.dashboard-main { min-width: 0; min-height: 100dvh; margin-left: 246px; background: var(--bg); }
.dashboard-topbar { min-height: 100px; padding: 24px 34px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); z-index: 15; }
.dashboard-topbar h1 { font-size: 28px; margin: 5px 0 0; letter-spacing: -.045em; line-height: 1; }
.dashboard-tools { display: flex; gap: 10px; align-items: center; }
.search-button { min-width: 280px; min-height: 44px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); display: flex; align-items: center; gap: 9px; padding: 0 13px; }
.search-button kbd { margin-left: auto; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); border-radius: 7px; padding: 3px 6px; font-size: 10px; }
.content-wrap { padding: 30px 34px 50px; max-width: 1600px; margin: 0 auto; }
.welcome-card { min-height: 220px; border-radius: 28px; padding: 34px; position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; background: linear-gradient(135deg, var(--brand-950), #160d1c 68%, #261330); color: white; box-shadow: var(--shadow); }
.welcome-card::after { content: ""; width: 460px; height: 460px; position: absolute; right: -140px; top: -250px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.02), 0 0 0 120px rgba(255,255,255,.015); }
.welcome-card > div { position: relative; z-index: 1; }
.welcome-card .eyebrow { color: #cbaadd; }
.welcome-card h2 { margin: 10px 0 12px; font-size: 32px; letter-spacing: -.04em; }
.welcome-card p { margin: 0; color: rgba(255,255,255,.66); max-width: 670px; line-height: 1.55; }
.live-indicator { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.05); border-radius: 999px; font-size: 11px; color: rgba(255,255,255,.72); }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #73d7a5; box-shadow: 0 0 0 4px rgba(115,215,165,.10); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 14px 0; }
.metric-card { min-height: 126px; background: var(--surface); border: 1px solid var(--border); border-radius: 19px; padding: 20px; display: grid; align-content: space-between; transition: .18s var(--ease); }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(40,26,48,.06); }
.metric-card span { color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.metric-card strong { font-size: 28px; letter-spacing: -.05em; }
.metric-card small { color: var(--text-2); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .6fr); gap: 14px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 23px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-title > div { display: grid; gap: 5px; }
.panel-title h3 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.roadmap { display: grid; }
.roadmap-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 13px; align-items: center; padding: 15px 0; border-top: 1px solid var(--border); }
.roadmap-row:first-child { border-top: 0; }
.roadmap-row i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--text-3); font-style: normal; font-size: 11px; font-weight: 800; }
.roadmap-row.done i { background: var(--success-soft); color: var(--success); }
.roadmap-row > div { display: grid; gap: 4px; }
.roadmap-row strong { font-size: 13px; }
.roadmap-row span { color: var(--text-2); font-size: 12px; line-height: 1.4; }
.roadmap-row b { color: var(--text-3); font-size: 11px; }
.health-list { display: grid; }
.health-list > div { min-height: 48px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); font-size: 12px; }
.health-list > div:first-child { border-top: 0; }
.health-list span { color: var(--text-2); }
.health-list b { font-size: 11px; }
.health-ok { color: var(--success); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 10px; width: min(370px, calc(100vw - 44px)); }
.toast { border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); border-radius: 16px; padding: 14px 15px; display: grid; grid-template-columns: 34px 1fr; gap: 11px; animation: toastIn .24s var(--ease); }
.toast i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--success-soft); color: var(--success); font-style: normal; font-weight: 900; }
.toast strong { display: block; font-size: 13px; margin-bottom: 3px; }
.toast span { color: var(--text-2); font-size: 12px; line-height: 1.35; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .split-layout, .auth-layout, .login-shell { grid-template-columns: 1fr; }
  .action-panel { border-left: 0; border-top: 1px solid var(--border); min-height: auto; }
  .auth-intro, .login-visual { min-height: 45vh; }
  .form-card { margin: 42px auto; }
  .system-grid { grid-template-columns: 1fr; }
  .dashboard-view { display: block; }
  .sidebar { width: 78px; padding-inline: 10px; }
  .dashboard-main { margin-left: 78px; }
  .sidebar-brand strong, .nav-item b, .nav-item em { display: none; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .search-button { min-width: auto; width: 44px; font-size: 0; padding: 0; justify-content: center; }
  .search-button kbd { display: none; }
}

@media (max-width: 640px) {
  .topbar { height: 68px; padding: 0 16px; }
  .topbar .status-pill { display: none; }
  .main-stage, .view { min-height: calc(100vh - 68px); }
  .hero-panel, .auth-intro, .login-visual { padding: 42px 22px; }
  h1 { font-size: 44px; }
  .action-panel { padding: 34px 22px; }
  .form-card { width: calc(100% - 32px); margin: 25px auto; padding: 25px 20px; }
  .dashboard-view { display: block; padding-bottom: 72px; }
  #dashboardView { margin-top: 0; min-height: 100dvh; }
  .sidebar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: 66px; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid rgba(255,255,255,.09); flex-direction: row; overflow: visible; box-shadow: 0 -12px 34px rgba(16,11,19,.10); }
  .sidebar-brand, .sidebar-footer { display: none; }
  .sidebar nav { width: 100%; grid-template-columns: repeat(4, 1fr); gap: 4px; overflow: visible; padding-right: 0; }
  .sidebar .nav-item:nth-child(n+5) { display: none; }
  .nav-item { min-height: 50px; }
  .nav-item span { font-size: 18px; }
  .dashboard-main { margin-left: 0; }
  .dashboard-topbar { min-height: 82px; padding: 18px; }
  .dashboard-topbar h1 { font-size: 23px; }
  .content-wrap { padding: 18px 16px 36px; }
  .welcome-card { min-height: 250px; padding: 24px; display: grid; align-content: space-between; }
  .welcome-card h2 { font-size: 27px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 112px; padding: 16px; }
  .metric-card strong { font-size: 23px; }
}

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

/* ============================================================
   CleverFox Core v0.2.0 - CRM Comercial
   ============================================================ */
.page-subtitle { margin: 6px 0 0; color: var(--text-2); font-size: 12px; }
.app-section { animation: sectionIn .18s var(--ease); }
@keyframes sectionIn { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.nav-disabled { opacity: .48; cursor: default; }
.nav-disabled:hover { background: transparent; color: #a9a0af; }
.text-button { border: 0; background: none; color: var(--brand-700); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; padding: 8px; }
.crm-hero { min-height: 205px; }
.section-toolbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 20px; }
.section-toolbar h2 { font-size: 30px; letter-spacing: -.045em; margin: 6px 0 7px; }
.section-toolbar p { margin: 0; color: var(--text-2); font-size: 13px; }
.section-actions { display: flex; align-items: center; gap: 9px; }
.compact-select, .drawer-form-row select, .drawer-form input, .drawer-form textarea, .form-grid select, .form-grid input, .form-grid textarea { min-height: 43px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: 0 12px; outline: none; transition: .16s var(--ease); font: inherit; }
.compact-select:focus, .drawer-form-row select:focus, .drawer-form input:focus, .drawer-form textarea:focus, .form-grid select:focus, .form-grid input:focus, .form-grid textarea:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-soft); }
.crm-metrics { margin-top: 0; }
.crm-tabs { display: flex; gap: 5px; padding: 5px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.crm-tabs::-webkit-scrollbar { display: none; }
.crm-tab { white-space: nowrap; min-height: 38px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-weight: 700; font-size: 12px; cursor: pointer; }
.crm-tab span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); font-size: 9px; }
.crm-tab.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.crm-panel { min-height: 420px; }
.list-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 44px; gap: 8px; margin-bottom: 10px; }
.search-field { min-height: 44px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); background: var(--surface); border-radius: 13px; padding: 0 13px; color: var(--text-3); }
.search-field:focus-within { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.lead-list { display: grid; gap: 7px; }
.lead-row { display: grid; grid-template-columns: 44px minmax(170px, 1.15fr) minmax(180px, 1fr) minmax(125px, .7fr) minmax(118px, .65fr) 110px; gap: 13px; align-items: center; min-height: 76px; padding: 10px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; cursor: pointer; transition: .16s var(--ease); outline: none; }
.lead-row:hover, .lead-row:focus-visible { transform: translateY(-1px); border-color: color-mix(in srgb, var(--brand-600) 36%, var(--border)); box-shadow: 0 12px 28px rgba(33,18,42,.055); }
.lead-avatar { width: 39px; height: 39px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); font-size: 13px; font-weight: 850; }
.lead-main, .lead-context, .lead-owner, .lead-time { min-width: 0; display: grid; gap: 5px; }
.lead-main strong, .lead-context strong, .lead-time strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.lead-main span, .lead-context span, .lead-owner small, .lead-time span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 10px; }
.lead-owner .status-pill { width: fit-content; }
.lead-action { display: flex; justify-content: flex-end; color: var(--text-3); }
.button-small { min-height: 34px !important; padding: 0 11px !important; border-radius: 10px !important; font-size: 10px !important; }
.button-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.button-secondary:hover { background: var(--surface-2); }
.status-brand { background: var(--brand-soft); color: var(--brand-700); }
.status-danger { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger); }
.empty-state { min-height: 290px; display: grid; place-items: center; align-content: center; text-align: center; padding: 30px; background: var(--surface); border: 1px dashed var(--border); border-radius: 18px; }
.empty-state > div { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand-700); font-size: 20px; margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 7px; font-size: 16px; }
.empty-state p { margin: 0; max-width: 430px; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.empty-inline { min-height: 94px; display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.empty-inline > span { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.empty-inline p { margin: 0; font-size: 12px; }
.attention-list { display: grid; }
.attention-item { width: 100%; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); display: grid; grid-template-columns: 36px 1fr 24px; align-items: center; gap: 12px; min-height: 74px; text-align: left; cursor: pointer; }
.attention-item:first-child { border-top: 0; }
.attention-item i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); font-style: normal; font-weight: 800; }
.attention-item i.danger-dot { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.attention-item div { display: grid; gap: 3px; }
.attention-item strong { font-size: 12px; }
.attention-item span { color: var(--text-2); font-size: 10px; }
.attention-item b { color: var(--text-3); }
.migration-card { border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border)); background: var(--warning-soft); border-radius: 15px; padding: 17px; display: grid; gap: 6px; }
.migration-card strong { font-size: 13px; color: var(--warning); }
.migration-card span { font-size: 11px; color: var(--text-2); }
.skeleton-stack { width: 100%; display: grid; gap: 8px; }
.skeleton-stack i { height: 74px; border-radius: 16px; background: linear-gradient(90deg, var(--surface) 20%, var(--surface-2) 45%, var(--surface) 70%); background-size: 240% 100%; animation: skeleton 1.2s linear infinite; border: 1px solid var(--border); }
.skeleton-stack.wide { min-width: 800px; }
@keyframes skeleton { to { background-position: -240% 0; } }
.kanban-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(255px, 285px); gap: 10px; overflow-x: auto; padding-bottom: 15px; min-height: 500px; }
.kanban-column { background: var(--surface-2); border: 1px solid var(--border); border-radius: 17px; padding: 9px; align-self: start; }
.kanban-column > header { height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 7px; }
.kanban-column > header > div { display: flex; align-items: center; gap: 8px; }
.kanban-column header strong { font-size: 11px; }
.kanban-column header b { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); font-size: 9px; color: var(--text-2); }
.kanban-dot { width: 7px; height: 7px; border-radius: 50%; display: block; background: var(--text-3); }
.kanban-dot.status-brand { background: var(--brand-600); }
.kanban-dot.status-warning { background: var(--warning); }
.kanban-dot.status-success { background: var(--success); }
.kanban-dot.status-danger { background: var(--danger); }
.kanban-cards { display: grid; gap: 7px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px; cursor: pointer; transition: .16s var(--ease); }
.kanban-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand-600) 30%, var(--border)); box-shadow: 0 10px 25px rgba(25,15,31,.055); }
.kanban-card-top { min-height: 18px; display: flex; align-items: center; justify-content: space-between; }
.kanban-card-top small { color: var(--text-3); font-size: 9px; }
.kanban-card > strong { display: block; margin-top: 9px; font-size: 12px; }
.kanban-card p { margin: 5px 0 12px; color: var(--text-2); font-size: 10px; line-height: 1.4; }
.kanban-card footer { border-top: 1px solid var(--border); padding-top: 9px; display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 9px; }
.kanban-card footer b { color: var(--warning); font-weight: 700; }
.priority { min-height: 18px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: transparent; }
.priority-high { color: var(--warning); }
.priority-urgent { color: var(--danger); }
.kanban-empty { min-height: 70px; display: grid; place-items: center; color: var(--text-3); border: 1px dashed var(--border); border-radius: 12px; font-size: 10px; }
.followup-toolbar { display: flex; }
.segmented-control { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; }
.segmented-control button { border: 0; background: transparent; color: var(--text-2); min-height: 34px; padding: 0 13px; border-radius: 9px; font-size: 10px; font-weight: 750; cursor: pointer; }
.segmented-control button.active { background: var(--surface-2); color: var(--text); }
.followup-row { min-height: 76px; display: grid; grid-template-columns: 145px minmax(170px,.7fr) 1fr auto; gap: 14px; align-items: center; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.followup-time { display: grid; gap: 4px; }
.followup-time strong { font-size: 11px; }
.followup-time span { color: var(--danger); font-size: 9px; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; }
.followup-note { color: var(--text-2); font-size: 11px; line-height: 1.4; }
.followup-actions { display: flex; gap: 6px; }
.source-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 12px; }
.source-header h3 { margin: 0 0 5px; font-size: 16px; }
.source-header p { margin: 0; color: var(--text-2); font-size: 11px; }
.source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.source-card { min-height: 145px; display: grid; grid-template-columns: 46px 1fr; gap: 13px; position: relative; padding: 18px; border: 1px solid var(--border); background: var(--surface); border-radius: 18px; }
.source-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand-700); font-size: 10px; font-weight: 900; }
.source-card > div:nth-child(2) > span { color: var(--text-3); font-size: 9px; text-transform: uppercase; font-weight: 800; }
.source-card h3 { margin: 5px 0; font-size: 14px; }
.source-card p { margin: 0; color: var(--text-2); font-size: 10px; }
.source-key { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; padding-top: 11px; border-top: 1px solid var(--border); min-width: 0; }
.source-key span { font-size: 9px; color: var(--text-3); }
.source-key code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: var(--text-2); }
.source-key button { margin-left: auto; border: 0; background: var(--surface-2); color: var(--text-2); border-radius: 8px; padding: 6px 8px; font-size: 9px; cursor: pointer; }
.span-all { grid-column: 1 / -1; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(5,3,7,.34); backdrop-filter: blur(2px); animation: fadeIn .17s ease; }
.lead-drawer { position: fixed; z-index: 110; right: 0; top: 0; width: min(540px, 100vw); height: 100vh; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -30px 0 80px rgba(10,5,14,.18); display: flex; flex-direction: column; animation: drawerIn .22s var(--ease); }
@keyframes drawerIn { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-header { min-height: 122px; padding: 22px 22px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.drawer-header > div { min-width: 0; }
.drawer-header h2 { margin: 9px 0 5px; font-size: 23px; letter-spacing: -.035em; }
.drawer-header p { margin: 0; color: var(--text-2); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drawer-body { overflow-y: auto; padding: 16px 22px 40px; }
.drawer-section { border-top: 1px solid var(--border); padding: 20px 0; }
.drawer-section:first-of-type { border-top: 0; }
.drawer-section-title { margin-bottom: 12px; }
.drawer-section-title span { font-size: 8px; font-weight: 850; letter-spacing: .09em; color: var(--text-3); text-transform: uppercase; }
.drawer-section-title h3 { margin: 4px 0 0; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-grid > div { min-height: 66px; padding: 11px; background: var(--surface-2); border-radius: 12px; display: grid; align-content: center; gap: 4px; }
.detail-grid span, .answer-list span { color: var(--text-3); font-size: 9px; text-transform: capitalize; }
.detail-grid strong, .answer-list strong { font-size: 11px; line-height: 1.4; word-break: break-word; }
.answer-list { display: grid; gap: 6px; }
.answer-list > div { min-height: 58px; padding: 10px 12px; background: var(--surface-2); border-radius: 11px; display: grid; gap: 5px; }
.drawer-form-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.drawer-form { display: grid; gap: 8px; }
.drawer-form textarea { padding: 11px 12px; resize: vertical; min-height: 72px; }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 9px; position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: 4px; top: 12px; bottom: -2px; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-item > i { width: 9px; height: 9px; border: 2px solid var(--surface); background: var(--brand-600); border-radius: 50%; margin-top: 3px; box-shadow: 0 0 0 2px var(--brand-soft); z-index: 1; }
.timeline-item > div { display: grid; gap: 3px; }
.timeline-item span { color: var(--text-3); font-size: 8px; }
.timeline-item strong { font-size: 11px; }
.timeline-item p { margin: 1px 0; color: var(--text-2); font-size: 10px; line-height: 1.45; }
.timeline-item small { color: var(--text-3); font-size: 8px; }
.muted { color: var(--text-3); font-size: 11px; }

.modal-dialog, .command-dialog { width: min(720px, calc(100vw - 28px)); max-width: none; padding: 0; border: 0; border-radius: 22px; background: transparent; color: var(--text); box-shadow: none; }
.modal-dialog::backdrop, .command-dialog::backdrop { background: rgba(6,3,8,.46); backdrop-filter: blur(5px); }
.modal-card { border: 1px solid var(--border); background: var(--surface); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); animation: modalIn .2s var(--ease); }
@keyframes modalIn { from { opacity: .4; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 21px; }
.modal-head h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.035em; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid label { display: grid; gap: 6px; color: var(--text-2); font-size: 10px; font-weight: 700; }
.form-grid label small { color: var(--text-3); font-weight: 500; }
.form-grid .span-two { grid-column: 1 / -1; }
.checkbox-label { grid-template-columns: 20px 1fr !important; align-items: center; align-self: end; min-height: 43px; }
.checkbox-label input { width: 17px; height: 17px; min-height: auto; accent-color: var(--brand-700); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.soft-note.compact { margin-top: 13px; padding: 12px 14px; min-height: auto; }
.command-dialog { width: min(590px, calc(100vw - 28px)); vertical-align: top; margin-top: 11vh; }
.command-box { border: 1px solid var(--border); background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 90px rgba(7,3,10,.28); }
.command-input { min-height: 62px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 7px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.command-input input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.command-input kbd { border: 1px solid var(--border); background: var(--surface-2); padding: 4px 6px; border-radius: 7px; font-size: 8px; }
.command-list { padding: 8px; display: grid; gap: 3px; }
.command-list button { min-height: 58px; border: 0; background: transparent; color: var(--text); border-radius: 12px; display: grid; grid-template-columns: 36px 1fr; align-items: center; text-align: left; gap: 8px; cursor: pointer; padding: 7px; }
.command-list button:hover { background: var(--surface-2); }
.command-list button > span { width: 34px; height: 34px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); border-radius: 11px; }
.command-list button > div { display: grid; gap: 3px; }
.command-list strong { font-size: 11px; }
.command-list small { color: var(--text-2); font-size: 9px; }

.user-list { display: grid; }
.user-row { min-height: 70px; display: grid; grid-template-columns: 42px 1.2fr 100px 1fr 1fr; gap: 12px; align-items: center; border-top: 1px solid var(--border); padding: 9px 0; }
.user-row:first-child { border-top: 0; }
.user-row > div:not(.lead-avatar) { min-width: 0; display: grid; gap: 4px; }
.user-row strong { font-size: 11px; }
.user-row span, .user-row small { color: var(--text-2); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast-danger i { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.toast-warning i { background: var(--warning-soft); color: var(--warning); }

@media (max-width: 1180px) {
  .lead-row { grid-template-columns: 44px 1fr 1fr 135px 90px; }
  .lead-time { display: none; }
  .source-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .section-actions { width: 100%; }
  .section-actions .compact-select { min-width: 0; flex: 1; }
  .list-toolbar { grid-template-columns: 1fr 44px; }
  .list-toolbar .compact-select { grid-row: 2; grid-column: 1 / -1; }
  .lead-row { grid-template-columns: 42px 1fr auto; }
  .lead-context, .lead-owner small { display: none; }
  .lead-owner { justify-items: end; }
  .lead-action { grid-column: 2 / -1; justify-content: flex-start; }
  .followup-row { grid-template-columns: 120px 1fr; }
  .followup-note { grid-column: 1 / -1; }
  .followup-actions { grid-column: 1 / -1; }
  .user-row { grid-template-columns: 42px 1fr auto; }
  .user-row > div:nth-child(4), .user-row > div:nth-child(5) { display: none; }
}

@media (max-width: 640px) {
  .section-toolbar h2 { font-size: 25px; }
  .section-actions { display: grid; grid-template-columns: 1fr auto; }
  .crm-metrics { grid-template-columns: 1fr 1fr; }
  .crm-tabs { margin-inline: -2px; }
  .lead-row { min-height: 82px; border-radius: 14px; padding: 10px; }
  .lead-owner { grid-column: 3; grid-row: 1; }
  .lead-action { grid-column: 2 / -1; }
  .kanban-board { grid-auto-columns: minmax(82vw, 82vw); }
  .followup-row { grid-template-columns: 1fr; }
  .followup-note, .followup-actions { grid-column: 1; }
  .source-header { align-items: stretch; flex-direction: column; }
  .lead-drawer { width: 100%; }
  .drawer-header { min-height: 106px; padding: 18px; }
  .drawer-body { padding: 12px 18px 34px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.two { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .checkbox-label { grid-column: auto; }
  .modal-card { padding: 18px; border-radius: 18px; }
  .modal-actions { position: sticky; bottom: 0; background: var(--surface); }
  .command-dialog { margin-top: 6vh; }
}
.kanban-card.is-dragging { opacity: .45; transform: rotate(1deg) scale(.99); }
.kanban-column.drag-over { border-color: color-mix(in srgb, var(--brand-600) 55%, var(--border)); box-shadow: inset 0 0 0 2px var(--brand-soft); }

/* V0.3.0 — Contratos + Administrativo */
.status-brand { background: var(--brand-soft); color: var(--brand-700); }
.status-danger { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.contract-list { display: grid; }
.contract-row { width: 100%; min-height: 82px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); display: grid; grid-template-columns: 130px minmax(180px,1.25fr) minmax(150px,.8fr) minmax(130px,.7fr) 155px 24px; gap: 15px; align-items: center; text-align: left; padding: 13px 4px; cursor: pointer; transition: .18s var(--ease); }
.contract-row:first-child { border-top: 0; }
.contract-row:hover { background: var(--surface-2); padding-inline: 12px; border-radius: 14px; }
.contract-row > div { min-width: 0; }
.contract-number, .contract-client, .contract-value, .contract-owner { display: grid; gap: 4px; }
.contract-number span { color: var(--brand-700); font-weight: 850; font-size: 10px; letter-spacing: .03em; }
.contract-row strong { font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.contract-row small, .contract-row div > span:not(.status-pill) { color: var(--text-3); font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.contract-arrow { color: var(--text-3); text-align: right; }
.contract-toolbar { grid-template-columns: minmax(260px,1fr) 210px 44px; }
.contract-modal { width: min(920px, calc(100vw - 28px)); }
.contract-form-scroll { max-height: min(68vh, 720px); overflow-y: auto; padding: 2px 5px 8px 0; scrollbar-width: thin; }
.modal-subtitle { margin: 6px 0 0; color: var(--text-2); font-size: 11px; line-height: 1.45; }
.form-section-label { display: flex; align-items: center; gap: 11px; margin: 24px 0 13px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-section-label:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-section-label > span { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); font-size: 9px; font-weight: 850; }
.form-section-label > div { display: grid; gap: 3px; }
.form-section-label strong { font-size: 12px; }
.form-section-label small { font-size: 9px; color: var(--text-3); }
.form-section-label .text-button { margin-left: auto; }
.contract-service-rows { display: grid; gap: 8px; }
.contract-service-row { display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(120px,.55fr) minmax(120px,.55fr) 44px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; }
.contract-service-row label { margin: 0; display: grid; gap: 5px; font-size: 9px; color: var(--text-2); font-weight: 700; }
.contract-service-row input { background: var(--surface); }
.contract-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.contract-totals > div { min-height: 68px; border-radius: 14px; background: var(--brand-soft); padding: 13px; display: grid; gap: 5px; align-content: center; }
.contract-totals span { color: var(--text-2); font-size: 9px; }
.contract-totals strong { color: var(--brand-700); font-size: 16px; }
.file-drop { position: relative; min-height: 86px; border: 1px dashed color-mix(in srgb, var(--brand-600) 45%, var(--border)); border-radius: 16px; background: var(--brand-soft); display: grid !important; grid-template-columns: 46px 1fr; align-items: center; gap: 12px !important; padding: 16px; cursor: pointer; }
.file-drop > span { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--brand-700); }
.file-drop > div { display: grid; gap: 4px; }
.file-drop strong { color: var(--text); font-size: 11px; }
.file-drop small { color: var(--text-3); font-size: 9px; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.contract-service-summary { display: grid; gap: 7px; }
.contract-service-summary > div { min-height: 58px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.contract-service-summary > div > div { display: grid; gap: 3px; min-width: 0; }
.contract-service-summary strong { font-size: 11px; }
.contract-service-summary span { color: var(--text-3); font-size: 9px; }
.contract-total-bar { margin-top: 8px; padding: 11px 12px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 9px; color: var(--text-2); }
.contract-total-bar strong { display: block; color: var(--text); font-size: 12px; margin-top: 2px; }
.contract-note { background: var(--surface-2); border-radius: 12px; padding: 12px; margin-top: 7px; }
.contract-note span { color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-size: 8px; font-weight: 800; }
.contract-note p { margin: 6px 0 0; font-size: 10px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; }
.document-list { display: grid; gap: 7px; }
.document-row { min-height: 62px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.document-row > div { display: grid; gap: 4px; min-width: 0; }
.document-row > div:last-child { grid-auto-flow: column; align-items: center; }
.document-row strong { font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.document-row span { color: var(--text-3); font-size: 8px; }
.document-row a { text-decoration: none; }
.drawer-actions-stack { display: grid; gap: 8px; }
.admin-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.danger-action { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.contract-handoff p { color: var(--text-2); font-size: 10px; line-height: 1.5; }
.compact-dialog { width: min(560px, calc(100vw - 28px)); }
.dialog-field { display: grid; gap: 7px; color: var(--text-2); font-size: 10px; font-weight: 700; }
.dialog-field textarea { resize: vertical; min-height: 120px; }
.dialog-field small { color: var(--text-3); font-weight: 500; }

@media (max-width: 1100px) {
  .contract-row { grid-template-columns: 120px 1fr 150px 145px 24px; }
  .contract-owner { display: none; }
}
@media (max-width: 820px) {
  .contract-toolbar { grid-template-columns: 1fr 44px; }
  .contract-toolbar .compact-select { grid-row: 2; grid-column: 1 / -1; }
  .contract-row { grid-template-columns: 105px 1fr auto; gap: 9px; }
  .contract-value, .contract-owner { display: none; }
  .contract-arrow { display: none; }
  .contract-service-row { grid-template-columns: 1fr 1fr 44px; }
  .contract-service-row label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .contract-metrics { grid-template-columns: 1fr 1fr; }
  .contract-row { grid-template-columns: 1fr auto; padding: 11px 4px; }
  .contract-number { grid-column: 1 / -1; display: flex; justify-content: space-between; }
  .contract-modal .modal-actions { flex-wrap: wrap; }
  .contract-modal .modal-actions .button { flex: 1; min-width: 130px; }
  .contract-totals { grid-template-columns: 1fr; }
  .contract-service-row { grid-template-columns: 1fr 44px; }
  .contract-service-row label { grid-column: 1 / -1; }
  .contract-service-row .remove-service { grid-column: 2; grid-row: 2; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .document-row { align-items: flex-start; flex-direction: column; }
}

.form-grid textarea { min-height: 92px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
