/* instantSplit Premium Minimalist Design System */

:root {
  --bg-color: #F8FAFC; /* Clean Slate-50 background */
  --text-dark: #0F172A; /* Slate-900 */
  --text-light: #475569; /* Slate-600 */
  --border-color: #E2E8F0; /* Slate-200 */
  
  /* Accent Colors */
  --color-primary: #059669; /* Rich Emerald Green */
  --color-primary-hover: #047857;
  --color-secondary: #3B82F6; /* Cobalt Blue */
  --color-secondary-hover: #2563EB;
  --color-danger: #EF4444; /* Premium Red */
  --color-danger-hover: #DC2626;
  --color-white: #FFFFFF;
  --color-card-bg: #FFFFFF;
  
  /* Layout & Shadows */
  --border-width: 1px; /* Thinner border for high-end look */
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --border-radius-pill: 50px;
  
  /* Soft, modern diffused shadows (no cartoon outlines) */
  --block-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --block-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --block-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  padding-bottom: 2rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--text-dark);
}

/* App Header */
.app-header {
  background-color: var(--color-white);
  border-bottom: var(--border-width) solid var(--border-color);
  padding: 1.2rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  outline: none;
}

.app-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
}

.logo-text {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

/* Screen Isolation Control */
.screen {
  display: none !important;
}
.screen.active {
  display: block !important;
}

/* Layout Main */
.main-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  min-height: 70vh;
}

/* Reusable Components: Cards & Buttons */
.card {
  background-color: var(--color-card-bg);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--block-shadow);
  padding: 1.8rem;
  margin-bottom: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
  background-color: var(--color-white);
  color: var(--text-dark);
  box-shadow: var(--block-shadow-sm);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--block-shadow-hover);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--block-shadow-sm);
}

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

.btn-secondary {
  background-color: #F1F5F9;
  color: var(--text-dark);
  border-color: #E2E8F0;
  box-shadow: none;
}
.btn-secondary:hover {
  background-color: #E2E8F0;
}

.btn-danger {
  background-color: #FEF2F2;
  color: var(--color-danger);
  border-color: #FEE2E2;
  box-shadow: none;
}
.btn-danger:hover {
  background-color: #FEE2E2;
}

.btn-text {
  background: transparent;
  border: none;
  box-shadow: none;
  font-family: inherit;
  color: var(--text-light);
  text-decoration: none;
  padding: 0.5rem;
  font-size: 0.9rem;
}
.btn-text:hover {
  color: var(--text-dark);
}
.btn-text:active {
  transform: scale(0.95);
  box-shadow: none;
}

