/* CollabForms Admin — premium steel, matching the CollabForms site:
   light steel page, dark ink, brand sky, restrained champagne gold.
   Mobile-first: the tab bar becomes a bottom app bar on phones and
   every list is a card stack (no wide tables to pinch-scroll). */
:root {
  --ink: #0b0c0e;
  --ink-2: #17191d;
  --page: #eceef1;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --muted: #5c6470;
  --line: #dde1e7;
  --brand: #0ea5e9;
  --brand-deep: #0369a1;
  --gold: #c9a227;
  --gold-dark: #9a7b14;
  --gold-soft: #f7ecd0;
  --green: #0f7b4d;
  --green-soft: #e3f4ec;
  --red: #b3261e;
  --red-soft: #fdeceb;
  --amber: #b25e09;
  --amber-soft: #fdf1e0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 12, 14, 0.05), 0 10px 30px -18px rgba(11, 12, 14, 0.25);
  --shadow-lg: 0 24px 60px -24px rgba(11, 12, 14, 0.35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
}
h1, h2, h3, .topbar-brand { font-family: "Clash Display", "Satoshi", sans-serif; letter-spacing: 0.01em; }
button { font-family: inherit; cursor: pointer; }
button:active { transform: scale(0.98); }
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; width: 100%;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18); }
input:disabled { background: #f2f3f5; color: var(--muted); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
a { color: var(--brand-deep); }

/* ---------- gate ---------- */
.gate { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 38px 32px; max-width: 400px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.gate-card h1 { font-size: 26px; margin: 14px 0 8px; }
.gate-sub { color: var(--muted); line-height: 1.55; margin: 0 0 20px; }
.gate-error { color: var(--red); font-size: 13.5px; margin: 14px 0 0; }
.gate-fine { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 18px 0 0; }
.brand-mark {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 15px;
  background: var(--ink); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: "Clash Display", sans-serif; font-weight: 700; font-size: 19px;
  border: 1px solid var(--gold);
  box-shadow: 0 8px 20px -8px rgba(11, 12, 14, 0.5);
}
.brand-mark.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; margin: 0; box-shadow: none; }
.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border: 1px solid var(--gold);
  padding: 12px 20px; border-radius: 12px; font-size: 15px; font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}
.btn-google:hover { background: var(--ink-2); }

