/* ===================================================================
   Guardian Mesh Admin Dashboard — Light Theme
   =================================================================== */

/* ── CSS Variables ─────────────────────────────────────────────────── */
:root {
  /* ── Colors ─────────────────────────────────────────────────────── */
  --bg-primary: #f4f6f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f5;
  --bg-input: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);

  --accent: #1a73e8;
  --accent-dim: rgba(26, 115, 232, 0.1);
  --accent-hover: #1557b0;
  --accent-green: #0d9f6e;
  --accent-green-dim: rgba(13, 159, 110, 0.1);
  --accent-green-hover: #0ab87a;
  --accent-red: #dc2626;
  --accent-red-dim: rgba(220, 38, 38, 0.1);
  --accent-red-hover: #e04545;
  --accent-orange: #d97706;
  --accent-orange-dim: rgba(217, 119, 6, 0.1);
  --accent-orange-hover: #e5a00d;
  --accent-yellow: #ca8a04;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #6b7280;
  --text-tertiary: #9ca3af;
  --text-on-accent: #ffffff;
  --border: #e5e7eb;
  --border-light: #d1d5db;

  /* ── Spacing (4px base) ─────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Typography ─────────────────────────────────────────────────── */
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;

  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;

  --tracking-tight: -0.02em;

  /* ── Layout ─────────────────────────────────────────────────────── */
  --sidebar-width: 240px;
  --header-height: 60px;
  --header-height-mobile: 48px;
  --touch-target: 44px;

  /* ── Radii ──────────────────────────────────────────────────────── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* ── Shadows ────────────────────────────────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.12);

  /* ── Z-Index ────────────────────────────────────────────────────── */
  --z-sticky: 10;
  --z-flash: 20;
  --z-sidebar-backdrop: 30;
  --z-sidebar: 35;
  --z-dropdown: 40;
  --z-modal: 50;
  --z-toast: 60;

  /* ── Fonts ──────────────────────────────────────────────────────── */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* ── Transitions ────────────────────────────────────────────────── */
  --transition-fast: 0.15s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
  --transition-sidebar: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ===================================================================
   LOGIN SCREEN
   =================================================================== */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}
.login-screen[hidden] {
  display: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 40px);
  width: 100%;
  max-width: min(420px, calc(100vw - 32px));
  box-shadow: var(--shadow-xl);
  animation: loginCardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo svg {
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.login-error {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

/* ===================================================================
   FORMS
   =================================================================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  display: block;
  width: 100%;
  padding: var(--space-3);
  min-height: var(--touch-target);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus),
.form-group textarea:hover:not(:focus) {
  border-color: var(--border-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 20px;
}

.form-group-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 8px;
}

.inline-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group {
  margin-bottom: 0;
}

/* ===================================================================
   BUTTONS
   =================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  min-height: var(--touch-target);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: var(--accent-red);
  color: var(--text-on-accent);
  border-color: var(--accent-red);
}

.btn-danger:hover:not(:disabled) {
  background: var(--accent-red-hover);
  border-color: var(--accent-red-hover);
}

.btn-warning {
  background: var(--accent-orange);
  color: var(--text-on-accent);
  border-color: var(--accent-orange);
}

.btn-warning:hover:not(:disabled) {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
}

.btn-success {
  background: var(--accent-green);
  color: var(--text-on-accent);
  border-color: var(--accent-green);
}

.btn-success:hover:not(:disabled) {
  background: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-sm);
  min-height: 36px;
}

.btn-xs {
  padding: 6px 12px;
  font-size: var(--text-sm);
  min-height: 32px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-text {}
.btn-loading { display: none; }

/* ===================================================================
   HEADER
   =================================================================== */

.header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

.header-brand:hover {
  text-decoration: none;
}

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

.header-nav {
  display: none; /* Hide horizontal nav - using dropdown instead */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}
.header-email-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}
.header-email-icon:hover { color: var(--text-primary); }
.header-email-icon svg { display: inline-block; }

.header-user,
#logout-btn {
  display: none; /* Hide - shown in dropdown */
}

