* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-color: #00a4bd;
  --primary-dark: #4f46e5;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
  --bg-color: #000000;
  --card-bg: #09111d;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #001533;
}

body.dark-mode .install-btn {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode input,
body.dark-mode select {
  background: #0f172a;
  color: #f1f5f9;
}

body.dark-mode .type-toggle {
  background: #0f172a;
}

body.dark-mode .type-option label {
  color: #94a3b8;
}

body.dark-mode .type-option input[type="radio"]:checked + label {
  background: #001533;
  color: #818cf8;
}

body.dark-mode thead {
  background: linear-gradient(135deg, #1e293b 0%, #001533 100%);
}

body.dark-mode .group-header {
  background: linear-gradient(135deg, #1e293b 0%, #001533 100%);
}

body.dark-mode tbody tr:hover {
  background-color: #001533;
}

body.dark-mode tbody tr.loan-row {
  background-color: #7f1d1d;
}

body.dark-mode tbody tr.loan-row:hover {
  background-color: #991b1b;
}

body.dark-mode tbody tr.savings-row {
  background-color: #065f46;
}

body.dark-mode tbody tr.savings-row:hover {
  background-color: #047857;
}

body.dark-mode .amount {
  color: #818cf8;
}

body.dark-mode .period-left.critical {
  background: #7f1d1d;
  color: #fca5a5;
}

body.dark-mode .period-left.warning {
  background: #78350f;
  color: #fde68a;
}

body.dark-mode .period-left.normal {
  background: #065f46;
  color: #86efac;
}

body.dark-mode .btn-icon.edit {
  color: #818cf8;
}

body.dark-mode .btn-icon.delete {
  color: #f87171;
}

body.dark-mode .sort-select,
body.dark-mode .sort-direction-btn {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

body.dark-mode .sort-direction-btn:hover {
  background: #001533;
  border-color: #818cf8;
}

body.dark-mode .modal-content {
  background: #1e293b;
}

body.dark-mode .close-btn {
  color: #94a3b8;
}

body.dark-mode .btn-secondary {
  background: #001533;
  color: #f1f5f9;
}

body.dark-mode .search-input {
  background: #0f172a;
  color: #f1f5f9;
  border-color: #475569;
}

body.dark-mode .view-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: #475569;
  color: #f1f5f9;
}

body.dark-mode .view-toggle-btn:hover {
  background: #001533;
  border-color: #818cf8;
}

body.dark-mode .view-tab-btn {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.dark-mode .view-tab-btn.active {
  background: var(--primary-color);
  color: white;
}

body.dark-mode .periodic-freq-filter {
  background: var(--bg-secondary);
}

body.dark-mode .freq-filter-btn.active {
  background: var(--primary-color);
  color: white;
}

body.dark-mode .payment-toast {
  background: #065f46;
  color: #d1fae5;
}

body.dark-mode tbody tr.paid-row td:not(:first-child) {
  opacity: 0.6;
  background-color: #1e293b;
}

body.dark-mode tbody tr.paid-row:hover {
  background-color: #334155;
}

body.dark-mode .summary-breakdown {
  color: #94a3b8;
}

/* Seal Banner */
.seal-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 16px;
  margin: 0 16px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: slideDown 0.4s ease;
}

.seal-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.seal-banner-icon {
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
}

.seal-banner-text {
  flex: 1;
  color: white;
}

.seal-banner-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.seal-banner-text span {
  font-size: 13px;
  opacity: 0.9;
}

.seal-btn {
  padding: 12px 24px;
  background: white;
  color: #059669;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.seal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.seal-btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  padding-bottom: 80px;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  padding: 20px 16px;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-subtitle {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 400;
  margin-bottom: 12px;
}

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

/* Install Button */
.install-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.install-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.install-btn:active {
  transform: translateY(0);
  opacity: 0.8;
}

.install-icon {
  font-size: 16px;
}

.theme-toggle {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.theme-toggle:active {
  transform: translateY(0);
  opacity: 0.8;
}

.data-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.data-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

.data-btn:active {
  transform: translateY(0);
  opacity: 0.8;
}

.data-btn:disabled {
  background: #ccc !important;
  border-color: #999 !important;
  color: #666 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.6 !important;
  transform: none !important;
}

body.dark-mode .data-btn:disabled {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #64748b !important;
}

/* Summary Cards */
.summary-section {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

.summary-card.freedom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.summary-card.success {
  border-left-color: var(--success-color);
}

.summary-card.warning {
  border-left-color: var(--warning-color);
}

.summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-breakdown {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* Search Section */
.search-section {
  padding: 0 16px 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Sort Controls */
.sort-controls {
  padding: 0 16px 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.sort-bar {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.seal-group {
  margin-left: 20px;
}

.sort-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sort-select {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sort-direction-btn {
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

.sort-direction-btn:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
}

.sort-direction-btn:active {
  transform: scale(0.95);
}

.view-toggle-btn {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  color: var(--text-primary);
  white-space: nowrap;
}

.view-toggle-btn:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
}

.view-toggle-btn:active {
  transform: scale(0.98);
}

/* View selector tab buttons */
.view-selector-group {
  display: flex;
  gap: 4px;
}

.view-tab-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.view-tab-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Periodic frequency filter bar */
.periodic-freq-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.freq-filter-btn {
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.freq-filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.freq-filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Seal Control Button */
.seal-control-btn {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.seal-control-btn:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
  border-color: #e5e7eb;
}

.seal-control-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.seal-control-btn:not(:disabled):active {
  transform: translateY(0);
}

/* Info Button */
.info-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: white;
  color: var(--primary-color);
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.info-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.info-btn:active {
  transform: scale(0.95);
}

body.dark-mode .seal-control-btn:disabled {
  background: #374151;
  color: #6b7280;
  border-color: #4b5563;
}

body.dark-mode .info-btn {
  background: #1e293b;
  color: #818cf8;
  border-color: #475569;
}

body.dark-mode .info-btn:hover {
  background: #818cf8;
  color: white;
}

.github-btn {
  display: inline-flex !important;
}

.github-btn svg {
  transition: transform 0.2s ease;
}

.github-btn:hover svg {
  transform: scale(1.1);
}

.group-header {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.group-header td {
  padding: 12px;
  border-bottom: 2px solid var(--border-color);
}

/* Table Container */
.table-container {
  padding: 0 16px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.table-wrapper {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

thead {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

th {
  padding: 14px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

th.mandatory::after {
  content: " *";
  color: var(--danger-color);
}

th.optional {
  opacity: 0.7;
}

th.checkbox-col {
  width: 60px;
  text-align: center;
}

td {
  padding: 16px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: #f8fafc;
}

tbody tr.loan-row {
  background-color: #fee2e2;
}

tbody tr.loan-row:hover {
  background-color: #fecaca;
}

tbody tr.savings-row {
  background-color: #d1fae5;
}

tbody tr.savings-row:hover {
  background-color: #a7f3d0;
}

tbody tr.paid-row td:not(:first-child){
  opacity: 0.5;
  text-decoration: line-through;
  background-color: #f1f5f9;
}

tbody tr.paid-row:hover {
  background-color: #e2e8f0;
}

tbody tr:last-child td {
  border-bottom: none;
}

.payment-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.amount {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 15px;
}

.date {
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.period-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.period-left.critical {
  background: #fee2e2;
  color: #991b1b;
}

.period-left.warning {
  background: #fef3c7;
  color: #92400e;
}

.period-left.normal {
  background: #d1fae5;
  color: #065f46;
}

.na-value {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 13px;
}

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

.btn-icon {
  padding: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  background: transparent;
}

.btn-icon.edit {
  color: var(--primary-color);
}

.btn-icon.delete {
  color: var(--danger-color);
}

.btn-icon:active {
  transform: scale(0.95);
  opacity: 0.7;
}

/* Sealed State Styles */
.sealed-badge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-left: 12px;
  animation: glow 2s ease-in-out infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes glow {
  0%, 100% { 
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  }
  50% { 
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.8);
  }
}

.table-wrapper.sealed {
  opacity: 0.85;
  position: relative;
}

.table-wrapper.sealed::before {
  content: "✅ Well done! You're now free from the burden";
  display: block;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 15;
}

tbody tr.sealed-row {
  opacity: 0.7;
}

tbody tr.sealed-row .payment-checkbox {
  display: none;
}

tbody tr.sealed-row td:first-child {
  text-align: center;
}

.lock-icon {
  font-size: 16px;
  color: #ef4444;
}

.actions.sealed {
  opacity: 0.3;
  pointer-events: none;
}

.fab.sealed {
  opacity: 0.5;
  cursor: not-allowed;
}

body.dark-mode .table-wrapper.sealed::before {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

body.dark-mode .lock-icon {
  color: #fca5a5;
}

/* Animations */
@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.1); 
  }
}

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

/* Payment Toast */
.payment-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.payment-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Super Celebration Toast */
.super-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  color: white;
  padding: 24px 32px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4);
  z-index: 3001;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
  max-width: 90%;
  line-height: 1.6;
}

.super-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Dark Mode Toast Adjustments */
body.dark-mode.payment-toast {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 8px 16px rgba(5, 150, 105, 0.4);
}

body.dark-mode .super-toast {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.5);
}

body.dark-mode .seal-banner {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

body.dark-mode .seal-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .seal-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 24px;
}

/* FAB Button */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border: none;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1000;
}

.fab:active {
  transform: scale(0.9);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

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

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

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

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

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
}

/* Info Modal Specific Styles */
.info-modal {
  max-width: 520px;
}

.info-warning {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  margin-bottom: 16px;
}

.info-warning p {
  margin: 0;
  color: #92400e;
  font-size: 14px;
}

.info-section {
  margin-bottom: 20px;
}

.info-section h3 {
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

.info-steps {
  padding-left: 20px;
  margin: 0;
}

.info-steps li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.info-restrictions,
.info-benefits {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-restrictions li,
.info-benefits li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.info-caution {
  background: #fee2e2;
  border: 2px solid #ef4444;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  margin-top: 16px;
}

.info-caution p {
  margin: 0;
  color: #991b1b;
  font-size: 14px;
  font-weight: 600;
}

body.dark-mode .info-warning {
  background: #78350f;
  border-color: #f59e0b;
}

body.dark-mode .info-warning p {
  color: #fde68a;
}

body.dark-mode .info-caution {
  background: #7f1d1d;
  border-color: #ef4444;
}

body.dark-mode .info-caution p {
  color: #fca5a5;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.close-btn:active {
  background: var(--border-color);
}

/* Seal Modal Specific Styles */
.seal-modal {
  max-width: 450px;
}

.seal-warning-box {
  background: #fef3c7;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.seal-warning-title {
  font-size: 14px;
  color: #92400e;
  margin-bottom: 8px;
  font-weight: 600;
}

.seal-date {
  font-size: 18px;
  font-weight: 700;
  color: #78350f;
}

.seal-consequences {
  list-style: none;
  padding: 0;
  margin: 0;
}

.seal-consequences li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

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

.btn-danger:active {
  transform: scale(0.98);
  opacity: 0.9;
}

body.dark-mode .seal-warning-box {
  background: #78350f;
  border-color: #f59e0b;
}

body.dark-mode .seal-warning-title {
  color: #fde68a;
}

body.dark-mode .seal-date {
  color: #fef3c7;
}

.modal-body {
  padding: 20px;
}

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

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title .required-badge {
  background: var(--danger-color);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

.form-section-title .optional-badge {
  background: var(--text-secondary);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}

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

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

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

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: white;
}

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

.helper-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Type Toggle */
.type-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-color);
  border-radius: 10px;
}

.type-option {
  flex: 1;
  position: relative;
}

.type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.type-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 0;
}

.type-option input[type="radio"]:checked + label {
  background: white;
  color: var(--primary-color);
  box-shadow: var(--shadow);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 14px;
}

.field-conditional {
  display: none;
}

.field-conditional.active {
  display: block;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  flex: 1;
}

.btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

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

.btn-secondary:active {
  opacity: 0.7;
}

/* Seal Toast Notifications */
.seal-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: white;
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 3001;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 30px;
  min-width: 300px;
}

.seal-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.countdown-toast {
  border: 2px solid #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.undo-toast {
  border: 2px solid #10b981;
  background: #d1fae5;
  color: #065f46;
}

.toast-btn {
  padding: 8px 25px;
  background: var(--text-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.toast-btn:hover {
  transform: scale(1.05);
}

.toast-btn:active {
  transform: scale(0.95);
}

body.dark-mode .seal-toast {
  background: #1e293b;
  color: #f1f5f9;
}

body.dark-mode .countdown-toast {
  background: #78350f;
  border-color: #f59e0b;
  color: #fde68a;
}

body.dark-mode .undo-toast {
  background: #065f46;
  border-color: #10b981;
  color: #d1fae5;
}

body.dark-mode .toast-btn {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
}

body.dark-mode .countdown-toast .toast-btn {
  background: #92400e;
  color: #fef3c7;
  border-color: #f59e0b;
}

body.dark-mode .countdown-toast .toast-btn:hover {
  background: #78350f;
}

body.dark-mode .undo-toast .toast-btn {
  background: #065f46;
  color: #d1fae5;
  border-color: #10b981;
}

body.dark-mode .undo-toast .toast-btn:hover {
  background: #047857;
}

/* Sealing Overlay */
.sealing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  display: none;
  animation: fadeIn 0.3s ease;
}

.sealing-overlay.active {
  display: block;
}

body.dark-mode .sealing-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* Responsive Design */
@media (max-width: 480px) {
  .header h1 {
    font-size: 20px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sort-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sort-group {
    width: 100%;
  }

  th,
  td {
    padding: 12px 8px;
    font-size: 13px;
  }

  .modal-content {
    width: 95%;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

/* Archive Mode Styling */
.table-wrapper.archive-mode {
  opacity: 0.75;
  filter: grayscale(100%);
  position: relative;
}

.table-wrapper.archive-mode::before {
  content: "📦 ARCHIVE MODE";
  display: block;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  text-align: center;
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 15;
}

.table-wrapper.archive-mode tbody tr:hover {
  background-color: transparent !important;
  cursor: default;
}

body.dark-mode.table-wrapper.archive-mode::before {
  background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   FREEDOM TIMELINE - OPTIMIZED & COMPLETE
   Based on commits 155be7a, 16dd09f, bca9042
   ============================================ */

/* Freedom Summary Card */
.summary-card.freedom {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-left-color: #047857;
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* OPTIMIZED: Specific properties only */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Decorative gradient bar - STATIC (no animation) */
.summary-card.freedom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, 
    rgba(255,255,255,0.7), 
    rgba(255,255,255,0.4), 
    rgba(255,255,255,0.7));
  /* REMOVED: animation for performance */
}

.summary-card.freedom:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.35);
}

.summary-card.freedom .summary-label {
  color: rgba(255, 255, 255, 0.95);
  font-size: 11px;
  font-weight: 600;
}

.summary-card.freedom .summary-value {
  color: white;
  font-size: 1.15rem;
  margin-bottom: 8px;
  /* OPTIMIZED: Lighter shadow */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Freedom Countdown Badge in Summary Card */
.freedom-countdown-badge-summary {
  margin-top: 8px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.25);
  /* REMOVED: backdrop-filter for performance */
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  /* REMOVED: glow-pulse animation */
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* OPTIMIZED: Add subtle hover effect instead of constant animation */
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.summary-card.freedom:hover .freedom-countdown-badge-summary {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

#freedomCountdownSummary {
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.3px;
}

/* ============================================
   FREEDOM TIMELINE MODAL
   ============================================ */

.freedom-modal {
  max-width: 650px;
}

.freedom-modal .modal-body {
  padding: 0;
}

/* Modal Highlight Header Section */
.freedom-modal-highlight {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 28px 24px;
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  position: relative;
  overflow: hidden;
}

/* Decorative circle - STATIC */
.freedom-modal-highlight::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.freedom-modal-card {
  text-align: center;
  color: white;
  position: relative;
  z-index: 1;
}

.freedom-modal-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.95;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.freedom-modal-date {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  /* OPTIMIZED: Lighter shadow */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  letter-spacing: -0.5px;
}

.freedom-modal-countdown {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.98;
  background: rgba(255, 255, 255, 0.25);
  /* REMOVED: backdrop-filter for performance */
  padding: 8px 20px;
  border-radius: 24px;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Modal Sections */
.freedom-modal-section {
  padding: 24px;
  margin-bottom: 0;
}

.freedom-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Milestones List */
.freedom-milestones-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.freedom-milestone-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border-left: 4px solid #10b981;
  box-shadow: var(--shadow-sm);
  /* OPTIMIZED: Specific properties only */
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              border-left-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.freedom-milestone-item:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-md);
  border-left-width: 6px;
}

.milestone-info {
  flex: 1;
}

.milestone-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.milestone-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.milestone-relief {
  font-weight: 700;
  color: var(--success-color);
  font-size: 1rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

body.dark-mode .summary-card.freedom {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

body.dark-mode .summary-card.freedom:hover {
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4);
}

body.dark-mode .freedom-modal-highlight {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

body.dark-mode .freedom-milestone-item {
  background: var(--bg-secondary);
  border-left-color: #10b981;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

body.dark-mode .freedom-milestone-item:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

body.dark-mode .freedom-modal-title {
  border-bottom-color: var(--border-color);
}

/* ============================================
   PERIODIC PAYMENTS SECTION
   ============================================ */

.periodic-section {
  margin: 0 auto 16px;
  max-width: 1200px;
  padding: 0 16px;
}

.periodic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}

.periodic-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.periodic-list {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0 0 12px 12px;
  padding: 8px 0;
}

.periodic-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 8px 16px 4px;
}

.periodic-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

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

.periodic-item.due-now {
  background: rgba(239, 68, 68, 0.05);
}

.periodic-item.upcoming {
  opacity: 0.65;
}

.periodic-item.paid-cycle {
  background: rgba(16, 185, 129, 0.05);
}

.periodic-item-info {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.periodic-item-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.periodic-item-due {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.periodic-item-amount {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.95rem;
  white-space: nowrap;
}

.periodic-due-total {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ef4444;
  text-align: right;
}

/* Frequency badges (used in table and periodic section) */
.freq-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.due-now-badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  border-radius: 20px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.paid-badge {
  display: inline-block;
  background: #10b981;
  color: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}

/* Frequency options in the form */
.frequency-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.freq-option {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

.freq-option input[type="radio"] {
  accent-color: var(--primary-color);
  width: 14px;
  height: 14px;
}

.freq-option:has(input:checked) {
  border-color: var(--primary-color);
  background: rgba(0, 164, 189, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.custom-freq-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.custom-freq-row input[type="number"] {
  width: 90px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.custom-freq-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

#cycleStartGroup {
  margin-top: 12px;
}

#cycleStartGroup label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.cycle-preview {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #6366f1;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 8px;
  display: inline-block;
}

/* Dark mode for periodic section */
body.dark-mode .periodic-header,
body.dark-mode .periodic-list {
  background: var(--card-bg);
  border-color: var(--border-color);
}

body.dark-mode .periodic-item.due-now {
  background: rgba(239, 68, 68, 0.1);
}

body.dark-mode .periodic-item.paid-cycle {
  background: rgba(16, 185, 129, 0.1);
}

body.dark-mode .freq-badge {
  background: rgba(129, 140, 248, 0.18);
  color: #818cf8;
}

body.dark-mode .freq-option {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.dark-mode .freq-option:has(input:checked) {
  border-color: #818cf8;
  background: rgba(129, 140, 248, 0.12);
  color: #818cf8;
}

body.dark-mode .cycle-preview {
  background: rgba(129, 140, 248, 0.12);
  color: #818cf8;
}

body.dark-mode .custom-freq-row input[type="number"] {
  background: #0f172a;
  color: #f1f5f9;
  border-color: var(--border-color);
}

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

@media (max-width: 768px) {
  .freedom-modal {
    max-width: 95%;
  }

  .summary-card.freedom .summary-value {
    font-size: 1rem;
  }

  .freedom-countdown-badge-summary {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  .freedom-modal-highlight {
    padding: 20px 16px;
  }

  .freedom-modal-date {
    font-size: 1.75rem;
  }

  .freedom-modal-countdown {
    font-size: 0.9rem;
    padding: 6px 16px;
  }

  .freedom-modal-section {
    padding: 20px 16px;
  }

  .freedom-milestone-item {
    padding: 12px 14px;
  }

  .milestone-name {
    font-size: 0.9rem;
  }

  .milestone-date {
    font-size: 0.75rem;
  }

  .milestone-relief {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .summary-card.freedom .summary-value {
    font-size: 0.95rem;
  }

  .freedom-countdown-badge-summary {
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  .freedom-modal-date {
    font-size: 1.5rem;
  }

  .freedom-modal-countdown {
    font-size: 0.85rem;
    padding: 6px 14px;
  }

  .freedom-milestone-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .milestone-relief {
    align-self: flex-end;
    font-size: 0.85rem;
  }
}