.btn-lg {
  padding: 0.8rem 1.8rem;
  font-size: 1.1rem;
  border-radius: var(--border-radius-md);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.badge {
  background-color: #EFF6FF;
  color: var(--color-secondary);
  border: 1px solid #BFDBFE;
  border-radius: var(--border-radius-pill);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

/* Welcome Screen */
.welcome-card {
  text-align: center;
  padding: 3.5rem 2rem;
  background: linear-gradient(135deg, #FFFFFF, #F1F5F9);
}

.welcome-title {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}

.welcome-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

/* Saved Trips Screen Section */
.saved-trips-section {
  margin-top: 2.5rem;
}

.section-title {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.saved-trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.saved-trip-card {
  cursor: pointer;
  padding: 1.5rem;
  box-shadow: var(--block-shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.saved-trip-title {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.saved-trip-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Dashboard Unified Container Layout */
.dashboard-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 2rem;
}

.dashboard-header-section {
  padding: 1.8rem 1.8rem 0 1.8rem;
  background-color: var(--color-card-bg);
}

.views-container {
  padding: 1.8rem;
}

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

.trip-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.trip-title {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.trip-stats {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.stat-divider {
  opacity: 0.4;
}

/* Tab Navigation (Flat Modern Bottom-Bordered tabs) */
.dashboard-nav {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0;
  border-top: none;
  border-bottom: 1px solid var(--border-color);
  scrollbar-width: none;
}
.dashboard-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 0;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  outline: none;
  color: var(--text-light);
  box-shadow: none;
  transition: border-color 0.2s, color 0.2s;
}

.tab-btn.active {
  background-color: transparent;
  border-bottom: 2px solid var(--color-secondary);
  color: var(--color-secondary);
  box-shadow: none;
  transform: none;
}

.tab-btn:hover:not(.active) {
  color: var(--text-dark);
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: panel-fade 0.25s ease-in-out;
}

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

@keyframes panel-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}

.panel-subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

/* Panel A: Expenses view */
.expenses-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.expense-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  padding: 1.2rem;
  gap: 1rem;
  border-radius: var(--border-radius-md);
  background-color: var(--color-white);
  border: 1px solid var(--border-color);
  box-shadow: var(--block-shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.expense-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--block-shadow);
}

.expense-date-box {
  background-color: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: var(--border-radius-sm);
  padding: 0.4rem;
  text-align: center;
  font-size: 0.75rem;
  min-width: 52px;
}

.expense-day {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
  color: var(--text-dark);
}

.expense-month {
  text-transform: uppercase;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-light);
}

.expense-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.expense-desc {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dark);
}

.expense-payer-info {
  font-size: 0.8rem;
  color: var(--text-light);
}

.expense-amount-box {
  font-family: 'Space Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.expense-actions-cell {
  display: flex;
  gap: 0.4rem;
}

.btn-icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--border-radius-sm);
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-light);
  transition: background-color 0.2s, color 0.2s;
}

.btn-icon-only:hover {
  background-color: #F1F5F9;
  color: var(--text-dark);
  transform: none;
  box-shadow: none;
}

.btn-delete-expense:hover {
  background-color: #FEE2E2;
  color: var(--color-danger);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3.5rem 2rem;
  background-color: var(--color-white);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon {
  font-size: 2.5rem;
}

.empty-text {
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Panel B: Balances View */
.balances-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.balance-item-card {
  padding: 1.2rem;
  background-color: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--block-shadow-sm);
}

.balance-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.balance-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.balance-summary {
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  gap: 0.8rem;
}

.balance-net-amount {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
}

.net-positive {
  color: #059669; /* Green */
}

.net-negative {
  color: #DC2626; /* Red */
}

.net-zero {
  color: var(--text-light);
}

.balance-bar-container {
  height: 8px;
  background-color: #F1F5F9;
  border-radius: var(--border-radius-pill);
  overflow: hidden;
  position: relative;
}

.balance-bar {
  height: 100%;
  border-radius: var(--border-radius-pill);
}

.bar-positive {
  background-color: #34D399;
}

.bar-negative {
  background-color: #F87171;
}

/* Panel C: Settle Up list */
.settlement-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.settle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem;
  background-color: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--block-shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}

.settle-flow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
}

.settle-friend {
  font-weight: 600;
  background-color: #F1F5F9;
  border-radius: var(--border-radius-sm);
  padding: 0.2rem 0.5rem;
}

.settle-arrow {
  font-size: 1.1rem;
  color: var(--text-light);
}

.settle-amount {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1rem;
  background-color: #FEF3C7; /* Soft yellow highlight */
  border-radius: var(--border-radius-sm);
  padding: 0.2rem 0.5rem;
  color: #D97706;
}

/* Panel D: Share & Export View */
.share-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .share-options-grid {
    grid-template-columns: 1fr 1fr;
  }
  .share-card:last-child {
    grid-column: span 2;
  }
}