/* Dropdown Menu */
.header-dropdown {
  position: relative;
}

.header-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-target);
  height: var(--touch-target);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-dropdown-toggle:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  padding: var(--space-2);
}

.header-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px var(--space-3);
  min-height: var(--touch-target);
  text-align: left;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-decoration: none;
  border: none;
  background: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.header-dropdown-item:hover {
  background: var(--bg-primary);
  text-decoration: none;
}

.header-dropdown-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.header-dropdown-item.logout {
  color: var(--accent-red);
}

.header-dropdown-item.logout:hover {
  background: var(--accent-red-dim);
}

.header-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.header-dropdown-user {
  display: block;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.header-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.header-menu-btn:hover,
.header-menu-btn[aria-expanded="true"] {
  color: var(--text-primary);
  background: var(--bg-primary);
}

.header-nav-footer {
  display: none;
}

/* ===================================================================
   TABS
   =================================================================== */

.tab-btn {
  padding: 10px var(--space-4);
  min-height: var(--touch-target);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.tab-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.sub-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.sub-tab-btn {
  padding: 10px var(--space-3);
  min-height: 36px;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.sub-tab-btn.active {
  color: var(--accent);
  background: var(--bg-card);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.page-shell .tab-content {
  display: block;
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
}

/* ===================================================================
   MAIN CONTENT
   =================================================================== */

.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8);
}

.page-shell-body {
  display: block;
}

.page-shell.has-sidebar .page-shell-body {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: start;
}

.page-sidebar {
  position: sticky;
  top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: var(--space-5) var(--space-4);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

.flash-stack {
  position: fixed;
  top: 72px;
  right: var(--space-6);
  z-index: var(--z-flash);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.flash-message {
  min-width: 220px;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  color: var(--text-on-accent);
}

.flash-success {
  background: var(--accent-green);
}

.flash-error {
  background: var(--accent-red);
}

.flash-warning {
  background: var(--accent-orange);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
  letter-spacing: var(--tracking-tight);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header .section-title {
  margin-bottom: 0;
}

.section-actions {
  display: flex;
  gap: 8px;
}

/* ===================================================================
   CARDS
   =================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

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

.card-header .card-title {
  margin-bottom: 0;
}

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

/* ===================================================================
   STAT CARDS
   =================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-blue {
  background: var(--accent-dim);
  color: var(--accent);
}

.stat-icon-green {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}

.stat-icon-orange {
  background: var(--accent-orange-dim);
  color: var(--accent-orange);
}

.stat-icon-cyan {
  background: var(--accent-dim);
  color: var(--accent);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===================================================================
   OVERVIEW GRID
   =================================================================== */

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ===================================================================
   PROGRESS BARS
   =================================================================== */

.progress-container {
  margin-bottom: 12px;
}

.progress-bar {
  height: 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  background: var(--accent);
  width: 0%;
}

.progress-fill.green { background: var(--accent-green); }
.progress-fill.orange { background: var(--accent-orange); }
.progress-fill.red { background: var(--accent-red); }

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===================================================================
   SECURITY & INFO ROWS
   =================================================================== */

.security-stats,
.bundles-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-row,
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.security-row:last-child,
.info-row:last-child {
  border-bottom: none;
}

.security-label,
.info-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.security-value,
.info-value {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.memory-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.details-grid .detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.details-grid .detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.details-grid .detail-value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===================================================================
   TABLES
   =================================================================== */

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.04);
}

.data-table td.mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.data-table td.truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===================================================================
   STATUS BADGES
   =================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-online,
.badge-active,
.badge-open,
.badge-passed,
.badge-approved,
.badge-paid {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}

.badge-offline,
.badge-closed,
.badge-rejected,
.badge-cancelled {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

.badge-pending,
.badge-draft,
.badge-scheduled {
  background: var(--accent-orange-dim);
  color: var(--accent-orange);
}

.badge-settled,
.badge-completed {
  background: var(--accent-dim);
  color: var(--accent);
}

.badge-private {
  background: rgba(136, 136, 170, 0.15);
  color: var(--text-secondary);
}

/* ===================================================================
   PAGINATION
   =================================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0 0;
}

.pagination button {
  padding: var(--space-2) 14px;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  font-size: var(--text-sm);
  font-family: var(--font);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination button:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.pagination button.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0 8px;
}

/* ===================================================================
   MODAL
   =================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-5);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - var(--space-6));
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.modal-sm {
  max-width: 420px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  width: var(--touch-target);
  height: var(--touch-target);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-primary);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 20px;
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 400px;
  border: 1px solid transparent;
}

.toast-success {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border-color: rgba(0, 255, 136, 0.3);
}

.toast-error {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: rgba(255, 68, 68, 0.3);
}

.toast-info {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0, 212, 255, 0.3);
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ===================================================================
   SKELETON LOADING
   =================================================================== */

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-primary) 25%, var(--bg-card-hover) 50%, var(--bg-primary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text.lg {
  height: 24px;
  width: 60%;
}

.skeleton-text.sm {
  height: 10px;
  width: 40%;
}

/* ===================================================================
   MODAL ANIMATIONS
   =================================================================== */

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

@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay:not([hidden]) {
  animation: modalOverlayIn 0.2s ease;
}

.modal-overlay:not([hidden]) .modal {
  animation: modalIn 0.25s ease;
}

/* Responsive table cards - consolidated into responsive section below */

/* ===================================================================
   LOADING SPINNER
   =================================================================== */

/* loading overlay removed */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===================================================================
   EMPTY STATE
   =================================================================== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--bg-primary);
  border-radius: 50%;
  color: var(--text-secondary);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.empty-state-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ===================================================================
   ACTION RESULT
   =================================================================== */

.action-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.action-result.success {
  background: var(--accent-green-dim);
  color: var(--accent-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.action-result.error {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border: 1px solid rgba(255, 68, 68, 0.3);
}

/* ===================================================================
   PERIODS LIST (Revenue)
   =================================================================== */

.periods-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.period-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.period-card:hover {
  border-color: var(--border-light);
}

.period-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  gap: 12px;
}

.period-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.period-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.period-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.period-details {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.period-details.expanded {
  display: block;
}

.period-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.period-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.period-info-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.period-info-value {
  font-size: 0.9rem;
  font-weight: 500;
}

.period-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Settlement preview table inside period */
.settlement-preview {
  margin-top: 12px;
}

.settlement-preview .data-table {
  font-size: 0.8rem;
}

/* ===================================================================
   VOTES LIST (Corporate)
   =================================================================== */

.votes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vote-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.vote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vote-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.vote-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.vote-ballots {
  margin: 12px 0;
}

.vote-result-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-primary);
  margin-bottom: 8px;
}

.vote-result-for {
  background: var(--accent-green);
}

.vote-result-against {
  background: var(--accent-red);
}

.vote-result-abstain {
  background: var(--text-muted);
}

.vote-result-labels {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.vote-result-labels span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vote-result-labels .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-for { background: var(--accent-green); }
.dot-against { background: var(--accent-red); }
.dot-abstain { background: var(--text-muted); }

.vote-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===================================================================
   ACTION ITEMS LIST (Corporate)
   =================================================================== */

.actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.action-item:hover {
  border-color: var(--border-light);
}

.action-item.completed {
  opacity: 0.6;
}

.action-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  background: none;
  color: transparent;
  font-size: 0.8rem;
  padding: 0;
}

.action-checkbox.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: var(--text-on-accent);
}

.action-label {
  flex: 1;
  font-size: 0.9rem;
}

.action-item.completed .action-label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.action-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.action-item-actions {
  display: flex;
  gap: 4px;
}

.priority-badge {
  font-size: var(--text-xs);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  font-weight: 600;
}

.priority-high {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

.priority-medium {
  background: var(--accent-orange-dim);
  color: var(--accent-orange);
}

.priority-low {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ===================================================================
   TEXT HELPERS
   =================================================================== */

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

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

.text-green {
  color: var(--accent-green);
}

.text-red {
  color: var(--accent-red);
}

.text-orange {
  color: var(--accent-orange);
}

.text-mono {
  font-family: var(--font-mono);
}

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */

/* ── 1440px+ ultrawide ───────────────────────────────────────────── */
@media (min-width: 1440px) {
  .main-content {
    max-width: 1600px;
    padding: var(--space-8) var(--space-12);
  }
}

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

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 768px ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header {
    flex-wrap: nowrap;
    height: auto;
    min-height: var(--header-height-mobile);
    padding: var(--space-2) var(--space-4);
    gap: var(--space-2);
    position: sticky;
    top: 0;
  }

  .header-menu-btn {
    display: flex;
    margin-left: auto;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) var(--space-3);
    z-index: var(--z-sidebar);
    gap: 2px;
    overflow: visible;
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav .tab-btn {
    width: 100%;
    text-align: left;
    padding: var(--space-3) 14px;
    border-radius: var(--radius);
    font-size: var(--text-base);
  }

  .header-nav .tab-btn.active {
    background: var(--accent-dim);
    font-weight: 600;
  }

  .header-nav .tab-btn:hover {
    background: var(--bg-primary);
  }

  .header-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin-top: var(--space-1);
    border-top: 1px solid var(--border);
  }

  .header-nav-user {
    color: var(--text-secondary);
    font-size: var(--text-base);
  }

  .header-right {
    display: none;
  }

  .main-content {
    padding: var(--space-4);
  }

  /* Email pages should be edge-to-edge on mobile */
  body.email-page .main-content,
  .email-layout .main-content {
    padding: 0;
  }

  /* Sidebar drawer on mobile */
  .page-shell.has-sidebar .page-shell-body {
    grid-template-columns: 1fr;
  }

  .page-sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height-mobile);
    bottom: 0;
    width: var(--sidebar-width);
    min-height: auto;
    border-right: 1px solid var(--border);
    border-bottom: none;
    z-index: var(--z-sidebar);
    transform: translateX(-100%);
    transition: transform var(--transition-sidebar);
    box-shadow: none;
    overflow-y: auto;
  }

  .page-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height-mobile);
    background: rgba(0, 0, 0, 0.4);
    z-index: var(--z-sidebar-backdrop);
    transition: opacity 0.25s;
  }

  .sidebar-backdrop.visible {
    display: block;
  }

  /* Sidebar toggle button */
  .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
  }

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

  /* Card header stacking */
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form .form-group {
    margin-bottom: var(--space-3);
  }

  .inline-form .btn {
    width: 100%;
  }

  /* Sub-tabs horizontal scroll with fade */
  .sub-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .sub-tabs::-webkit-scrollbar {
    display: none;
  }

  .period-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .period-dates {
    flex-direction: column;
    gap: var(--space-1);
  }

  .memory-details {
    grid-template-columns: 1fr;
  }

  /* Modal: bottom-sheet on small screens */
  .modal-overlay {
    padding: var(--space-2);
  }

  .modal-header {
    padding: var(--space-4) var(--space-4) 0;
  }

  .modal-body {
    padding: var(--space-4);
  }

  .modal-footer {
    padding: 0 var(--space-4) var(--space-4);
  }

  /* Toast: full-width on mobile */
  .toast-container {
    right: var(--space-3);
    left: var(--space-3);
    bottom: var(--space-4);
  }

  .toast {
    max-width: 100%;
  }

  /* Button group stacking */
  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }

  /* Email filter buttons */
  .em-filter {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ── Responsive table cards (768px) ──────────────────────────────── */
@media (max-width: 768px) {
  .data-table.responsive-cards,
  .tab-content .data-table,
  .data-table.responsive-cards thead,
  .tab-content .data-table thead,
  .data-table.responsive-cards tbody,
  .tab-content .data-table tbody,
  .data-table.responsive-cards th,
  .tab-content .data-table th,
  .data-table.responsive-cards td,
  .tab-content .data-table td,
  .data-table.responsive-cards tr,
  .tab-content .data-table tr {
    display: block;
  }

  .data-table.responsive-cards thead,
  .tab-content .data-table thead {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .data-table.responsive-cards tbody,
  .tab-content .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .data-table.responsive-cards tbody tr,
  .tab-content .data-table tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
  }

  .data-table.responsive-cards td,
  .tab-content .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid var(--border);
  }

  .data-table.responsive-cards td:last-child,
  .tab-content .data-table td:last-child {
    border-bottom: none;
  }

  .data-table.responsive-cards td::before,
  .tab-content .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: var(--space-3);
    min-width: 80px;
  }

  .data-table.responsive-cards td:first-child,
  .tab-content .data-table td:first-child {
    font-weight: 600;
    font-size: var(--text-base);
    padding-bottom: 10px;
    margin-bottom: 2px;
    border-bottom: 2px solid var(--border);
  }

  .data-table.responsive-cards td:first-child::before,
  .tab-content .data-table td:first-child::before {
    display: none;
  }

  /* Section header/total rows in report tables */
  .tab-content .data-table .section-header td,
  .tab-content .data-table .section-total td {
    display: block;
    text-align: left;
    padding: 10px 0;
  }

  .tab-content .data-table .section-header td::before,
  .tab-content .data-table .section-total td::before {
    display: none;
  }

  .tab-content .data-table .section-header td[colspan] {
    font-size: var(--text-base);
    font-weight: 700;
    border-bottom: 2px solid var(--accent);
    color: var(--accent);
  }
}

