/* Soft Calls Portal
   Brand: deep navy + blue to cyan gradient taken from the Soft Calls logo. */

:root {
  --navy-900: #071226;
  --navy-800: #0b1b38;
  --navy-700: #12284f;
  --blue-600: #1d6fe0;
  --blue-500: #2f86f6;
  --blue-50: #eef5ff;
  --cyan-400: #22c3ee;
  --grad: linear-gradient(135deg, #1d6fe0 0%, #22c3ee 100%);

  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e3e9f2;
  --border-strong: #cfd8e6;
  --text: #0f1b2d;
  --text-2: #4a5872;
  --muted: #74829b;

  --green: #15a36b;  --green-bg: #e6f7ef;
  --amber: #c98208;  --amber-bg: #fff5e0;
  --red: #dc3b45;    --red-bg: #fdecee;
  --violet: #7353e5; --violet-bg: #f0ecfe;
  --slate: #56657e;  --slate-bg: #edf1f6;
  --cyan: #0b9ccb;   --cyan-bg: #e3f7fd;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 16px rgba(15, 27, 45, .05);
  --shadow-lg: 0 20px 50px rgba(7, 18, 38, .18);
  --sidebar-w: 256px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .75em; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .95em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; }
.ml-auto { margin-left: auto; }
.text-danger { color: var(--red); }
.link { color: var(--blue-600); font-weight: 500; }
.link:hover { text-decoration: underline; }
.link-plain:hover { color: var(--blue-600); }
.link-btn { background: none; border: 0; color: var(--blue-600); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }

.icon { width: 18px; height: 18px; flex: none; }
.icon.xs { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: radial-gradient(120% 60% at 0% 0%, #13305f 0%, var(--navy-900) 60%);
  color: #c4d1e8; display: flex; flex-direction: column;
  transition: transform .25s ease;
}
.sidebar-brand { padding: 22px 20px 14px; }
.sidebar-brand img { width: 190px; display: block; }
.sidebar-label { padding: 6px 24px 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6f84a8; font-weight: 600; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 12px; }
.sidebar-nav a, .sidebar-foot a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  margin-bottom: 2px; font-weight: 500; color: #b5c4de; transition: background .15s, color .15s;
}
.sidebar-nav a:hover, .sidebar-foot a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(29, 111, 224, .35); }
.sidebar-nav a span { flex: 1; }
.nav-count { font-style: normal; font-size: 11px; font-weight: 700; background: #ff9f1c; color: #1b1300; border-radius: 999px; padding: 1px 7px; }
.sidebar-nav a.active .nav-count { background: #fff; color: var(--blue-600); }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: rgba(243, 246, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.topbar-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .menu-btn { display: none; }
.content { flex: 1; padding: 24px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.footer { padding: 16px 28px 24px; color: var(--muted); font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(29, 111, 224, .28); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(29, 111, 224, .4); }
.btn-light { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-light:hover { background: var(--surface-2); border-color: #b9c5d8; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0f8e5c; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c22f39; }
.btn-danger-outline { background: var(--surface); border-color: #f2b8bd; color: var(--red); }
.btn-danger-outline:hover { background: var(--red-bg); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-row.center { justify-content: center; }
.btn-row.end { justify-content: flex-end; }
.btn-stack { display: flex; flex-direction: column; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; position: relative;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.icon-btn.xs .icon { width: 13px; height: 13px; }
.icon-btn.ok:hover:not([disabled]) { background: var(--green-bg); color: var(--green); border-color: #a5e2c8; }
.icon-btn.danger:hover:not([disabled]) { background: var(--red-bg); color: var(--red); border-color: #f2b8bd; }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.topbar .icon-btn { width: 40px; height: 40px; border-radius: 11px; }
.topbar .icon-btn .icon { width: 18px; height: 18px; }
.bell-dot {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; border: 2px solid var(--bg);
}

/* ---------- Cards and stats ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 15.5px; font-weight: 650; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats.inner { margin: 18px 0 14px; }
.stat-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.stat-card:hover { transform: translateY(-2px); border-color: #c7d6ee; box-shadow: 0 8px 24px rgba(15, 27, 45, .08); }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat-icon .icon { width: 20px; height: 20px; }
.stat-value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tone-blue { background: var(--blue-50); color: var(--blue-600); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-red { background: var(--red-bg); color: var(--red); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-slate { background: var(--slate-bg); color: var(--slate); }
.tone-cyan { background: var(--cyan-bg); color: var(--cyan); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid-2.align-start { gap: 20px; align-items: start; }

/* ---------- Badges and chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { background: var(--amber-bg); color: #a96b00; }
.badge-approved, .badge-active { background: var(--green-bg); color: var(--green); }
.badge-rejected, .badge-suspended { background: var(--red-bg); color: var(--red); }
.badge-inactive { background: var(--slate-bg); color: var(--slate); }
.badge-duplicate { background: var(--violet-bg); color: var(--violet); padding: 1px 7px; font-size: 10.5px; margin-left: 4px; }
.badge-duplicate::before { display: none; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue-600); font-size: 12px; font-weight: 600; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 500; }
.chip-btn:hover { border-color: var(--blue-500); color: var(--blue-600); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 9px; }
.table th:last-child { border-top-right-radius: 9px; }
.table td { padding: 11px 12px; border-bottom: 1px solid #eef2f7; vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f9fbff; }
.table tbody tr.is-editing { background: var(--blue-50); }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.table.compact td { padding: 9px 10px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .wrap { white-space: normal; max-width: 260px; }
.table .sub, td .sub { display: block; color: var(--muted); font-size: 12px; }
.table .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.sort-link { display: inline-flex; gap: 2px; color: inherit; }
.sort-link:hover, .sort-link.is-active { color: var(--blue-600); }
.row-actions, .inline-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.reason { margin-top: 4px; font-size: 12px; color: var(--red); max-width: 280px; white-space: normal; }
tr.flash-row { animation: flashrow 1.4s ease; }
@keyframes flashrow { from { background: #e3f7ec; } to { background: transparent; } }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; flex-wrap: wrap; font-size: 13px; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.pager a:hover { border-color: var(--blue-500); color: var(--blue-600); }
.pager .current { background: var(--blue-600); color: #fff; border-color: var(--blue-600); font-weight: 600; }
.pager .disabled { color: #b4bfd0; }

/* ---------- Filters and tabs ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters select, .filters input[type=date] { height: 38px; width: auto; min-width: 140px; }
.search-input { position: relative; flex: 1 1 260px; max-width: 380px; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search-input input { padding-left: 36px; height: 38px; }
.date-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.date-filter input { min-width: 0 !important; width: 150px !important; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue-600); }
.quick-ranges { display: flex; gap: 6px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--blue-600); border-color: var(--blue-600); }
.inner-tabs { margin: 8px 0 14px; }

[data-ajax-region] { transition: opacity .15s; }
[data-ajax-region].is-loading { opacity: .55; pointer-events: none; }

/* ---------- Forms ---------- */
.form .field, .field { margin-bottom: 16px; min-width: 0; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.check, .switch, .toggle-row { font-weight: 500; }
input, select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; font: inherit; font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374829b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(47, 134, 246, .16); }
input.readonly, input[readonly] { background: var(--surface-2); color: var(--text-2); }
input[type=checkbox] { width: auto; height: auto; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.has-error input:focus { box-shadow: 0 0 0 3px rgba(220, 59, 69, .14); }
.field-error { display: block; color: var(--red); font-size: 12px; margin-top: 5px; }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.optional { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.req { color: var(--red); }
.form-section { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-600); font-weight: 700; margin: 4px 0 12px; padding-top: 6px; }
.form-section:not(:first-of-type) { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 16px 0 4px; z-index: 5; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-prefix input { padding-left: 26px; }
.input-prefix.sm input { height: 34px; max-width: 130px; }
.input-prefix.sm span { left: 10px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; display: grid; }
.mt-label { margin-top: 30px; }
.check-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.check-list .check { flex-wrap: wrap; }
.check-list small { width: 100%; padding-left: 24px; margin-top: -4px; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch > span { position: absolute; inset: 0; background: #cdd6e4; border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch > span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--blue-600); }
.switch input:checked + span::after { transform: translateX(18px); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; cursor: pointer; }
.toggle-row small { display: block; font-weight: 400; margin-top: 2px; }
tr[data-assign-row]:not(.is-assigned) td:nth-child(n+4) { opacity: .4; }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; border: 1px solid; margin-bottom: 0; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--green-bg); border-color: #b6e6cf; color: #0c6b46; }
.alert-error { background: var(--red-bg); border-color: #f5c3c7; color: #a3242d; }
.alert-warning { background: var(--amber-bg); border-color: #f5dca3; color: #7d5100; align-items: center; }
.alert-info { background: var(--blue-50); border-color: #cbe0fd; color: #18509f; }
.card .alert { margin-bottom: 16px; }

/* ---------- Dashboard pieces ---------- */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.campaign-grid.large { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.campaign-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: linear-gradient(180deg, #fbfdff, #fff); }
.campaign-card h3 { font-size: 14.5px; }
.campaign-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.campaign-card .btn { align-self: flex-start; margin-top: auto; }
.campaign-detail h2 { font-size: 17px; margin-bottom: 6px; }
.campaign-detail { display: flex; flex-direction: column; gap: 12px; }
.campaign-detail .btn { align-self: flex-start; }
.payout { font-weight: 700; color: var(--green); white-space: nowrap; font-size: 15px; }
.payout small { color: var(--muted); font-weight: 500; font-size: 11.5px; margin-left: 2px; }
.payout.big { font-size: 24px; letter-spacing: -.02em; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.payout.big small { margin: 2px 0 0; }
.meta-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; margin: 0; }
.instructions { background: var(--blue-50); border: 1px solid #d6e6fd; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #1f3f6d; }
.instructions strong { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.instructions p { margin: 0; white-space: pre-line; }

.did-list { list-style: none; margin: 0; padding: 0; }
.did-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef2f7; }
.did-list li:last-child { border-bottom: 0; }
.did-list small { display: block; color: var(--muted); font-size: 12px; }

.dl { margin: 0; display: flex; flex-direction: column; gap: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid #eef2f7; }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; text-align: right; }
.grid-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.grid-dl > div { flex-direction: column; gap: 2px; }
.grid-dl dd { text-align: left; }
.grid-dl .span-2 { grid-column: span 2; }
.dl.inline { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 28px; margin: 6px 0 18px; }
.dl.inline > div { border: 0; flex-direction: column; align-items: center; gap: 0; padding: 0; }

.bar-chart { height: 240px; display: flex; align-items: flex-end; gap: 6px; padding-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-stack { width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; position: relative; }
.bar-total { width: 100%; background: #d9e7fb; border-radius: 6px 6px 3px 3px; position: relative; min-height: 2px; display: flex; align-items: flex-end; transition: height .5s ease; }
.bar-approved { width: 100%; background: var(--grad); border-radius: 6px 6px 3px 3px; min-height: 0; }
.bar-col small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bar-col:nth-child(even) small { visibility: hidden; }
.bar-tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text-2); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-total { background: #d9e7fb; }
.lg-approved { background: var(--grad); }

.ratio-bar { display: flex; height: 28px; border-radius: 8px; overflow: hidden; font-size: 12px; font-weight: 600; color: #fff; margin-bottom: 8px; background: var(--slate-bg); }
.ratio-bar span { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; }
.ratio-bar .ok { background: var(--green); }
.ratio-bar .bad { background: var(--red); justify-content: flex-end; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty strong { color: var(--text); font-size: 14.5px; }
.empty p { margin: 0; max-width: 360px; }
.empty-icon { width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: var(--blue-50); color: var(--blue-600); margin-bottom: 4px; box-sizing: content-box; }
.empty.small { padding: 18px; }

/* ---------- Submission form ---------- */
.campaign-panel { position: sticky; top: 92px; }
.campaign-panel-empty { text-align: center; padding: 28px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.campaign-panel-body { display: flex; flex-direction: column; gap: 14px; }
.campaign-panel-body h3 { font-size: 18px; }
.campaign-panel-body .payout.big { align-items: flex-start; font-size: 30px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-600); }
.success-card { text-align: center; padding: 40px 24px; max-width: 640px; margin: 0 auto; width: 100%; }
.success-card h2 { font-size: 22px; margin-bottom: 8px; }
.callid-box { display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 12px; background: var(--blue-50); border: 1px dashed #9fc3f7; margin: 8px 0 18px; }
.callid-box span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.callid-box strong { font-size: 20px; color: var(--blue-600); }

.status-screen { text-align: center; }
.status-screen h1 { font-size: 22px; margin-bottom: 8px; }
.status-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; }
.status-icon .icon { width: 30px; height: 30px; }
.status-pending { background: var(--amber-bg); color: var(--amber); }
.status-approved { background: var(--green-bg); color: var(--green); }
.status-rejected, .status-suspended, .status-inactive { background: var(--red-bg); color: var(--red); }

.review-card form + form { margin-top: 12px; }
.reject-form { padding-top: 12px; border-top: 1px dashed var(--border); margin-top: 12px; }
.reject-form .field { margin-bottom: 10px; }
.review-card form:first-of-type + .reject-form { margin-top: 14px; }

.integration-row { display: flex; gap: 12px; flex-wrap: wrap; }
.integration { flex: 1 1 180px; display: flex; justify-content: space-between; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; }

/* ---------- Dropdowns, notifications, user chip ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu > a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-weight: 500; }
.dropdown-menu > a:hover { background: var(--surface-2); }
.notif-menu { width: 360px; padding: 0; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dropdown-foot { justify-content: center; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px !important; color: var(--blue-600); padding: 11px !important; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item, .notif-page li { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef2f7; align-items: flex-start; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread, .notif-page li.unread { background: #f5f9ff; }
.notif-item strong, .notif-page strong { display: block; font-size: 13px; }
.notif-item p, .notif-page p { margin: 2px 0; font-size: 12.5px; color: var(--text-2); }
.notif-item small { color: var(--muted); font-size: 11.5px; }
.notif-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; flex: none; }
.notif-ic .icon { width: 16px; height: 16px; }
.notif-page { list-style: none; padding: 0; margin: 0 -20px; }
.notif-page li { padding: 14px 20px; align-items: center; }
.notif-page li > div { flex: 1; min-width: 0; }

.user-chip { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; text-align: left; }
.avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-chip-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-chip-name small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }

/* ---------- Modal and toasts ---------- */
.modal { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(7, 18, 38, .45); backdrop-filter: blur(2px); }
.modal-body { padding: 24px; }
.modal-body h2 { font-size: 18px; margin-bottom: 6px; }
.quick-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--navy-800); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; display: flex; gap: 10px; align-items: center; animation: toastin .2s ease; max-width: 360px; }
.toast.error { background: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Auth pages ---------- */
body.auth { background: #fff; }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(90% 70% at 100% 100%, rgba(34, 195, 238, .35), transparent 60%), radial-gradient(80% 60% at 0% 0%, #17407e, transparent 70%), var(--navy-900);
}
.auth-logo { width: 260px; position: relative; z-index: 1; }
.auth-hero-copy { position: relative; z-index: 1; max-width: 460px; }
.auth-hero-copy h2 { font-size: 34px; letter-spacing: -.02em; margin-bottom: 14px; line-height: 1.15; }
.auth-hero-copy p { color: #b9c8e2; font-size: 15px; }
.auth-hero-copy ul { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-hero-copy li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.auth-hero-copy li .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--cyan-400); box-sizing: border-box; }
.auth-wave {
  position: absolute; right: -80px; bottom: -40px; width: 520px; height: 520px; border-radius: 50%; opacity: .5;
  background: repeating-radial-gradient(circle at center, transparent 0 28px, rgba(34, 195, 238, .12) 29px 30px);
}
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 480px; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 36px; }
.auth-card h1 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card > .muted { margin-bottom: 22px; }
.auth-card .alert { margin-bottom: 16px; }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: 13.5px; }
.auth-switch a { color: var(--blue-600); font-weight: 600; }
.auth-switch.small { margin-top: 8px; }
.auth-foot { color: var(--muted); font-size: 12px; margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 1100px) {
  .grid-main, .grid-side, .grid-form { grid-template-columns: minmax(0, 1fr); }
  .campaign-panel { position: static; order: -1; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(7, 18, 38, .45); z-index: 35; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .topbar-actions .btn span, .topbar-actions .btn-group .btn span { display: none; }
  .topbar-actions .btn { padding: 0 11px; }
  .user-chip-name { display: none; }
  .user-chip { padding: 4px; }
  .content { padding: 16px; gap: 16px; }
  .footer { padding: 8px 16px 20px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; }
  .auth-hero-copy, .auth-wave { display: none; }
  .auth-logo { width: 200px; }
  .auth-panel { padding: 20px 16px 28px; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  .stat-value { font-size: 17px; }
  .grid-2, .grid-3, .grid-dl { grid-template-columns: minmax(0, 1fr); }
  .grid-dl .span-2 { grid-column: auto; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .notif-page { margin: 0 -16px; }
  .search-input { max-width: none; flex-basis: 100%; }
  .filters select, .date-filter { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .date-filter input { width: 100% !important; }
  .notif-menu { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .auth-card { padding: 24px 20px; }
  .campaign-grid.large { grid-template-columns: minmax(0, 1fr); }
  .form-actions .btn { flex: 1; }
  .pagination { justify-content: center; }
}
