/* ==========================================================================
   Apple / Stripe Pure White Minimalist & Breathable Theme
   Clean, luminous, breathable, high legibility, corporate & elegant
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Canvas & Surfaces */
  --bg-primary: #f8fafc;        /* Slate-50 clean canvas */
  --bg-secondary: #ffffff;      /* Pure white card surface */
  --bg-tertiary: #f1f5f9;       /* Slate-100 muted controls/pills */
  --bg-hover: #f1f5f9;
  
  /* Borders */
  --border-color: #e2e8f0;      /* Slate-200 crisp border */
  --border-hover: #cbd5e1;      /* Slate-300 */
  --border-focus: #4f46e5;      /* Stripe Indigo focus */

  /* Text Hierarchy */
  --text-primary: #0f172a;      /* Slate-900 deep high-contrast */
  --text-secondary: #475569;    /* Slate-600 body text */
  --text-muted: #64748b;        /* Slate-500 secondary info */
  --text-dim: #94a3b8;          /* Slate-400 placeholders/hints */

  /* Accent Colors */
  --accent: #4f46e5;            /* Stripe Indigo */
  --accent-hover: #4338ca;
  --accent-text: #ffffff;
  --accent-dim: #eef2ff;

  --accent-blue: #2563eb;       /* Royal Blue */
  --accent-blue-dim: #eff6ff;

  --success: #059669;           /* Emerald */
  --success-dim: #ecfdf5;

  --danger: #e11d48;            /* Rose */
  --danger-dim: #fff1f2;

  --warning: #d97706;           /* Amber */
  --warning-dim: #fffbeb;

  --purple: #7c3aed;
  --purple-dim: #f5f3ff;

  /* Geometry & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Geist", "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image: radial-gradient(at 50% 0%, #ffffff 0%, var(--bg-primary) 70%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  background-color: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.domain-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'Geist Mono', monospace;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}

.user-badge.viewer {
  background: var(--warning-dim);
  border-color: #fde68a;
  color: var(--warning);
}

.viewer-notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--warning-dim);
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  padding: 0.65rem 2rem;
  font-size: 0.85rem;
}

.banner-icon {
  font-size: 1.1rem;
}

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

/* Date Range Filter Section */
.date-filter-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.date-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.date-filter-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Apple-style segmented control */
.date-filter-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: 8px;
}

.date-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}

.date-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.5);
}

.date-tab-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.current-range-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.775rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid #c7d2fe;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-weight: 500;
}

.range-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.custom-date-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.custom-label {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.date-input {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.date-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.date-sep {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Stats Overview Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.stat-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  font-size: 1.15rem;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  font-family: 'Geist Mono', monospace;
  letter-spacing: -0.03em;
}

.stat-value.text-accent {
  color: var(--accent-blue);
}

.stat-value.text-success {
  color: var(--success);
}

.stat-value-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value-uv {
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
}

.stat-value-uv-green {
  background: var(--success-dim);
  border-color: #a7f3d0;
  color: var(--success);
}

.stat-value-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stat-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* Action & Filter Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}

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

.search-wrap input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.search-wrap input:focus {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search-wrap input::placeholder {
  color: var(--text-dim);
}

.client-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.filter-select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  font-weight: 500;
}

.filter-select option {
  background: #ffffff;
  color: var(--text-primary);
}

/* Buttons (Stripe & Apple Style) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  border-color: var(--accent);
  padding: 0.55rem 1.15rem;
  box-shadow: 0 1px 2px 0 rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px 0 rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 0.95rem;
  box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
  background: var(--bg-primary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.775rem;
}

.btn-block {
  width: 100%;
}

.btn-icon-sm {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-icon-sm:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.text-danger {
  color: var(--danger) !important;
}

/* Links Table Card */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
  vertical-align: middle;
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover td {
  background: #f8fafc;
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.empty-state {
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-active {
  background: var(--success-dim);
  border: 1px solid #a7f3d0;
  color: var(--success);
}

.badge-inactive {
  background: var(--danger-dim);
  border: 1px solid #fecaca;
  color: var(--danger);
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid #ddd6fe;
}

.owner-badge-public {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.status-badge-active {
  color: var(--success);
  background: var(--success-dim);
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge-disabled {
  color: var(--danger);
  background: var(--danger-dim);
  border: 1px solid #fecaca;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.referer-pill {
  display: inline-block;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.825rem;
  transition: color 0.15s ease;
}

.referer-pill:hover {
  color: var(--accent);
  text-decoration: underline;
}

.referer-direct {
  color: var(--text-muted);
  font-size: 0.825rem;
}

.country-badge {
  font-size: 0.825rem;
  color: var(--text-primary);
}

.ip-text {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.device-badge {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Modals & Overlays */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-lg {
  max-width: 1100px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 2rem;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s ease;
}

.btn-close:hover {
  color: var(--text-primary);
}

.subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-control,
input[type="text"],
input[type="password"] {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.input-prefix-group {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease;
}

.input-prefix-group:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.prefix-label {
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.6rem 0.85rem;
  font-size: 0.825rem;
  font-family: 'Geist Mono', monospace;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.input-prefix-group input {
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

.required {
  color: var(--danger);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.75rem;
}

.error-msg {
  background: var(--danger-dim);
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  margin-bottom: 1rem;
}

/* Country Tabs & Logs Modal */
.country-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.country-filter-prefix {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.country-tabs-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  padding: 2px 0;
}

.country-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.775rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  font-weight: 500;
}

.country-tab-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
}

.country-tab-btn.active {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.country-tab-count {
  font-size: 0.725rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-family: 'Geist Mono', monospace;
}

.logs-body {
  flex: 1;
  overflow-y: auto;
  min-height: 260px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.logs-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.logs-count-badge {
  font-size: 0.75rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid #c7d2fe;
  padding: 3px 9px;
  border-radius: 12px;
  font-family: 'Geist Mono', monospace;
  font-weight: 600;
}

/* Login Modal */
.login-box {
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-logo-mark {
  font-size: 2.2rem;
  margin-bottom: 0.35rem;
}

/* QR Code Box */
.qr-box {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  margin: 0 auto;
}

.qr-url-text {
  margin-top: 12px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.825rem;
  color: var(--accent);
  word-break: break-all;
  text-align: center;
  font-weight: 500;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2000;
  display: none;
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .topbar { padding: 0.75rem 1rem; }
  .main-content { padding: 1.25rem 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: 100%; }
  .date-filter-row { flex-direction: column; align-items: flex-start; }
}
