/* Driftr shared design system */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');
@import url('./workspace.css');

/* ── Reset & Variables ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0c;
  --surface:   #111114;
  --surface2:  #18181b;
  --border:    #222226;
  --border2:   #2e2e32;
  --text:      #f0efe8;
  --muted:     #6b6b72;
  --accent:    #b8a98a;
  --accent2:   #b8a98a;
  --link:      #b8a98a;
  --danger:    #f87171;
  --green:     #86efac;
  --yellow:    #fde047;
  --hover:        rgba(255,255,255,0.04);
  --hover-faint:  rgba(255,255,255,0.02);
  --row-hover:    rgba(255,255,255,0.022);
  --focus-ring:   rgba(255,255,255,0.06);
  --ghost-border: rgba(255,255,255,0.3);
  --danger-soft:  #fca5a5;
  --yellow-soft:  #fde68a;
  --info:         #93c5fd;
  --on-accent:    #0a0a0c;
  --chip:           rgba(255,255,255,0.08);
  --chip-on-strong: rgba(0,0,0,0.15);
  --surface-fade:   rgba(17,17,20,0.55);
}

[data-theme="light"] {
  --bg:        #f7f6f2;
  --surface:   #fffefb;
  --surface2:  #efede7;
  --border:    #e3e1d8;
  --border2:   #d3d0c5;
  --text:      #1c1b19;
  --muted:     #716f67;
  --accent:    #8a7550;
  --accent2:   #8a7550;
  --link:      #8a7550;
  --danger:    #dc2626;
  --green:     #15803d;
  --yellow:    #a16207;
  --hover:        rgba(0,0,0,0.045);
  --hover-faint:  rgba(0,0,0,0.025);
  --row-hover:    rgba(0,0,0,0.03);
  --focus-ring:   rgba(0,0,0,0.08);
  --ghost-border: rgba(0,0,0,0.3);
  --danger-soft:  #b91c1c;
  --yellow-soft:  #854d0e;
  --info:         #1d4ed8;
  --on-accent:    #fffefb;
  --chip:           rgba(0,0,0,0.07);
  --chip-on-strong: rgba(255,255,255,0.25);
  --surface-fade:   rgba(250,249,245,0.55);
}

/* ── App shell ──────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

#main {
  flex: 1;
  overflow-y: auto;
  padding: 2.25rem 2.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── Sidebar ────────────────────────────────────────────── */
#sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 0.25rem;
}

.sidebar-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 0 0.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  line-height: 1;
}

.sidebar-brand .r { color: var(--muted); font-style: italic; }

.hub-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0 0.5rem 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

nav a:hover    { background: var(--hover); color: var(--text); }
nav a.active   { background: rgba(184,169,138,0.1); color: var(--accent); font-weight: 500; }
nav a.disabled { opacity: 0.35; pointer-events: none; cursor: default; }

.nav-group { margin-top: 0.6rem; }
.nav-group:first-child { margin-top: 0; }

.nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.4rem 0.75rem 0.2rem;
  opacity: 0.7;
  transition: opacity 0.12s;
  min-height: 32px;
}

.nav-group-label:hover { opacity: 1; }

.nav-group-chevron {
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.nav-group.open .nav-group-chevron { transform: rotate(90deg); }

.nav-group-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.nav-group.open .nav-group-items { grid-template-rows: 1fr; }

.nav-group-items-inner { overflow: hidden; min-height: 0; }

nav a.nav-sub { padding-left: 1.85rem; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.user-email {
  font-size: 0.73rem;
  color: var(--muted);
  padding: 0 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-signout {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.12s, color 0.12s;
}

.btn-signout:hover { border-color: var(--danger); color: var(--danger); }

.btn-switch-hub,
.btn-switch-portal,
.btn-create-hub {
  display: block;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
}

.btn-switch-hub:hover,
.btn-switch-portal:hover,
.btn-create-hub:hover { border-color: var(--accent); color: var(--accent); }

.btn-theme-toggle {
  display: block;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.12s, color 0.12s;
}

.btn-theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.billing-lock-banner {
  background: rgba(184, 169, 138, 0.08);
  border: 1px solid rgba(184, 169, 138, 0.35);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.55;
}

.billing-lock-banner a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.25rem;
}

.billing-lock-banner a:hover { text-decoration: underline; }

.domain-status.billing-warning .status-dot { background: var(--yellow); }

/* ── Page header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s, background 0.15s;
  border: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.92;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--ghost-border);
  color: var(--text);
  background: var(--hover);
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
}
.btn-danger-ghost:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.78rem; border-radius: 6px; }

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-family: inherit;
}
.btn-link:hover { color: var(--text); }

/* ── Forms ──────────────────────────────────────────────── */
.form-grid  { display: grid; gap: 1rem; }
.form-stack { display: flex; flex-direction: column; gap: 1rem; }

.field            { display: flex; flex-direction: column; gap: 0.35rem; }
.field.full       { grid-column: 1 / -1; }

.field label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.field input,
.field textarea,
.field select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.6rem 0.875rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--border2);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.field select option  { background: var(--surface2); }
textarea              { resize: vertical; min-height: 80px; }

.form-hint, .field-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
  line-height: 1.4;
}

.role-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  background: var(--hover);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.role-hint a { color: var(--accent, var(--text)); text-decoration: underline; }

.btn-row { display: flex; gap: 0.6rem; margin-top: 0.25rem; align-items: center; }

