@font-face {
    font-family: "Degular";
    src: url("../fonts/Degular-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Degular";
    src: url("../fonts/Degular-Semibold.woff2") format("woff2");
    font-weight: 600 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #181818;
    --panel: #262626;
    --panel-2: #2d2d2d;
    --panel-3: #323232;
    --text: #f5f5f3;
    --muted: #a5a5a0;
    --line: rgba(255,255,255,.09);
    --accent: #95fe01;
    --accent-dark: #76cc00;
    --danger: #ff6b6b;
    --warning: #ffc857;
    --radius: 18px;
    --shadow: 0 18px 55px rgba(0,0,0,.22);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font-family: "Degular", Inter, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 17px; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 20px; background: #111; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; }
.sidebar-brand { display: block; padding: 3px 8px 30px; }
.sidebar-brand img { width: 164px; max-width: 100%; display: block; }
.sidebar-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: #bdbdb8; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.045); color: white; }
.nav-item.active { background: rgba(149,254,1,.11); color: white; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; }
.nav-item.active .nav-dot { background: var(--accent); box-shadow: 0 0 0 5px rgba(149,254,1,.08); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 13px; }
.admin-mini { display: flex; align-items: center; gap: 11px; min-width: 0; }
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #111; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.admin-mini div { min-width: 0; }
.admin-mini strong, .admin-mini span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-mini strong { font-size: 15px; }
.admin-mini span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.logout-link { color: var(--muted); text-decoration: none; font-size: 14px; padding-left: 47px; }
.logout-link:hover { color: white; }

.main-content { min-width: 0; }
.topbar { min-height: 104px; padding: 24px clamp(22px, 4vw, 52px) 18px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(24,24,24,.92); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { margin: 1px 0 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.03em; line-height: 1; }
.topbar-kicker { color: var(--accent); text-transform: uppercase; font-size: 12px; letter-spacing: .14em; font-weight: 700; }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: white; }
.content-wrap { padding: 30px clamp(22px, 4vw, 52px) 60px; max-width: 1650px; margin: 0 auto; }

.panel, .toolbar-card, .metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.toolbar-card { padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.toolbar-card strong { font-size: 20px; }
.section-kicker { margin: 0 0 4px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.period-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
select, input { width: 100%; border: 1px solid rgba(255,255,255,.12); background: #1d1d1d; color: var(--text); border-radius: 11px; padding: 11px 12px; outline: none; transition: .15s ease; }
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(149,254,1,.08); }
.period-form select { width: auto; min-width: 150px; }
.custom-dates { display: none; align-items: center; gap: 8px; }
.custom-dates.visible { display: flex; }
.custom-dates input { width: auto; }
.custom-dates span { color: var(--muted); }

.primary-button, .secondary-button, .ghost-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border-radius: 11px; padding: 10px 15px; font-weight: 700; cursor: pointer; transition: .15s ease; border: 1px solid transparent; }
.primary-button { background: var(--accent); color: #111; }
.primary-button:hover { background: #a6ff2c; transform: translateY(-1px); }
.secondary-button { background: rgba(255,255,255,.055); color: white; border-color: var(--line); }
.secondary-button:hover { background: rgba(255,255,255,.09); }
.ghost-button { background: transparent; color: var(--muted); border-color: var(--line); }
.ghost-button:hover { color: white; }
.full { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric-card { min-height: 155px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.metric-card.accent::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(149,254,1,.14); filter: blur(4px); right: -45px; top: -44px; }
.metric-label { color: var(--muted); font-size: 15px; }
.metric-card strong { font-size: clamp(38px, 4vw, 54px); line-height: .95; letter-spacing: -.04em; }
.metric-card.accent strong { color: var(--accent); }
.metric-card small { color: #c7c7c3; font-size: 14px; }

.dashboard-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.dashboard-grid.two-one { grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr); }
.dashboard-grid.half-half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 21px; min-width: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-head h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.views { background: rgba(255,255,255,.42); }
.legend-dot.starts { background: #b9b9b9; }
.legend-dot.submits { background: var(--accent); }
.chart-wrap { height: 310px; position: relative; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.empty-chart { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

.funnel { display: grid; gap: 20px; }
.funnel-row { display: grid; gap: 7px; }
.funnel-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.funnel-label span { color: #d3d3ce; }
.funnel-label strong { font-size: 21px; }
.funnel-track, .bar-track { height: 9px; border-radius: 999px; background: #171717; overflow: hidden; }
.funnel-track span, .bar-track span { height: 100%; display: block; border-radius: inherit; background: var(--accent); min-width: 2px; }
.funnel-stats { margin-top: 25px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.funnel-stats div { background: rgba(255,255,255,.035); padding: 13px; border-radius: 12px; }
.funnel-stats span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.funnel-stats strong { font-size: 23px; }

.bar-list { display: grid; gap: 16px; }
.bar-row { display: grid; gap: 7px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; color: #d7d7d3; font-size: 15px; }
.bar-label strong { color: white; }
.neutral-bars .bar-track span { background: #767676; }

.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-head { padding: 21px 21px 0; }
.table-head { align-items: center; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 14px 18px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .07em; font-weight: 700; background: rgba(255,255,255,.015); }
td { font-size: 15px; color: #dfdfdc; }
.clickable-row { cursor: pointer; transition: .12s ease; }
.clickable-row:hover { background: rgba(255,255,255,.035); }
.status-pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-pill.submitted { background: rgba(149,254,1,.12); color: var(--accent); border: 1px solid rgba(149,254,1,.22); }
.status-pill.partial { background: rgba(255,200,87,.10); color: var(--warning); border: 1px solid rgba(255,200,87,.2); }
.empty-cell, .empty-state { color: var(--muted); text-align: center; padding: 34px 18px; }

.filters-panel { margin-bottom: 16px; }
.filter-grid { display: grid; grid-template-columns: minmax(250px, 2fr) repeat(3, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; }
.filter-grid label > span, .settings-form label > span { display: block; color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.filter-actions { display: flex; gap: 8px; }
.filter-custom { grid-column: 1 / -1; justify-content: flex-start; }
.filter-custom label { min-width: 190px; }
.pagination { padding: 17px 20px; border-top: 1px solid var(--line); display: flex; justify-content: center; align-items: center; gap: 18px; color: var(--muted); }
.pagination a { text-decoration: none; color: white; }

.detail-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.back-link { color: var(--muted); text-decoration: none; }
.back-link:hover { color: white; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 16px; margin-bottom: 16px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.detail-list div { background: #232323; padding: 15px; min-width: 0; }
.detail-list span, .detail-list strong { display: block; }
.detail-list span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.detail-list strong { font-size: 16px; font-weight: 600; }
.detail-list.compact { grid-template-columns: 1fr; }
.lead-actions { display: flex; gap: 9px; margin-top: 17px; flex-wrap: wrap; }
.break-text { overflow-wrap: anywhere; word-break: break-word; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 11px; padding: 0 0 24px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); margin-top: 5px; box-shadow: 0 0 0 4px rgba(149,254,1,.08); }
.timeline-item strong, .timeline-item span, .timeline-item small { display: block; }
.timeline-item span { color: var(--muted); font-size: 14px; margin-top: 2px; }
.timeline-item small { color: #777; margin-top: 5px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .55fr); gap: 16px; }
.settings-form { display: grid; gap: 13px; }
.settings-form .primary-button { justify-self: start; margin-top: 4px; }
.alert { border-radius: 11px; padding: 11px 13px; margin: 0 0 14px; font-size: 15px; }
.alert.error { background: rgba(255,107,107,.09); border: 1px solid rgba(255,107,107,.25); color: #ff9b9b; }
.alert.success { background: rgba(149,254,1,.09); border: 1px solid rgba(149,254,1,.2); color: #b5ff52; }

.auth-body { min-height: 100vh; background: radial-gradient(circle at 75% 20%, rgba(149,254,1,.08), transparent 26%), #171717; }
.auth-shell { min-height: 100vh; padding: 24px; display: grid; place-items: center; }
.auth-card { width: min(470px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(25px, 5vw, 38px); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-brand img { width: 175px; max-width: 70%; display: block; margin-bottom: 33px; }
.auth-card h1 { margin: 5px 0 9px; font-size: clamp(31px, 6vw, 42px); line-height: .98; letter-spacing: -.04em; }
.auth-intro { margin: 0 0 24px; color: var(--muted); line-height: 1.4; }
.auth-form { display: grid; gap: 14px; }
.auth-form label span { display: block; margin-bottom: 6px; color: #cfcfcb; font-size: 14px; }
.auth-form .primary-button { margin-top: 4px; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-weight: 800; letter-spacing: .12em; font-size: 12px; margin: 0; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid.two-one, .detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-search { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: min(285px, 88vw); transform: translateX(-102%); transition: .2s ease; box-shadow: 25px 0 70px rgba(0,0,0,.45); }
    .sidebar.open { transform: translateX(0); }
    .menu-button { display: grid; place-items: center; }
    .topbar { min-height: 86px; padding: 17px 18px; }
    .content-wrap { padding: 20px 16px 45px; }
    .toolbar-card { align-items: flex-start; flex-direction: column; }
    .period-form { width: 100%; justify-content: flex-start; }
    .dashboard-grid.half-half { grid-template-columns: 1fr; }
    .chart-panel .panel-head { flex-direction: column; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { min-height: 135px; padding: 16px; }
    .metric-card strong { font-size: 37px; }
    .metric-card small { font-size: 12px; }
    .panel { padding: 17px; }
    .chart-wrap { height: 260px; }
    .filter-grid { grid-template-columns: 1fr; }
    .filter-search, .filter-custom { grid-column: auto; }
    .filter-custom.visible { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .filter-custom label { min-width: 0; }
    .filter-actions { width: 100%; }
    .filter-actions > * { flex: 1; }
    .custom-dates.visible { width: 100%; flex-wrap: wrap; }
    .custom-dates input { width: calc(50% - 18px); }
    .detail-list { grid-template-columns: 1fr; }
    .funnel-stats { grid-template-columns: 1fr; }
    .auth-shell { padding: 14px; }
    .auth-card { border-radius: 18px; padding: 23px; }
}
