/* ==========================================================
   Vendor Accounts
   Typography: Urbanist · Palette: #0051FF #F08C00 #12B034 #0C0D11 #FFFFFF
   ========================================================== */

@font-face {
  font-family: "Urbanist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/urbanist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Urbanist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/urbanist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #0051FF;
  --blue-600: #0043D6;
  --orange: #F08C00;
  --green: #12B034;
  --ink: #0C0D11;
  --white: #FFFFFF;
  --danger: #E5484D;

  --bg: #F3F4F8;
  --bg-glow-1: rgba(240, 140, 0, 0.10);
  --bg-glow-2: rgba(0, 81, 255, 0.10);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #FFFFFF;
  --surface-2: #F0F1F5;
  --surface-3: #E7E9EF;
  --text: #0C0D11;
  --text-2: #4A4F5C;
  --muted: #7A808F;
  --border: rgba(12, 13, 17, 0.08);
  --border-strong: rgba(12, 13, 17, 0.14);
  --shadow-sm: 0 1px 2px rgba(12, 13, 17, 0.04), 0 1px 1px rgba(12, 13, 17, 0.03);
  --shadow: 0 1px 2px rgba(12, 13, 17, 0.04), 0 8px 24px -12px rgba(12, 13, 17, 0.12);
  --shadow-lg: 0 24px 60px -20px rgba(12, 13, 17, 0.30);
  --btn-dark-bg: #0C0D11;
  --btn-dark-fg: #FFFFFF;
  --chip-out-bg: rgba(240, 140, 0, 0.12);
  --chip-out-fg: #B86A00;
  --chip-part-bg: rgba(0, 81, 255, 0.10);
  --chip-part-fg: #0043D6;
  --chip-paid-bg: rgba(18, 176, 52, 0.12);
  --chip-paid-fg: #0C8A27;
  --text-orange: #C77400;
  --text-green: #0C8A27;
  --focus: 0 0 0 3px rgba(0, 81, 255, 0.25);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 160ms;
  --t: 260ms;
  --t-slow: 520ms;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0C0D11;
  --bg-glow-1: rgba(240, 140, 0, 0.07);
  --bg-glow-2: rgba(0, 81, 255, 0.12);
  --surface: rgba(22, 24, 30, 0.78);
  --surface-solid: #16181E;
  --surface-2: #1D2028;
  --surface-3: #262A33;
  --text: #F3F4F7;
  --text-2: #C2C6D0;
  --muted: #8C93A3;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  --btn-dark-bg: #FFFFFF;
  --btn-dark-fg: #0C0D11;
  --chip-out-bg: rgba(240, 140, 0, 0.16);
  --chip-out-fg: #FFB24D;
  --chip-part-bg: rgba(0, 81, 255, 0.20);
  --chip-part-fg: #7EA6FF;
  --chip-paid-bg: rgba(18, 176, 52, 0.18);
  --chip-paid-fg: #4ED670;
  --text-orange: #FFA733;
  --text-green: #3DCC5F;
  --focus: 0 0 0 3px rgba(80, 130, 255, 0.4);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "lnum" 1;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(26px, 3vw, 34px); }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); }
