/* ===================================================================
   NIKHITH BIRRU - BUDGET VAULT & 50/20/30 WORKSHEET STYLES
   Fully matches the portfolio design tokens, sleek glassmorphism,
   dark/light theme, and exact 50/20/30 worksheet visual layout.
   =================================================================== */

/* Custom properties specific to Budget Worksheet */
:root {
  --color-needs: #2563eb;
  --color-needs-rgb: 37, 99, 235;
  --color-needs-light: #3b82f6;
  --color-needs-bg: rgba(37, 99, 235, 0.08);

  --color-wants: #d97706;
  --color-wants-rgb: 217, 119, 6;
  --color-wants-light: #f59e0b;
  --color-wants-bg: rgba(245, 158, 11, 0.08);

  --color-savings: #059669;
  --color-savings-rgb: 5, 150, 105;
  --color-savings-light: #10b981;
  --color-savings-bg: rgba(16, 185, 129, 0.08);

  --color-income: #3b82f6;
  --color-chart-orange: #ea580c;
  --color-chart-orange-rgb: 234, 88, 12;
}

[data-theme="dark"] {
  --worksheet-header-bg: #1e293b;
  --worksheet-header-border: #334155;
  --table-border: rgba(255, 255, 255, 0.08);
  --table-row-alt: rgba(255, 255, 255, 0.02);
  --table-row-hover: rgba(59, 130, 246, 0.08);
  --summary-bg: #151e34;
  --chart-card-bg: #0f172a;
}

[data-theme="light"] {
  --worksheet-header-bg: #e2e8f0;
  --worksheet-header-border: #cbd5e1;
  --table-border: #e2e8f0;
  --table-row-alt: #f8fafc;
  --table-row-hover: #f1f5f9;
  --summary-bg: #f1f5f9;
  --chart-card-bg: #ffffff;
}

/* Page Background */
body.budget-body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* -------------------------------------------------------------
   PIN AUTHENTICATION SCREEN
   ------------------------------------------------------------- */
.pin-screen-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.15), transparent 70%), var(--bg-canvas);
}

.pin-container {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  text-align: center;
  animation: modalEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.pin-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.pin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.pin-back-link:hover {
  color: var(--primary);
}

.pin-theme-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pin-theme-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pin-shield-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  box-shadow: var(--glow-primary);
}