/* ── 480px (small phones) ────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .section-title {
    font-size: var(--text-lg);
  }

  /* Email pages edge-to-edge on mobile */
  body.email-page .main-content,
  .email-layout .main-content {
    padding: 0;
  }

  .main-content {
    padding: var(--space-2) var(--space-3);
  }

  /* Edge-to-edge cards */
  .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: var(--space-4) var(--space-3);
    margin-bottom: var(--space-2);
  }

  .tab-content .data-table tbody tr {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: var(--space-3) var(--space-2);
  }

  /* Details grid single column */
  .details-grid {
    grid-template-columns: 1fr;
  }

  /* Stat card compact */
  .stat-card {
    padding: var(--space-4);
  }

  /* Modal bottom sheet */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    max-width: 100%;
  }
}

/* ── Landscape orientation (phones) ──────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {
  .header { height: 40px; }
  .modal { max-height: calc(100dvh - var(--space-4)); }
  .login-card { padding: var(--space-4) var(--space-6); }
}

/* ===================================================================
   MISSING CLASS DEFINITIONS
   =================================================================== */

/* Profile grid (governance page) */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* Period dates (revenue page) */
.period-dates {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Report section styling (accounting reports) */
.section-header td {
  background: var(--bg-primary);
  font-weight: 600;
  font-size: 0.85rem;
}
.section-total td {
  border-top: 2px solid var(--border);
  font-weight: 700;
}

/* Email management filters */
.em-filter {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
  transition: all var(--transition);
}

.em-filter:hover:not(.active) {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.em-filter.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* Badge aliases (semantic) */
.badge-success {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}
.badge-warning {
  background: var(--accent-orange-dim);
  color: var(--accent-orange);
}
.badge-primary {
  background: var(--accent-dim);
  color: var(--accent);
}
.badge-danger {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}
.badge-secondary {
  background: rgba(136,136,170,0.15);
  color: var(--text-secondary);
}

/* ===================================================================
   EXECUTIVE DASHBOARD (Overview)
   =================================================================== */

/* Stat icon — red variant */
.stat-icon-red {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

/* Text color utilities for financial values */
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }

/* Skeleton loading animation */
.ov-loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ov-skeleton-lines {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.ov-skeleton-lines::before,
.ov-skeleton-lines::after {
  content: '';
  display: block;
  height: 14px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-primary) 50%, var(--border) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-xs);
  animation: ovShimmer 1.5s infinite;
}

.ov-skeleton-lines::before { width: 80%; }
.ov-skeleton-lines::after  { width: 55%; }

@keyframes ovShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Card loaded state — remove skeleton */
.ov-loaded .ov-skeleton-lines { display: none; }
.ov-loaded.ov-loading { min-height: auto; display: block; }

/* Section subheadings within cards */
.ov-subheading {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-2) 0;
}