::selection { background: rgba(0, 81, 255, 0.18); }
.icon { flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.text-orange { color: var(--text-orange); }
.text-green { color: var(--text-green); }
.text-danger { color: var(--danger); }
.small-text { font-size: 13px; }
[hidden] { display: none !important; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at -10% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(900px 700px at 110% 10%, var(--bg-glow-2), transparent 60%);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 12px; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  max-width: 1320px; margin: 12px auto 0; padding: 10px 12px 10px 20px;
  background: var(--surface);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  margin-inline: 16px;
}
@media (min-width: 1352px) { .topbar { margin-inline: auto; } }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.brand .logo-mark { color: var(--text); }
.brand-light, .brand-light .logo-mark { color: #fff; }

.nav-pills { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 999px; }
.nav-pills a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-pills a:hover { background: var(--surface-2); color: var(--text); }
.nav-pills a:active { transform: scale(0.97); }
.nav-pills a.active { background: var(--btn-dark-bg); color: var(--btn-dark-fg); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-pills + .topbar-actions { margin-left: 0; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text);
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast) var(--ease), color var(--t) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(229, 72, 77, 0.08); border-color: rgba(229, 72, 77, 0.25); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn .count {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px;
}
.icon-btn[aria-expanded="true"] { background: var(--btn-dark-bg); color: var(--btn-dark-fg); border-color: transparent; }

[data-theme-toggle] .when-dark { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .when-dark { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .when-light { display: none; }
[data-theme-toggle] svg { transition: transform var(--t-slow) var(--ease); }
[data-theme-toggle]:hover svg { transform: rotate(-20deg); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), #3F7BFF);
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.02em;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-soft { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }

.menu { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-solid);
  transition: background-color var(--t) var(--ease);
}
.avatar-btn:hover { background: var(--surface-2); }
.avatar-btn .avatar { width: 34px; height: 34px; font-size: 12px; }
.avatar-meta { display: flex; flex-direction: column; text-align: left; line-height: 1.15; max-width: 160px; }
.avatar-meta strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-meta small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-btn > .icon { color: var(--muted); transition: transform var(--t) var(--ease); }
.menu.open .avatar-btn > .icon { transform: rotate(180deg); }

.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 6px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right; pointer-events: none;
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.menu.open .menu-panel { opacity: 1; transform: none; pointer-events: auto; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu-head small { color: var(--muted); font-size: 12px; word-break: break-all; }
.menu-head .role-badge { align-self: flex-start; margin-top: 6px; }
.menu-panel a, .menu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 12px; background: none; text-align: left;
  font-size: 14px; font-weight: 500; transition: background-color var(--t-fast) var(--ease);
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel form { margin: 0; }

.role-badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.role-admin { background: var(--btn-dark-bg); color: var(--btn-dark-fg); }
.role-user { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* Mobile tab bar */
.tabbar { display: none; }

/* ---------- Page ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 720px) { .page { padding: 40px 28px 72px; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head .muted { margin-top: 6px; max-width: 520px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.title-with-back { display: flex; align-items: center; gap: 16px; }
.head-stats { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.head-stat { display: flex; align-items: center; gap: 12px; }
.head-stat strong { display: block; font-size: 20px; font-weight: 700; line-height: 1.1; }
.head-stat small { color: var(--muted); font-size: 12px; }
.head-stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; gap: 6px; }
.btn-block { width: 100%; }
.btn-dark { background: var(--btn-dark-bg); color: var(--btn-dark-fg); }
.btn-dark:hover { box-shadow: 0 8px 20px -8px rgba(12, 13, 17, 0.5); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); box-shadow: 0 8px 20px -8px rgba(0, 81, 255, 0.7); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #0F9A2D; box-shadow: 0 8px 20px -8px rgba(18, 176, 52, 0.7); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn.is-loading { pointer-events: none; opacity: 0.8; }
.btn.is-loading::after {
  content: ""; width: 14px; height: 14px; border-radius: 999px;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Panels & cards ---------- */
.panel {
  background: var(--surface);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { display: flex; align-items: center; gap: 10px; }
.count-badge { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-2); }
.count-badge.green { background: var(--chip-paid-bg); color: var(--chip-paid-fg); border-color: transparent; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px; justify-content: space-between;
  min-height: 150px; padding: 20px; border-radius: var(--radius-lg);
  color: #fff; isolation: isolate;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::after {
  content: ""; position: absolute; z-index: -1; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  transition: transform var(--t-slow) var(--ease);
}
.stat-card:hover::after { transform: scale(1.15); }
.sc-blue { background: var(--blue); }
.sc-green { background: var(--green); }
.sc-orange { background: var(--orange); }
.sc-plain { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border); }
.sc-plain::after { background: var(--surface-2); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; opacity: 0.95; }
.stat-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35); }
.sc-plain .stat-ic { border-color: var(--border-strong); }
.stat-value { font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; word-break: break-word; }
.stat-pill { align-self: flex-start; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(12, 13, 17, 0.22); color: #fff; }
.sc-plain .stat-pill { background: var(--surface-2); color: var(--text-2); }

.dash-grid { display: grid; gap: 16px; grid-template-columns: 1.2fr 1fr 1fr; align-items: start; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px;
  transition: background-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.list-row:hover { background: var(--surface-2); transform: translateX(2px); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.list-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small { color: var(--muted); font-size: 12px; margin-top: -4px; }
.list-amount { text-align: right; font-weight: 700; white-space: nowrap; display: flex; flex-direction: column; }
.list-amount small { color: var(--muted); font-weight: 500; font-size: 12px; }
.list-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 999px; background: var(--chip-paid-bg); color: var(--chip-paid-fg); }

.progress { position: relative; display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress.lg { height: 8px; }
.progress.xs { height: 4px; width: 72px; margin: 6px 0 0 auto; }
.progress > span {
  position: absolute; inset: 0 auto 0 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #4FD06C);
  transform-origin: left; animation: grow 900ms var(--ease) both;
}
@keyframes grow { from { transform: scaleX(0); } }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 8px; }
.bar-label span { color: var(--text-2); }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; transform-origin: left; animation: grow 1s var(--ease) both; }
.bf-0 { background: var(--orange); }
.bf-1 { background: var(--blue); }
.bf-2 { background: var(--green); }
.bars li:nth-child(2) .bar-fill { animation-delay: 80ms; }
.bars li:nth-child(3) .bar-fill { animation-delay: 160ms; }
.bars li:nth-child(4) .bar-fill { animation-delay: 240ms; }
.bars li:nth-child(5) .bar-fill { animation-delay: 320ms; }
.bars li:nth-child(6) .bar-fill { animation-delay: 400ms; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 48px 20px; }
.empty.small { padding: 28px 12px; }
.empty p { color: var(--muted); max-width: 360px; }
.empty .btn { margin-top: 8px; }
.empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.empty-ic.ok { background: var(--chip-paid-bg); color: var(--chip-paid-fg); border-color: transparent; }

/* ---------- Toolbar & inputs ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 999px; color: var(--muted);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.search:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); height: 100%; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap.block { display: flex; width: 100%; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; height: 46px; padding: 0 42px 0 18px; width: 100%;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-solid); font-weight: 600; font-size: 14px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); cursor: pointer;
}
.select-wrap.block select { border-radius: 14px; font-weight: 500; font-size: 15px; }
.select-wrap select:hover { border-color: var(--border-strong); }
.select-wrap select:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.select-wrap > .icon { position: absolute; right: 16px; pointer-events: none; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field em { font-style: normal; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .input-affix {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), background-color var(--t) var(--ease);
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.field input:disabled { background: var(--surface-2); color: var(--muted); }
.field input[type="date"] { appearance: none; -webkit-appearance: none; }
:root[data-theme="dark"] .field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; }
.input-affix { display: flex; align-items: center; padding: 0 6px 0 0; }
.input-affix:focus-within { border-color: var(--blue); box-shadow: var(--focus); }
.input-affix input { border: 0 !important; box-shadow: none !important; background: none; min-height: 44px; }
.affix-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 10px; }
.affix-btn:hover { background: var(--surface-2); color: var(--text); }
.hint { font-size: 12px; color: var(--muted); margin-top: -6px; }
.hint.link { margin-top: 0; color: var(--blue); font-weight: 600; align-self: flex-start; }
:root[data-theme="dark"] .hint.link { color: #7EA6FF; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; }
.check.align-end { align-self: end; min-height: 46px; }
.check input {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; flex: none;
  border-radius: 7px; border: 1.5px solid var(--border-strong); background: var(--surface-solid);
  display: grid; place-items: center; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.check input::after {
  content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform var(--t) var(--ease);
}
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.segmented input:checked + span { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.chip-outstanding { background: var(--chip-out-bg); color: var(--chip-out-fg); }
.chip-partial { background: var(--chip-part-bg); color: var(--chip-part-fg); }
.chip-paid { background: var(--chip-paid-bg); color: var(--chip-paid-fg); }
.chip-muted { background: var(--surface-2); color: var(--muted); }
.head-tag { display: inline-flex; padding: 5px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- Vendors grid ---------- */
.vendor-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.vendor-card {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 20px;
  background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.vendor-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.vendor-card header { display: flex; align-items: center; gap: 12px; }
.vendor-title { flex: 1; min-width: 0; }
.vendor-title h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vendor-title small { color: var(--muted); font-size: 13px; }
.stretched::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-actions { position: relative; z-index: 1; display: flex; gap: 6px; }
.card-actions form { margin: 0; }
.vendor-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vendor-figures small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.vendor-figures strong { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.vendor-card footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.vendor-card .arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--surface-2); color: var(--text); transition: transform var(--t) var(--ease), background-color var(--t) var(--ease), color var(--t) var(--ease); }
.vendor-card:hover .arrow { transform: rotate(45deg); background: var(--btn-dark-bg); color: var(--btn-dark-fg); }

/* ---------- Ledger page ---------- */
.ledger-top { display: grid; gap: 16px; grid-template-columns: 340px 1fr; align-items: stretch; }
.ledger-top .stat-card { min-height: 100%; }
.vendor-profile h2 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-list li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; word-break: break-word; }
.contact-list .icon { color: var(--muted); }
.contact-list a:hover { color: var(--blue); }
.vendor-notes { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }

.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.ledger { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ledger th {
  text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ledger td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ledger tbody tr.entry-row { transition: background-color var(--t) var(--ease); }
@media (hover: hover) {
  .ledger tbody tr.entry-row:hover { background: var(--surface-2); }
  .ledger tbody tr.entry-row:hover td:first-child { border-radius: 14px 0 0 14px; }
  .ledger tbody tr.entry-row:hover td:last-child { border-radius: 0 14px 14px 0; }
}
.ledger td small { display: block; font-size: 12px; }
.ledger .num { text-align: right; white-space: nowrap; }
.ledger .strong { font-weight: 700; }
.ledger .desc { max-width: 320px; color: var(--text-2); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { vertical-align: middle; }
.row-actions form { display: inline; margin: 0; }
.row-actions .icon-btn, .row-actions .btn { margin-left: 4px; }
.actions-col { width: 1%; }
tr.flash-row td { animation: flashRow 1.6s var(--ease); }
@keyframes flashRow { 0%, 30% { background: rgba(0, 81, 255, 0.08); } 100% { background: transparent; } }

.payments-row td { padding: 0 12px 14px; border-bottom: 1px solid var(--border); }
.payments-box { padding: 16px 18px; border-radius: 16px; background: var(--surface-2); animation: dropIn var(--t) var(--ease); }
.payments-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.payments-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.payments-box li { position: relative; display: flex; align-items: center; gap: 14px; padding: 8px 0 8px 2px; }
.payments-box li + li::before { content: ""; position: absolute; left: 6px; top: -10px; height: 20px; width: 2px; background: var(--border-strong); }
.pay-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 4px var(--chip-paid-bg); flex: none; }
.pay-main { flex: 1; display: flex; flex-direction: column; }
.pay-main small { color: var(--text-2); font-size: 12px; }
.payments-box form { margin: 0; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } }

.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.pay-summary small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pay-summary strong { font-size: 15px; font-weight: 700; word-break: break-word; }

/* ---------- Heads / users / settings ---------- */
.head-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.head-list li { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-solid); transition: border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.head-list li:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.head-list .list-ic { background: var(--surface-2); color: var(--text-2); }
.head-list .list-main { gap: 2px; }
.head-list .list-main small { margin-top: 0; }
.user-cell { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.settings-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.segmented.wide span { height: 42px; }
.install-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--surface-2); }

/* ---------- Modal ---------- */
.modal {
  padding: 0; border: 0; background: transparent; color: var(--text);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: visible;
}
.modal-sm { width: min(420px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(12, 13, 17, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal[open] { animation: modalIn var(--t) var(--ease); }
.modal[open]::backdrop { animation: fadeIn var(--t) var(--ease); }
.modal.closing { animation: modalOut 180ms var(--ease-in-out) forwards; }
.modal.closing::backdrop { animation: fadeOut 180ms var(--ease-in-out) forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.modal-card {
  display: flex; flex-direction: column; max-height: calc(100vh - 32px);
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { font-size: 20px; font-weight: 700; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; border-top: 1px solid var(--border); }
.modal[data-mode="edit"] .new-only { display: none; }
.modal:not([data-mode="edit"]) .edit-only { display: none; }

/* ---------- Toasts & alerts ---------- */
.toasts { position: fixed; z-index: 100; top: 86px; right: 16px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px;
  border-radius: 18px; background: var(--btn-dark-bg); color: var(--btn-dark-fg); box-shadow: var(--shadow-lg); font-size: 14px;
  animation: toastIn 420ms var(--ease) both;
}
.toast.leaving { animation: toastOut 260ms var(--ease-in-out) forwards; }
.toast > span:nth-child(2) { flex: 1; padding-top: 1px; }
.toast-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; flex: none; background: var(--green); color: #fff; }
.toast-error .toast-icon { background: var(--danger); }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; border: 0; padding: 0; border-radius: 8px; background: none; color: inherit; opacity: 0.6; }
.toast-close:hover { opacity: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(0.96); } }

.alert { padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; animation: dropIn var(--t) var(--ease); }
.alert-error { background: rgba(229, 72, 77, 0.10); color: #C2363B; border: 1px solid rgba(229, 72, 77, 0.2); }
.alert-success { background: var(--chip-paid-bg); color: var(--chip-paid-fg); }
:root[data-theme="dark"] .alert-error { color: #FF8A8E; }

/* ---------- Auth ---------- */
body.auth { background: var(--bg); }
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden; margin: 16px; border-radius: 32px; color: #fff;
  background:
    radial-gradient(700px 500px at 0% 100%, rgba(240, 140, 0, 0.45), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(0, 81, 255, 0.55), transparent 60%),
    #0C0D11;
}
.auth-art-inner { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px; }
.auth-copy h2 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; max-width: 520px; }
.auth-copy p { margin-top: 16px; font-size: 17px; color: rgba(255, 255, 255, 0.72); max-width: 420px; }
.auth-cards { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 520px; }
.mini-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 22px; animation: floatIn 800ms var(--ease) both; }
.mini-card small { font-size: 13px; font-weight: 600; opacity: 0.9; }
.mini-card strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.mini-chip { align-self: flex-start; margin-top: 6px; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: rgba(12, 13, 17, 0.25); }
.mc-blue { background: var(--blue); animation-delay: 150ms; }
.mc-green { background: var(--green); animation-delay: 300ms; }
.mc-orange { background: var(--orange); grid-column: span 2; max-width: 60%; animation-delay: 450ms; }
@keyframes floatIn { from { opacity: 0; transform: translateY(24px); } }

.auth-form-wrap { position: relative; display: grid; place-items: center; padding: 48px 24px; }
.auth-theme { position: absolute; top: 24px; right: 24px; }
.auth-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; animation: floatIn 600ms var(--ease) both; }
.auth-form h1 { font-size: 34px; }
.auth-form > .muted { margin-top: -8px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--blue); font-weight: 700; }
:root[data-theme="dark"] .auth-switch a { color: #7EA6FF; }

/* ---------- Reveal animation ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 600ms var(--ease), transform 600ms var(--ease); transition-delay: calc(var(--i, 0) * 55ms); }

/* Page transition */
body.app .page { animation: pageIn 420ms var(--ease) both; }
body.leaving .page { opacity: 0; transform: translateY(6px); transition: opacity 180ms var(--ease-in-out), transform 180ms var(--ease-in-out); }
@keyframes pageIn { from { opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid > :first-child { grid-column: span 2; }
  .ledger-top { grid-template-columns: 1fr; }
  .avatar-meta { display: none; }
}

@media (max-width: 900px) {
  .nav-pills { display: none; }
  .topbar { border-radius: 22px; }
  .topbar-actions { margin-left: auto !important; }
  .tabbar {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    display: flex; justify-content: space-around; gap: 4px; padding: 6px;
    background: var(--surface); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
    border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 16px;
    font-size: 11px; font-weight: 600; color: var(--muted); transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
  }
  .tabbar a.active { background: var(--btn-dark-bg); color: var(--btn-dark-fg); }
  .page { padding-bottom: 120px; }
  .toasts { top: auto; bottom: 100px; }
  .settings-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

@media (max-width: 760px) {
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger tr.entry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 16px 4px; border-bottom: 1px solid var(--border); }
  .ledger tr.entry-row:hover { background: transparent; }
  .ledger td { padding: 0; border: 0; }
  .ledger td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .ledger .num { text-align: left; }
  .ledger .desc { grid-column: span 2; max-width: none; }
  .progress.xs { margin-left: 0; }
  .row-actions { grid-column: span 2; text-align: left; display: flex; gap: 6px; flex-wrap: wrap; }
  .row-actions .icon-btn, .row-actions .btn { margin-left: 0; }
  .payments-row td { padding: 0 0 14px; }
  .users-table tr { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .users-table td[data-label="Name"], .users-table td[data-label="Email"] { grid-column: span 2; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { top: 8px; margin-top: 8px; padding: 8px 8px 8px 14px; }
  .brand span { font-size: 16px; }
  .stat-grid, .stat-grid-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 120px; padding: 16px; border-radius: 20px; }
  .stat-ic { width: 32px; height: 32px; }
  .stat-ic .icon { width: 16px; height: 16px; }
  .stat-grid-3 .stat-card:last-child { grid-column: span 2; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > :first-child { grid-column: auto; }
  .panel { padding: 16px; border-radius: 22px; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head > .btn { width: 100%; }
  .head-stats { width: 100%; justify-content: space-between; gap: 12px; }
  .head-stats .btn { width: 100%; }
  .toolbar .select-wrap { flex: 1 1 calc(50% - 5px); }
  .modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; }
  .modal-card { border-radius: 26px 26px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .modal[open] { animation: sheetIn 340ms var(--ease); }
  .modal.closing { animation: sheetOut 220ms var(--ease-in-out) forwards; }
  .pay-summary { grid-template-columns: 1fr 1fr; }
  .segmented span { font-size: 13px; padding: 0 8px; }
}
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .topbar, .tabbar, .toolbar, .row-actions, .card-actions, .toasts, .page-head .btn, .bg-glow { display: none !important; }
  .panel, .stat-card { box-shadow: none; backdrop-filter: none; border: 1px solid #ddd; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Confirm dialog ---------- */
.confirm-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 28px; }
.confirm-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: rgba(229, 72, 77, 0.12); color: var(--danger); margin-bottom: 4px; animation: pop 420ms var(--ease) both; }
.confirm-body p { max-width: 320px; }
#confirmModal .modal-foot { justify-content: stretch; }
#confirmModal .modal-foot .btn { flex: 1; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #CF3A3F; box-shadow: 0 8px 20px -8px rgba(229, 72, 77, 0.7); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

/* Smooth colour change when switching theme */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 350ms var(--ease), color 350ms var(--ease), border-color 350ms var(--ease), fill 350ms var(--ease) !important;
}

/* ---------- Who did it ---------- */
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.who-avatar { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 9px; font-weight: 700; letter-spacing: 0.02em; }
.who-role { padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.who-role.role-admin { background: var(--btn-dark-bg); color: var(--btn-dark-fg); }
.who-role.role-user { background: var(--chip-part-bg); color: var(--chip-part-fg); }
.by-line { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.by-line .who { font-size: 11px; color: var(--muted); }
.vendor-by { margin-top: -6px; }
.pay-main .who { margin-top: 4px; }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.act { position: relative; display: flex; gap: 14px; padding: 10px 0; }
.act + .act::before { content: ""; position: absolute; left: 17px; top: -12px; height: 22px; width: 2px; background: var(--border-strong); }
.act-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); transition: transform var(--t) var(--ease); }
.act:hover .act-ic { transform: scale(1.08); }
.act-created .act-ic { background: var(--chip-part-bg); color: var(--chip-part-fg); border-color: transparent; }
.act-paid .act-ic { background: var(--chip-paid-bg); color: var(--chip-paid-fg); border-color: transparent; }
.act-updated .act-ic { background: var(--chip-out-bg); color: var(--chip-out-fg); border-color: transparent; }
.act-deleted .act-ic { background: rgba(229, 72, 77, 0.10); color: var(--danger); border-color: transparent; }
.act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.act-main p { font-size: 14px; font-weight: 500; color: var(--text); }
.act-link { margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--blue); white-space: nowrap; }
:root[data-theme="dark"] .act-link { color: #7EA6FF; }
.act-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.act-meta time { font-size: 12px; color: var(--muted); }

.filter-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--btn-dark-bg); color: var(--btn-dark-fg); font-size: 13px; font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; }
@media (max-width: 1120px) and (min-width: 901px) {
  .nav-pills a { padding: 9px 13px; }
  .brand span { display: none; }
}

/* ---------- Export ---------- */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.range-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.range-presets button {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-solid); color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.range-presets button:hover { background: var(--surface-2); color: var(--text); }
.range-presets button:active { transform: scale(0.96); }
.range-presets button.active { background: var(--btn-dark-bg); color: var(--btn-dark-fg); border-color: transparent; }
@media (max-width: 640px) {
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
}