/* ---------- panel chrome ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.topbar-admin { color: var(--gold-dark); }
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-email { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs {
  display: flex; gap: 6px; padding: 12px 16px 2px;
  max-width: 1180px; margin: 0 auto;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 8px 15px; border-radius: 999px; font-weight: 700; font-size: 13.5px;
  white-space: nowrap; flex: 0 0 auto;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
}
.tab:hover { border-color: #c4cad3; color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 6px 16px -8px rgba(11, 12, 14, 0.6); }
.content { padding: 16px 16px 48px; max-width: 1180px; margin: 0 auto; }
.tabpage { animation: page-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.page-h { font-size: 22px; margin: 6px 0 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
.inline-error { color: var(--red); font-size: 13.5px; }
.banner-error { background: var(--red-soft); border: 1px solid #f3c1bd; color: var(--red); padding: 11px 14px; border-radius: 12px; margin: 0 0 14px; }

/* ---------- cards / stats ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card h3 { font-size: 16px; margin: 0 0 12px; }
.card.flash { outline: 2px solid var(--gold); outline-offset: 2px; transition: outline-color 0.3s; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 11px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--gold), rgba(201, 162, 39, 0.15)); }
.stat .stat-label { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stat .stat-value { font-family: "Clash Display", sans-serif; font-size: 26px; font-weight: 700; margin-top: 3px; }
.kv-list { display: grid; gap: 7px; font-size: 14px; }
.kv-list .kv { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.kv-list .kv:last-child { border-bottom: none; padding-bottom: 0; }
.kv-list .kv span { color: var(--muted); flex: 0 0 auto; }
.kv-list .kv b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }

/* ---------- list cards (replaces wide tables) ---------- */
.list-stack { display: grid; gap: 11px; margin-bottom: 18px; }
.list-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow);
  display: grid; gap: 9px;
  animation: rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.lc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lc-title { font-weight: 700; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.lc-sub { color: var(--muted); font-size: 12.8px; overflow-wrap: anywhere; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 5px 16px; color: var(--muted); font-size: 13px; }
.lc-meta b { color: var(--ink); font-weight: 700; }
.lc-plan { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 3px; }
.lc-plan > .pill { justify-self: start; }
.lc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cell-main { font-weight: 700; }
.cell-sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.logo-thumb { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #f2f3f5; flex: 0 0 auto; }
.logo-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-grey { background: #eef0f3; color: var(--muted); }
.pill-gold { background: var(--gold-soft); color: var(--gold-dark); }
.pill-sky { background: #e0f2fe; color: var(--brand-deep); }

/* ---------- sub-tab chips ---------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 13px;
  white-space: nowrap; flex: 0 0 auto;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.chip .chip-n { opacity: 0.65; font-weight: 500; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- upcoming earnings rows ---------- */
.up-row { display: flex; align-items: center; gap: 13px; }
.up-date {
  flex: 0 0 auto; text-align: center; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 7px 10px; min-width: 62px;
}
.up-date .up-d { font-family: "Clash Display", sans-serif; font-size: 19px; font-weight: 700; line-height: 1.1; }
.up-date .up-m { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.up-main { flex: 1 1 auto; min-width: 0; }
.up-amt { font-family: "Clash Display", sans-serif; font-size: 18px; font-weight: 700; white-space: nowrap; }

/* ---------- payments table (inside earnings cards) ---------- */
.tbl-scroll { overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
td { padding: 9px 12px; border-bottom: 1px solid #eef0f3; vertical-align: middle; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: none; }
.payments-table { margin: 0; min-width: 520px; }

/* ---------- buttons / forms ---------- */
.btn-primary {
  background: var(--ink); color: #fff; border: 1px solid var(--gold);
  padding: 10px 17px; border-radius: 11px; font-weight: 700; font-size: 14px;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--ink-2); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 11px; font-weight: 700; font-size: 14px; }
.btn-secondary.sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: var(--surface); color: var(--red); border: 1px solid #f3c1bd; padding: 8px 13px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.btn-small { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 8px 13px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.btn-small:disabled, .btn-danger:disabled { opacity: 0.55; cursor: default; }
.btn-link { background: none; border: none; padding: 2px 0; color: var(--brand-deep); font-size: 12.8px; font-weight: 700; cursor: pointer; text-align: left; }
.btn-link:hover { text-decoration: underline; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 13px; margin-bottom: 13px; }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 13px; }
.file-btn { display: inline-block; background: var(--surface); border: 1px solid var(--line); padding: 9px 14px; border-radius: 11px; font-weight: 700; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.search-input { flex: 1 1 200px; max-width: 420px; }
.empty-note { color: var(--muted); padding: 16px 4px; }

/* ---------- sections ---------- */
.section-summary { color: var(--muted); font-size: 14px; margin: 2px 0 14px; line-height: 1.55; }
.section-summary b { color: var(--ink); }
.group-h { font-family: "Clash Display", sans-serif; font-size: 16.5px; margin: 20px 0 10px; }
.group-h:first-child { margin-top: 4px; }

/* ---------- loading skeleton ---------- */
.skeleton { border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(100deg, #e8ebef 40%, #f4f6f8 50%, #e8ebef 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 92px; margin-bottom: 11px; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* ---------- notifications ---------- */
.notify-body-label { display: block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.notify-body-label textarea, .notify-body-label input { margin-top: 5px; font-weight: 400; color: var(--ink); }

/* ---------- mobile: bottom app bar + stacked everything ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .topbar { padding: 9px 13px; }
  .topbar-email { display: none; }
  .content { padding: 14px 13px 108px; }
  .page-h { font-size: 20px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    max-width: none; margin: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
    overflow: visible;
  }
  .tab {
    border: none; background: transparent; color: var(--muted);
    padding: 7px 1px; border-radius: 11px; font-size: 10px; line-height: 1.25;
    text-align: center; white-space: normal; box-shadow: none;
  }
  .tab.active { background: var(--ink); color: #fff; box-shadow: 0 6px 14px -6px rgba(11, 12, 14, 0.55); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat { padding: 12px 13px; }
  .stat .stat-value { font-size: 21px; }
  .card { padding: 15px 14px; }
  .form-row .btn-primary, .form-row .btn-secondary { flex: 1 1 auto; }
  .search-input { max-width: none; flex: 1 1 100%; }
  .lc-actions .btn-small, .lc-actions .btn-danger { flex: 1 1 auto; padding: 10px 13px; }
  .gate-card { padding: 30px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