.share-card h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.share-card p {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.copy-input-group {
  display: flex;
  gap: 0.5rem;
}

.copy-input {
  flex: 1;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: #F8FAFC;
  color: var(--text-light);
  outline: none;
}

.copy-textarea {
  width: 100%;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background-color: #F8FAFC;
  resize: vertical;
  margin-bottom: 0.8rem;
  outline: none;
  color: var(--text-light);
}

.export-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-file-label {
  margin: 0;
}

.hidden-file-input {
  display: none;
}

/* Toggle Switch Styling */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #E2E8F0;
  transition: .2s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 4px;
  bottom: 4px;
  background-color: var(--color-white);
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Modal Overlay & Container */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.3); /* Soft dark overlay */
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end; /* Bottom sheet styling on mobile */
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 100%;
  max-width: 480px;
  background-color: var(--color-white);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@media (min-width: 600px) {
  .modal-container {
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    transform: scale(0.95) translateY(0);
  }
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .modal-overlay.active .modal-container {
    transform: scale(1);
  }
}

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

.modal-title {
  font-size: 1.25rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.2rem;
}

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

.modal-body {
  padding: 1.2rem;
  overflow-y: auto;
  flex: 1;
}

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

/* Forms styling */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: var(--text-light);
}

.form-input {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--color-white);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.label-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-light);
}

.friend-input-row {
  display: flex;
  gap: 0.5rem;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
  min-height: 40px;
  padding: 0.4rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: #F8FAFC;
}

.chip {
  background-color: #EFF6FF;
  border: 1px solid #DBEAFE;
  border-radius: var(--border-radius-pill);
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-secondary);
}

.chip-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.chip-remove:hover {
  color: var(--color-danger);
}

/* Input currency wrapper */
.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-addon {
  position: absolute;
  left: 0.8rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-light);
}

.input-currency-wrapper .form-input {
  padding-left: 1.8rem;
}

.monospace-input {
  font-family: 'Space Mono', monospace;
  font-weight: 600;
}

/* Custom Checkbox list for split members */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 28px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
  font-weight: 500;
  color: var(--text-dark);
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 1px;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.checkbox-container:hover input ~ .checkmark {
  background-color: #F8FAFC;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--color-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.split-header-row {
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.split-members-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: #F8FAFC;
}

/* Modal Trips Saved */
.modal-trips-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 250px;
  overflow-y: auto;
}

.modal-trip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--color-white);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.modal-trip-item:hover {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
}

.modal-trip-item.active {
  background-color: #ECFDF5;
  border: 1.5px solid #10B981;
}
.modal-trip-item.active .modal-trip-name {
  color: #047857;
}
.modal-trip-item.active .modal-trip-sub {
  color: #059669;
}

.modal-trip-info {
  display: flex;
  flex-direction: column;
}

.modal-trip-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.modal-trip-sub {
  font-size: 0.75rem;
  color: var(--text-light);
}

.modal-trip-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  font-size: 0.95rem;
  color: var(--text-light);
}

.modal-trip-delete:hover {
  color: var(--color-danger);
}

.modal-trips-footer {
  margin-top: 1.2rem;
}

.btn-block {
  width: 100%;
}

/* Toast Alerts */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #0F172A;
  color: #FFFFFF !important;
  border: 1px solid #334155;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 2000;
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
  pointer-events: none;
}

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

/* Below-the-fold SEO style */
.seo-section {
  border-top: var(--border-width) solid var(--border-color);
  background-color: var(--color-white);
  padding: 4rem 1.5rem;
  margin-top: 4rem;
}

