/* 
  Financial & Dormitory Spreadsheet Tracker CSS
  Theme: Modern Dark Mode with Glassmorphism & Vibrant Google Sheets Styles
*/

@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300&display=swap');

:root {
  /* Theme Colors */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-gradient: radial-gradient(circle at top, #111827 0%, #030712 100%);
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(17, 24, 39, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.5);
  --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  
  /* Accent Colors */
  --color-primary: #6366f1;       /* Indigo */
  --color-primary-hover: #4f46e5;
  --color-income: #10b981;        /* Emerald Green */
  --color-income-hover: #059669;
  --color-expense: #ef4444;       /* Rose Red */
  --color-expense-hover: #dc2626;
  --color-wealth: #06b6d4;        /* Sky Blue */
  --color-debt: #f59e0b;          /* Amber */
  --color-electricity: #eab308;   /* Yellow */
  --color-water: #06b6d4;         /* Cyan */
  
  /* Tab Colors */
  --tab-record: #3b82f6;          /* Blue for Record */
  --tab-total: #fbbf24;
  --tab-month: #10b981;
  --tab-remaining: #f97316;
  --tab-work: #84cc16;
  --tab-deposit: #6b7280;
  --tab-inv: #06b6d4;
  --tab-debt: #ef4444;
  --tab-mk: #ef4444;
  --tab-ttb: #ef4444;
  --tab-card-debt: #84cc16;
  --tab-elec: #8b5cf6;
  --tab-dorm: #d8b4fe;
  --tab-yt: #991b1b;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  /* Structure */
  --header-height: 64px;
  --tabs-height: 48px;
  --border-radius-lg: 12px;
  --border-radius-md: 8px;
  --border-radius-sm: 4px;
  --transition-speed: 0.25s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Prompt', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Top Header Bar */
.app-header {
  height: var(--header-height);
  width: 100%;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
}

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

.logo-icon {
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-excel {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-excel:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.6);
}

/* Excel Auto-Sync Connect Button */
.btn-excel-connect {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-excel-connect:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.55);
}

.btn-excel-connect.connected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-excel-connect.connected:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Excel Sync Flash Indicator */
#excel-sync-indicator {
  transition: opacity 0.3s ease;
  opacity: 0;
}

#excel-sync-indicator.flash-active {
  opacity: 1;
  animation: excelSyncPulse 2s ease-out forwards;
}

