/* ───────────────────────────────────────────────────────────────────────
   Offer Tool — dark design system.
   Palette + chrome reused from the AIDA / designer / proAds tools;
   highlight is green→cyan, the K isotype is green.
   ─────────────────────────────────────────────────────────────────────── */
:root {
  --bg:        #0f1115;
  --panel:     #1a1d24;
  --panel-2:   #22262f;
  --panel-3:   #2a2f3a;
  --line:      #2d3139;
  --fg:        #f3f4f6;
  --fg-dim:    #9aa1ac;
  --fg-faint:  #5f6672;
  --grn:       #34d399;
  --grn-deep:  #10b981;
  --cyn:       #22d3ee;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

/* Selection + focus in brand green */
::selection { background: rgba(52, 211, 153, 0.25); }
:focus-visible { outline: 1px solid var(--grn); outline-offset: 1px; }

/* ── Scrollbars ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--panel-3); border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #38404e; }

/* ── Top progress bar — fast, for the "site speed" feel ──────────────── */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--grn), var(--cyn));
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  z-index: 100; opacity: 0;
  transition: width 0.18s ease, opacity 0.2s ease;
}
#progress.active { opacity: 1; }

/* ── Fast spinner ────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--grn);
  border-radius: 50%;
  animation: spin 0.55s linear infinite;
  vertical-align: -2px;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Full-card / panel loading overlay */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit; z-index: 20;
}

/* ── Entrance animations — quick, to feel snappy ─────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 0.16s ease both; }
main > * { animation: fadeUp 0.18s ease both; }

/* ── Panels / cards ──────────────────────────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 2px 12px rgba(0, 0, 0, 0.35);
}
.lift { transition: transform 0.13s ease, border-color 0.13s ease,
                    box-shadow 0.13s ease; }
.lift:hover {
  transform: translateY(-1px);
  border-color: #3a4150;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Glass — subtle blur for sticky chrome */
.glass {
  background: rgba(15, 17, 21, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

/* ── Form controls ───────────────────────────────────────────────────── */
input, select, textarea {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--grn);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}
input:disabled, select:disabled, textarea:disabled {
  background: transparent; border-color: transparent; color: var(--fg);
  cursor: default;
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); }
select option { background: var(--panel-2); }
input[type="checkbox"] { accent-color: var(--grn); }
input[type="range"] { accent-color: var(--grn); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }

/* Autosave feedback */
[data-autosave].saving, [data-product].saving { opacity: 0.55; }
[data-autosave].saved, input[data-product].saved {
  box-shadow: 0 0 0 2px var(--grn); border-radius: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2); color: var(--fg);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease,
              transform 0.08s ease;
}
.btn:hover { background: var(--panel-3); border-color: #3a4150; }
.btn:active { transform: scale(0.98); }
.btn-accent {
  background: linear-gradient(135deg, var(--grn), var(--grn-deep));
  border-color: transparent; color: #07120d;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.28);
}
.btn-accent:hover { filter: brightness(1.07); background: var(--grn); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-dim); }
.btn-ghost:hover { background: var(--panel-2); color: var(--fg); }

/* ── Tables ──────────────────────────────────────────────────────────── */
.tabular-nums { font-variant-numeric: tabular-nums; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-faint);
  background: var(--panel-2);
  padding: 10px 14px; font-weight: 600;
}
table.tbl tbody td { padding: 10px 14px; border-top: 1px solid var(--line); }
table.tbl tbody tr { transition: background 0.1s ease; }
table.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
table.tbl .r { text-align: right; }
table.tbl tfoot td { padding: 8px 14px; background: var(--panel-2);
                     border-top: 1px solid var(--line); font-size: 12px; }

/* ── Chips / tags ────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--fg-dim);
}
.chip-grn { color: var(--grn); border-color: rgba(52, 211, 153, 0.35);
            background: rgba(52, 211, 153, 0.08); }
.chip-cyn { color: var(--cyn); border-color: rgba(34, 211, 238, 0.35);
            background: rgba(34, 211, 238, 0.08); }
.chip-amber { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35);
              background: rgba(251, 191, 36, 0.08); }
.chip-rose { color: #fb7185; border-color: rgba(251, 113, 133, 0.35);
             background: rgba(251, 113, 133, 0.08); }

/* Hairline divider */
.hairline { height: 1px; background: var(--line); }

/* Tab underline slide */
.tab-link { position: relative; transition: color 0.12s ease; }
.tab-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--grn); border-radius: 2px;
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.16s ease;
}
.tab-link.active::after, .tab-link:hover::after { transform: scaleX(1); }
.tab-link:hover:not(.active)::after { background: var(--line); }