.ov-subheading + .ov-subheading,
.ov-fin-row + .ov-subheading,
.ov-badge-row + .ov-subheading,
.badge + .ov-subheading {
  margin-top: var(--space-4);
}

/* Financial summary rows */
.ov-fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.ov-fin-row:last-child { border-bottom: none; }
.ov-fin-label { color: var(--text-secondary); }

.ov-fin-value {
  font-weight: 600;
  font-family: var(--font-mono);
}

.ov-fin-total {
  border-top: 2px solid var(--text-primary);
  border-bottom: none;
  padding-top: 10px;
  margin-top: 2px;
}

.ov-fin-total .ov-fin-label { font-weight: 700; color: var(--text-primary); }
.ov-fin-total .ov-fin-value { font-size: var(--text-base); }

/* HR badge counters */
.ov-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-2);
}

.ov-badge-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--bg-primary);
  border: 1px solid var(--border);
}

.ov-badge-count.ov-st-active   { background: var(--accent-green-dim); color: var(--accent-green); border-color: transparent; }
.ov-badge-count.ov-st-onleave  { background: var(--accent-orange-dim); color: var(--accent-orange); border-color: transparent; }
.ov-badge-count.ov-st-terminated { background: var(--accent-red-dim); color: var(--accent-red); border-color: transparent; }

