/* Modern UI/UX Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Brand palette */
  --primary: #0FA3B1; /* Primary Teal */
  --primary-dark: #0B8290; /* darker teal */
  --primary-light: #8FE3EA; /* light teal */
  --accent: #84CC16; /* Accent Lime */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #0F172A; /* Dark Slate */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--gray-900);
  background: linear-gradient(135deg, #F0FDFA 0%, #ffffff 100%); /* Mint 50 to white */
  min-height: 100vh;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Modern Header with Glassmorphism */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-logo {
  height: 42px;
  width: auto;
  display: block;
}

.brand {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}

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

.nav-spacer {
  flex: 1 1 auto;
}

.nav a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: 0.875rem;
}

.nav a:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  transform: translateY(-1px);
}

.nav a.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,0.25);
}

.nav a.disabled {
  color: var(--gray-400);
  cursor: not-allowed;
}

.nav a.disabled:hover {
  background: none;
  transform: none;
}

.nav-dropdown {
  position: relative;
  padding-bottom: 0.65rem;
  margin-bottom: -0.65rem;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: 0.875rem;
  cursor: pointer;
}

.nav-dropdown-toggle:hover,
.nav-dropdown:focus-within .nav-dropdown-toggle {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  transform: translateY(-1px);
}

.nav-dropdown.active .nav-dropdown-toggle {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,0.25);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% - 0.1rem);
  left: 0;
  min-width: 220px;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 140;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
}

.nav-dropdown-menu a:hover {
  transform: none;
}

/* Main content with glassmorphism container */
main {
  min-height: calc(100vh - 140px);
  padding: 2rem 0;
}

.main-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin: 0.75rem 0;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modern Cards */
.card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Modern Forms */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.875rem;
  letter-spacing: 0.025em;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--gray-200);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

/* Better color picker styling */
input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 0; /* native control manages its own */
  border: none; /* remove text-input border */
  background: transparent;
  cursor: pointer;
}
input[type="color"]:focus {
  outline: none;
  box-shadow: none;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 2px solid var(--gray-200);
  border-radius: 8px;
}
input[type="color"]::-moz-color-swatch {
  border: 2px solid var(--gray-200);
  border-radius: 8px;
}

/* Color picker group: swatch + small hex field */
.color-picker-group {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: center;
}
.color-picker-group .color-picker {
  width: 100%;
}
.color-swatch label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.color-hex {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.color-hex input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  background: #fff;
  height: 42px; /* align with color picker swatch height */
  box-sizing: border-box;
  margin-top: 24px;
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  letter-spacing: 0.025em;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

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

.btn-secondary {
  background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-600) 100%);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
}

/* Compact buttons */
.btn.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 0.6rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

/* Reminders compact lists */
.kv {
  list-style: none;
  padding-left: 0;
}
.kv li {
  padding: 4px 0;
}
.kv li span:last-child {
  color: var(--gray-600);
}

