/* KesiAGV · CRM — Apple-like internos */

:root {
  --blue: #0029bc;
  --blue-600: #0136d6;
  --blue-soft: rgba(0, 41, 188, 0.08);
  --orange: #ffa811;
  --ocre: #b8790c;
  --ocre-light: #ffb01f;
  --kesi-light: #7aa2ff;
  --green: #25d366;
  --red: #e5484d;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #8e8e93;
  --line: #e6e6ea;
  --bg: #f5f5f7;
  --card: #ffffff;
  --radius: 18px;
  --sidebar: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", Arial, sans-serif;
  font-size: 15px; line-height: 1.45; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.028em; font-weight: 650; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
::selection { background: rgba(0, 41, 188, 0.16); }

/* ---------------- logo ---------------- */
.logo-app { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 649; letter-spacing: -0.02em; }
.logo-app em { font-style: normal; color: var(--orange); }
.logo-word { display: inline-flex; gap: 1px; }
.logo-word .l-kesi { color: var(--blue); }
.logo-word .l-agv { color: var(--ocre); }
.logo-app.light .logo-word .l-kesi { color: var(--kesi-light); }
.logo-app.light .logo-word .l-agv { color: var(--ocre-light); }
.logo-k {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, #2b57ff, var(--blue)); color: #fff;
  font-weight: 800; font-size: 15px; box-shadow: 0 4px 12px rgba(0, 41, 188, 0.3);
}
.logo-app.light { color: #fff; }
.logo-app.light em { color: var(--orange); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: 11px; padding: 10px 16px; font-size: 14px; font-weight: 550;
  cursor: pointer; transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  white-space: nowrap;
}
.btn:hover { background: #fafafa; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 17px; height: 17px; stroke-width: 2; }
.btn.primary { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(0, 41, 188, 0.22); }
.btn.primary:hover { background: var(--blue-600); }
.btn.accent { background: var(--orange); color: #241500; border-color: transparent; font-weight: 600; }
.btn.wa { background: #e8f9ee; color: #0d7a3d; border-color: rgba(37, 211, 102, 0.3); }
.btn.danger { color: var(--red); }
.btn.small { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn.full { width: 100%; padding: 13px; font-size: 15px; border-radius: 12px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, 0.05); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }

/* ---------------- login ---------------- */
.login-screen { position: fixed; inset: 0; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; z-index: 200; }
.login-art {
  position: relative; overflow: hidden; display: flex; align-items: center; padding: 64px;
  background: radial-gradient(120% 100% at 15% 10%, #0a2ea8 0%, #001b5e 45%, #000a22 100%); color: #fff;
}
.login-art::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: rgba(255, 168, 17, 0.16); filter: blur(110px); right: -160px; bottom: -160px;
}
.login-art-inner { position: relative; z-index: 2; max-width: 440px; }
.login-art h2 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 650; letter-spacing: -0.04em; line-height: 1.08; margin: 30px 0 18px; }
.login-art h2 span { color: var(--orange); }
.login-art p { color: #a9bbe6; font-size: 16px; max-width: 38ch; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-form { width: min(360px, 100%); }
.login-form .logo-app { margin-bottom: 28px; }
.login-form h1 { font-size: 27px; margin-bottom: 4px; }
.login-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 26px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 0 0 10px; }
.login-back { display: block; text-align: center; margin-top: 22px; font-size: 13px; color: var(--ink-2); }
.login-back:hover { color: var(--ink); }

/* ---------------- fields ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid #d9d9de; border-radius: 11px; padding: 11px 12px; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s; -webkit-appearance: none;
}
.field textarea { resize: vertical; min-height: 84px; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3.5px rgba(0, 41, 188, 0.11); }
.field input:disabled { background: #f5f5f7; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #d9d9de; border-radius: 11px; cursor: pointer; background: #fff; }
.switch input { display: none; }
.switch b { font-weight: 500; font-size: 14px; }
.track { width: 42px; height: 26px; border-radius: 99px; background: #d9d9de; position: relative; transition: background 0.2s; flex: 0 0 auto; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.22s var(--ease); }
.switch input:checked + .track { background: #34c759; }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ---------------- shell ---------------- */
.app-shell { display: flex; height: 100dvh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); height: 100dvh; background: #fff;
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 18px 14px 14px; position: sticky; top: 0;
  transition: width 0.28s var(--ease), flex-basis 0.28s var(--ease), padding 0.24s var(--ease), opacity 0.2s var(--ease);
  overflow: hidden;
}
.app-shell.nav-hidden .sidebar {
  width: 0; flex-basis: 0; padding-left: 0; padding-right: 0;
  border-right-color: transparent; opacity: 0; pointer-events: none;
}
.nav-toggle { flex: 0 0 auto; color: var(--ink-2); }
.nav-toggle:hover { background: rgba(0,0,0,0.06); }
.sidebar-top { padding: 4px 6px 20px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-collapse { width: 30px; height: 30px; border-radius: 9px; color: var(--ink-3); }
.side-collapse svg { width: 17px; height: 17px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: #424245; font-size: 14px; font-weight: 500; transition: background 0.15s, color 0.15s;
}
.side-nav a svg { width: 18px; height: 18px; color: #7c7c82; transition: color 0.15s; }
.side-nav a:hover { background: #f5f5f7; }
.side-nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.side-nav a.active svg { color: var(--blue); }
.nav-count { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.nav-count:empty { display: none; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 9px; flex: 1; padding: 6px; border-radius: 11px; min-width: 0; }
.user-chip:hover { background: #f5f5f7; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: linear-gradient(145deg, #d9e2ff, #b9c9ff); color: var(--blue); font-weight: 700; font-size: 13px;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: 11px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; height: 100dvh; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 14px 28px; display: flex; align-items: center; gap: 20px;
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 21px; letter-spacing: -0.03em; }
.topbar-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box {
  display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 0 10px; height: 36px; width: 250px;
}
.search-box svg { width: 16px; height: 16px; color: var(--ink-3); }
.search-box input { border: 0; outline: none; background: transparent; font: inherit; font-size: 13px; width: 100%; }
.view { padding: 24px 28px 48px; max-width: 1400px; }

/* ---------------- typography helpers ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 19px; }
.page-head p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.section-title { font-size: 15px; font-weight: 600; margin: 26px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12px; color: var(--ink-3); }

/* ---------------- cards / kpi ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 18px 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 118px; }
.kpi-label { font-size: 12px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.kpi-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); display: inline-block; }
.kpi-value { font-size: 27px; font-weight: 650; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-foot { font-size: 11.5px; color: var(--ink-3); margin-top: auto; }
.kpi-foot b { color: #15803d; font-weight: 600; }
.kpi-foot.warn b { color: #b45309; }
.kpi.hero-kpi { background: linear-gradient(150deg, #0029bc, #0a3bd6 60%, #123fc9); border-color: transparent; color: #fff; }
.kpi.hero-kpi .kpi-label, .kpi.hero-kpi .kpi-foot { color: rgba(255, 255, 255, 0.72); }
.kpi.hero-kpi .kpi-foot b { color: #ffd27a; }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; margin-top: 12px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.panel-head h3 { font-size: 14.5px; font-weight: 600; }
.panel-head a, .panel-head button.link { font-size: 12.5px; color: var(--blue); font-weight: 500; background: none; border: 0; cursor: pointer; }

/* funil */
.funnel { display: grid; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 132px 1fr 38px; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel-row span:first-child { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; border-radius: 6px; background: #f0f0f3; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--blue); transition: width 0.5s var(--ease); }
.funnel-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* recent list */
.mini-list { display: grid; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f3; cursor: pointer; }
.mini-item:last-child { border-bottom: 0; }
.mini-item .avatar { width: 30px; height: 30px; font-size: 12px; }
.mini-item .mi-main { min-width: 0; flex: 1; }
.mini-item .mi-main b { display: block; font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-item .mi-main small { font-size: 11.5px; color: var(--ink-3); }
.mini-item .mi-val { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .col i { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #3d6bff, #0029bc); min-height: 3px; transition: height 0.5s var(--ease); }
.chart .col em { font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.chart-empty {
  height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed #dcdce2; border-radius: 13px; background: #fafafc; text-align: center; padding: 12px;
}
.chart-empty span { font-size: 12.5px; color: var(--ink-3); }
.chart-empty a { font-size: 12.5px; color: var(--blue); font-weight: 550; }

/* ---------------- badges / status ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 550; padding: 4px 9px; border-radius: 99px; background: #f0f0f3; color: #424245; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: #e7f9ee; color: #0d7a3d; }
.badge.warn { background: #fff5e5; color: #a35b00; }
.badge.err { background: #fdecec; color: #b42318; }
.badge.info { background: var(--blue-soft); color: var(--blue); }

/* ---------------- toolbar / chips ---------------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 500; color: #424245; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.chip:hover { background: #fafafa; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { font-size: 11px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.toolbar .spacer { flex: 1; }

/* ---------------- table ---------------- */
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3); font-weight: 600; padding: 11px 14px; background: #fafafa;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid #f0f0f3; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: #fafafc; }
td .cell-name { font-weight: 550; }
td .cell-sub { font-size: 11.5px; color: var(--ink-3); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
th.num { text-align: right; }
.lead-avatar { width: 30px; height: 30px; border-radius: 50%; background: #eef1fb; color: var(--blue); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; }
.cell-lead { display: flex; align-items: center; gap: 10px; }

/* mobile cards */
.list-cards { display: none; gap: 10px; }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 14px; cursor: pointer; }
.lead-card .lc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lead-card .lc-top .cell-main { flex: 1; min-width: 0; }
.lead-card .lc-top b { display: block; font-size: 14.5px; font-weight: 600; }
.lead-card .lc-top small { font-size: 11.5px; color: var(--ink-3); }
.lead-card .lc-info { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.lead-card .lc-info span { display: inline-flex; align-items: center; gap: 5px; }
.lead-card .lc-info svg { width: 13px; height: 13px; color: var(--ink-3); }

/* ---------------- kanban ---------------- */
.kanban-wrap { display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 18px; margin: 0 -4px; align-items: flex-start; min-height: 60vh; scroll-snap-type: x mandatory; }
.kcol { flex: 0 0 270px; background: #f0f0f4; border-radius: 15px; padding: 10px; max-height: calc(100dvh - 190px); display: flex; flex-direction: column; scroll-snap-align: start; }
.kcol.drag-over { background: #e4e9ff; box-shadow: inset 0 0 0 2px rgba(0, 41, 188, 0.25); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.kcol-head i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.kcol-head b { font-size: 12.5px; font-weight: 600; }
.kcol-head span.n { font-size: 11px; color: var(--ink-3); background: #fff; border-radius: 99px; padding: 1px 7px; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; padding: 2px; }
.kcard { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); cursor: grab; border: 1px solid transparent; transition: border-color 0.15s, transform 0.12s; }
.kcard:hover { border-color: rgba(0, 41, 188, 0.25); }
.kcard:active { cursor: grabbing; }
.kcard b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.kcard small { font-size: 11.5px; color: var(--ink-3); display: block; }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.kcard .kc-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kcard .kc-wa { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #eafaf0; color: #128a41; }
.kcard .kc-wa svg { width: 14px; height: 14px; }
.kcol-empty { font-size: 11.5px; color: var(--ink-3); text-align: center; padding: 14px 6px; border: 1px dashed #d5d5dc; border-radius: 10px; }

/* ---------------- drawer / sheet / modal ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 90; opacity: 0; transition: opacity 0.25s; }
.overlay.show { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #f5f5f7;
  z-index: 100; display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform 0.32s var(--ease); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.14);
}
.drawer.show { transform: none; }
.drawer-head { padding: 18px 20px 12px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head .dh-main { flex: 1; min-width: 0; }
.drawer-head h2 { font-size: 19px; }
.drawer-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; }
.drawer-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); display: flex; gap: 8px; }

.sheet {
  position: fixed; z-index: 110; background: #fff; box-shadow: 0 -20px 60px rgba(0,0,0,0.18);
  left: 50%; transform: translate(-50%, 20px); bottom: 0; width: min(560px, 100%);
  border-radius: 20px 20px 0 0; max-height: 88dvh; display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transition: transform 0.3s var(--ease), opacity 0.25s;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.sheet-head { padding: 16px 20px 10px; display: flex; align-items: center; gap: 12px; }
.sheet-head h2 { font-size: 17px; flex: 1; }
.sheet-body { padding: 4px 20px 20px; overflow-y: auto; }
.sheet-grab { width: 38px; height: 4px; border-radius: 3px; background: #d9d9de; margin: 8px auto 0; }

/* status picker */
.status-list { display: grid; gap: 4px; }
.status-opt { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-radius: 11px; background: none; border: 0; text-align: left; cursor: pointer; font-size: 14px; width: 100%; }
.status-opt:hover { background: #f5f5f7; }
.status-opt i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.status-opt svg { margin-left: auto; color: var(--blue); }

/* detail blocks */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 12px 13px; }
.detail small { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.detail b { font-size: 13.5px; font-weight: 550; word-break: break-word; }
.detail.full { grid-column: span 2; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.actions-row .btn { flex: 1; min-width: 118px; }
.timeline { display: grid; gap: 0; margin-top: 6px; }
.tl-item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 9px 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin: 6px auto 0; position: relative; }
.tl-item + .tl-item .tl-dot::before { content: ""; position: absolute; bottom: 8px; left: 50%; width: 1px; height: 34px; background: #e0e0e5; transform: translateX(-50%); }
.tl-body b { font-size: 12.5px; font-weight: 550; display: block; }
.tl-body small { font-size: 11px; color: var(--ink-3); }
.tl-body p { margin: 3px 0 0; font-size: 13px; color: #3a3a3d; }

/* ---------------- financeiro ---------------- */
.fin-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.fin-box { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 16px; }
.fin-box small { font-size: 11.5px; color: var(--ink-2); display: block; margin-bottom: 7px; }
.fin-box b { font-size: 21px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fin-box.green b { color: #0d7a3d; }
.fin-box.red b { color: #b42318; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav b { font-size: 14px; min-width: 138px; text-align: center; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.set-card h3 { font-size: 15px; margin-bottom: 4px; }
.set-card > p { margin: 0 0 16px; font-size: 12.5px; color: var(--ink-2); }
.set-card .btn { margin-top: 6px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f3; }
.user-row:last-child { border-bottom: 0; }
.user-row .ur-main { flex: 1; min-width: 0; }
.user-row b { font-size: 13.5px; display: block; }
.user-row small { font-size: 11.5px; color: var(--ink-3); }

/* empty state */
.empty { text-align: center; padding: 56px 20px; }
.empty .e-icon { font-size: 34px; margin-bottom: 12px; opacity: 0.5; }
.empty h3 { font-size: 16px; margin-bottom: 5px; }
.empty p { margin: 0; color: var(--ink-2); font-size: 13px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 300;
  background: #1d1d1f; color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: all 0.28s var(--ease); box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b42318; }

/* tabbar (mobile) */
.tabbar { display: none; }

/* skeleton */
.skel { background: linear-gradient(90deg, #eee 25%, #f6f6f8 50%, #eee 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .fin-totals { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .sidebar { display: none; }
  .nav-toggle { display: none; }
  .main { padding-bottom: calc(66px + env(safe-area-inset-bottom)); height: 100dvh; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-title h1 { font-size: 19px; }
  .topbar-title p { display: none; }
  .topbar-actions .search-box { width: 40px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .topbar-actions .search-box input { display: none; }
  .topbar-actions .search-box.open { position: absolute; left: 16px; right: 16px; top: 10px; width: auto; background: #fff; border: 1px solid var(--line); padding: 0 10px; justify-content: flex-start; z-index: 40; }
  .topbar-actions .search-box.open input { display: block; }
  .view .search-box { width: 100% !important; max-width: 100% !important; height: 40px; }
  .view .search-box input { display: block; font-size: 14px; }
  .toolbar .btn { flex: 0 0 auto; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 9px 11px; }
  .view { padding: 16px 16px 24px; }
  .table-wrap { display: none; }
  .list-cards { display: grid; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .kpi { padding: 14px; min-height: 104px; border-radius: 15px; }
  .kpi-value { font-size: 22px; }
  .kanban-wrap { scroll-snap-type: x mandatory; }
  .kcol { flex: 0 0 82vw; max-height: none; }
  .kcol-body { overflow: visible; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
    background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--ink-3); padding: 4px 0; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--blue); }
  .tabbar a.tab-main svg { color: var(--blue); }
  .drawer { width: 100%; border-radius: 0; }
  .sheet { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail.full { grid-column: span 1; }
  .toast { bottom: 84px; }
  .sheet .status-list { max-height: 60dvh; overflow-y: auto; }
}
@media (min-width: 901px) {
  .sheet { width: min(520px, 92vw); bottom: auto; top: 50%; left: 50%; border-radius: 20px; transform: translate(-50%, -46%) scale(0.98); box-shadow: 0 30px 90px rgba(0,0,0,0.24); }
  .sheet.show { transform: translate(-50%, -50%) scale(1); }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 20px; }
}
@media (max-width: 900px) {
  .funnel-row { grid-template-columns: minmax(96px, 1.1fr) 1fr 28px; gap: 8px; font-size: 12px; }
  .funnel-row span:first-child { white-space: normal; line-height: 1.25; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 20px; }
}
