/* =========================================================
   ReclaimTime — Application Styles
   Philosophy: Clear, restrained, readable, timeless
   ========================================================= */

/* -----------------------------
   1. Design Tokens
   ----------------------------- */

:root {
  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --text-primary: #0f172a;   /* slate-900 */
  --text-secondary: #475569; /* slate-600 */
  --text-muted: #64748b;     /* slate-500 */

  /* Backgrounds */
  --bg-page: #f8fafc;        /* slate-50 */
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;      /* slate-100 */

  /* Accents */
  --accent: #2563eb;         /* blue-600 */
  --accent-soft: #dbeafe;    /* blue-100 */

  /* Borders */
  --border: #e5e7eb;         /* gray-200 */

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  /* Layout */
  --content-width: 920px;

  /* ========== Semantic Color Tokens (UI Refactor Phase 1) ========== */

  /* Success (green spectrum) */
  --color-success-bg: #d1fae5;
  --color-success-bg-alt: #a7f3d0;
  --color-success-border: #6ee7b7;
  --color-success: #059669;
  --color-success-dark: #047857;
  --color-success-text: #065f46;

  /* Warning (yellow/amber spectrum) */
  --color-warning-bg: #fef3c7;
  --color-warning-bg-alt: #fde68a;
  --color-warning-border: #fbbf24;
  --color-warning: #f59e0b;
  --color-warning-text: #92400e;
  --color-warning-text-darker: #78350f;

  /* Info (blue spectrum) */
  --color-info-bg: #eff6ff;
  --color-info-bg-alt: #dbeafe;
  --color-info-border: #93c5fd;
  --color-info: #3b82f6;
  --color-info-text: #1e40af;

  /* Danger (red spectrum) */
  --color-danger-bg: #fef2f2;
  --color-danger-bg-alt: #fca5a5;
  --color-danger: #dc2626;
  --color-danger-dark: #991b1b;
  --color-danger-text: #7f1d1d;

  /* Neutral & Accents */
  --color-muted: #64748b;
  --color-danger-accent: #ea580c; /* Orange - for "canceled" states */

  /* ========== Utility Tokens ========== */

  /* Gaps (for layout utilities) */
  --gap-sm: 0.5rem;
  --gap-md: 1rem;
  --gap-lg: 1.5rem;
}

/* -----------------------------
   2. Base Reset
   ----------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.5;
}

/* -----------------------------
   3. Page Layout
   ----------------------------- */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  padding: var(--space-lg);
}

/* Mobile spacing */
@media (max-width: 640px) {
  .container {
    padding: var(--space-md);
  }
}

/* -----------------------------
   4. Typography
   ----------------------------- */

h1, h2, h3 {
  margin: 0 0 var(--space-sm) 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-secondary);
}