.seo-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.seo-text-block h2 {
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.seo-text-block p {
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.95rem;
}

.seo-steps {
  list-style-position: inside;
  padding-left: 0.5rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

.seo-steps li {
  margin-bottom: 0.8rem;
}

.seo-steps strong {
  color: var(--text-dark);
}

.seo-faq-block h2 {
  font-size: 1.35rem;
  margin-bottom: 1.2rem;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background-color: #F8FAFC;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 1.2rem;
  cursor: pointer;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
}

.faq-question::after {
  content: "＋";
  font-weight: 700;
  transition: transform 0.2s;
  color: var(--text-light);
}

.faq-question[aria-expanded="true"]::after {
  content: "－";
  transform: rotate(90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
  background-color: var(--color-white);
}

.faq-question[aria-expanded="true"] + .faq-answer {
  border-top: 1px dashed var(--border-color);
}

.faq-answer p {
  padding: 1.2rem;
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Footer Section styling */
.app-footer {
  border-top: var(--border-width) solid var(--border-color);
  background-color: #0F172A;
  color: #94A3B8;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
}

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

.footer-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
}

.footer-links a {
  color: #94A3B8;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
  color: var(--color-white);
}

/* Hide helper class */
.hidden {
  display: none !important;
}

/* =============================================================
   DARK MODE THEME OVERRIDES
   ============================================================= */

body.dark-mode {
  --bg-color: #0F172A; /* Slate-900 */
  --text-dark: #F8FAFC; /* Slate-50 */
  --text-light: #94A3B8; /* Slate-400 */
  --border-color: #334155; /* Slate-700 */
  --color-card-bg: #1E293B; /* Slate-800 */
  --color-white: #1E293B;
  
  /* Muted dark-mode shadow depths (prevent glowing gray artifacts) */
  --block-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.25), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
  --block-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
}

/* Specific elements adjustments in Dark Mode */
body.dark-mode .welcome-card {
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border-color: var(--border-color);
}

body.dark-mode .welcome-subtitle {
  color: var(--text-light);
}

body.dark-mode .btn-secondary {
  background-color: #334155; /* Slate-700 */
  border-color: #475569; /* Slate-600 */
  color: #F8FAFC;
  box-shadow: none;
}

body.dark-mode .btn-secondary:hover {
  background-color: #475569; /* Slate-600 */
}

body.dark-mode .toast-notification {
  background-color: #1E293B;
  color: #FFFFFF !important;
  border-color: #475569;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

body.dark-mode .btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  box-shadow: none;
}

body.dark-mode .btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.25);
}

body.dark-mode .btn-text {
  color: #94A3B8;
}

body.dark-mode .btn-text:hover {
  color: #F8FAFC;
}

body.dark-mode .copy-input,
body.dark-mode .copy-textarea,
body.dark-mode .split-members-list,
body.dark-mode .chips-container {
  background-color: #0F172A;
  color: #E2E8F0;
  border-color: var(--border-color);
}

body.dark-mode .expense-date-box {
  background-color: #334155;
  border-color: var(--border-color);
}

body.dark-mode .expense-day {
  color: #F8FAFC;
}

body.dark-mode .settle-friend {
  background-color: #334155;
  color: #F8FAFC;
}

body.dark-mode .settle-amount {
  background-color: rgba(217, 119, 6, 0.2);
  color: #FBBF24;
}

body.dark-mode select option {
  background-color: #1E293B;
  color: #F8FAFC;
}

