/* =========================================================
   Sprint Sales — Glass theme
   Loaded after app.css. Floating sidebar, frosted cards,
   soft gradient backdrop, floating mobile navigation.
   ========================================================= */
:root {
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-soft: rgba(255, 255, 255, .38);
  --glass-line: rgba(255, 255, 255, .75);
  --hair: rgba(17, 28, 84, .08);
  --blur: saturate(160%) blur(18px);
  --blur-lg: saturate(180%) blur(28px);
  --glass-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 12px 32px -14px rgba(23, 33, 94, .22);
  --float-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 24px 60px -20px rgba(23, 33, 94, .35);
  --radius: 20px;
  --line: rgba(17, 28, 84, .09);
  --line-2: rgba(17, 28, 84, .05);
  --bg: #EEF1FA;
  --side: 248px;
  --gap: 18px;
}

/* ---------- Backdrop ---------- */
html { background: var(--bg); }
body {
  background:
    radial-gradient(900px 620px at -8% -12%, rgba(18, 48, 245, .20), transparent 62%),
    radial-gradient(760px 560px at 108% 4%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(820px 600px at 70% 112%, rgba(14, 165, 233, .14), transparent 60%),
    radial-gradient(600px 480px at 20% 95%, rgba(236, 72, 153, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before { /* fine grain so the glass reads as glass */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: radial-gradient(rgba(17,28,84,.06) .6px, transparent .7px);
  background-size: 3px 3px;
}
.shell { position: relative; z-index: 1; }

/* ---------- Floating sidebar ---------- */
.sidebar {
  inset: var(--gap) auto var(--gap) var(--gap);
  width: var(--side);
  border: 1px solid var(--glass-line);
  border-radius: 26px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur-lg); backdrop-filter: var(--blur-lg);
  box-shadow: var(--float-shadow);
  padding: 20px 14px 14px;
}
.brand { padding: 2px 10px 18px; }
.brand img { height: 42px; }
.side-ctas { gap: 8px; margin-bottom: 20px; }
.side-nav { gap: 4px; }
.side-nav a { padding: 11px 14px; border-radius: 14px; color: #475070; font-weight: 600; position: relative; }
.side-nav a:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.side-nav a.active {
  background: linear-gradient(135deg, #1230F5 0%, #4A5CFF 100%);
  color: #fff;
  box-shadow: 0 10px 22px -8px rgba(18, 48, 245, .6), 0 1px 0 rgba(255,255,255,.25) inset;
}
.side-foot {
  border-top: 0; margin: auto -2px 0; padding: 10px; border-radius: 18px;
  background: rgba(255,255,255,.6); border: 1px solid var(--glass-line);
}
.main { margin-left: calc(var(--side) + var(--gap) * 2); padding: 34px 36px 60px 18px; }

/* ---------- Surfaces ---------- */
.card, .stat, .client-card, .no-chip, .summary-strip > div, .pipe-stats > *, .auth-card {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow);
}
.card { border-radius: var(--radius); }
.card-head { padding: 20px 22px 0; }
.card-head h2 { font-size: 15.5px; letter-spacing: -.01em; }

/* stat tiles */
.stats { gap: 16px; }
.stat { border-radius: var(--radius); padding: 20px 22px; }
.stat-top { font-size: 12.5px; }
.stat-top .ic { opacity: .55; }
.stat-hero {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.22) 0%, transparent 42%),
    linear-gradient(140deg, #3F55FF 0%, #1230F5 45%, #0A1CB0 100%);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 24px 50px -22px rgba(18, 48, 245, .75), 0 1px 0 rgba(255,255,255,.35) inset;
}
.stat-hero .stat-top .ic { opacity: .9; }
.stat-hero::after { background: rgba(255,255,255,.08); width: 220px; height: 220px; right: -60px; bottom: -90px; }

/* summary & pipeline strips become separate floating tiles */
.summary-strip, .pipe-stats { background: transparent; border: 0; gap: 14px; overflow: visible; }
.summary-strip > div, .pipe-stats > * { border-radius: 18px; }
.pipe-stats a.alert { background: rgba(255, 237, 222, .72); }

/* lists & tables */
.list-row { border-radius: 14px; }
.list-row + .list-row { border-top-color: var(--line-2); }
.list-row:hover { background: rgba(255,255,255,.7); }
.table th { background: transparent; border-bottom: 1px solid var(--line); color: #7A819C; }
.table td { border-bottom-color: var(--line-2); }
.table tbody tr:hover td { background: rgba(255,255,255,.55); }
.pager { border-top-color: var(--line); }
.no-badge { background: rgba(18,48,245,.09); }
.avatar { box-shadow: 0 6px 14px -6px rgba(18,48,245,.6); }

/* ---------- Controls ---------- */
input, select, textarea {
  background-color: rgba(255,255,255,.72);
  border-color: rgba(17, 28, 84, .12);
}
input:hover, select:hover, textarea:hover { border-color: rgba(17, 28, 84, .2); }
input:focus, select:focus, textarea:focus { background-color: #fff; }
input:disabled { background: rgba(255,255,255,.4); }
.search { background: rgba(255,255,255,.6); border-color: rgba(17,28,84,.1); }
.filters.card { padding: 10px; }

.btn { border-radius: 13px; }
.btn-primary {
  background: linear-gradient(135deg, #2A44FF 0%, #1230F5 55%, #0E26D0 100%);
  box-shadow: 0 12px 24px -10px rgba(18, 48, 245, .7), 0 1px 0 rgba(255,255,255,.25) inset;
}
.btn-primary:hover { background: linear-gradient(135deg, #3A52FF 0%, #1A37F7 55%, #0E26D0 100%); }
.btn-ghost { background: rgba(255,255,255,.65); border-color: var(--glass-line); box-shadow: 0 4px 14px -8px rgba(23,33,94,.25); }
.btn-ghost:hover { background: #fff; border-color: rgba(17,28,84,.1); }
.btn-soft { background: rgba(18,48,245,.09); }
.btn-soft:hover { background: rgba(18,48,245,.15); }
.btn-dark { background: linear-gradient(135deg, #1B2240, #0B1023); box-shadow: 0 10px 20px -10px rgba(11,16,35,.6); }
.icon-btn:hover { background: rgba(255,255,255,.75); }

/* ---------- Feedback ---------- */
.flash {
  background: var(--glass-strong); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-shadow); border-left: 4px solid currentColor; border-radius: 14px;
}
.flash-success { color: #05603A; }
.flash-error { color: #A1191F; }
.flash-info { color: var(--brand-600); }
.note.warn { background: rgba(255, 246, 229, .8); }

dialog.modal {
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: var(--blur-lg); backdrop-filter: var(--blur-lg);
  border: 1px solid var(--glass-line); border-radius: 24px; box-shadow: var(--float-shadow);
}
dialog.modal::backdrop { background: rgba(14, 20, 50, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.empty-ic { background: rgba(18,48,245,.09); }

/* ---------- Sale form & details ---------- */
.words { background: rgba(18,48,245,.07); border: 1px solid rgba(18,48,245,.08); }
.item-row { border-radius: 14px; }
.totals .grand { border-top-color: var(--line); }
.cc-stats { background: rgba(255,255,255,.55); border: 1px solid var(--glass-line); }
.client-card { border-radius: var(--radius); }
.client-card:hover { background: rgba(255,255,255,.78); border-color: #fff; }
.no-chip { border-radius: 16px; }
.sticky-save .btn { box-shadow: 0 18px 36px -14px rgba(18,48,245,.75); }
.logo-preview { background: rgba(255,255,255,.7); }

/* ---------- Dashboard bits ---------- */
.bar-track { background: rgba(17,28,84,.05); }
.bar { background: rgba(18,48,245,.18); }
.bar-col.current .bar { background: linear-gradient(180deg, #4A5CFF, #1230F5); box-shadow: 0 10px 20px -10px rgba(18,48,245,.7); }
.pm-track { background: rgba(17,28,84,.06); }
.rank li + li { border-top-color: var(--line-2); }
.nofu { background: rgba(255, 246, 229, .75); }

/* ---------- Pipeline ---------- */
.col {
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.6);
  border-top: 3px solid var(--c);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: 20px;
}
.col-won, .col-lost { background: rgba(255,255,255,.24); }
.col-title .count { background: rgba(255,255,255,.85); }
.deal { background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.95); border-radius: 14px; box-shadow: 0 6px 16px -10px rgba(23,33,94,.35); }
.deal:hover { background: #fff; border-color: rgba(18,48,245,.18); }
.col-empty { border-color: rgba(17,28,84,.14); }
.col-add:hover { background: rgba(255,255,255,.7); }
.stepper.card { padding: 8px; }
.step:hover:not(:disabled) { background: rgba(255,255,255,.7); }
.step-end { border-left-color: var(--line); }
.fu-head { background: rgba(18,48,245,.07); }
.fu-card-overdue .fu-head { background: rgba(224, 53, 59, .08); }
.fu-card-today .fu-head { background: rgba(249, 115, 22, .09); }
.fu-card-none .fu-head { background: rgba(217, 154, 30, .1); }
.fu-ic { box-shadow: 0 10px 20px -8px currentColor; }
.act-form { border-bottom-color: var(--line-2); }
.type-chips span { background: rgba(255,255,255,.7); border: 1px solid var(--glass-line); }
.quick-dates button { background: rgba(255,255,255,.75); border-color: rgba(17,28,84,.1); }
.tl-ic { background: rgba(255,255,255,.8); border: 1px solid var(--glass-line); }
.reason span { background: rgba(255,255,255,.6); }

/* mobile create menu */
.fab-menu {
  background: rgba(255,255,255,.86); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--blur-lg); backdrop-filter: var(--blur-lg); border-radius: 22px;
}

/* ---------- Auth ---------- */
.auth-body { background: transparent; }
.auth-card { border-radius: 28px; background: rgba(255,255,255,.66); box-shadow: var(--float-shadow); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .topbar {
    position: sticky; top: 10px; margin: 10px 12px 0; border-radius: 20px; padding: 8px 10px 8px 14px;
    background: rgba(255,255,255,.72); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: var(--blur-lg); backdrop-filter: var(--blur-lg); box-shadow: var(--glass-shadow);
  }
  .main { margin-left: 0; padding: 20px 16px calc(120px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    border-radius: 24px; padding: 6px;
    background: rgba(255,255,255,.78); border: 1px solid var(--glass-line);
    -webkit-backdrop-filter: var(--blur-lg); backdrop-filter: var(--blur-lg); box-shadow: var(--float-shadow);
  }
  .bottom-nav a { border-radius: 16px; padding: 7px 0; }
  .bottom-nav a.on { background: rgba(18,48,245,.09); }
  .bottom-nav .fab {
    margin: -26px auto 0; border-radius: 20px;
    background: linear-gradient(135deg, #3F55FF, #1230F5 60%, #0E26D0);
    box-shadow: 0 14px 28px -10px rgba(18,48,245,.8), 0 0 0 5px rgba(238,241,250,.9);
  }
  .fab-menu { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .board { margin: 0 -16px; }
}

@media (max-width: 720px) {
  .stats, .stats.three { gap: 12px; }
  .summary-strip, .pipe-stats { gap: 10px; }
  .card { border-radius: 18px; }
  .mobile-total {
    left: 12px; right: 12px; border-radius: 18px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    background: rgba(11, 16, 35, .86);
    -webkit-backdrop-filter: var(--blur-lg); backdrop-filter: var(--blur-lg);
    box-shadow: 0 18px 40px -16px rgba(11,16,35,.6);
  }
  .sale-form { padding-bottom: 90px; }
  .table.responsive tr { border-bottom-color: var(--line-2); }
  .item-row { background: rgba(255,255,255,.55); border: 1px solid var(--glass-line); }
}

/* Browsers without backdrop-filter: make glass a bit more solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .stat, .client-card, .sidebar, .topbar, .bottom-nav, .col, dialog.modal { background: rgba(255,255,255,.94); }
}

/* ---------- Refinements ---------- */
.item-head, .item-row { grid-template-columns: minmax(0, 1fr) 92px 64px 118px 108px 34px; gap: 8px; }
@media (max-width: 1180px) {
  .item-head, .item-row { grid-template-columns: minmax(0, 1fr) 84px 56px 106px 96px 34px; }
}
@media (max-width: 960px) {
  .bottom-nav, .topbar { background: rgba(255,255,255,.95); }
}
@media (max-width: 720px) {
  .item-head, .item-row { grid-template-columns: 1fr .7fr 1.4fr; gap: 10px; }
  .stats:not(.three) { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stats:not(.three) .stat:not(.stat-hero) { padding: 12px; border-radius: 16px; }
  .stats:not(.three) .stat:not(.stat-hero) .stat-top .ic { display: none; }
  .stats:not(.three) .stat:not(.stat-hero) .stat-top { font-size: 11.5px; }
  .stats:not(.three) .stat:not(.stat-hero) .stat-val { font-size: 17px; margin: 6px 0 2px; }
  .stats:not(.three) .stat:not(.stat-hero) .stat-val small { font-size: 10px; }
  .stats:not(.three) .stat:not(.stat-hero) .stat-sub { font-size: 11px; line-height: 1.3; }
  .stats.three { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   To-dos
   ========================================================= */
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--bad); color: #fff; }
.side-nav a.active .nav-badge { background: #fff; color: var(--brand); }
.has-dot { position: relative; }
.dot-badge { position: absolute; top: 2px; right: 1px; font-style: normal; font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; background: var(--bad); color: #fff; }
.fm-ic.todo { background: var(--ok-50); color: var(--ok); }

/* quick add */
.todo-quick { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.75); border: 1px solid rgba(17,28,84,.1); border-radius: 16px; padding: 6px 6px 6px 12px; transition: box-shadow .15s, border-color .15s; }
.todo-quick:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(18,48,245,.12); background: #fff; }
.todo-quick .tq-ic { color: var(--brand); display: grid; }
.todo-quick input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 4px; height: 40px; }
.todo-quick input[name=title] { flex: 1; min-width: 0; font-weight: 600; }
.todo-quick input[type=date] { width: 150px; flex: none; color: var(--ink-2); font-size: 14px; }
.todo-quick .btn { height: 40px; padding: 0 16px; }
.todo-hero { padding: 16px; }
.todo-hero .todo-quick { padding: 8px 8px 8px 14px; }
.todo-hero .todo-quick input[name=title] { font-size: 16px; }
.tq-dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tq-dates button { font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(17,28,84,.1); background: rgba(255,255,255,.7); color: var(--ink-2); cursor: pointer; }
.tq-dates button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.today-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--ink-2); }
.tp-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(17,28,84,.07); overflow: hidden; }
.tp-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22C55E, #0E9F6E); }

/* segmented tabs */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.55); border: 1px solid var(--glass-line); margin-bottom: 16px; }
.seg a { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.seg a em { font-style: normal; font-size: 12px; background: rgba(17,28,84,.07); padding: 0 7px; border-radius: 99px; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -6px rgba(23,33,94,.3); }

/* groups & items */
.tg-count { font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(17,28,84,.06); padding: 1px 8px; border-radius: 99px; }
.tg-overdue h2 { color: var(--bad); }
.tg-today h2 { color: #C2410C; }
.todo-list { list-style: none; margin: 0; padding: 8px 10px 10px; }
.todo { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: 14px; transition: background .15s; }
.todo + .todo { border-top: 1px solid var(--line-2); }
.todo:hover { background: rgba(255,255,255,.7); }
.todo-check { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 8px; border: 2px solid rgba(17,28,84,.22); background: #fff; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: all .15s; }
.todo-check:hover { border-color: var(--ok); color: rgba(14,159,110,.45); }
.todo.is-high .todo-check { border-color: rgba(224,53,59,.55); }
.todo.is-done .todo-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.todo.just-toggled.is-done .todo-check { animation: tick .3s ease; }
@keyframes tick { 50% { transform: scale(1.2); } }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 600; font-size: 14.5px; word-break: break-word; }
.todo-flag { color: var(--bad); display: inline-flex; vertical-align: -1px; margin-right: 5px; }
.todo.is-done .todo-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.todo-notes { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; word-break: break-word; }
.todo-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.todo-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 7px; background: rgba(139,92,246,.1); color: #7C3AED; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.todo:hover .todo-actions, .todo:focus-within .todo-actions { opacity: 1; }
.todo-actions .icon-btn { width: 32px; height: 32px; }
.todo-list.compact .todo { padding: 8px; }
.sale-side .todo-quick input[type=date] { display: none; }
.todo-list.compact .todo-notes { display: none; }
@media (hover: none) { .todo-actions { opacity: 1; } .todo-actions [data-delete] { display: none; } }
@media (max-width: 720px) {
  .todo-quick input[type=date] { width: 128px; font-size: 13px; }
  .todo-hero .todo-quick { flex-wrap: wrap; padding: 8px; }
  .todo-hero .todo-quick input[name=title] { flex: 1 1 calc(100% - 40px); }
  .todo-hero .todo-quick input[type=date] { flex: 1; width: auto; }
  #todos .todo-quick input[type=date] { width: 118px; }
  .seg { display: flex; }
  .seg a { flex: 1; justify-content: center; }
}