/* Alert / activity list items */
.ov-alert-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ov-alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.ov-alert-item:last-child { border-bottom: none; }

.ov-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ov-alert-dot-red    { background: var(--accent-red); }
.ov-alert-dot-orange { background: var(--accent-orange); }
.ov-alert-dot-blue   { background: var(--accent); }
.ov-alert-dot-green  { background: var(--accent-green); }

.ov-alert-text { flex: 1; color: var(--text-primary); }

.ov-alert-meta {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
  font-weight: 500;
}

/* Fundraising pipeline bars */
.ov-pipeline-item { margin-bottom: var(--space-3); }
.ov-pipeline-item:last-child { margin-bottom: 0; }

.ov-pipeline-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
}

.ov-pipeline-label span:last-child {
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.ov-pipeline-bar {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.ov-pipeline-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Network mini stat grid within overview card */
.ov-network-stats {
  gap: 12px;
  margin-bottom: var(--space-5);
}

.ov-network-stats .stat-card {
  padding: var(--space-4);
}

.ov-network-stats .stat-icon {
  width: 36px;
  height: 36px;
}

.ov-network-stats .stat-icon svg {
  width: 18px;
  height: 18px;
}

.ov-network-stats .stat-value {
  font-size: var(--text-xl);
}

/* Dashboard section spacing */
.ov-section-gap { margin-bottom: var(--space-5); }

/* ===================================================================
   PRINT STYLES
   =================================================================== */
@media print {
  .ov-loading { display: none !important; }
  .ov-skeleton-lines { display: none !important; }
  @page { margin: 1.5cm; }
  .header, .page-sidebar, .header-nav, .header-dropdown,
  .modal-overlay, .toast-container, .btn, button,
  .header-menu-btn, #toast-container, .sidebar-backdrop,
  .sidebar-toggle-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .main-content { padding: 0; max-width: 100%; }
  .page-shell-body { display: block; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .stat-card { break-inside: avoid; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .data-table { font-size: 10pt; }
  table { page-break-inside: avoid; }
  .badge { border: 1px solid currentColor; }
  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
  a[href^="#"]::after, a[href^="javascript"]::after { content: ""; }
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