body.dark-mode .category-badge {
  background-color: #334155;
  color: #CBD5E1;
  border-color: #475569;
}
body.dark-mode .category-badge-food { background-color: rgba(220, 38, 38, 0.2); color: #FCA5A5; border-color: rgba(220, 38, 38, 0.4); }
body.dark-mode .category-badge-accommodation { background-color: rgba(79, 70, 229, 0.2); color: #A5B4FC; border-color: rgba(79, 70, 229, 0.4); }
body.dark-mode .category-badge-transport { background-color: rgba(22, 163, 74, 0.2); color: #86EFAC; border-color: rgba(22, 163, 74, 0.4); }

body.dark-mode .modal-trip-item:hover {
  background-color: #334155;
  border-color: #475569;
}

body.dark-mode .modal-trip-item.active {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1.5px solid #10B981;
}
body.dark-mode .modal-trip-item.active .modal-trip-name {
  color: #34D399;
}
body.dark-mode .modal-trip-item.active .modal-trip-sub {
  color: #6EE7B7;
}

body.dark-mode .faq-item {
  background-color: #1E293B;
}

body.dark-mode .faq-answer {
  background-color: #1E293B;
}

body.dark-mode .tab-btn:hover:not(.active) {
  color: #F8FAFC;
}

body.dark-mode .checkmark {
  background-color: #0F172A;
}

body.dark-mode .checkbox-container:hover input ~ .checkmark {
  background-color: #1E293B;
}

/* Ensure checkmarks are dark slate in dark mode check box */
body.dark-mode .checkbox-container .checkmark:after {
  border-color: #0F172A;
}

/* Vector Icons SVG Alignment */
.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
  vertical-align: middle;
  display: inline-block;
}

.logo-icon.lucide {
  width: 22px;
  height: 22px;
  color: var(--color-secondary);
  stroke-width: 2.5px;
}

.btn-icon.lucide {
  margin-right: 0.35rem;
  width: 16px;
  height: 16px;
}

.inline-icon.lucide {
  margin-left: 0.2rem;
  margin-right: 0.2rem;
  width: 20px;
  height: 20px;
  color: var(--color-secondary);
}

.empty-icon.lucide {
  width: 48px;
  height: 48px;
  color: var(--text-light);
  opacity: 0.5;
}

.modal-close .lucide {
  width: 20px;
  height: 20px;
}

/* Ensure tab icons sit nicely */
.tab-btn .lucide {
  width: 16px;
  height: 16px;
}

/* =============================================================
   NEW ADDITIONS: ADS, SYNC, FORMS, QR CODE, & LEGAL PAGES
   ============================================================= */

/* Ad Placeholders */
.ad-container {
  background-color: var(--bg-color);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}
.ad-top {
  max-width: 100%;
  width: 728px;
  height: 90px;
}
.ad-bottom {
  max-width: 100%;
  width: 728px;
  height: 90px;
}
.ad-label {
  opacity: 0.7;
}

/* Two-column responsive form row */
.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 480px) {
  .form-row-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

/* Cloud Sync status indicator badge */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--border-radius-pill);
  transition: all 0.3s ease;
}
.sync-badge.offline {
  background-color: #F1F5F9;
  color: var(--text-light);
  border: 1px solid #E2E8F0;
}
.sync-badge.syncing {
  background-color: #FEF3C7;
  color: #D97706;
  border: 1px solid #FCD34D;
  animation: syncPulse 1.5s infinite ease-in-out;
}
.sync-badge.synced {
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}
.sync-icon {
  width: 12px;
  height: 12px;
}
@keyframes syncPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Manage Participants (Friends) List */
.manage-friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.manage-friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.8rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.manage-friend-item:hover {
  border-color: var(--color-secondary);
}
.manage-friend-name {
  font-weight: 600;
  color: var(--text-dark);
}
.manage-friend-actions {
  display: flex;
  gap: 0.2rem;
}
.manage-friend-actions .btn {
  padding: 0.3rem;
  border-radius: var(--border-radius-sm);
  background: transparent;
  border: none;
  box-shadow: none;
}
.manage-friend-actions .btn:hover {
  background: var(--border-color);
}
.manage-friend-actions .btn-delete:hover {
  background: #FEF2F2;
  color: var(--color-danger);
}

/* QR Code representation container */
.qr-code-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #FFFFFF !important;
  border: 1px solid #E2E8F0;
  border-radius: var(--border-radius-md);
  padding: 1.2rem;
  width: fit-content;
  margin: 0.5rem auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
#share-qr-code canvas, #share-qr-code img {
  display: block;
  max-width: 140px;
  max-height: 140px;
}