/* Modern toggle switches */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}
.toggle-switch:before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch.active {
  background: var(--primary);
}
.toggle-switch.active:before {
  transform: translateX(20px);
}
.toggle-switch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Reminder rows & items */
.reminder-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.reminder-row:last-child {
  border-bottom: none;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.reminder-copy {
  flex: 1;
  min-width: 0;
}
.reminder-meta {
  margin-bottom: 0.25rem;
}
.reminder-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 163, 177, 0.1);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.reminder-title {
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.35;
}
.reminder-date {
  font-size: 0.875rem;
  color: var(--gray-600);
  min-width: 72px;
  text-align: right;
  font-weight: 600;
}
.reminder-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.reminder-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px 40px;
}
.reminder-links-system {
  margin-left: 52px;
}
.reminder-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--gray-200);
  color: var(--gray-800);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.reminder-link-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(15, 163, 177, 0.35);
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
}
.section-actions {
  display: flex;
  gap: 4px;
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Modern Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.table th {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  font-weight: 700;
  color: var(--gray-800);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table tbody tr {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.table-actions {
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.table-actions > * {
  vertical-align: middle;
}

.table-actions > * + * {
  margin-left: 0.375rem;
}

.table-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  margin: 0;
  min-height: 36px; /* normalize height for Edit/PDF/Eliminar */
  line-height: 1;   /* avoid taller native button line-height */
}

.table-actions form { display: inline-flex; margin: 0; }

/* Icon-only action buttons (compact, single-line action cells) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-700);
  border-radius: 0.625rem;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.15s ease,
              color 0.15s ease,
              border-color 0.15s ease,
              box-shadow 0.15s ease;
  position: relative;
  line-height: 0;
  text-decoration: none;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gray-300);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

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

.icon-btn.is-primary:hover { color: var(--primary-dark); border-color: var(--primary-light); background: rgba(15, 163, 177, 0.06); }
.icon-btn.is-success:hover { color: #047857; border-color: #6ee7b7; background: rgba(16, 185, 129, 0.08); }
.icon-btn.is-warning:hover { color: #b45309; border-color: #fcd34d; background: rgba(245, 158, 11, 0.08); }
.icon-btn.is-danger:hover  { color: #b91c1c; border-color: #fca5a5; background: rgba(239, 68, 68, 0.08); }

/* Subtle divider between safe and destructive actions */
.table-actions .actions-sep {
  width: 1px;
  height: 22px;
  background: var(--gray-200);
  margin: 0 0.125rem;
  flex-shrink: 0;
}

/* Modern Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--primary-dark);
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

/* Login Page Specific */
.login-container {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label {
  color: var(--gray-600);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Status badges */
.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-draft { background: var(--gray-200); color: var(--gray-700); }
.status-issued { background: #FEF3C7; color: #D97706; }
.status-paid { background: #D1FAE5; color: #065F46; }
.status-cancelled { background: #FEE2E2; color: #B91C1C; }
.status-converted { background: #DBEAFE; color: #1D4ED8; }

/* Invoices page */
.invoices-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.invoices-filter-grid-compact {
  grid-template-columns: minmax(280px, 1.4fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: start;
}

.invoices-filter-block {
  min-width: 0;
}

.invoices-filter-block input,
.invoices-filter-block select {
  margin-bottom: 0;
}

.invoices-filter-search {
  grid-column: span 1;
}

.invoices-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.invoices-auto-hint {
  font-size: 0.82rem;
  color: var(--gray-500);
}

.invoices-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.group-clear-btn {
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--gray-600);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}

.group-clear-btn:hover {
  border-color: var(--gray-500);
  color: var(--gray-800);
}

.check-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.check-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-pill span {
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--gray-700);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.check-pill input:checked + span {
  border-color: var(--primary);
  background: rgba(15, 163, 177, 0.14);
  color: var(--primary-dark);
}

.invoices-summary-card {
  background: linear-gradient(135deg, rgba(15, 163, 177, 0.08) 0%, rgba(132, 204, 22, 0.08) 100%);
}

.invoices-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.invoices-active-caption {
  margin-top: 12px;
  color: var(--gray-600);
  font-size: 0.9rem;
}

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

.invoices-loading {
  opacity: 0.6;
  transition: opacity 0.16s ease;
}

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.table-sort-link:hover {
  color: var(--primary-dark);
}

.table-sort-indicator {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.invoice-row-overdue {
  box-shadow: inset 4px 0 0 var(--danger);
  background: rgba(239, 68, 68, 0.04);
}

.invoice-row-upcoming {
  box-shadow: inset 4px 0 0 var(--warning);
  background: rgba(245, 158, 11, 0.05);
}

.invoice-date-main {
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
}

.invoice-date-sub {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--gray-500);
}

.invoice-date-sub.is-danger {
  color: #B91C1C;
  font-weight: 700;
}

.invoice-date-sub.is-warning {
  color: #B45309;
  font-weight: 700;
}

.invoice-meta-warning {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #B91C1C;
  font-weight: 700;
}

.invoice-meta-upcoming {
  color: #B45309;
}

/* Mobile app shell */
.mobile-bottom-nav,
.mobile-sheet,
.mobile-sheet-overlay,
.mobile-invoice-list,
.mobile-compact-list {
  display: none;
}

.expenses-mobile-subtitle {
  display: none;
}

/* Footer */
.app-footer {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Public site */
.public-body {
  background:
    radial-gradient(circle at top left, rgba(15, 163, 177, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(132, 204, 22, 0.14), transparent 24%),
    linear-gradient(180deg, #f7fbfa 0%, #ffffff 38%, #eef7f4 100%);
}

.public-home-body {
  color: #10211d;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 110;
  backdrop-filter: blur(18px);
  background: rgba(250, 253, 252, 0.86);
  border-bottom: 1px solid rgba(15, 35, 31, 0.08);
}

.public-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.public-nav a {
  color: var(--gray-800);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.public-nav .btn {
  color: #ffffff;
}

.public-nav .btn:hover,
.public-nav .btn:focus {
  color: #ffffff;
}

.public-main {
  min-height: calc(100vh - 176px);
}

.public-main-home {
  padding: 0;
}

.public-footer {
  border-top: 1px solid rgba(15, 35, 31, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.public-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 0;
}

.public-footer-inner p {
  max-width: 32rem;
  color: var(--gray-600);
  margin-top: 0.35rem;
}

.public-footer-links {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.public-footer-links a {
  color: var(--gray-700);
  text-decoration: none;
  font-weight: 600;
}

.landing-hero {
  padding: 4.5rem 0 2.5rem;
}

.landing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 2rem;
  align-items: center;
}

.landing-copy {
  max-width: 42rem;
}

.beta-pill,
.section-kicker,
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 163, 177, 0.1);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.landing-title,
.section-lead h2,
.pricing-card h2,
.login-title {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -0.03em;
}

.landing-title {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.98;
  margin: 1rem 0 1.2rem;
  max-width: 14ch;
}

.landing-subtitle {
  font-size: 1.12rem;
  color: var(--gray-700);
  max-width: 40rem;
}

.landing-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin: 1.6rem 0 1rem;
}

.landing-footnote {
  color: var(--gray-600);
  max-width: 34rem;
}

.landing-preview {
  position: relative;
}

.preview-shell {
  position: relative;
  padding: 1rem;
  border-radius: 2rem;
  background: linear-gradient(145deg, rgba(9, 29, 26, 0.96), rgba(23, 56, 51, 0.88));
  box-shadow: 0 30px 70px rgba(13, 33, 29, 0.22);
}

.preview-toolbar {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.preview-toolbar span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.preview-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.preview-stat,
.preview-list,
.preview-note {
  border-radius: 1.25rem;
  padding: 1rem;
  background: rgba(248, 252, 251, 0.98);
}

.preview-stat strong,
.preview-note strong {
  display: block;
  font-size: 1.5rem;
  color: #11201d;
}

.preview-stat span,
.preview-note span {
  color: var(--gray-600);
  font-size: 0.92rem;
}

.preview-stat.primary {
  background: linear-gradient(145deg, rgba(15, 163, 177, 0.18), rgba(255, 255, 255, 0.98));
}

.preview-list {
  grid-column: span 2;
}

.preview-list-header,
.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.preview-list-header {
  margin-bottom: 0.8rem;
}

.preview-list-header span {
  color: var(--gray-500);
  font-size: 0.86rem;
}

.preview-row {
  padding: 0.8rem 0;
  border-top: 1px solid var(--gray-100);
}

.preview-row div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.preview-row span {
  color: var(--gray-600);
  font-size: 0.88rem;
}

.preview-row em {
  font-style: normal;
  font-weight: 700;
  color: var(--primary-dark);
}

.preview-row.overdue em {
  color: var(--danger);
}

.preview-row.muted em {
  color: var(--gray-500);
}

.preview-note {
  grid-column: span 2;
  background: linear-gradient(145deg, rgba(132, 204, 22, 0.13), rgba(255, 255, 255, 0.98));
}

.landing-strip {
  padding: 0 0 2rem;
}

.landing-strip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.landing-strip-grid > div {
  padding: 1.1rem 1.2rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(15, 35, 31, 0.08);
  box-shadow: var(--shadow-md);
}

.landing-strip-grid strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #18312d;
}

.landing-strip-grid span {
  color: var(--gray-600);
}

.landing-section {
  padding: 3.25rem 0;
}

.landing-section-contrast {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(240, 250, 246, 0.72));
  border-top: 1px solid rgba(15, 35, 31, 0.06);
  border-bottom: 1px solid rgba(15, 35, 31, 0.06);
}

.section-lead {
  max-width: 44rem;
  margin-bottom: 1.75rem;
}

.section-lead.compact {
  margin-bottom: 1.25rem;
}

.section-lead p {
  color: var(--gray-600);
  font-size: 1.02rem;
}

.feature-grid,
.benefit-list,
.flow-grid {
  display: grid;
  gap: 1rem;
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.benefit-item,
.flow-step,
.pricing-panel {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 35, 31, 0.08);
  border-radius: 1.3rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.feature-card h3,
.benefit-item strong,
.flow-step strong {
  color: #18312d;
}

.feature-card p,
.benefit-item p,
.flow-step p,
.pricing-panel p {
  color: var(--gray-600);
  margin: 0;
}

.benefit-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: rgba(15, 163, 177, 0.13);
  color: var(--primary-dark);
  font-weight: 800;
}

.pricing-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1rem;
  align-items: stretch;
  padding: 1.25rem;
  border-radius: 1.8rem;
  background: linear-gradient(145deg, #113934, #1c4a44);
  box-shadow: 0 24px 60px rgba(13, 33, 29, 0.22);
}

.pricing-copy,
.pricing-panel {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.45rem;
  padding: 1.5rem;
}

.pricing-price {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
  margin: 0.7rem 0 0.6rem;
  color: #113934;
}

.pricing-description {
  color: var(--gray-600);
  max-width: 34rem;
}

.pricing-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: #18312d;
}

.pricing-list li + li {
  margin-top: 0.45rem;
}

.pricing-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-login {
  margin-top: 0.9rem;
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.auth-shell {
  padding: 3rem 1rem 4rem;
}

.login-card-public {
  max-width: 460px;
  text-align: left;
}

.login-card-public .login-title {
  background: none;
  -webkit-text-fill-color: initial;
  color: #17332d;
  margin-top: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-sheet-open {
    overflow: hidden;
  }

  main {
    padding: 0.8rem 0 1rem;
  }

  .app-header {
    padding: 0.55rem 0;
  }

  .app-header .container {
    min-height: 42px;
  }

  .brand-logo {
    height: 34px;
  }

  .nav {
    display: none;
  }

  .nav-spacer {
    display: none;
  }
  
  .nav a {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .nav-dropdown-toggle {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .nav-dropdown-menu {
    min-width: 200px;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  input, textarea, select {
    min-height: 44px;
    padding: 0.68rem 0.82rem;
    margin-bottom: 0.65rem;
  }

  textarea {
    min-height: 92px;
  }

  .btn {
    min-height: 42px;
    padding: 0.65rem 0.95rem;
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .btn.btn-sm {
    min-height: 36px;
    padding: 0.42rem 0.7rem;
  }

  .card {
    border-radius: 0.95rem;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
  }

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

  .reminder-date {
    min-width: auto;
    text-align: left;
  }

  .reminder-links,
  .reminder-links-system {
    margin-left: 0;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .expenses-mobile-subtitle {
    display: block;
    max-width: 36rem;
    margin: 0.35rem 0 0;
    color: var(--gray-600);
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .expenses-filter-card {
    padding: 0.72rem;
  }

  .expenses-filter-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.58rem !important;
    align-items: end;
  }

  .expenses-filter-search,
  .expenses-filter-supplier,
  .expenses-filter-actions,
  .expenses-active-filters {
    grid-column: 1 / -1;
  }

  .expenses-filter-field,
  .expenses-filter-search,
  .expenses-filter-supplier {
    min-width: 0 !important;
  }

  .expenses-filter-form label {
    margin-bottom: 0.28rem;
    font-size: 0.76rem;
  }

  .expenses-filter-form input,
  .expenses-filter-form select {
    width: 100%;
    min-width: 0 !important;
    margin-bottom: 0;
  }

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

  .expenses-filter-actions .btn {
    flex: 1 1 0;
    margin: 0;
  }

  .expenses-active-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 1px;
    scrollbar-width: none;
  }

  .expenses-active-filters::-webkit-scrollbar {
    display: none;
  }

  .expenses-active-filters span {
    flex: 0 0 auto;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.28rem 0.52rem;
    border-radius: 999px;
    background: rgba(15, 163, 177, 0.09);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 800;
  }

  .expenses-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 0.75rem !important;
  }

  .expenses-summary-grid .stat-card {
    padding: 0.68rem;
  }

  .expenses-summary-grid .stat-card:nth-child(1) {
    order: 2;
  }

  .expenses-summary-grid .stat-card:nth-child(2) {
    order: 1;
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 8px;
  }

  .expenses-summary-grid .stat-card:nth-child(3) {
    order: 3;
  }

  .expenses-summary-grid .stat-card:nth-child(4) {
    order: 4;
  }

  .expenses-summary-grid .stat-card:nth-child(5) {
    order: 5;
  }

  .expenses-summary-grid .stat-card:nth-child(2) .stat-label {
    order: -1;
  }

  .expenses-mobile-list {
    gap: 9px;
  }

  .expense-mobile-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 251, 0.94));
  }

  .expense-mobile-card .mobile-compact-title strong {
    max-width: 100%;
  }

  .expense-mobile-breakdown {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 0.42rem;
  }

  .expense-mobile-breakdown span {
    padding: 0.24rem 0.48rem;
    border-radius: 999px;
    background: var(--gray-50);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--gray-600);
    font-size: 0.7rem;
    font-weight: 760;
    line-height: 1;
  }

  .invoices-filter-grid,
  .invoices-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .invoices-page-head {
    margin-bottom: 0.75rem !important;
  }

  .mobile-page-head {
    margin-bottom: 0.75rem !important;
  }

  .invoices-page-head h1,
  .mobile-page-head h1 {
    margin-bottom: 0.3rem !important;
    font-size: 1.7rem;
  }

  .invoices-page-head p,
  .mobile-page-head p {
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .invoices-primary-action,
  .mobile-page-primary-action,
  .mobile-page-actions {
    display: none !important;
  }

  .invoices-filter-grid-compact {
    grid-template-columns: 1fr 1fr;
  }

  .invoices-filter-search {
    grid-column: span 2;
  }
  
  .table-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  
  .main-container {
    padding: 0.85rem;
    margin: 0.35rem 0;
    border-radius: 1rem;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 260;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 8px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 250, 0.94)),
      radial-gradient(circle at 50% 0%, rgba(15, 163, 177, 0.16), transparent 42%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
  }

  .mobile-nav-item {
    min-width: 0;
    min-height: 50px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--gray-600);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-item:active {
    transform: translateY(1px) scale(0.98);
  }

  .mobile-nav-item.active {
    background: linear-gradient(180deg, rgba(15, 163, 177, 0.13), rgba(15, 163, 177, 0.07));
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px rgba(15, 163, 177, 0.12);
  }

  .mobile-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.55;
  }

  .mobile-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    line-height: 1;
  }

  .mobile-nav-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav-create {
    min-height: 58px;
    margin-top: -20px;
    background:
      radial-gradient(circle at 30% 15%, rgba(255, 255, 255, 0.42), transparent 32%),
      linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: 22px;
    box-shadow: 0 14px 28px rgba(15, 163, 177, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .mobile-nav-create .mobile-nav-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.4;
  }

  .mobile-sheet-overlay:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 240;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .mobile-sheet:not([hidden]) {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 270;
    display: block;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: 0.8rem;
    border-radius: 26px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 250, 0.97)),
      radial-gradient(circle at top right, rgba(132, 204, 22, 0.12), transparent 34%);
    border: 1px solid rgba(15, 23, 42, 0.09);
    box-shadow: 0 24px 68px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    animation: mobileSheetIn 0.18s ease-out;
  }

  .mobile-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: var(--gray-300);
    margin: 0 auto 0.7rem;
  }

  .mobile-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0.7rem;
  }

  .mobile-sheet-head strong {
    font-size: 1.02rem;
    letter-spacing: -0.01em;
  }

  .mobile-sheet-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
  }

  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-sheet-grid a,
  .mobile-more-list a {
    display: grid;
    gap: 2px;
    min-height: 48px;
    padding: 0.72rem 0.8rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--gray-800);
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  }

  .mobile-sheet-grid a span,
  .mobile-more-list a span {
    font-size: 0.9rem;
    font-weight: 820;
    line-height: 1.15;
  }

  .mobile-sheet-grid a small,
  .mobile-more-list a small {
    color: var(--gray-500);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
  }

  .mobile-more-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-more-list a.active {
    border-color: rgba(15, 163, 177, 0.35);
    background: linear-gradient(180deg, rgba(15, 163, 177, 0.12), rgba(15, 163, 177, 0.06));
    color: var(--primary-dark);
  }

  .mobile-more-list a.active small {
    color: var(--primary-dark);
    opacity: 0.74;
  }

  .mobile-more-groups {
    display: grid;
    gap: 12px;
  }

  .mobile-more-group {
    display: grid;
    gap: 7px;
  }

  .mobile-more-kicker {
    color: var(--gray-500);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    padding: 0 0.18rem;
  }

  .mobile-more-logout {
    color: #B91C1C !important;
  }

  .invoices-table-card,
  .mobile-table-card {
    display: none;
  }

  .invoices-empty-card,
  .mobile-empty-card {
    padding: 1.1rem !important;
  }

  .mobile-invoice-list,
  .mobile-compact-list {
    display: grid;
    gap: 8px;
  }

  .mobile-invoice-card,
  .mobile-compact-card {
    padding: 0.72rem 0.78rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
  }

  .mobile-invoice-card.is-overdue,
  .mobile-compact-card.is-danger {
    border-left: 4px solid var(--danger);
  }

  .mobile-invoice-card.is-upcoming,
  .mobile-compact-card.is-warning {
    border-left: 4px solid var(--warning);
  }

  .mobile-invoice-main,
  .mobile-compact-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-invoice-title,
  .mobile-compact-title {
    min-width: 0;
  }

  .mobile-invoice-title strong,
  .mobile-invoice-title span,
  .mobile-compact-title strong,
  .mobile-compact-title span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-invoice-title strong,
  .mobile-compact-title strong {
    color: var(--gray-900);
    font-size: 0.95rem;
    line-height: 1.2;
  }

  .mobile-invoice-title span,
  .mobile-compact-title span {
    color: var(--gray-600);
    font-size: 0.78rem;
    margin-top: 2px;
  }

  .mobile-invoice-amount,
  .mobile-compact-amount {
    color: var(--gray-900);
    font-size: 0.96rem;
    font-weight: 850;
    line-height: 1.15;
    white-space: nowrap;
  }

  .mobile-invoice-meta,
  .mobile-compact-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 8px;
    margin-top: 0.42rem;
    color: var(--gray-500);
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .mobile-invoice-warning,
  .mobile-compact-warning {
    margin-top: 0.42rem;
    color: #B45309;
    font-size: 0.74rem;
    font-weight: 800;
  }

  .mobile-invoice-warning.danger,
  .mobile-compact-warning.danger {
    color: #B91C1C;
  }

  .mobile-invoice-actions,
  .mobile-compact-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.55rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-invoice-actions::-webkit-scrollbar,
  .mobile-compact-actions::-webkit-scrollbar {
    display: none;
  }

  .mobile-invoice-actions form,
  .mobile-compact-actions form {
    flex: 0 0 auto;
  }

  .mobile-invoice-actions .btn,
  .mobile-compact-actions .btn {
    min-height: 34px;
    margin: 0;
    padding: 0.42rem 0.68rem;
    border-radius: 11px;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .mobile-invoice-secondary-actions,
  .mobile-compact-secondary-actions {
    display: flex;
    gap: 12px;
    margin-top: 0.42rem;
  }

  .mobile-invoice-secondary-actions button,
  .mobile-compact-secondary-actions button {
    border: 0;
    background: transparent;
    color: var(--gray-500);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
  }

  .mobile-invoice-secondary-actions button:hover,
  .mobile-compact-secondary-actions button:hover {
    color: var(--danger);
  }

  .dashboard-hero,
  .dashboard-kpi-grid,
  .dashboard-board-grid,
  .dashboard-bottom-grid,
  .dashboard-action-list {
    grid-template-columns: 1fr !important;
  }

  .dashboard-shell {
    gap: 10px !important;
  }

  .dashboard-hero {
    padding: 0.95rem !important;
    gap: 10px !important;
  }

  .dashboard-hero-copy p {
    font-size: 0.9rem !important;
  }

  .dashboard-hero-actions {
    gap: 6px !important;
    margin-top: 12px !important;
  }

  .dashboard-hero-actions .btn {
    flex: 1 1 auto;
    min-width: max-content;
    margin: 0;
  }

  .dashboard-hero-summary,
  .dashboard-focus-grid,
  .dashboard-mini-grid,
  .dashboard-tax-grid {
    gap: 8px !important;
  }

  .dashboard-hero-metric,
  .dashboard-kpi-card,
  .dashboard-mini-stat,
  .dashboard-tax-card {
    padding: 0.72rem 0.78rem !important;
    border-radius: 14px !important;
  }

  .dashboard-kpi-card strong {
    font-size: 1.08rem !important;
  }

  @keyframes mobileSheetIn {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .login-card {
    padding: 2rem;
  }

  .public-header-inner,
  .public-footer-inner,
  .landing-hero-grid,
  .pricing-card,
  .landing-strip-grid,
  .feature-grid,
  .benefit-list,
  .flow-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .public-header-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .public-nav {
    width: 100%;
  }

  .landing-title {
    max-width: 100%;
  }

  .preview-board,
  .preview-list,
  .preview-note {
    grid-column: span 1;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.65rem;
  }
  
  .brand {
    font-size: 1.5rem;
  }
  
  .nav a {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .nav-dropdown-toggle {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .invoices-filter-grid,
  .invoices-summary-grid {
    grid-template-columns: 1fr;
  }

  .invoices-filter-grid-compact {
    grid-template-columns: 1fr;
  }

  .invoices-filter-search {
    grid-column: span 1;
  }

  .landing-hero {
    padding-top: 2.5rem;
  }

  .landing-actions,
  .public-nav,
  .public-footer-links {
    flex-direction: column;
    align-items: stretch;
  }

  .invoices-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .invoices-summary-card {
    padding: 0.65rem;
  }

  .stat-card {
    padding: 0.7rem;
    border-radius: 12px;
  }

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

  .stat-label {
    font-size: 0.64rem;
    letter-spacing: 0.03em;
  }

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

  .expenses-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .expenses-summary-grid .stat-card:nth-child(2) {
    grid-column: 1 / -1;
  }

  .expense-mobile-breakdown span {
    font-size: 0.68rem;
  }

  .invoices-filter-grid-compact {
    gap: 10px;
  }

  .check-pills {
    gap: 6px;
  }

  .check-pill span {
    padding: 5px 9px;
    font-size: 0.76rem;
  }

  .mobile-sheet-grid,
  .mobile-more-list {
    grid-template-columns: 1fr;
  }

  .mobile-more-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-more-group:last-child .mobile-more-list {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-more-logout {
    grid-column: 1 / -1;
  }

  .mobile-sheet:not([hidden]) {
    left: 8px;
    right: 8px;
  }
}

p.form-hint {
  font-size: 12px;
  font-style: italic;
}

/* Declaraciones UI helpers */
.grid-stats-4 { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-top:10px; }
.grid-stats-5 { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; margin-top:10px; }
.kpi { display:flex; flex-direction:column; min-height:56px; }
.kpi-label { font-size:0.7rem; color: var(--gray-600); }
.kpi-value { margin-top:auto; font-size:1rem; font-weight:700; white-space:nowrap; }
.sep { height:1px; background:#EEF2F7; margin:12px 0; }
.form-band { padding:12px; background: var(--gray-50); border-radius:8px; }
.form-grid-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; align-items:end; }
.hint { font-size:0.85rem; color: var(--gray-600); margin-top:4px; }
