:root {
  --orange: #63b32e;
  --orange-light: #7cc84a;
  --orange-pale: #eff8e9;
  --ink: #2b3134;
  --ink-soft: #373b3f;
  --bg: #f3f6f1;
  --card: #ffffff;
  --border: #dde5d9;
  --muted: #6f796b;
  --green: #2d9d78;
  --green-pale: #e8f7f1;
  --blue: #3979df;
  --blue-pale: #eaf1ff;
  --purple: #8061d3;
  --purple-pale: #f0ebff;
  --red: #d95050;
  --red-pale: #fff0f0;
  --yellow: #d89218;
  --yellow-pale: #fff6df;
  --sidebar-w: 260px;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(30, 42, 50, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.08fr) minmax(420px, .92fr); background: white; }
.login-art { position: relative; overflow: hidden; display: grid; align-items: center; padding: 8vw; color: white; background: linear-gradient(145deg, #263e20 8%, #4b7935 58%, #373b3f); }
.login-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, black, transparent); }
.login-message { position: relative; z-index: 2; max-width: 610px; }
.login-message h1 { font-size: clamp(46px, 6vw, 82px); line-height: .98; margin: 22px 0 28px; letter-spacing: -.055em; }
.login-message > p:not(.eyebrow) { font-size: 18px; line-height: 1.65; max-width: 540px; color: #c9d2d7; }
.login-feature-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 45px; font-weight: 700; }
.login-feature-row span { border: 1px solid rgba(255,255,255,.18); border-radius: 99px; padding: 10px 15px; background: rgba(255,255,255,.06); backdrop-filter: blur(8px); }
.login-feature-row i { color: var(--orange-light); font-style: normal; }
.orb { position: absolute; border-radius: 50%; filter: blur(3px); opacity: .65; }
.orb-one { width: 360px; height: 360px; right: -80px; top: -90px; background: radial-gradient(circle at 35% 35%, #b7e294, #63b32e 45%, transparent 70%); }
.orb-two { width: 240px; height: 240px; left: -60px; bottom: 2%; background: radial-gradient(circle at 35% 35%, #d8caa8, #a99566 50%, transparent 72%); }
.orb-three { width: 160px; height: 160px; right: 20%; bottom: 8%; background: radial-gradient(circle at 35% 35%, #9bd276, #4b7935 45%, transparent 72%); }
.login-panel { display: grid; place-items: center; padding: 60px; }
.login-card { width: min(430px, 100%); }
.login-card h2 { font-size: 34px; letter-spacing: -.035em; margin: 9px 0; }
.login-card > .muted { margin: 0 0 36px; }
.login-card label { display: grid; gap: 8px; margin: 20px 0; font-weight: 700; }
.login-card input { width: 100%; padding: 15px 16px; border: 1px solid var(--border); border-radius: 12px; outline: none; background: #fafbfc; transition: .2s; }
.login-card input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(99,179,46,.13); background: white; }
.login-card small { display: block; text-align: center; color: var(--muted); margin-top: 24px; }
.password-wrap { display: flex; position: relative; }
.password-wrap .icon-button { position: absolute; right: 8px; top: 7px; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 40px; }
.form-error { min-height: 20px; color: var(--red); font-weight: 650; text-align: center; }
.eyebrow { margin: 0; color: var(--orange); letter-spacing: .16em; font-size: 11px; font-weight: 800; }
.eyebrow.light { color: var(--orange-light); }
.login-logo-surface { width: min(290px, 70vw); padding: 13px 18px 10px; border: 1px solid rgba(255,255,255,.32); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 18px 45px rgba(24,45,18,.22); }
.login-logo-surface img { display: block; width: 100%; height: auto; }
.mobile-brand img { width: 150px; height: auto; }
.mobile-brand strong { color: var(--orange); letter-spacing: .12em; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar-w); display: flex; flex-direction: column; border-right: 1px solid #dce7d8; background: #f5f8f2; color: var(--ink); transition: width .25s ease, transform .25s ease; }
.brand { min-height: 116px; display: flex; align-items: center; justify-content: center; padding: 12px 18px 8px; }
.brand-logo-surface { width: 210px; height: 92px; display: grid; place-items: center; overflow: hidden; border-radius: 15px; background: transparent; transition: width .22s ease, height .22s ease, background .2s; }
.brand-logo-full { display: block; width: auto; height: 84px; max-width: 100%; object-fit: contain; }
.brand-logo-symbol { display: none; width: 38px; height: 38px; object-fit: contain; }
.brand-copy { display: grid; min-width: 0; transition: opacity .18s; }
.brand-copy strong { font-size: 18px; letter-spacing: -.02em; white-space: nowrap; }
.brand-copy small { color: #94a3ab; margin-top: 2px; white-space: nowrap; }
.sidebar-toggle { margin: 0 14px 12px; height: 39px; border: 1px solid #d6e2d1; border-radius: 11px; display: flex; align-items: center; justify-content: space-between; color: #596655; background: #eaf2e6; padding: 0 13px; transition: .2s; }
.sidebar-toggle:hover { border-color: #bbd7ad; background: #e0efd8; color: #355c28; }
.sidebar-toggle b { font-size: 22px; line-height: 1; }
.main-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 24px; scrollbar-width: thin; scrollbar-color: #b8c9b1 transparent; }
.nav-label { margin: 18px 12px 7px; font-size: 9px; letter-spacing: .18em; color: #7a8d74; font-weight: 900; white-space: nowrap; }
.main-nav a, .sidebar-bottom > a { min-height: 45px; display: flex; align-items: center; gap: 13px; padding: 0 12px; border-radius: 12px; color: #596655; margin: 3px 0; transition: .18s; position: relative; }
.main-nav a:hover, .sidebar-bottom > a:hover { background: #ffffff; color: #2f422b; box-shadow: 0 4px 14px rgba(49,78,40,.06); }
.main-nav a.active { color: #315b25; background: linear-gradient(100deg, #dcefd2, #edf7e8); }
.main-nav a.active::before { content: ""; width: 4px; height: 23px; border-radius: 0 5px 5px 0; position: absolute; left: -12px; background: var(--orange); }
.nav-icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; font-size: 18px; font-weight: 500; }
.nav-copy { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .18s; }
.nav-badge { min-width: 19px; height: 19px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 99px; margin-left: auto; background: var(--orange); color: white; font-size: 10px; font-weight: 800; }
.nav-badge:empty { display: none; }
.nav-badge.danger { background: var(--red); }
.sidebar-bottom { flex: 0 0 auto; border-top: 1px solid #dce5d9; padding: 10px 12px 14px; background: rgba(245,248,242,.96); }
.sidebar-theme { width: 100%; min-height: 45px; display: flex; align-items: center; gap: 13px; margin: 0 0 3px; padding: 0 12px; border: 0; border-radius: 12px; color: #596655; background: transparent; text-align: left; transition: .18s; }
.sidebar-theme:hover { color: #2f422b; background: white; }
.theme-switch { width: 35px; height: 20px; position: relative; flex: 0 0 auto; margin-left: auto; border-radius: 99px; background: #cad5c6; transition: .2s; }
.theme-switch i { width: 14px; height: 14px; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(38,60,31,.22); transition: .2s; }
[data-theme="dark"] .theme-switch { background: var(--orange); }
[data-theme="dark"] .theme-switch i { transform: translateX(15px); background: white; }
.user-chip { width: 100%; border: 1px solid #e0e8dd; color: var(--ink); display: flex; align-items: center; gap: 11px; padding: 10px 9px; border-radius: 13px; background: white; text-align: left; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: white; font-weight: 900; flex: 0 0 auto; }
.user-copy { flex: 1; display: grid; min-width: 0; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.sidebar.collapsed { width: 88px; }
.sidebar.collapsed .brand { padding: 15px 0 12px; }
.sidebar.collapsed .brand-logo-surface { width: 48px; height: 48px; border: 1px solid #dce7d8; border-radius: 14px; background: white; }
.sidebar.collapsed .brand-logo-full { display: none; }
.sidebar.collapsed .brand-logo-symbol { display: block; }
.sidebar.collapsed .brand-copy, .sidebar.collapsed .nav-copy, .sidebar.collapsed .nav-label, .sidebar.collapsed .user-copy, .sidebar.collapsed .toggle-copy { opacity: 0; width: 0; pointer-events: none; }
.sidebar.collapsed .theme-switch { display: none; }
.sidebar.collapsed .sidebar-toggle { justify-content: center; }
.sidebar.collapsed .sidebar-toggle b { transform: rotate(180deg); }
.sidebar.collapsed .main-nav a, .sidebar.collapsed .sidebar-bottom > a { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .nav-badge { position: absolute; right: 4px; top: 3px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-w); transition: margin-left .25s ease; }
.sidebar.collapsed + .workspace { margin-left: 88px; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid rgba(223,228,231,.75); background: rgba(242,244,246,.88); backdrop-filter: blur(14px); }
.global-search { width: min(510px, 48vw); position: relative; display: flex; align-items: center; color: var(--muted); }
.global-search > span { position: absolute; left: 15px; font-size: 21px; }
.global-search input { width: 100%; height: 44px; padding: 0 65px 0 45px; border: 1px solid transparent; background: white; border-radius: 13px; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,.025); }
.global-search input:focus { border-color: #9dce7c; box-shadow: 0 0 0 4px rgba(99,179,46,.10); }
kbd { position: absolute; right: 10px; border: 1px solid var(--border); background: #f6f7f8; border-radius: 6px; padding: 3px 6px; font-size: 10px; color: #8a969d; }
.search-results { position: absolute; left: 0; right: 0; top: 51px; background: white; border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); overflow: hidden; }
.search-result { display: flex; gap: 12px; padding: 12px 15px; border-bottom: 1px solid #eef1f2; cursor: pointer; }
.search-result:hover { background: #faf7f3; }
.search-result:last-child { border: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; position: relative; border: 0; border-radius: 11px; background: transparent; color: var(--ink-soft); }
.icon-button:hover { background: #e6eaec; }
.status-dot { position: absolute; width: 8px; height: 8px; right: 7px; top: 7px; border: 2px solid white; border-radius: 50%; background: var(--orange); }
.mobile-menu { display: none; }
.page { padding: 28px 30px 60px; max-width: 1700px; margin: 0 auto; outline: none; }
.loading-page { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--muted); }
.loading-page span { width: 34px; height: 34px; border: 3px solid #e2e6e8; border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; }
.page-title h1 { margin: 4px 0 5px; font-size: clamp(28px, 3vw, 39px); line-height: 1.1; letter-spacing: -.045em; }
.page-title p { margin: 0; color: var(--muted); }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); border-radius: 11px; padding: 0 15px; background: white; color: var(--ink); font-weight: 750; transition: .18s; }
.button:hover { transform: translateY(-1px); border-color: #c9d0d4; box-shadow: 0 5px 14px rgba(25,34,40,.07); }
.button.primary { border-color: var(--orange); background: linear-gradient(135deg, var(--orange-light), var(--orange)); color: white; box-shadow: 0 7px 18px rgba(99,179,46,.24); }
.button.ghost { background: transparent; }
.button.danger { color: var(--red); border-color: #efc8c8; background: var(--red-pale); }
.button.large { min-height: 50px; width: 100%; font-size: 15px; }
.button.compact { min-height: 38px; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.muted { color: var(--muted); }
.subtle { color: #97a1a7; }
.text-orange { color: var(--orange); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.nowrap { white-space: nowrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { min-height: 145px; padding: 20px; position: relative; overflow: hidden; border: 1px solid rgba(223,228,231,.85); border-radius: var(--radius); background: white; box-shadow: 0 3px 14px rgba(25,34,40,.025); }
.kpi::after { content: ""; position: absolute; width: 85px; height: 85px; border-radius: 50%; right: -26px; bottom: -30px; background: var(--tint, var(--orange-pale)); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-weight: 650; }
.kpi-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: var(--accent, var(--orange)); background: var(--tint, var(--orange-pale)); font-size: 18px; }
.kpi strong { display: block; font-size: 36px; letter-spacing: -.05em; margin-top: 14px; }
.kpi small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .7fr); gap: 18px; }
.card { border: 1px solid rgba(223,228,231,.9); border-radius: var(--radius); background: var(--card); box-shadow: 0 3px 15px rgba(23,34,40,.025); }
.card + .card { margin-top: 18px; }
.card-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid #edf0f1; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.card-body { padding: 20px; }
.funnel { display: grid; gap: 13px; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 38px; align-items: center; gap: 14px; }
.funnel-label { font-weight: 650; color: var(--ink-soft); }
.bar-track { height: 12px; border-radius: 99px; background: #edf0f2; overflow: hidden; }
.bar-value { height: 100%; min-width: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--orange-light), var(--orange)); }
.funnel-row:nth-child(2) .bar-value { background: linear-gradient(90deg, #6ca7ff, var(--blue)); }
.funnel-row:nth-child(3) .bar-value { background: linear-gradient(90deg, #a98ded, var(--purple)); }
.funnel-row:nth-child(4) .bar-value { background: linear-gradient(90deg, #6bc5a5, var(--green)); }
.task-list, .activity-feed, .team-list, .mail-list { display: grid; }
.task-row, .feed-row, .team-row, .mail-row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-bottom: 1px solid #eef1f2; }
.task-row:last-child, .feed-row:last-child, .team-row:last-child, .mail-row:last-child { border-bottom: 0; }
.task-check { width: 24px; height: 24px; border: 2px solid #cdd4d8; border-radius: 8px; background: white; flex: 0 0 auto; }
.task-check:hover { border-color: var(--green); background: var(--green-pale); }
.row-copy { min-width: 0; flex: 1; }
.row-copy strong, .row-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-copy small { margin-top: 3px; color: var(--muted); }
.date-pill { padding: 5px 8px; border-radius: 8px; background: #f0f2f3; color: var(--muted); font-size: 11px; white-space: nowrap; }
.date-pill.overdue { background: var(--red-pale); color: var(--red); }
.empty-state { min-height: 200px; display: grid; place-items: center; align-content: center; text-align: center; padding: 30px; color: var(--muted); }
.empty-state .empty-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--orange-pale); color: var(--orange); font-size: 25px; margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 5px; color: var(--ink); }
.empty-state p { margin: 0 0 16px; max-width: 440px; }

.filterbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.filterbar .search-field { min-width: min(300px, 100%); flex: 1; }
.search-field, .select-field { min-height: 42px; border: 1px solid var(--border); border-radius: 11px; background: white; padding: 0 12px; outline: none; color: var(--ink-soft); }
.search-field:focus, .select-field:focus { border-color: #9dce7c; box-shadow: 0 0 0 3px rgba(99,179,46,.10); }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.view-switch button { min-width: 36px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.view-switch button.active { background: var(--ink); color: white; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 99px; background: #f0f2f3; color: var(--ink-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.chip.orange { background: var(--orange-pale); color: #4b7935; }
.chip.green { background: var(--green-pale); color: #207b5c; }
.chip.blue { background: var(--blue-pale); color: #2e64bb; }
.chip.purple { background: var(--purple-pale); color: #6344af; }
.chip.red { background: var(--red-pale); color: var(--red); }
.chip.yellow { background: var(--yellow-pale); color: #a66b08; }
.tag-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 15px; align-items: start; }
.kanban-column { min-height: 460px; padding: 10px; border: 1px solid #e0e5e7; border-radius: 17px; background: #e9edef; }
.kanban-head { display: flex; align-items: center; gap: 9px; padding: 7px 6px 13px; }
.kanban-head strong { flex: 1; }
.stage-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stage-color, var(--orange)); }
.column-count { min-width: 23px; height: 23px; display: grid; place-items: center; border-radius: 99px; background: white; font-size: 11px; font-weight: 800; color: var(--muted); }
.lead-card { padding: 15px; margin-bottom: 9px; border: 1px solid rgba(214,221,224,.9); border-radius: 14px; background: white; box-shadow: 0 2px 5px rgba(23,34,40,.035); cursor: pointer; transition: .18s; }
.lead-card:hover { transform: translateY(-2px); border-color: #f6a666; box-shadow: 0 8px 18px rgba(30,42,50,.08); }
.lead-card-top { display: flex; gap: 9px; justify-content: space-between; align-items: flex-start; }
.lead-card h3 { margin: 0; font-size: 14px; line-height: 1.3; }
.lead-card .contact-name { margin: 5px 0 11px; color: var(--muted); font-size: 12px; }
.lead-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.lead-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 11px; border-top: 1px solid #eff1f2; }
.mini-avatar { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 10px; font-weight: 850; }
.temperature { letter-spacing: -3px; font-size: 12px; }
.temperature.hot { color: var(--red); }.temperature.warm { color: var(--orange); }.temperature.cold { color: var(--blue); }

.data-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: white; }
.data-table { width: 100%; border-collapse: collapse; min-width: 850px; }
.data-table th { padding: 13px 16px; text-align: left; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: #f8f9fa; border-bottom: 1px solid var(--border); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #edf0f1; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background .15s; }
.data-table tbody tr:hover { background: #fffaf6; }
.company-cell { display: flex; align-items: center; gap: 11px; }
.company-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--orange-pale); color: var(--orange); font-weight: 900; }
.company-cell strong, .company-cell small { display: block; }
.company-cell small { color: var(--muted); margin-top: 2px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: -8px 0 12px; border: 1px solid #bfdea9; border-radius: 12px; background: var(--orange-pale); }

.campaign-grid { display: grid; grid-template-columns: repeat(3, minmax(270px, 1fr)); gap: 17px; }
.campaign-card { overflow: hidden; border: 1px solid var(--border); border-radius: 19px; background: white; box-shadow: 0 4px 15px rgba(25,34,40,.035); cursor: pointer; transition: .2s; }
.campaign-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.campaign-stripe { height: 7px; background: var(--campaign-color, var(--orange)); }
.campaign-content { padding: 19px; }
.campaign-top { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.campaign-top h3 { font-size: 18px; margin: 7px 0 5px; letter-spacing: -.025em; }
.campaign-content > p { min-height: 38px; line-height: 1.45; color: var(--muted); }
.campaign-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 17px 0; }
.campaign-stat { padding: 10px; border-radius: 11px; background: #f5f7f8; text-align: center; }
.campaign-stat strong, .campaign-stat small { display: block; }
.campaign-stat strong { font-size: 17px; }.campaign-stat small { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.progress { height: 7px; border-radius: 99px; overflow: hidden; background: #edf0f1; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--campaign-color, var(--orange)); }
.campaign-foot { display: flex; justify-content: space-between; margin-top: 9px; color: var(--muted); font-size: 11px; }

.calendar-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: white; }
.calendar-day-name { padding: 10px; text-align: center; background: #f8f9fa; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.calendar-cell { min-height: 118px; padding: 8px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.outside { background: #fafbfb; color: #b3bcc1; }
.calendar-cell.today .day-number { color: white; background: var(--orange); }
.day-number { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 11px; font-weight: 800; }
.calendar-event { display: block; margin-top: 5px; padding: 5px 6px; border-left: 3px solid var(--event-color,var(--orange)); border-radius: 5px; background: #f6f7f8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; cursor: pointer; }

.document-grid { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 15px; }
.document-card { padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: white; transition: .18s; }
.document-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pdf-icon { width: 45px; height: 52px; display: grid; place-items: center; position: relative; border-radius: 9px; color: white; background: linear-gradient(145deg,#f37469,#d8473b); font-size: 11px; font-weight: 900; }
.pdf-icon::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent rgba(255,255,255,.45) transparent; }
.document-card h3 { margin: 14px 0 5px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-card p { min-height: 35px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.document-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }

.analytics-toolbar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 15px; background: white; }
.analytics-toolbar > div { display: grid; gap: 3px; margin-right: auto; }
.analytics-toolbar > div small { color: var(--muted); }
.analytics-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.analytics-toolbar input { min-height: 38px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfc; color: var(--ink); }
.operator-grid { display: grid; grid-template-columns: repeat(3,minmax(280px,1fr)); gap: 16px; margin-bottom: 18px; }
.operator-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: 0 3px 15px rgba(23,34,40,.025); }
.operator-card > header { display: flex; align-items: center; gap: 11px; }
.operator-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin: 17px 0 13px; }
.operator-metrics span { min-width: 0; padding: 10px 7px; border-radius: 11px; background: #f5f7f4; text-align: center; }
.operator-metrics strong, .operator-metrics small { display: block; }
.operator-metrics strong { font-size: 19px; letter-spacing: -.03em; }
.operator-metrics small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.15; }
.activity-mix { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 10px; }
.activity-mix span { padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; }
.goal-progress { display: grid; grid-template-columns: 1fr 55px; align-items: center; gap: 7px 10px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #edf0f1; }
.goal-progress > div:not(.progress) { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.goal-progress > div:not(.progress) strong { color: var(--ink); }
.goal-progress .progress { grid-column: 1 / -1; margin-top: -4px; }
.no-goal { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #edf0f1; color: var(--muted); font-size: 11px; }
.team-analysis-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 18px; }
.team-analysis-grid .card + .card { margin-top: 0; }
.trend-chart { height: 205px; min-width: 560px; display: flex; align-items: stretch; gap: 5px; padding: 8px 2px 0; overflow: hidden; }
.trend-day { min-width: 12px; flex: 1; display: grid; grid-template-rows: 18px 1fr 24px; align-items: end; justify-items: center; color: var(--muted); }
.trend-day > strong { font-size: 9px; }
.trend-day > small { align-self: center; font-size: 8px; white-space: nowrap; }
.trend-bar { width: min(18px,70%); height: 100%; display: flex; align-items: flex-end; border-radius: 6px 6px 3px 3px; background: #edf1eb; overflow: hidden; }
.trend-bar i { width: 100%; min-height: 3px; display: block; border-radius: inherit; background: linear-gradient(180deg,var(--orange-light),var(--orange)); }
.chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.chart-legend span:first-child { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 700; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--orange); }
.card-body.flush { padding: 0; }
.data-table-wrap.embedded { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.goal-cell { min-width: 130px; display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 8px; }
.goal-cell strong { font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: 230px minmax(0, 760px); gap: 24px; }
.settings-nav { display: grid; align-content: start; gap: 5px; }
.settings-nav button { min-height: 43px; text-align: left; padding: 0 13px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; }
.settings-nav button.active { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(20,30,37,.05); }
.form-card { padding: 23px; }
.form-card h2 { margin: 0 0 6px; font-size: 20px; }
.form-card > p { margin: 0 0 24px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field { display: grid; gap: 7px; align-content: start; }
.field.span-2 { grid-column: span 2; }
.field label, label.field { font-weight: 700; color: var(--ink-soft); }
.field small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; outline: none; background: #fbfcfc; color: var(--ink); }
.field textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #9dce7c; box-shadow: 0 0 0 3px rgba(99,179,46,.10); background: white; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; }
.switch { position: relative; width: 44px; height: 25px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #ccd4d8; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--green); }.switch input:checked + span::after { transform: translateX(19px); }
.section-divider { margin: 24px 0; border: 0; border-top: 1px solid var(--border); }
.info-box { padding: 14px 16px; border-radius: 12px; background: var(--blue-pale); color: #315a9c; line-height: 1.5; }
.warning-box { padding: 14px 16px; border-radius: 12px; background: var(--yellow-pale); color: #8e5e0e; line-height: 1.5; }

.modal { width: min(720px, calc(100vw - 30px)); max-height: calc(100vh - 50px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 28px 90px rgba(16,26,33,.3); overflow: auto; }
.modal::backdrop { background: rgba(17,26,33,.58); backdrop-filter: blur(4px); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 21px 23px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.modal-head h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }.modal-head p { margin: 5px 0 0; color: var(--muted); }
.modal-body { padding: 23px; }.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 17px 23px; border-top: 1px solid var(--border); background: #fafbfb; }
.close-modal { flex: 0 0 auto; }
.drawer { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: white; transform: translateX(105%); transition: transform .27s ease; box-shadow: -20px 0 60px rgba(17,26,33,.18); overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-backdrop { display: none; position: fixed; z-index: 70; inset: 0; background: rgba(17,26,33,.38); }.drawer-backdrop.open { display: block; }
.drawer-head { position: sticky; top: 0; z-index: 3; padding: 20px 22px; color: white; background: linear-gradient(135deg, var(--ink-soft), var(--ink)); }
.drawer-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-head h2 { margin: 7px 0 5px; font-size: 27px; letter-spacing: -.035em; }.drawer-head p { margin: 0; color: #b8c3c9; }
.drawer-head .icon-button { color: white; background: rgba(255,255,255,.08); }
.drawer-tabs { display: flex; gap: 7px; margin-top: 20px; overflow-x: auto; }
.drawer-tabs button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; color: #c7d0d5; background: transparent; white-space: nowrap; }
.drawer-tabs button.active { color: var(--ink); background: white; border-color: white; }
.drawer-body { padding: 22px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.detail-item { padding: 13px; border: 1px solid #edf0f1; border-radius: 11px; background: #fafbfb; }
.detail-item small { display: block; color: var(--muted); margin-bottom: 4px; }.detail-item strong { overflow-wrap: anywhere; }
.timeline { position: relative; padding-left: 27px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 10px; width: 2px; background: #e4e8ea; }
.timeline-item { position: relative; padding: 0 0 19px; }
.timeline-dot { position: absolute; left: -25px; top: 2px; width: 16px; height: 16px; border: 3px solid white; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px #a8d68a; }
.timeline-item h4 { margin: 0 0 3px; }.timeline-item p { margin: 5px 0; color: var(--ink-soft); white-space: pre-wrap; }.timeline-item small { color: var(--muted); }

.toast-stack { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-left: 5px solid var(--green); border-radius: 13px; background: white; box-shadow: var(--shadow); animation: toastin .2s ease; }
.toast.error { border-left-color: var(--red); }.toast strong { display: block; margin-bottom: 3px; }.toast p { margin: 0; color: var(--muted); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf3e9;
  --ink-soft: #dce5d7;
  --bg: #151b16;
  --card: #1e2720;
  --border: #354138;
  --muted: #a2aea0;
  --orange-pale: #263820;
  --green-pale: #19392e;
  --blue-pale: #1b2c47;
  --purple-pale: #2c2444;
  --red-pale: #422222;
  --yellow-pale: #40331b;
  --shadow: 0 14px 38px rgba(0,0,0,.28);
}
html[data-theme="dark"] body,
html[data-theme="dark"] .login-shell,
html[data-theme="dark"] .login-panel { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .sidebar { border-right-color: #34462f; background: linear-gradient(180deg, #293925 0%, #253120 62%, #202a1d 100%); color: white; }
html[data-theme="dark"] .brand-logo-surface { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(9,24,6,.2); }
html[data-theme="dark"] .sidebar-toggle { border-color: rgba(255,255,255,.11); color: #c7d2c3; background: rgba(255,255,255,.05); }
html[data-theme="dark"] .sidebar-toggle:hover { border-color: rgba(255,255,255,.16); color: white; background: rgba(255,255,255,.09); }
html[data-theme="dark"] .main-nav { scrollbar-color: #52634d transparent; }
html[data-theme="dark"] .nav-label { color: #82917e; }
html[data-theme="dark"] .main-nav a,
html[data-theme="dark"] .sidebar-bottom > a,
html[data-theme="dark"] .sidebar-theme { color: #b8c5b5; }
html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .sidebar-bottom > a:hover,
html[data-theme="dark"] .sidebar-theme:hover { color: white; background: rgba(255,255,255,.06); box-shadow: none; }
html[data-theme="dark"] .main-nav a.active { color: white; background: linear-gradient(100deg, rgba(99,179,46,.31), rgba(99,179,46,.09)); }
html[data-theme="dark"] .sidebar-bottom { border-top-color: rgba(255,255,255,.08); background: rgba(32,42,29,.96); }
html[data-theme="dark"] .user-chip { border-color: rgba(255,255,255,.08); color: white; background: rgba(255,255,255,.06); }
html[data-theme="dark"] .user-copy small { color: #9dac99; }
html[data-theme="dark"] .topbar { border-color: rgba(53,65,56,.8); background: rgba(21,27,22,.9); }
html[data-theme="dark"] .global-search input,
html[data-theme="dark"] .search-results,
html[data-theme="dark"] .kpi,
html[data-theme="dark"] .card,
html[data-theme="dark"] .lead-card,
html[data-theme="dark"] .data-table-wrap,
html[data-theme="dark"] .campaign-card,
html[data-theme="dark"] .calendar-grid,
html[data-theme="dark"] .document-card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .button:not(.primary):not(.danger) { background: var(--card); color: var(--ink); }
html[data-theme="dark"] .login-card input,
html[data-theme="dark"] .search-field,
html[data-theme="dark"] .select-field,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea { border-color: var(--border); background: #202922; color: var(--ink); }
html[data-theme="dark"] .login-card input:focus,
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus { background: #253128; }
html[data-theme="dark"] kbd,
html[data-theme="dark"] .date-pill,
html[data-theme="dark"] .campaign-stat,
html[data-theme="dark"] .calendar-event,
html[data-theme="dark"] .detail-item { border-color: var(--border); background: #273029; color: var(--muted); }
html[data-theme="dark"] .search-result,
html[data-theme="dark"] .card-head,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .feed-row,
html[data-theme="dark"] .team-row,
html[data-theme="dark"] .mail-row,
html[data-theme="dark"] .lead-footer,
html[data-theme="dark"] .data-table td,
html[data-theme="dark"] .modal-head,
html[data-theme="dark"] .modal-foot { border-color: var(--border); }
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .data-table tbody tr:hover { background: #263228; }
html[data-theme="dark"] .icon-button:hover { background: #29342b; }
html[data-theme="dark"] .kanban-column { border-color: var(--border); background: #171e19; }
html[data-theme="dark"] .lead-card:hover { border-color: #63b32e; }
html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .calendar-day-name,
html[data-theme="dark"] .modal-foot { background: #19211b; }
html[data-theme="dark"] .calendar-cell { border-color: var(--border); }
html[data-theme="dark"] .calendar-cell.outside { background: #181f1a; color: #697468; }
html[data-theme="dark"] .progress,
html[data-theme="dark"] .bar-track { background: #313c33; }
html[data-theme="dark"] .analytics-toolbar,
html[data-theme="dark"] .operator-card { background: var(--card); }
html[data-theme="dark"] .analytics-toolbar input { border-color: var(--border); background: #202922; color: var(--ink); }
html[data-theme="dark"] .operator-metrics span { background: #273029; }
html[data-theme="dark"] .goal-progress,
html[data-theme="dark"] .no-goal { border-color: var(--border); }
html[data-theme="dark"] .trend-bar { background: #313c33; }
html[data-theme="dark"] .settings-nav button.active { background: var(--card); color: var(--ink); }
html[data-theme="dark"] .modal-head { background: rgba(30,39,32,.96); }
html[data-theme="dark"] .drawer-head { background: linear-gradient(135deg, #4b7935, #263e20); }
html[data-theme="dark"] .timeline::before { background: #3a463d; }
html[data-theme="dark"] .timeline-dot { border-color: var(--card); }
html[data-theme="dark"] .mobile-brand { padding: 10px 14px; border-radius: 14px; background: white; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .campaign-grid { grid-template-columns: repeat(2,1fr); }
  .document-grid { grid-template-columns: repeat(3,1fr); }
  .operator-grid { grid-template-columns: repeat(2,1fr); }
  .team-analysis-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }.login-art { display: none; }.mobile-brand { display: flex; }
  .sidebar, .sidebar.collapsed { width: min(310px, 88vw); transform: translateX(-105%); box-shadow: 20px 0 60px rgba(17,26,33,.22); }
  .sidebar.collapsed .brand { padding: 15px 18px 12px; }
  .sidebar.collapsed .brand-logo-surface { width: 210px; height: 92px; }
  .sidebar.collapsed .brand-logo-full { display: block; }
  .sidebar.collapsed .brand-logo-symbol { display: none; }
  .sidebar.collapsed .nav-copy, .sidebar.collapsed .nav-label, .sidebar.collapsed .user-copy, .sidebar.collapsed .toggle-copy { width: auto; opacity: 1; pointer-events: auto; }
  .sidebar.collapsed .theme-switch { display: block; }
  .sidebar.collapsed .sidebar-toggle { justify-content: space-between; }
  .sidebar.collapsed .sidebar-toggle b { transform: none; }
  .sidebar.collapsed .main-nav a, .sidebar.collapsed .sidebar-bottom > a { justify-content: flex-start; padding-inline: 12px; }
  .sidebar.collapsed .nav-badge { position: static; margin-left: auto; }
  .sidebar.mobile-open { transform: translateX(0); }.workspace, .sidebar.collapsed + .workspace { margin-left: 0; }
  .sidebar-backdrop { display: none; position: fixed; z-index: 35; inset: 0; background: rgba(17,26,33,.4); }.sidebar-backdrop.open { display: block; }
  .mobile-menu { display: inline-grid; }.topbar { padding: 0 16px; }.global-search { flex: 1; width: auto; }.global-search kbd { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }.settings-grid { grid-template-columns: 1fr; }.settings-nav { display: flex; overflow-x: auto; }
  .campaign-grid { grid-template-columns: 1fr 1fr; }.document-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
  .login-panel { padding: 28px 22px; }.login-card h2 { font-size: 29px; }
  .topbar { height: 66px; gap: 7px; }.global-search input { padding-right: 10px; }.top-actions .button span { display: none; }.top-actions { gap: 3px; }
  .page { padding: 20px 14px 40px; }.page-head { align-items: flex-start; flex-direction: column; gap: 15px; }.page-head .head-actions { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.kpi { min-height: 120px; padding: 15px; }.kpi strong { font-size: 29px; }.kpi-top { font-size: 11px; }
  .campaign-grid, .document-grid { grid-template-columns: 1fr; }.form-grid, .detail-grid { grid-template-columns: 1fr; }.field.span-2 { grid-column: auto; }
  .analytics-toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }.analytics-toolbar > div { grid-column: 1 / -1; }.analytics-toolbar .button { width: 100%; }
  .operator-grid { grid-template-columns: 1fr; }.operator-metrics { grid-template-columns: repeat(2,1fr); }
  .team-analysis-grid .card-body { overflow-x: auto; }.chart-legend { min-width: 560px; }
  .modal-body, .drawer-body { padding: 17px; }.modal-head { padding: 17px; }
  .calendar-cell { min-height: 78px; padding: 4px; }.calendar-event { padding: 3px; font-size: 0; }.calendar-event::before { content: "•"; font-size: 14px; }.day-number { width: 22px; height: 22px; }
}