.small {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

a:hover {
  text-decoration: underline;
}

/* -----------------------------
   5. Surfaces & Cards
   ----------------------------- */

.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.card {
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* Summary header layout */
.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
}

.summary-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Entries header - compact layout (Option 4) */
.entries-header-compact {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.entries-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
  gap: var(--space-md);
}

.entries-title-group {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.entries-title-group h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.entries-date-range {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.entries-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.view-mode-select {
  display: flex;
  gap: 2px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-select-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border: none;
}

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

.view-select-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.button-compact {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.entries-nav-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-content: center;
}

.nav-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 8px;
  transition: all 0.15s;
}

.nav-link:hover {
  text-decoration: underline;
}

.nav-link-today {
  font-weight: 500;
  padding: 4px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.nav-link-disabled {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: none;
}

/* Mobile summary and entries layout */
@media (max-width: 640px) {
  .card {
    padding: var(--space-md);
  }

  .summary-header {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-actions {
    margin-top: var(--space-md);
  }

  .summary-actions .button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Compact entries header mobile */
  .entries-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .entries-title-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .entries-title-group h3 {
    font-size: 1rem;
  }

  .entries-date-range {
    font-size: 0.85rem;
  }

  .entries-controls {
    width: 100%;
    justify-content: space-between;
  }

  .view-mode-select {
    flex: 1;
  }

  .view-select-btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
  }

  .button-compact {
    flex-shrink: 0;
    padding: 10px 16px;
  }

  .entries-nav-row {
    gap: var(--space-sm);
  }

  .nav-link {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
  }

  .nav-link-today {
    padding: 10px 12px;
  }
}

.card + .card {
  margin-top: var(--space-lg);
}

/* -----------------------------
   6. Top Navigation
   ----------------------------- */

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Main navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-width: 0;
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Account dropdown */
.account-dropdown {
  position: relative;
}

.account-button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.account-button:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.account-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-icon {
  transition: transform 0.2s;
}

.account-button:hover .dropdown-icon {
  transform: translateY(1px);
}

.account-menu {
  position: absolute;
  top: calc(100% + var(--space-xs));
  right: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: var(--space-xs);
  z-index: 100;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-decoration: none;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.account-menu-item:hover {
  background: var(--bg-subtle);
}

.account-menu-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.account-menu-logout {
  margin-top: var(--space-xs);
  padding-top: var(--space-md);
  padding-bottom: var(--space-sm);
  border-top: 1px solid var(--border);
}

.account-menu-logout:hover {
  background: #fef2f2;
  color: #dc2626;
}

.account-menu-logout:hover svg {
  color: #dc2626;
}

/* Mobile navigation adjustments */
@media (max-width: 640px) {
  .main-nav {
    gap: var(--space-md);
  }

  .account-name {
    max-width: 100px;
  }
}

/* -----------------------------
   7. Flash Messages
   ----------------------------- */

.flash-notice,
.flash-alert {
  position: relative;
  padding: var(--space-md);
  padding-right: calc(var(--space-md) + 32px);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  animation: slideIn 0.3s ease-out;
}

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

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

.flash-notice {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.flash-alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.flash-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: currentColor;
  cursor: pointer;
  padding: var(--space-xs);
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.flash-close:hover {
  opacity: 1;
}

/* -----------------------------
   8. Toolbar / Filters
   ----------------------------- */

.toolbar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.toolbar-group {
  display: flex;
  gap: var(--space-sm);
}

/* View mode toggle (Week / Month) */
.view-mode-toggle {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.toggle-btn {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}

.toggle-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

/* Date navigation */
.date-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
}

.current-range {
  text-align: center;
}

.current-range h2 {
  margin: 0;
}

.today-link {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.85rem;
  color: var(--accent);
}

.nav-btn {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
}

.nav-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Mobile date navigation */
@media (max-width: 640px) {
  .view-mode-toggle .toggle-btn {
    flex: 1;
    padding: 12px 16px; /* Larger touch target */
    text-align: center;
  }

  .date-navigation {
    gap: var(--space-sm);
  }

  .current-range h2 {
    font-size: 1.1rem;
  }

  .nav-btn {
    padding: 12px 20px; /* Larger touch target */
    flex-shrink: 0;
  }
}

/* -----------------------------
   9. Buttons
   ----------------------------- */

button, .button {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}

button:hover, .button:hover {
  background: var(--bg-subtle);
}

button.primary, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 500;
}

button.primary:hover, .button.primary:hover {
  background: #1d4ed8; /* blue-700 */
}

button.button-secondary, .button.button-secondary {
  background: #f1f5f9; /* slate-100 */
  border-color: #cbd5e1; /* slate-300 */
  color: #475569; /* slate-600 */
}

button.button-secondary:hover, .button.button-secondary:hover {
  background: #e2e8f0; /* slate-200 */
  border-color: #94a3b8; /* slate-400 */
  color: #334155; /* slate-700 */
}

/* Mobile button optimizations */
@media (max-width: 640px) {
  button, .button {
    padding: 12px 16px; /* Larger touch target (44px min) */
    font-size: 0.9rem;
  }

  .edit-link {
    padding: 8px 12px; /* Ensure minimum 44px touch target */
    display: inline-block;
    margin: -8px -12px; /* Negative margin to maintain visual spacing */
  }
}

/* -----------------------------
   10. Tables (Core UI)
   ----------------------------- */

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

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

thead {
  background: var(--bg-subtle);
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sortable table headers */
.sortable-header {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}

.sortable-header:hover {
  color: var(--accent);
  text-decoration: none;
}

.sortable-header.active {
  color: var(--accent);
  font-weight: 700;
}

tbody tr:hover {
  background: var(--bg-subtle);
}

tbody tr td:last-child {
  text-align: right;
}

.edit-link {
  color: var(--accent);
  font-size: 0.875rem;
  text-decoration: none;
}

.edit-link:hover {
  text-decoration: underline;
}

/* Mobile table optimizations */
@media (max-width: 640px) {
  th, td {
    padding: 12px 8px;
    font-size: 0.85rem;
  }

  table {
    font-size: 0.85rem;
  }

  /* Make Edit column sticky on mobile so it's always visible */
  th:last-child,
  td:last-child {
    position: sticky;
    right: 0;
    background: var(--bg-surface);
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
  }

  thead th:last-child {
    background: var(--bg-subtle);
  }

  tbody tr:hover td:last-child {
    background: var(--bg-subtle);
  }

  /* Reduce timestamp column on mobile */
  th:nth-child(4),
  td:nth-child(4) {
    font-size: 0.75rem;
  }
}

/* -----------------------------
   11. Badges / Status
   ----------------------------- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 500;
}

.badge.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* -----------------------------
   12. Forms
   ----------------------------- */

input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* -----------------------------
   13. Edit Modal
   ----------------------------- */

.edit-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1000;
}

.edit-modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.edit-modal-header h3 {
  margin: 0;
}

.edit-modal-close {
  background: none;
  border: none;
  padding: var(--space-xs);
  cursor: pointer;
  color: var(--text-muted);
}

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

.edit-form-group {
  margin-bottom: var(--space-md);
}

.edit-form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.edit-form-group input[type="text"],
.edit-form-group input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.edit-form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.edit-form-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-start;
  align-items: center;
  margin-top: var(--space-md);
}

.edit-form-actions form {
  width: 100%;
}

.edit-form-right-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

.edit-btn-cancel {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
}

.edit-btn-cancel:hover {
  background: var(--bg-subtle);
}

.edit-btn-save {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
}

.edit-btn-save:hover {
  background: #1d4ed8;
}

.edit-btn-delete {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.edit-btn-delete:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Mobile modal optimizations */
@media (max-width: 640px) {
  .edit-modal-overlay {
    padding: var(--space-md);
  }

  .edit-modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .edit-form-group label {
    font-size: 0.9rem;
  }

  .edit-form-group input {
    padding: 14px 12px; /* Larger touch target */
    font-size: 1rem; /* Prevents zoom on iOS */
  }

  .edit-form-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .edit-form-right-actions {
    width: 100%;
    flex-direction: column-reverse;
  }

  .edit-btn-cancel,
  .edit-btn-save,
  .edit-btn-delete {
    width: 100%;
    padding: 14px 16px; /* Larger touch target */
    text-align: center;
    font-size: 1rem;
  }

  .edit-modal-close {
    padding: var(--space-sm); /* Larger touch target */
  }
}

/* -----------------------------
   14. CSV Preview
   ----------------------------- */

.csv-preview-card {
  margin-top: var(--space-lg);
}

.csv-preview-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.csv-toggle-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.csv-preview-content {
  margin-top: var(--space-md);
}

.csv-preview {
  background: var(--bg-subtle);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* -----------------------------
   15. Utilities (Minimal)
   ----------------------------- */

.stack > * + * {
  margin-top: var(--space-md);
}

.right {
  text-align: right;
}

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

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

/* ==========================================
   UI Refactor Phase 1: Semantic Utilities
   ========================================== */

/* ===== Banner Variants ===== */

.banner {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  line-height: 1.5;
}

.banner-success {
  background: linear-gradient(135deg, var(--color-success-bg) 0%, var(--color-success-bg-alt) 100%);
  border-color: var(--color-success-border);
  color: var(--color-success-text);
}

.banner-warning {
  background: linear-gradient(135deg, var(--color-warning-bg) 0%, var(--color-warning-bg-alt) 100%);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text-darker);
}

.banner-info {
  background: linear-gradient(135deg, var(--color-info-bg) 0%, var(--color-info-bg-alt) 100%);
  border-color: var(--color-info-border);
  color: var(--color-info-text);
}

.banner-danger {
  background: linear-gradient(135deg, var(--color-danger-bg) 0%, var(--color-danger-bg-alt) 100%);
  border-color: var(--color-danger);
  color: var(--color-danger-text);
}

.banner h3 {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.banner p {
  margin: 0;
}

.banner a {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
}

.banner a:hover {
  opacity: 0.8;
}

/* ===== Text Utilities ===== */

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

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

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

.text-warning-dark {
  color: var(--color-warning-text);
}

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

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

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

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

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

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

/* ===== Text Alignment ===== */

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

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

.text-left {
  text-align: left;
}

/* ===== Margin Utilities ===== */

.m-0 {
  margin: 0;
}

.mb-xs {
  margin-bottom: 4px;
}

.mb-sm {
  margin-bottom: 8px;
}

.mb-md {
  margin-bottom: 12px;
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.m-auto {
  margin: 0 auto;
}

.mt-xs {
  margin-top: var(--space-xs);
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

/* ===== Padding Utilities ===== */

.pt-sm {
  padding-top: var(--space-sm);
}

.pt-md {
  padding-top: var(--space-md);
}

.pt-lg {
  padding-top: var(--space-lg);
}

.pl-lg {
  padding-left: 28px;
}

/* ===== Font Weight Utilities ===== */

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* ===== Font Size Utilities ===== */

.text-xs {
  font-size: 0.85rem;
}

.text-sm {
  font-size: 0.9rem;
}

.text-base {
  font-size: 0.95rem;
}

.text-lg {
  font-size: 1.1rem;
}

.text-xl {
  font-size: 1.2rem;
}

.text-xxl {
  font-size: 1.6rem;
}

.text-xxs {
  font-size: 0.75rem;
}

.text-uppercase {
  text-transform: uppercase;
}

.tracking-wide {
  letter-spacing: 0.05em;
}

.font-mono {
  font-family: monospace;
}

/* ===== Flex Utilities ===== */

.flex-1 {
  flex: 1;
}

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

.items-start {
  align-items: flex-start;
}

.min-w-250 {
  min-width: 250px;
}

/* ===== Line Height Utilities ===== */

.leading-normal {
  line-height: 1.5;
}

.leading-relaxed {
  line-height: 1.6;
}

/* ===== Padding Utilities ===== */

.p-lg {
  padding: 40px;
}

/* ===== Layout Utilities ===== */

.row {
  display: flex;
  align-items: center;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.row-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.stack-sm > * + * {
  margin-top: var(--gap-sm);
}

/* ===== Inline Code Style ===== */

.inline-code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
  padding: 2px 6px;
  background: var(--bg-subtle);
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ===== Status Dots ===== */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.status-dot--success {
  background-color: var(--color-success-border);
}

.status-dot--warning {
  background-color: var(--color-warning-border);
}

.status-dot--danger {
  background-color: var(--color-danger);
}

.status-dot--info {
  background-color: var(--color-info-border);
}

/* ===== Button Utilities ===== */

.btn-warning {
  background: linear-gradient(135deg, var(--color-warning) 0%, #d97706 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: scale(1.02);
}

.btn-success {
  background: var(--color-success);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-success:hover {
  background: var(--color-success-dark);
  transform: scale(1.05);
}

.btn-close {
  background: none;
  border: none;
  color: var(--color-warning-text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.btn-close:hover {
  opacity: 0.7;
}

/* ===== Perfect Entry Guide ===== */

.perfect-entry-header {
  cursor: pointer;
}

.perfect-entry-content {
  display: none;
  margin-top: var(--space-md);
}

.perfect-entry-example {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-info-text);
  line-height: 1.6;
}

.perfect-entry-format {
  font-size: 1rem;
  color: var(--color-info);
  margin-top: var(--space-md);
  font-weight: 500;
}

.perfect-entry-grid {
  display: grid;
  gap: var(--space-md);
}

.perfect-entry-item {
  padding: var(--space-md);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.perfect-entry-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.perfect-entry-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.perfect-entry-why {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-warning-bg);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
}

/* ===== Account Page Utilities ===== */

.container-narrow {
  max-width: 700px;
  margin: 0 auto;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.display-block {
  display: block;
}

.display-inline {
  display: inline;
}

.display-inline-flex {
  display: inline-flex;
}

.items-center {
  align-items: center;
}

.gap-sm {
  gap: var(--gap-sm);
}

.gap-md {
  gap: var(--gap-md);
}

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

.w-full {
  width: 100%;
}

.cursor-pointer {
  cursor: pointer;
}

/* Position utilities */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.absolute-left-dollar {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* Border utilities */
.border-t {
  border-top: 1px solid var(--border);
}

.border-b {
  border-bottom: 1px solid var(--border);
}

.border-danger {
  border-color: var(--color-danger-bg-alt);
}

/* Subscription status badges */
.status-badge {
  margin: 0;
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.6;
}

.status-box {
  padding: var(--space-md);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.status-active {
  color: var(--color-success);
}

.status-canceled {
  color: var(--color-danger-accent);
}

.status-past-due {
  color: var(--color-danger);
}

.status-free-tier {
  color: var(--color-muted);
}

/* Phone display box */
.phone-display {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: monospace;
}

/* Billing table */
.billing-table {
  width: 100%;
  font-size: 0.875rem;
}

.billing-table th {
  padding: var(--space-sm) 0;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
}

.billing-table th.text-right {
  text-align: right;
}

.billing-table td {
  padding: var(--space-md) 0;
}

/* Danger zone */
.danger-zone-box {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-bg-alt);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
}

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

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.btn-accent:hover {
  opacity: 0.9;
}

/* Inline button utilities */
.btn-inline-flex {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-sm);
}

/* Resize utilities */
.resize-vertical {
  resize: vertical;
}
/*
 * ReclaimTime Application Styles
 *


 */