.pin-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.pin-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* 6 PIN Digit Input Boxes */
.pin-digits-wrap {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.pin-digit-box {
  width: 48px;
  height: 56px;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
}

.pin-digit-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.pin-digit-box.filled {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
}

.pin-feedback {
  min-height: 20px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.pin-feedback.error {
  color: var(--red);
}

.pin-feedback.success {
  color: var(--emerald);
}

/* Virtual Numpad */
.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.num-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  height: 52px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  user-select: none;
}

.num-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.num-btn:active {
  transform: scale(0.96);
}

.num-btn.num-action {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.pin-primary-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.pin-primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.pin-hints-box {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.quick-demo-pill {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-demo-pill:hover {
  background: var(--primary);
  color: #fff;
}

/* Shake Animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

/* -------------------------------------------------------------
   MAIN BUDGET APPLICATION HEADER
   ------------------------------------------------------------- */
.budget-app-wrapper {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

.budget-app-wrapper.active {
  display: flex;
}

.budget-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.topbar-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.back-to-portfolio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.back-to-portfolio:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.budget-logo-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon-nb {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.03em;
}

.app-title-text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: none;
}

@media (min-width: 768px) {
  .app-title-text {
    display: inline-block;
  }
}

/* Month Switcher Toolbar */
.month-switcher-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.3rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.month-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.month-nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.month-display-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.month-display-btn:hover {
  color: var(--primary);
}

.today-shortcut-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-right: 0.25rem;
}

.today-shortcut-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Topbar Right Controls */
.topbar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-toggle-wrap {
  display: inline-flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.2rem;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.view-toggle-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.currency-select-btn,
.privacy-toggle-btn,
.pin-status-pill,
.lock-vault-btn,
.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  height: 34px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0 0.65rem;
  gap: 0.35rem;
}

.privacy-toggle-btn,
.theme-toggle-btn {
  width: 34px;
  padding: 0;
}

.pin-status-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.pin-status-pill:hover {
  background: rgba(59, 130, 246, 0.16);
}

.lock-vault-btn {
  color: var(--red);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
}

.lock-vault-btn:hover {
  background: rgba(239, 68, 68, 0.18);
}

.topbar-controls button:hover {
  border-color: var(--primary);
}

@media (max-width: 767px) {
  .budget-topbar {
    padding: 0.65rem 0.75rem;
  }

  .topbar-container {
    align-items: stretch;
    flex-direction: column;
    gap: 0.65rem;
  }

  .topbar-brand {
    justify-content: space-between;
  }

  .month-switcher-bar {
    align-self: center;
    max-width: 100%;
  }

  .month-display-btn {
    min-width: 0;
    padding-inline: 0.55rem;
  }

  .topbar-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .view-toggle-wrap {
    flex: 1 1 100%;
  }

  .view-toggle-btn {
    flex: 1;
    justify-content: center;
    padding-inline: 0.45rem;
  }

  .pin-status-pill {
    max-width: min(52vw, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .back-text {
    display: none;
  }

  .month-display-btn {
    font-size: 0.85rem;
  }

  .today-shortcut-btn {
    font-size: 0.7rem;
    padding-inline: 0.3rem;
  }

  .view-toggle-btn {
    font-size: 0.74rem;
  }

  .currency-select-btn {
    max-width: 76px;
    padding-inline: 0.35rem;
  }

  .lock-vault-btn {
    font-size: 0;
    width: 34px;
    padding: 0;
  }

  .lock-vault-btn i {
    font-size: 1rem;
  }
}

/* -------------------------------------------------------------
   MAIN CONTENT CONTAINER
   ------------------------------------------------------------- */
.budget-main-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
}

/* -------------------------------------------------------------
   WORKSHEET HEADER BAR (Matches attached image)
   ------------------------------------------------------------- */
.worksheet-header-banner {
  background: var(--worksheet-header-bg);
  border: 1px solid var(--worksheet-header-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.worksheet-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
}

.worksheet-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

.worksheet-title-separator {
  color: var(--text-muted);
  font-weight: 600;
}

.worksheet-meta-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-left: auto;
}

@media (max-width: 540px) {
  .worksheet-header-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem 0.65rem;
    padding: 0.7rem 0.8rem;
  }

  .worksheet-title-row {
    grid-column: 1;
    grid-row: 1;
    gap: 0.45rem;
  }

  .worksheet-title {
    font-size: 1.15rem;
    white-space: nowrap;
  }

  .worksheet-month-tag {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .worksheet-meta-tools {
    grid-column: 2;
    grid-row: 1;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .worksheet-meta-tools .btn-pill-action:not(.btn-accent) {
    padding-inline: 0.5rem;
  }
}

.worksheet-month-tag {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-pill-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-pill-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-pill-action.btn-accent {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-pill-action.btn-accent:hover {
  background: var(--primary-hover);
}

.clear-month-btn {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
  padding-inline: 0.55rem;
}

.clear-month-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--red);
}

.export-icon-btn {
  padding-inline: 0.55rem;
}

/* -------------------------------------------------------------
   ROW 1: INCOME & NOTES (Matches attached image)
   ------------------------------------------------------------- */
.income-notes-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .income-notes-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Shell */
.sheet-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sheet-card-header {
  background: var(--worksheet-header-bg);
  border-bottom: 1.5px solid var(--worksheet-header-border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  margin: 0;
}

.sheet-card-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Worksheet Table Styles */
.worksheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.worksheet-table th {
  background: var(--worksheet-header-bg);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--table-border);
  text-align: left;
}

.worksheet-table th.col-amount {
  text-align: right;
  width: 130px;
}

.worksheet-table th.col-actions {
  text-align: center;
  width: 60px;
}

.worksheet-table td {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--table-border);
  color: var(--text-main);
  vertical-align: middle;
}

.worksheet-table td.col-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
  letter-spacing: -0.01em;
}

.worksheet-table tr:nth-child(even) td {
  background: var(--table-row-alt);
}

.worksheet-table tr:hover td {
  background: var(--table-row-hover);
}

.table-tag-pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  margin-left: 0.4rem;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
  vertical-align: middle;
}

.table-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.row-action-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.row-action-btn:hover {
  color: var(--text-main);
}

.row-action-btn.btn-delete:hover {
  color: var(--red);
}

.table-add-row {
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--table-border);
  background: var(--bg-surface);
}

.add-entry-inline-btn {
  background: transparent;
  border: 1px dashed var(--border-subtle);
  width: 100%;
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.add-entry-inline-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

/* Total Bar at Bottom of Table */
.sheet-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--worksheet-header-bg);
  border-top: 2px solid var(--worksheet-header-border);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.sheet-total-bar .total-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

/* Notes Lined Card */
.notes-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.5rem;
  background: var(--bg-surface);
}

.notes-textarea {
  width: 100%;
  height: 100%;
  min-height: 160px;
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 2rem;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  background-attachment: local;
  background-image: repeating-linear-gradient(
    transparent,
    transparent calc(2rem - 1px),
    var(--table-border) calc(2rem - 1px),
    var(--table-border) 2rem
  );
}