/* ── Toolbar ────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 340px;
}

.search-wrap input { padding-left: 2.25rem; width: 100%; }

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}

tbody tr            { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: var(--row-hover); }
tbody td            { padding: 0.75rem 1rem; vertical-align: middle; }

.td-muted { color: var(--muted); font-size: 0.82rem; }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 5px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-active    { background: rgba(74,222,128,0.12);  color: var(--green); }
.badge-inactive  { background: rgba(100,116,139,0.14); color: var(--muted); }
.badge-published { background: rgba(74,222,128,0.12);  color: var(--green); }
.badge-draft     { background: rgba(100,116,139,0.14); color: var(--muted); }
.badge-cancelled { background: rgba(239,68,68,0.12);   color: var(--danger); }
.badge-pending   { background: rgba(184,169,138,0.1);  color: var(--accent); }
.badge-paid      { background: rgba(74,222,128,0.12);  color: var(--green); }
.badge-overdue   { background: rgba(239,68,68,0.12);   color: var(--danger); }
.badge-void      { background: rgba(100,116,139,0.14); color: var(--muted); }
.badge-all       { background: rgba(184,169,138,0.12); color: var(--accent); }

/* ── Feedback ───────────────────────────────────────────── */
.feedback {
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  display: none;
  line-height: 1.5;
}

.feedback.visible { display: block; }

.feedback.error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--danger-soft);
}

.feedback.success {
  background: rgba(134,239,172,0.06);
  border: 1px solid rgba(134,239,172,0.18);
  color: var(--green);
}

.feedback.warn {
  background: rgba(250,204,21,0.07);
  border: 1px solid rgba(250,204,21,0.18);
  color: var(--yellow-soft);
}

/* ── Skeleton ───────────────────────────────────────────── */
.skeleton {
  background: var(--border);
  border-radius: 6px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── Side panel ─────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  padding: 2rem 1.75rem;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
}

.panel.open { transform: translateX(0); }

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

/* ── Actions column ──────────────────────────────────────── */
.actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Event title links ───────────────────────────────────── */
.event-title-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.12s;
}

.event-title-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Link bar (no raw URLs shown) ─────────────────────────── */
.link-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.link-bar-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.link-bar-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.link-bar-path {
  font-size: 0.85rem;
  color: var(--text);
}

.link-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-family: inherit;
}

.btn-text:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.btn-text.copied { color: var(--green); text-decoration: none; }

.copy-btn,
.btn-copy {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.copy-btn:hover,
.btn-copy:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.btn-copy.copied { color: var(--green); text-decoration: none; }

/* ── Hub logo upload ───────────────────────────────────────── */
.hub-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.hub-logo-display {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.hub-logo-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}

.hub-profile-info {
  flex: 1;
  min-width: 0;
}

.logo-upload-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.logo-upload-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-upload-preview img,
.logo-upload-preview .hub-logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.logo-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.logo-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── Profile photo avatars ─────────────────────────────────── */
.ws-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 999px;
  color: #f8f6f0;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  object-fit: cover;
}
.ws-avatar-sm { width: 30px; height: 30px; font-size: 0.66rem; }
.ws-avatar-md { width: 38px; height: 38px; font-size: 0.76rem; }
.ws-avatar-lg { width: 46px; height: 46px; font-size: 0.86rem; }
.ws-avatar-xl { width: 84px; height: 84px; font-size: 1.5rem; }

.avatar-picker { display: flex; align-items: center; gap: 1.1rem; }
.avatar-picker-frame { position: relative; flex-shrink: 0; }

.avatar-picker-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.12s;
}

.avatar-picker-btn:hover { opacity: 0.85; }
.avatar-picker-input { display: none; }
.avatar-picker-hint { font-size: 0.8rem; color: var(--muted); }

/* ── List row links ────────────────────────────────────────── */
.list-row-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.12s;
}

.list-row-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Mobile responsive ─────────────────────────────────────── */
.mobile-topbar { display: none; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 40;
}

.sidebar-overlay.open { display: block; }

@media (max-width: 900px) {
  body { flex-direction: column; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .mobile-topbar-brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  .mobile-topbar-hub {
    font-size: 0.75rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 300px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

  #sidebar.open { transform: translateX(0); }

  #sidebar nav {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  #sidebar nav a { padding: 0.6rem 0.75rem; font-size: 0.9rem; }

  .user-email { max-width: 140px; }

  #main { padding: 1.25rem 1rem; }

  .page-header { flex-wrap: wrap; gap: 0.75rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .hub-profile-header { flex-direction: column; align-items: center; text-align: center; }

  .copy-row { flex-wrap: wrap; }

  .panel { width: 100%; }
}

/* ── Reports ─────────────────────────────────────────────── */
.report-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
}

.report-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.report-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
}

.report-tile-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.report-tile-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.report-tile-value.green { color: var(--green); }
.report-tile-value.accent { color: var(--accent); }
.report-tile-value.warn { color: var(--yellow); }

.report-tile-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

.report-note {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 62ch;
}

.report-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status-breakdown {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface2);
  margin: 0.75rem 0 0.5rem;
}

.status-breakdown-seg { min-width: 4px; transition: width 0.2s; }
.status-breakdown-seg.pending  { background: var(--yellow); }
.status-breakdown-seg.approved { background: var(--accent); }
.status-breakdown-seg.paid     { background: var(--green); }
.status-breakdown-seg.denied   { background: var(--danger); opacity: 0.55; }

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.bar-row:last-child { border-bottom: none; }

.bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(184,169,138,0.55), var(--accent));
  border-radius: 999px;
  min-width: 2px;
}

.bar-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.td-num { text-align: right; font-variant-numeric: tabular-nums; }

.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.empty-hint {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0;
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  .stat-tile { padding: 1rem; }

  .stat-value { font-size: 1.5rem; }

  .list-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .list-row-meta,
  .list-row-amount { text-align: left; }
}