@keyframes excelSyncPulse {
  0%   { opacity: 1; transform: scale(1.05); }
  30%  { opacity: 1; transform: scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Spreadsheet Tabs Navigation Bar */
/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* Spreadsheet Tabs Navigation Bar (Vertical Left Sidebar) */
.spreadsheet-tabs-container {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 240px;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-100%);
  overflow-y: auto;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.spreadsheet-tabs-container.open {
  transform: translateX(0);
}

.spreadsheet-tabs {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.45rem;
}

.sheet-tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.95rem;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  opacity: 0.8;
}

.sheet-tab:hover {
  opacity: 1;
  transform: translateX(4px);
}

/* Color Coding for Tabs matching original image */
.tab-record { background-color: var(--tab-record); color: #ffffff !important; }
.tab-total { background-color: var(--tab-total); color: #0b0f19 !important; }
.tab-month { background-color: var(--tab-month); color: #ffffff !important; }
.tab-remaining { background-color: var(--tab-remaining); color: #ffffff !important; }
.tab-work { background-color: var(--tab-work); color: #0b0f19 !important; }
.tab-deposit { background-color: var(--tab-deposit); color: #ffffff !important; }
.tab-inv { background-color: var(--tab-inv); color: #ffffff !important; }
.tab-debt { background-color: var(--tab-debt); color: #ffffff !important; }
.tab-mk { background-color: var(--tab-mk); color: #ffffff !important; }
.tab-ttb { background-color: var(--tab-ttb); color: #ffffff !important; }
.tab-card-debt { background-color: var(--tab-card-debt); color: #0b0f19 !important; }
.tab-elec { background-color: var(--tab-elec); color: #ffffff !important; }
.tab-dorm { background-color: var(--tab-dorm); color: #0b0f19 !important; }
.tab-yt { background-color: var(--tab-yt); color: #ffffff !important; }

/* Active tab style */
.sheet-tab.active {
  opacity: 1;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

/* Fluid Main Content Space */
.main-content-fluid {
  margin-top: var(--header-height);
  margin-bottom: 0;
  padding: 1.5rem;
  width: 100%;
  min-height: calc(100vh - var(--header-height));
}

/* Sheet Panel display state */
.sheet-panel {
  display: none;
  animation: tabFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* Header Banner inside panels */
.panel-header-banner {
  padding: 1rem;
  border-radius: var(--border-radius-lg);
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(15, 23, 42, 0) 100%);
  border-left: 4px solid var(--color-primary);
}

.panel-header-banner h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-header-banner p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.green-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--color-income);
}
.orange-banner {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--tab-remaining);
}
.lightgreen-banner {
  background: linear-gradient(135deg, rgba(132, 204, 22, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--tab-work);
}
.cyan-banner {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--color-wealth);
}
.red-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--color-expense);
}
.purple-banner {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--tab-elec);
}
.grey-banner {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-left-color: var(--tab-deposit);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.balance::after { background: var(--color-primary); }
.stat-card.savings::after { background: var(--color-income); }
.stat-card.debts::after { background: var(--color-expense); }
.stat-card.info-card::after { background: var(--tab-inv); }

.stat-info p {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.stat-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.balance .stat-icon { background: rgba(99, 102, 241, 0.12); color: var(--color-primary); }
.savings .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--color-income); }
.debts .stat-icon { background: rgba(239, 68, 68, 0.12); color: var(--color-expense); }
.info-card .stat-icon { background: rgba(6, 182, 212, 0.12); color: var(--color-wealth); }

/* Dashboard layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 992px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--glass-shadow);
  margin-bottom: 1.25rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.panel-title i {
  color: var(--color-primary);
}

/* Charts grid */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-height: 250px;
}

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

.chart-container-half {
  position: relative;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sub lists styling */
.sub-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.sub-list-item {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
}

.sub-list-item .item-title {
  font-weight: 500;
}

.sub-list-item .item-value {
  font-weight: 600;
  color: var(--color-wealth);
}

/* Recent Transactions List Styling */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.list-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
}

.list-item-title {
  font-weight: 500;
  color: var(--text-main);
}

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

.list-item-amount {
  font-weight: 600;
}

.list-item-amount.amount-income {
  color: var(--color-income);
}

.list-item-amount.amount-expense {
  color: var(--color-expense);
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Spreadsheet Style Tables */
.glass-table-container {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--glass-shadow);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.custom-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

/* Header colors */
.header-green th { background-color: rgba(16, 185, 129, 0.15); }
.header-orange th { background-color: rgba(249, 115, 22, 0.15); }
.header-lightgreen th { background-color: rgba(132, 204, 22, 0.15); }
.header-cyan th { background-color: rgba(6, 182, 212, 0.15); }
.header-red th { background-color: rgba(239, 68, 68, 0.15); }
.header-purple th { background-color: rgba(139, 92, 246, 0.15); }
.header-grey th { background-color: rgba(107, 114, 128, 0.15); }

/* Table color rows matching original Excel sheets */
.tr-income {
  background-color: transparent !important;
  color: #10b981 !important;
}

.tr-expense {
  background-color: transparent !important;
  color: #ef4444 !important;
}

.tr-highlight {
  background-color: transparent !important;
  color: #fbbf24 !important;
  font-weight: 500;
}

/* Empty placeholder row */
.tr-empty {
  opacity: 0.35;
}

.tr-today {
  background-color: rgba(59, 130, 246, 0.12) !important;
  border-left: 4px solid #3b82f6 !important;
}

.custom-table tbody tr:hover {
  filter: brightness(1.1);
  background-color: rgba(255, 255, 255, 0.03);
}

/* Inline Add Row Form style */
.spreadsheet-add-form {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.form-inputs-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.input-control {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  flex: 1;
  min-width: 120px;
  height: 34px;
}

.input-control:focus {
  border-color: var(--glass-border-focus);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.font-sm {
  font-size: 0.8rem !important;
}

.btn-add-row {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-add-row:hover {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, #4338ca 100%);
  transform: translateY(-1px);
}

.row-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem;
  font-size: 0.8rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}

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

.row-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem;
  font-size: 0.8rem;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
}

.row-edit-btn:hover {
  color: #38bdf8;
}

/* Quick elec statuses */
.quick-status-cell {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.quick-status-cell .cell-label {
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.quick-status-cell .cell-value {
  font-weight: 600;
  color: var(--color-electricity);
}

/* Dorm calculator grid layout */
.dorm-calculator-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 1.25rem;
}

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

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.form-row .form-group {
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  height: 38px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 100%);
  color: white;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover) 0%, #4338ca 100%);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-income); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-debt); }

/* Toast alert styling */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 0.85rem 1.25rem;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  font-size: 0.85rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid var(--color-income); }
.toast.error { border-left: 4px solid var(--color-expense); }
.toast.info { border-left: 4px solid var(--color-primary); }

.toast i {
  font-size: 1.1rem;
}
.toast.success i { color: var(--color-income); }
.toast.error i { color: var(--color-expense); }
.toast.info i { color: var(--color-primary); }

/* ================= NEW INPUT COCKPIT AND MODAL STYLES ================= */

.spreadsheet-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
  background-color: #000000;
  border: 1.5px solid #000000;
  border-radius: 4px;
  overflow: hidden;
}

/* Keep 2-column on ALL screen sizes for this grid */
@media (max-width: 768px) {
  .spreadsheet-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5px;
  }
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  background-color: #000000;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 0;
  border-radius: 0;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  background: inherit;
  min-height: 2.6rem;
}

.summary-row .cell-label {
  flex: 1;
  padding: 0.45rem 0.5rem;
  border-right: 1.5px solid #000000;
  text-align: left;
  display: flex;
  align-items: center;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.2;
  font-size: 0.78rem;
}

.summary-row .cell-value {
  min-width: 0;
  flex-shrink: 0;
  width: auto;
  max-width: 48%;
  padding: 0.45rem 0.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-row.cell-grey { background-color: #a6a6a6; color: #000000; }
.summary-row.cell-cyan { background-color: #00b0f0; color: #000000; }
.summary-row.cell-red { background-color: #ff0000; color: #000000; }
.summary-row.cell-yellow { background-color: #ffc000; color: #000000; }
.summary-row.cell-darkblue { background-color: #0070c0; color: #ffffff; }
.summary-row.cell-lightblue { background-color: #9bc2e6; color: #000000; }
.summary-row.cell-green { background-color: #00b050; color: #000000; }

.spreadsheet-date-banner {
  background: var(--color-income);
  color: #090d16;
  text-align: center;
  padding: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.spreadsheet-utilities-row {
  display: flex;
  justify-content: space-around;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.utility-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 100px;
}

.utility-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.utility-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Sub tabs options in cockpit */
.subtab-content {
  display: none;
  animation: tabFadeIn 0.2s ease forwards;
}
.subtab-content.active {
  display: block;
}

.ss-daily-totals {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.total-box {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.25rem;
  border-radius: var(--border-radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.total-box.cell-red { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #f87171; }
.total-box.cell-green { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: #34d399; }
.total-box.cell-yellow { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.2); color: #fde047; }

.total-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.total-value { font-size: 1.05rem; font-weight: 700; }

.header-red-cell { background-color: rgba(239, 68, 68, 0.12) !important; font-weight: 600 !important; }
.header-green-cell { background-color: rgba(16, 185, 129, 0.12) !important; font-weight: 600 !important; }

/* Wealth Quick Actions layout matching Image 1 */
.wealth-quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-quick-shortcut {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem;
  border-radius: var(--border-radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.btn-quick-shortcut i {
  font-size: 1.15rem;
}

.btn-quick-shortcut:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.shortcut-savings {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #38bdf8;
}

.shortcut-invest {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.shortcut-debts {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.shortcut-export {
  background: rgba(71, 85, 105, 0.1);
  border: 1px solid rgba(71, 85, 105, 0.25);
  color: #94a3b8;
}

.shortcut-excel {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

/* Modal Popup UI */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: #0f172a;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}

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

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
}

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

.modal-body {
  padding: 1.25rem;
}

/* ==========================================================================
   MOBILE EMULATOR & CALCULATOR STYLE SHEET (บันทึกมือถือ)
   ========================================================================== */

.mobile-emulator-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 0;
  width: 100%;
}

/* Smartphone frame outline style */
.smartphone-frame {
  position: relative;
  width: 410px;
  height: 840px;
  background: #1e1e2e;
  border: 12px solid #2d2d3d;
  border-radius: 40px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), inset 0 0 4px 2px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Smartphone notch */
.smartphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 24px;
  background: #2d2d3d;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 1000;
}

/* Inner Screen content */
.smartphone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #111827 0%, #090d16 100%); /* Premium dark gradient background, no photo */
  display: flex;
  flex-direction: column;
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  user-select: none;
}

/* Status Bar */
.mobile-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  padding: 0 1.5rem 0 1.8rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  z-index: 900;
  margin-top: 2px;
}

.mobile-status-bar .status-icons {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

/* Top Horizontal Mode Tabs */
.mobile-top-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem 0.5rem 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 10;
}

.mobile-top-tabs::-webkit-scrollbar {
  display: none;
}

.mobile-tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.mobile-tab-btn.active {
  background: #ffe4e6; /* Soft pink-cream active button */
  color: #1e1e2e;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 228, 230, 0.25);
}

/* Selector Pills Row */
.mobile-selectors-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

.mobile-selector-pill {
  flex: 1;
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
}

.mobile-selector-pill:hover {
  background: rgba(30, 30, 30, 0.9);
}

.mobile-selector-pill i {
  font-size: 0.95rem;
  color: #fb7185; /* Soft red tint */
}

.pill-text-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pill-title {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pill-value-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 110px;
}

.mobile-pill-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.pill-chevron {
  font-size: 0.7rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.mobile-transfer-arrow {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  padding: 0 0.15rem;
}

/* Category Search Bar Wrapper */
.mobile-search-wrapper {
  position: relative;
  padding: 0 0.75rem 0.5rem 0.75rem;
  z-index: 10;
}

.mobile-search-wrapper .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%) translateY(-2px);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

.mobile-search-wrapper input {
  width: 100%;
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.4rem 0.8rem 0.4rem 2.1rem;
  font-family: 'Prompt', sans-serif;
  font-size: 0.75rem;
  color: #ffffff;
  outline: none;
  transition: all 0.2s;
}

.mobile-search-wrapper input:focus {
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(20, 20, 20, 0.85);
}

/* Scrollable Category Grid area */
.mobile-categories-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 72px;
  gap: 0.25rem;
  padding: 0.25rem 0.4rem;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 10;
  align-content: flex-start;
}

.mobile-categories-grid::-webkit-scrollbar {
  display: none;
}

.mobile-cat-item {
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.2rem;
  text-align: center;
}

.mobile-cat-item:hover {
  background: transparent;
}

.mobile-cat-icon {
  font-size: 1.35rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
}

.mobile-cat-item:hover .mobile-cat-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.mobile-cat-item.active .mobile-cat-icon {
  background-color: #fb7185 !important;
  border-color: #fb7185 !important;
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.6);
  transform: scale(1.1);
}

.mobile-cat-item.active .mobile-cat-label {
  color: #fb7185;
  font-weight: 600;
}

.mobile-cat-label {
  font-size: 0.6rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.1;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Transfer Center View */
.mobile-transfer-portrait {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 1rem;
}

.portrait-photo-container {
  width: 90%;
  height: 240px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.portrait-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Bottom Area housing inputs + keypad */
.mobile-bottom-section {
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 20;
  margin-top: auto;
}

/* Amount view row */
.mobile-amount-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.scan-receipt-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.1), rgba(244, 63, 94, 0.15));
  border: 1px solid rgba(251, 113, 133, 0.25);
  color: #fb7185;
  padding: 0.4rem 0.6rem;
  border-radius: 18px;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.scan-receipt-btn:hover {
  background: rgba(251, 113, 133, 0.2);
}

.scan-receipt-btn i {
  font-size: 0.75rem;
}

.amount-number-view {
  display: flex;
  align-items: baseline;
  color: #ffffff;
  margin-left: auto;
}

.amount-currency {
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: 0.25rem;
  color: rgba(255, 255, 255, 0.7);
}

.amount-digits {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* Options Input Row */
.mobile-meta-inputs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.15rem;
}

.meta-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  height: 28px;
  position: relative;
  overflow: hidden;
}

.meta-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.meta-item i {
  color: #fb7185;
}

.category-indicator {
  font-weight: 500;
}

.mobile-hidden-datetime {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.mobile-note-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.68rem;
  width: 100%;
  text-align: center;
}

.mobile-note-input::placeholder {
  color: rgba(255,255,255,0.45);
}

/* Calculator Keypad Grid */
.mobile-calculator-keypad {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.calc-row {
  display: flex;
  gap: 0.3rem;
}

.calc-key {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-key:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0.96);
}

.num-key {
  font-family: monospace;
  font-size: 1.35rem;
  font-weight: 600;
  background: rgba(40, 40, 45, 0.7);
}

.op-key {
  background: rgba(251, 113, 133, 0.12);
  color: #fb7185;
  font-weight: 600;
}

.save-key {
  flex: 2;
  background: #ffedd5; /* Cream background like screenshot */
  color: #1e1e2e;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 237, 213, 0.2);
}

.save-key:active {
  background: #fee2e2;
}

/* Category Actions row & editing tools */
.mobile-search-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.search-input-container {
  position: relative;
  flex: 1;
}

.search-input-container .search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%) translateY(-1px);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

.search-input-container input {
  width: 100%;
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.4rem 0.8rem 0.4rem 1.8rem;
  font-family: 'Prompt', sans-serif;
  font-size: 0.75rem;
  color: #ffffff;
  outline: none;
}

.category-edit-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-category-action {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.75rem;
}

.btn-category-action:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-category-action.active {
  background: #fb7185;
  color: #ffffff;
  border-color: #f43f5e;
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.4);
}

/* Edit badges on category grid */
.mobile-cat-item-wrapper {
  position: relative;
}

.cat-edit-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #1e1e2e;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.cat-edit-badge:hover {
  background: #dc2626;
  transform: scale(1.15);
}

/* Transfer visual mockup cards */
.transfer-visual-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.mock-card {
  width: 85%;
  height: 95px;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.card-from {
  background: linear-gradient(135deg, #1e3a8a, #0d9488);
}

.card-to {
  background: linear-gradient(135deg, #4c1d95, #db2777);
}

.card-chip {
  width: 24px;
  height: 18px;
  background: #f59e0b;
  border-radius: 4px;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
}

.card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 0.15rem;
}

.card-balance {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: monospace;
  color: #ffffff;
}

.card-type {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
}

.transfer-vector {
  color: #fb7185;
  font-size: 1.1rem;
  animation: pulseArrow 1.5s infinite alternate;
}

@keyframes pulseArrow {
  from { transform: translateY(-3px); }
  to { transform: translateY(3px); }
}

/* Excel Budget Table styling */
.excel-budget-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(17, 24, 39, 0.4);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  font-size: 0.85rem;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.excel-budget-table th, 
.excel-budget-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.75rem;
}

.eb-header-green {
  background: #059669;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
}

.excel-budget-table th {
  text-align: center;
}

.eb-label {
  font-weight: 500;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.eb-sub-label {
  font-weight: 500;
  text-align: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

.eb-label-small {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.01);
}

.eb-value {
  text-align: right;
  font-family: monospace;
  font-size: 0.9rem;
}

.eb-row-bold {
  font-weight: bold;
  background: rgba(255, 255, 255, 0.04);
}

.eb-row-blue {
  background: transparent;
  color: #38bdf8;
  font-weight: 500;
}

.eb-row-blue td {
  border-color: rgba(2, 132, 199, 0.25);
}

.eb-row-yellow {
  background: transparent;
  color: #fef08a;
  text-align: center;
}

.eb-row-yellow td {
  border-color: rgba(217, 119, 6, 0.25);
}

/* Summary Grid Interactive Editing Styles */
.summary-row.editable-balance {
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

.summary-row.editable-balance:hover {
  filter: brightness(1.08);
  box-shadow: inset 0 0 0 2px #107c41; /* Excel green selection border */
  z-index: 2; /* Bring hovered row above standard borders */
}

.summary-row.editable-balance::after {
  content: '\f304';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 0.7rem;
  color: inherit;
}

.summary-row.editable-balance:hover::after {
  opacity: 0.6;
}

/* ================= MOBILE PORTRAIT LAYOUT CUSTOM RESTRICTION ================= */
body {
  max-width: 430px !important;
  margin: 0 auto !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8) !important;
  position: relative !important;
  background-attachment: fixed !important;
}

/* Header and navigation elements inside 430px width */
.app-header {
  max-width: 430px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  padding: 0 1rem !important;
}

.logo-text {
  font-size: 1rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 140px !important;
}

.spreadsheet-tabs-container {
  max-width: 240px !important;
}

@media (min-width: 430px) {
  .spreadsheet-tabs-container {
    left: calc(50% - 215px) !important;
    transform: translateX(-100%) !important;
  }
  .spreadsheet-tabs-container.open {
    transform: translateX(0) !important;
  }
  .sidebar-overlay {
    max-width: 430px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* Modify header buttons to be icon-only on mobile style */
.header-actions .btn-action span {
  display: none !important;
}

.header-actions .btn-action {
  padding: 0 !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.9rem !important;
}

/* Modal centering and containment within body */
.modal-overlay {
  left: 50% !important;
  transform: translateX(-50%) !important;
  max-width: 430px !important;
  width: 100% !important;
}

/* Force grid stacking on mobile */
.dashboard-layout {
  grid-template-columns: 1fr !important;
  gap: 1.25rem !important;
}

/* Optimize Smartphone Emulator into a standard dashboard widget */
.smartphone-frame {
  width: 100% !important;
  height: auto !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.smartphone-screen {
  border-radius: var(--border-radius-lg) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  height: 720px !important;
}

.smartphone-notch {
  display: none !important;
}

.mobile-status-bar {
  display: none !important;
}

.mobile-top-tabs {
  padding-top: 0.5rem !important;
}

/* Adjust page spacing */
.main-content-fluid {
  padding: 1rem !important;
}

/* ==================== PLANNER TARGETS LAYOUT ==================== */
/* Desktop: classic 4-col grid header row */
.planner-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

/* Each planner row (item) — desktop: still a 4-col grid via planner-item-values */
.planner-item {
  display: grid;
  grid-template-columns: 2fr 3.5fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.planner-item-name {
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 500;
}
.planner-item-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 0.5rem;
  align-items: center;
}
.planner-value-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.planner-mobile-label {
  display: none; /* hidden on desktop */
  font-size: 0.65rem;
  color: var(--text-muted);
}
.planner-calc-val {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  padding: 0 0.25rem;
}

/* Mobile: card layout */
@media (max-width: 600px) {
  /* Hide desktop header row on mobile */
  .planner-header-row {
    display: none !important;
  }

  /* Each item becomes a card with name on top, values in a row below */
  .planner-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    margin-bottom: 0.5rem;
  }
  .planner-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
  }
  .planner-item-values {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.4rem;
    align-items: end;
  }
  .planner-value-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }
  .planner-mobile-label {
    display: block; /* show labels on mobile */
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
  }
  .planner-calc-val {
    font-size: 0.78rem;
    text-align: center;
    padding: 0;
  }
  .planner-item .input-control {
    font-size: 0.78rem !important;
    height: 30px !important;
    padding: 0 0.3rem !important;
    text-align: center !important;
  }
}

@media (max-width: 380px) {
  .planner-item-values {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.25rem;
  }
  .planner-mobile-label {
    font-size: 0.6rem;
  }
  .planner-item .input-control {
    font-size: 0.72rem !important;
    height: 28px !important;
  }
}