/* -------------------------------------------------------------
   ROW 2: THE 50 / 30 / 20 THREE-COLUMN CARDS
   (Matches exact colors in attached screenshot)
   ------------------------------------------------------------- */
.budget-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 960px) {
  .budget-categories-grid {
    grid-template-columns: 1fr;
  }
}

/* Category Card Headers */
.category-card {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border-subtle);
}

.category-card.card-needs {
  border-top: 4px solid var(--color-needs);
}

.category-card.card-wants {
  border-top: 4px solid var(--color-wants-light);
}

.category-card.card-savings {
  border-top: 4px solid var(--color-savings-light);
}

/* Bold colored banners matching image */
.cat-banner {
  padding: 0.75rem 1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-banner.banner-needs {
  background: #2563eb; /* Blue in screenshot */
}

.cat-banner.banner-wants {
  background: #f59e0b; /* Yellow/Gold in screenshot */
  color: #0f172a;
}

.cat-banner.banner-savings {
  background: #70b86a; /* Pastel green in screenshot */
  color: #0f172a;
}

[data-theme="dark"] .cat-banner.banner-savings {
  background: #2e7d32;
  color: #ffffff;
}

[data-theme="dark"] .cat-banner.banner-wants {
  background: #d97706;
  color: #ffffff;
}

.cat-banner-percent {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.cat-banner-info {
  text-align: right;
}

.cat-banner-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.cat-banner-target {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.95;
}

/* Category Total Footer */
.cat-total-footer {
  padding: 0.7rem 1rem;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-total-footer.footer-needs {
  background: #2563eb;
  color: #ffffff;
}

.cat-total-footer.footer-wants {
  background: #f59e0b;
  color: #0f172a;
}

.cat-total-footer.footer-savings {
  background: #70b86a;
  color: #0f172a;
}

[data-theme="dark"] .cat-total-footer.footer-wants {
  background: #d97706;
  color: #ffffff;
}

[data-theme="dark"] .cat-total-footer.footer-savings {
  background: #2e7d32;
  color: #ffffff;
}

.cat-total-footer .cat-total-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

/* Category Progress Indicator */
.cat-progress-wrap {
  padding: 0.5rem 0.85rem;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cat-variance-badge {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.cat-variance-badge.positive {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
}

.cat-variance-badge.negative {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

/* -------------------------------------------------------------
   ROW 3: SUMMARY BARS (Matches attached screenshot)
   ------------------------------------------------------------- */
.summary-bars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-wide-bar {
  background: var(--worksheet-header-bg);
  border: 1.5px solid var(--worksheet-header-border);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.summary-wide-bar .summary-value {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
}

.summary-wide-bar.diff-bar .summary-value.positive {
  color: var(--emerald);
}

.summary-wide-bar.diff-bar .summary-value.negative {
  color: var(--red);
}

/* -------------------------------------------------------------
   ROW 4: VISUAL CHARTS (Matches attached screenshot)
   ------------------------------------------------------------- */
.charts-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: var(--chart-card-bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.chart-svg-container {
  width: 100%;
  height: 280px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tooltip */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -100%);
  transition: opacity 0.15s ease;
  opacity: 0;
  z-index: 10;
  white-space: nowrap;
}

/* Legend */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.85rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* -------------------------------------------------------------
   YEARLY REPORT VIEW
   ------------------------------------------------------------- */
.yearly-view-wrapper {
  display: none;
  animation: fadeIn 0.3s ease;
}

.yearly-view-wrapper.active {
  display: block;
}

.yearly-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .yearly-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .yearly-kpis-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.yearly-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* -------------------------------------------------------------
   MODALS (Add/Edit Entry, Data Backup, Month Picker)
   ------------------------------------------------------------- */
.budget-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.budget-modal-backdrop.active {
  display: flex;
}

.budget-modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  position: relative;
  animation: modalEnter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1.4rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.modal-header-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.modal-header-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Form Controls */
.budget-form-group {
  margin-bottom: 1.15rem;
}

.budget-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.budget-input,
.budget-select {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.budget-input:focus,
.budget-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Preset Category Chips */
.tag-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.tag-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-chip:hover,
.tag-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.modal-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Privacy Mode Blur */
body.privacy-mode .col-amount,
body.privacy-mode .summary-value,
body.privacy-mode .total-value,
body.privacy-mode .cat-banner-target,
body.privacy-mode .cat-total-val,
body.privacy-mode .kpi-val {
  filter: blur(6px);
  user-select: none;
  transition: filter 0.2s ease;
}

body.privacy-mode .col-amount:hover,
body.privacy-mode .summary-value:hover,
body.privacy-mode .total-value:hover {
  filter: blur(0);
}

/* Toast */
.budget-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.budget-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.budget-toast-undo {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: 0.5rem;
}

/* Mobile Quick Floating Action Button */
.mobile-fab-add {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.75rem;
  box-shadow: var(--shadow-lg), var(--glow-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  transition: transform var(--transition-fast);
}

.mobile-fab-add:active {
  transform: scale(0.92);
}

@media (max-width: 680px) {
  .mobile-fab-add {
    display: flex;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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


/* -------------------------------------------------------------
   MULTI-USER PIN & PASSWORD AUTHENTICATION STYLES
   ------------------------------------------------------------- */
.auth-step {
  display: none;
  animation: fadeIn 0.25s ease;
}

.auth-step.active {
  display: block;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.password-input-wrap .budget-input {
  padding-right: 42px;
}

.toggle-password-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.toggle-password-btn:hover {
  color: var(--text-main);
}

.active-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

/* Password Rules Checklist */
.pw-rules-checklist {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  text-align: left;
}

.pw-rules-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
  transition: color var(--transition-fast);
}

.pw-rule:last-child {
  margin-bottom: 0;
}

.pw-rule i {
  font-size: 0.95rem;
}

.pw-rule.valid {
  color: var(--emerald);
  font-weight: 600;
}

.pw-rule.valid i::before {
  content: "\eb7b"; /* remixicon ri-checkbox-circle-fill */
}

/* Request PIN footer link */
.pin-request-link-wrap {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pin-request-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.pin-request-btn:hover {
  color: var(--primary-hover);
}

/* -------------------------------------------------------------
   ADMIN CONTROLS & APPROVALS MODAL
   ------------------------------------------------------------- */
.admin-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-admin-approvals {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  height: 34px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-admin-approvals:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-admin-approvals.visible {
  display: inline-flex;
}

.badge-count {
  background: var(--red);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}

.badge-count.zero {
  display: none;
}

/* Approvals Modal Card Layout */
.approvals-modal-card {
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}

.approvals-section {
  margin-bottom: 1.5rem;
}

.approvals-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.approval-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.approval-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.approval-pin-tag {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.approval-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.approval-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-approve {
  background: var(--emerald);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.btn-approve:hover {
  background: #059669;
}

.btn-reject {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.btn-reject:hover {
  background: var(--red);
  color: #fff;
}

.status-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.status-chip.approved {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip.pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Cloud DB Box */
.cloud-db-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.cloud-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.cloud-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
}

.cloud-dot.connected {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* -------------------------------------------------------------
   MULTI-USER PIN & PASSWORD AUTHENTICATION STYLES
   ------------------------------------------------------------- */
.auth-step {
  display: none;
  animation: fadeIn 0.25s ease;
}

.auth-step.active {
  display: block;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.password-input-wrap .budget-input {
  padding-right: 42px;
}

.toggle-password-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.toggle-password-btn:hover {
  color: var(--text-main);
}

.active-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

/* Password Rules Checklist */
.pw-rules-checklist {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 1rem 0;
  text-align: left;
}

.pw-rules-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pw-rule {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
  transition: color var(--transition-fast);
}

.pw-rule:last-child {
  margin-bottom: 0;
}

.pw-rule i {
  font-size: 0.95rem;
}

.pw-rule.valid {
  color: var(--emerald);
  font-weight: 600;
}

.pw-rule.valid i::before {
  content: "\eb7b"; /* remixicon ri-checkbox-circle-fill */
}

/* Request PIN footer link */
.pin-request-link-wrap {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pin-request-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.pin-request-btn:hover {
  color: var(--primary-hover);
}

/* -------------------------------------------------------------
   ADMIN CONTROLS & APPROVALS MODAL
   ------------------------------------------------------------- */
.admin-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.btn-admin-approvals {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  height: 34px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-admin-approvals:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-admin-approvals.visible {
  display: inline-flex;
}

.badge-count {
  background: var(--red);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}

.badge-count.zero {
  display: none;
}

/* Approvals Modal Card Layout */
.approvals-modal-card {
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}

.approvals-section {
  margin-bottom: 1.5rem;
}

.approvals-section-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.approvals-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.approval-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.approval-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.approval-pin-tag {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.approval-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.approval-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-approve {
  background: var(--emerald);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.btn-approve:hover {
  background: #059669;
}

.btn-reject {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.btn-reject:hover {
  background: var(--red);
  color: #fff;
}

.status-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.status-chip.approved {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip.pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Cloud DB Box */
.cloud-db-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.cloud-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.cloud-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
}

.cloud-dot.connected {
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}


/* Cloud Diagnostics Box */
.cloud-diag-box {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
  display: none;
}

.cloud-diag-box.loading {
  display: block;
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.cloud-diag-box.success {
  display: block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cloud-diag-box.error {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.cloud-diag-box code {
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: inline-block;
  margin-top: 0.25rem;
}