/* Category Badges for Expenses */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--border-radius-sm);
  background-color: #F1F5F9;
  color: var(--text-light);
  border: 1px solid #E2E8F0;
  margin-top: 0.2rem;
  width: fit-content;
}
.category-badge-food { background-color: #FEF2F2; color: #DC2626; border-color: #FEE2E2; }
.category-badge-accommodation { background-color: #EEF2FF; color: #4F46E5; border-color: #E0E7FF; }
.category-badge-transport { background-color: #F0FDF4; color: #16A34A; border-color: #DCFCE7; }
.category-badge-entertainment { background-color: #FAF5FF; color: #9333EA; border-color: #F3E8FF; }
.category-badge-shopping { background-color: #FFF7ED; color: #EA580C; border-color: #FFEDD5; }
.category-badge-other { background-color: #F8FAFC; color: #475569; border-color: #E2E8F0; }

/* Category Distribution Breakdown styles */
.category-dist-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}
.category-dist-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.category-dist-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-light);
}
.category-dist-name {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.category-dist-bar-bg {
  height: 6px;
  background-color: #F1F5F9;
  border-radius: var(--border-radius-pill);
  overflow: hidden;
}
.category-dist-bar {
  height: 100%;
  background-color: var(--color-primary);
  border-radius: var(--border-radius-pill);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Legal Documents & Policies Layout styling */
.policy-body {
  background-color: var(--bg-color);
}
.policy-card {
  max-width: 720px;
  margin: 2rem auto;
  padding: 2.5rem;
}
@media (max-width: 600px) {
  .policy-card {
    padding: 1.5rem;
    margin: 1rem;
  }
}
.policy-title {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  letter-spacing: -0.5px;
}
.policy-meta {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
}
.policy-section {
  margin-bottom: 2rem;
}
.policy-section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}
.policy-section p {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
}
.policy-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.95rem;
}
.policy-section li {
  margin-bottom: 0.5rem;
}

/* 4-Digit PIN Security Styles */
.pin-input-container {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.pin-digit-input {
  width: 50px;
  height: 56px;
  font-family: 'Space Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background-color: var(--color-white);
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.pin-digit-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.pin-error-text {
  color: var(--color-danger);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 600;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: #D97706;
  font-size: 0.8rem;
  font-weight: 600;
}

body.dark-mode .pin-digit-input {
  background-color: #0F172A;
  color: #F8FAFC;
  border-color: #334155;
}

/* Settings Grid Layout */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.settings-card {
  padding: 1.5rem;
}

.total-spent-highlight {
  font-weight: 700;
  color: var(--text-dark);
}

/* =============================================================
   MOBILE RESPONSIVE BREAKPOINTS (Max-Width 600px)
   ============================================================= */
@media (max-width: 600px) {
  .main-content {
    padding: 0 0.5rem;
    margin: 1rem auto;
  }

  .card {
    padding: 1.2rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
  }

  .dashboard-header-section {
    padding: 1.2rem 1rem 0 1.2rem;
  }

  .views-container {
    padding: 1rem;
  }

  .trip-title {
    font-size: 1.35rem;
  }

  .trip-stats {
    font-size: 0.8rem;
    gap: 0.3rem;
  }

  .dashboard-nav {
    gap: 0.8rem;
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 0.6rem 0;
  }

  /* Mobile Responsive Expense Cards */
  .expense-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "date details amount"
      "date details actions";
    padding: 0.85rem;
    gap: 0.4rem 0.75rem;
  }
  
  .expense-date-box {
    grid-area: date;
    min-width: 44px;
    padding: 0.25rem;
  }

  .expense-details {
    grid-area: details;
  }

  .expense-amount-box {
    grid-area: amount;
    text-align: right;
    font-size: 0.95rem;
  }

  .expense-actions-cell {
    grid-area: actions;
    justify-content: flex-end;
  }

  /* Mobile Responsive Settlements */
  .settle-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 1rem;
  }
  .settle-flow {
    justify-content: space-between;
    width: 100%;
    font-size: 0.9rem;
  }
  .btn-mark-settled {
    width: 100%;
  }

  /* Mobile Responsive Form Grid Rows */
  .form-row-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile Responsive Share Grid */
  .share-options-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile PIN Digits */
  .pin-digit-input {
    width: 42px;
    height: 48px;
    font-size: 1.3rem;
  }
  .pin-input-container {
    gap: 0.5rem;
  }

  /* Mobile Header & Brand Logo */
  .logo-text {
    font-size: 1.25rem;
  }
  .app-logo-img {
    width: 24px;
    height: 24px;
  }
}

/* Cookie Consent Banner (GDPR / AdSense Compliant) */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  background-color: var(--color-card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 1500;
  transition: opacity 0.3s ease;
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-dark);
}

@media (max-width: 600px) {
  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}



