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

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d1321;
  --card-bg: rgba(17, 25, 40, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.2);
  --secondary: #3b82f6;
  --secondary-glow: rgba(59, 130, 246, 0.2);
  --accent: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --purple: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.2);
  
  --sidebar-width: 260px;
  --border-radius: 16px;
  --transition: all 0.25s ease;
  --font-family: 'Outfit', 'Prompt', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Glassmorphism base */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* ----------------------------------------------------
   LOGIN SCREEN STYLES
   ---------------------------------------------------- */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #050811;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
  animation: bgRotate 20s linear infinite;
}

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

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 10;
  text-align: center;
}

.login-logo {
  display: inline-flex;
  padding: 16px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  margin-bottom: 24px;
  box-shadow: 0 0 20px var(--primary-glow);
}

.login-card h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  margin-bottom: 20px;
  min-width: 0;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i, .input-with-icon svg {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
}

.input-with-icon input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: white;
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.input-with-icon input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px var(--primary-glow);
}

.login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  border: none;
  color: white;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.credentials-badge {
  margin-top: 24px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--card-border);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ----------------------------------------------------
   MAIN APP LAYOUT
   ---------------------------------------------------- */
.app-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar navigation */
aside {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

aside .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding-left: 8px;
}

aside .logo svg {
  color: var(--primary);
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

aside .logo h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, white, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

aside nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item i, .nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-glow);
  border-color: rgba(16, 185, 129, 0.15);
}

.nav-item.active svg {
  color: var(--primary);
}

.logout-section {
  padding-top: 14px;
  border-top: 1px solid var(--card-border);
}

/* Main Area */
main {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  flex-grow: 1;
  min-height: 100vh;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
}

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

header h2 {
  font-size: 24px;
  font-weight: 700;
}

header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page {
  display: none;
  animation: pageFadeIn 0.3s ease-out;
}

.page.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

/* ----------------------------------------------------
   CARDS & GRIDS
   ---------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
  opacity: 0.12;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Dashboard Sections Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.card-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-panel h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

/* Lists and Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
}

td {
  padding: 14px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.badge {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.badge-income { background: rgba(16, 185, 129, 0.1); color: var(--primary); }
.badge-expense { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-secondary { background: rgba(59, 130, 246, 0.1); color: var(--secondary); }

/* Bank accounts card design */
.bank-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.acc-card {
  padding: 20px;
  color: white;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.acc-card::before {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.acc-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.acc-card-balance {
  font-size: 22px;
  font-weight: 700;
  margin-top: 10px;
}

.acc-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 14px;
}

/* Forms controls */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}

.btn:hover { background: rgba(255,255,255,0.08); }
.btn-primary { background: var(--primary); color: white; border-color: transparent; }
.btn-primary:hover { background: #059669; }
.btn-secondary { background: var(--secondary); color: white; border-color: transparent; }
.btn-secondary:hover { background: #2563eb; }
.btn-danger { background: var(--danger); color: white; border-color: transparent; }
.btn-danger:hover { background: #dc2626; }

input, select, textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filters-group {
  display: flex;
  gap: 10px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal-card {
  width: 100%;
  max-width: 520px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-form-grid .full { grid-column: 1 / -1; }

/* Liabilities list bar */
.liab-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.liab-progress-fill {
  height: 100%;
  background: var(--purple);
}

/* Printable billing */
@media print {
  body * {
    visibility: hidden !important;
  }
  #modal-print-preview, #modal-print-preview * {
    visibility: visible !important;
  }
  #modal-print-preview {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: white !important;
    overflow: visible !important;
  }
  .print-banner {
    display: none !important;
  }
  .print-page-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
  }
  #print-a4-page {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
  }
}

/* Responsiveness & Mobile Friendly Enhancements */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  #mobile-menu-btn {
    display: flex !important;
  }
  aside {
    position: fixed !important;
    left: -280px !important;
    top: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 1000 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.4) !important;
  }
  aside.open {
    left: 0 !important;
  }
  aside .logo h1, aside .nav-item span, aside .logout-section span {
    display: inline !important;
  }
  aside .logo {
    justify-content: flex-start !important;
    padding-left: 8px !important;
  }
  .nav-item {
    justify-content: flex-start !important;
  }
  main {
    margin-left: 0 !important;
    padding: 16px !important;
    width: 100% !important;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  #dash-accounts-two-columns {
    grid-template-columns: 1fr !important;
  }
  
  /* Auto-fold any flex row wrappers with gap to vertical stack on smaller screens */
  div[style*="display:flex"][style*="gap"] {
    flex-wrap: wrap !important;
  }
  
  /* Page title layout styling adjustments for mobile */
  header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  header > div {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  /* Ensure all tables scroll horizontally on swipe instead of overflowing layout */
  .table-container {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Form group responsive margins */
  .form-group {
    width: 100% !important;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 13.5px !important;
  }
  main {
    padding: 12px 10px !important;
  }
  .card-panel {
    padding: 14px 12px !important;
    border-radius: 8px !important;
  }
  .stat-card {
    padding: 14px 12px !important;
  }
  .stat-card h3 {
    font-size: 11.5px !important;
  }
  .stat-card .value {
    font-size: 20px !important;
  }
  .stats-grid {
    gap: 10px !important;
  }
  input, select, textarea {
    padding: 8px 10px !important;
    font-size: 13px !important;
  }
  .btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  table th, table td {
    padding: 8px 6px !important;
    font-size: 11.5px !important;
  }
  /* Sub tabs scrolling in mobile */
  .sub-tabs-container {
    overflow-x: auto !important;
    white-space: nowrap !important;
    gap: 16px !important;
  }
}

/* Sub-tabs Navigation for Customers/Billing */
.sub-tabs-container {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
  padding-bottom: 2px;
}

.sub-tab-link {
  color: #64748b;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 8px 4px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sub-tab-link:hover {
  color: var(--primary-color, #3b82f6);
}

.sub-tab-link.active {
  color: #3b82f6 !important;
  border-bottom-color: #3b82f6 !important;
  font-weight: 600;
}

.sub-tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Color theme selector block */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.theme-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-picker-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.theme-picker-item.active {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3b82f6;
}

.theme-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* Tax range slider styling */
.tax-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1) !important;
  outline: none;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 0;
  border: none;
  cursor: pointer;
}
.tax-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  transition: transform 0.1s;
}
.tax-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.tax-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: none;
  transition: transform 0.1s;
}
.tax-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Premium Tax Pull Badges */
.tax-pull-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  margin-left: 4px;
  line-height: 1.2;
}
.tax-pull-badge.real {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.15);
}
.tax-pull-badge.real:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}
.tax-pull-badge.pred {
  background: rgba(139, 92, 246, 0.08);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.15);
}
.tax-pull-badge.pred:hover {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.1);
}

/* Tax Form Styling Enhancements */
.tax-section-card {
  border-left-width: 4px !important;
  border-left-style: solid !important;
  transition: all 0.3s ease;
}
.tax-section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-color: var(--primary);
}
.tax-label-desc {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* Light Theme Variables and Element Styles */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(0, 0, 0, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

body.light-theme input, 
body.light-theme select, 
body.light-theme textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-theme input::placeholder {
  color: #94a3b8 !important;
}

body.light-theme .nav-item:hover,
body.light-theme .nav-item.active {
  background: rgba(16, 185, 129, 0.08) !important;
}

body.light-theme .card-panel {
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .login-screen {
  background: #f1f5f9 !important;
}

body.light-theme .login-card {
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme table.data-table th {
  background: #f8fafc !important;
  color: #334155 !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

body.light-theme table.data-table td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-theme table.data-table tr:hover {
  background: #f8fafc !important;
}

/* Theme Toggle Icon Display rules */
body:not(.light-theme) .dark-icon {
  display: flex !important;
}
body:not(.light-theme) .light-icon {
  display: none !important;
}
body.light-theme .dark-icon {
  display: none !important;
}
body.light-theme .light-icon {
  display: flex !important;
}

body.light-theme #login-theme-toggle,
body.light-theme #header-theme-toggle {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0f172a !important;
}/* Toggle Switch Styles */
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,0.1);
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}
input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

body.light-theme .toggle-slider {
  background-color: rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.1);
}
body.light-theme input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* Light Theme Overrides for Hardcoded/Inline Colors */
body.light-theme select,
body.light-theme input,
body.light-theme textarea {
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme aside .logo h1 {
  background: linear-gradient(135deg, #0f172a, var(--primary)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
  color: #0f172a !important;
}

body.light-theme .stat-value {
  color: #0f172a !important;
}

body.light-theme table th {
  color: #334155 !important;
  background-color: #f1f5f9 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

body.light-theme table td {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme table tr:hover td {
  background: #f8fafc !important;
}

body.light-theme #lbl-fore-retire-wealth,
body.light-theme #lbl-fore-diagnosis-value,
body.light-theme #lbl-retire-year-header,
body.light-theme .forecast-summary h3,
body.light-theme .forecast-summary div {
  color: #0f172a !important;
}

body.light-theme .login-card,
body.light-theme .card-panel,
body.light-theme .glass,
body.light-theme .modal-card {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Fix inline styling with high-contrast rules */
body.light-theme :not(.btn):not(button)[style*="color:white"],
body.light-theme :not(.btn):not(button)[style*="color: white"],
body.light-theme :not(.btn):not(button)[style*="color:#fff"],
body.light-theme :not(.btn):not(button)[style*="color:#ffffff"],
body.light-theme :not(.btn):not(button)[style*="color: #fff"],
body.light-theme :not(.btn):not(button)[style*="color: #ffffff"] {
  color: #0f172a !important;
}

body.light-theme [style*="rgba(255,255,255,0.0"],
body.light-theme [style*="rgba(255, 255, 255, 0.0"],
body.light-theme [style*="rgba(255,255,255,0.1"],
body.light-theme [style*="rgba(255, 255, 255, 0.1"] {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme [style*="border:1px solid rgba(255,255,255"],
body.light-theme [style*="border: 1px solid rgba(255, 255, 255"],
body.light-theme [style*="border:1px dashed rgba(255,255,255"],
body.light-theme [style*="border: 1px dashed rgba(255, 255, 255"],
body.light-theme [style*="border-color:rgba(255,255,255"],
body.light-theme [style*="border-color: rgba(255, 255, 255"] {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Force dark text for basic buttons in Light Mode to override inline style="color:white" */
body.light-theme .btn:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not([style*="background:#10b981"]):not([style*="background:#3b82f6"]):not([style*="background:#8b5cf6"]):not([style*="background:linear-gradient"]) {
  color: var(--text-primary) !important;
}
body.light-theme button:not(.btn-primary):not(.btn-secondary):not(.btn-danger):not([style*="background:#10b981"]):not([style*="background:#3b82f6"]):not([style*="background:#8b5cf6"]):not([style*="background:linear-gradient"]) {
  color: var(--text-primary) !important;
}



/* Responsive AdSense Wrappers for Mobile Viewports */
.adsense-unit-wrapper {
  display: block !important;
  width: 100% !important;
  overflow: hidden !important;
}

.adsense-unit-wrapper ins.adsbygoogle {
  display: block !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
}

@media (max-width: 600px) {
  .adsense-unit-wrapper ins.adsbygoogle[style*="width"] {
    width: 100% !important;
  }
}

@media (max-width: 1200px) {
  .backup-checkbox-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .backup-checkbox-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .backup-checkbox-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Utility Classes */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }

/* ====================================================
   Product Management and Display Cards System (Minimal Style)
   ==================================================== */
.product-top-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.product-card-top {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.product-card-top:hover {
  border-color: var(--text-secondary);
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 50%; /* Compact aspect ratio */
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}

.product-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.product-price-sale {
  font-size: 13px;
  font-weight: 800;
  color: var(--secondary);
}

.product-price-original {
  font-size: 10px;
  text-decoration: line-through;
  color: var(--text-muted);
}

.product-description {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.product-description-full {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.btn-product-buy {
  background: var(--danger);
  color: white;
  border: none;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-product-buy:hover {
  background: #dc2626;
}

.product-badge-pinned {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f59e0b;
  color: #050811;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Bottom Horizontal List Styles */
.product-bottom-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.product-card-horizontal {
  position: relative;
  display: flex;
  flex-direction: row;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
  min-height: 120px;
}

.product-card-horizontal:hover {
  border-color: var(--text-secondary);
}

.product-card-horizontal .product-image-wrapper {
  width: 180px;
  height: 100%;
  min-height: 120px;
  flex-shrink: 0;
  padding-top: 0;
  border-bottom: none;
  border-right: 1px solid var(--card-border);
}

/* Responsive adjustment for horizontal cards */
@media (max-width: 768px) {
  .product-card-horizontal {
    flex-direction: column;
  }
  .product-card-horizontal .product-image-wrapper {
    width: 100%;
    padding-top: 50%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
  }
}

/* ====================================================
   Account Cash Purpose Badges
   ==================================================== */
.account-purpose-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.2;
  margin-top: 4px;
  white-space: nowrap;
}

/* Dark mode colors (default) */
.purpose-unclassified {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.2);
}
.purpose-operating {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.purpose-free-cash {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.purpose-emergency {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.purpose-tax {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.purpose-credit-card {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.purpose-education {
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.purpose-sinking-fund {
  background: rgba(100, 116, 139, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.25);
}
.purpose-debt-reserve {
  background: rgba(249, 115, 22, 0.12);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.2);
}
.purpose-investment-cash {
  background: rgba(20, 184, 166, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.2);
}
.purpose-retirement {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.purpose-restricted {
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.2);
}
.purpose-investment-account {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.purpose-liability {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Light theme overrides */
body.light-theme .purpose-unclassified {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}
body.light-theme .purpose-operating {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
body.light-theme .purpose-free-cash {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
body.light-theme .purpose-emergency {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
body.light-theme .purpose-tax {
  background: #faf5ff;
  color: #6d28d9;
  border-color: #e9d5ff;
}
body.light-theme .purpose-credit-card {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}
body.light-theme .purpose-education {
  background: #ecfeff;
  color: #0369a1;
  border-color: #cffafe;
}
body.light-theme .purpose-sinking-fund {
  background: #f8fafc;
  color: #334155;
  border-color: #e2e8f0;
}
body.light-theme .purpose-debt-reserve {
  background: #fff7ed;
  color: #c2410c;
  border-color: #ffedd5;
}
body.light-theme .purpose-investment-cash {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #ccfbf1;
}
body.light-theme .purpose-retirement {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}
body.light-theme .purpose-restricted {
  background: #fdf2f8;
  color: #b91c1c;
  border-color: #fbcfe8;
}
body.light-theme .purpose-investment-account {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}
body.light-theme .purpose-liability {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Credit card coverage modal status badges */
.credit-coverage-status-clear {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.credit-coverage-status-funded {
  background: rgba(16, 185, 129, 0.12);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.credit-coverage-status-partial {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.credit-coverage-status-unfunded {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

body.light-theme .credit-coverage-status-clear {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
body.light-theme .credit-coverage-status-funded {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}
body.light-theme .credit-coverage-status-partial {
  background: #fff7ed;
  color: #c2410c;
  border-color: #ffedd5;
}
body.light-theme .credit-coverage-status-unfunded {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.net-free-cash-positive {}
.net-free-cash-zero {}
.net-free-cash-shortfall {}
.net-free-cash-neutral {}

/* Account Group Header Hover styles */
.account-group-header-hover {
  transition: background 0.15s ease;
}
.account-group-header-hover:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
body.light-theme .account-group-header-hover:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

/* Cash Composition Legend Item Interactive styles */
.cash-composition-legend-item-btn {
  font-family: inherit;
  width: 100%;
}
.cash-composition-legend-item-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}
.cash-composition-legend-item-btn:focus-visible {
  outline: 2px solid var(--secondary) !important;
  outline-offset: 1px !important;
}
body.light-theme .cash-composition-legend-item-btn:hover {
  background: rgba(0, 0, 0, 0.04) !important;
}
body.light-theme .cash-composition-legend-item-btn span {
  color: var(--text-primary) !important;
}
body.light-theme .cash-composition-legend-item-btn span:first-child {
  color: var(--text-secondary) !important;
}

/* Dashboard Card Spanning and Layout Modifications */
.dashboard-full-width-card {
  grid-column: 1 / -1 !important;
  align-self: start !important;
  min-height: 0 !important;
  height: auto !important;
}

/* Card 5 (สิ่งที่ควรทำต่อ) Layout Grid */
.dash-cash-actions-grid-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.dash-cash-actions-info-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-cash-actions-amount-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: right;
  min-width: 150px;
}
.dash-cash-actions-btn-col {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: fit-content;
}

/* Card 6 (ภาพรวมการจัดสรรเงินสด) Legend Grid */
.dash-cash-composition-legend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  font-size: 11.5px;
  margin-top: 12px;
  margin-bottom: 12px;
  width: 100%;
}

/* Tablet view adjustments (max-width: 768px) */
@media (max-width: 768px) {
  .dash-cash-actions-grid-container {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }
  .dash-cash-actions-btn-col {
    grid-column: span 2;
    width: 100%;
    justify-content: flex-start;
  }
  .dash-cash-actions-amount-col {
    text-align: right;
  }
  .dash-cash-composition-legend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Mobile view adjustments (max-width: 480px) */
@media (max-width: 480px) {
  .dash-cash-actions-grid-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dash-cash-actions-btn-col {
    grid-column: span 1;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .dash-cash-actions-btn-col button {
    width: 100%;
    justify-content: center;
  }
  .dash-cash-actions-amount-col {
    text-align: left;
    min-width: 0;
  }
  .dash-cash-composition-legend-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ====================================================
   DATA HEALTH CHECK STYLES
   ==================================================== */
.dh-summary-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  align-items: center;
}

.dh-score-circle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dh-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--card-bg, #1a1f36) 79%, transparent 80% 100%),
              conic-gradient(var(--score-color, #4cd964) calc(var(--score-percent, 0) * 1%), rgba(255,255,255,0.1) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dh-score-circle::before {
  content: attr(data-score);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

body.light-theme .dh-score-circle::before {
  color: #2c3e50;
}

.dh-status-title {
  font-size: 20px;
  font-weight: 600;
}

.dh-status-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

.dh-stats-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.dh-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.dh-stat-badge.critical {
  background: rgba(255, 59, 48, 0.15);
  border-color: rgba(255, 59, 48, 0.3);
  color: #ff453a;
}
.dh-stat-badge.warning {
  background: rgba(255, 159, 10, 0.15);
  border-color: rgba(255, 159, 10, 0.3);
  color: #ff9f0a;
}
.dh-stat-badge.attention {
  background: rgba(10, 132, 255, 0.15);
  border-color: rgba(10, 132, 255, 0.3);
  color: #0a84ff;
}
.dh-stat-badge.healthy {
  background: rgba(48, 209, 88, 0.15);
  border-color: rgba(48, 209, 88, 0.3);
  color: #30d158;
}

/* Category grid & cards */
.dh-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dh-category-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dh-category-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.dh-category-card.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

.dh-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dh-category-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dh-category-count {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.dh-category-count.has-issues {
  background: rgba(255, 59, 48, 0.2);
  color: #ff453a;
}

.dh-category-count.warning-only {
  background: rgba(255, 159, 10, 0.2);
  color: #ff9f0a;
}

.dh-category-count.info-only {
  background: rgba(10, 132, 255, 0.2);
  color: #0a84ff;
}

.dh-category-count.healthy {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
}

/* Issues section styling */
.dh-issues-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dh-issue-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.dh-issue-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.dh-issue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dh-issue-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dh-severity-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dh-severity-indicator.error {
  background-color: #ff453a;
  box-shadow: 0 0 6px #ff453a;
}

.dh-severity-indicator.warning {
  background-color: #ff9f0a;
  box-shadow: 0 0 6px #ff9f0a;
}

.dh-severity-indicator.info {
  background-color: #0a84ff;
  box-shadow: 0 0 6px #0a84ff;
}

.dh-issue-code {
  font-family: monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.dh-issue-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}

.dh-issue-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 2px;
}

.dh-issue-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
}

.dh-issue-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.dh-issue-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Light Theme Overrides */
body.light-theme .dh-summary-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .dh-score-circle {
  background: radial-gradient(closest-side, #ffffff 79%, transparent 80% 100%),
              conic-gradient(var(--score-color, #4cd964) calc(var(--score-percent, 0) * 1%), rgba(0,0,0,0.1) 0);
}

body.light-theme .dh-category-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .dh-category-card:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .dh-category-card.active {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-theme .dh-issue-card {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .dh-issue-card:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .dh-issue-action-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .dh-issue-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .dh-summary-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 16px;
    padding: 16px;
  }
  .dh-stats-row {
    justify-content: center;
  }
  .dh-category-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Refined Dashboard Card Drilldown Action Buttons Styling */
.stats-grid .stat-card:not(.dashboard-full-width-card) {
  display: flex;
  flex-direction: column;
}

.dashboard-summary-card__actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  width: 100%;
}

.dashboard-summary-drilldown {
  /* Inherits layout, padding, background, border, border-radius, and font-size from .btn and inline styles */
  font-weight: 500;
  outline: none;
}

/* Hover state matching standard btn */
.dashboard-summary-drilldown:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
}

body.light-theme .dashboard-summary-drilldown:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-primary) !important;
}

/* Active State */
.dashboard-summary-drilldown:active {
  transform: scale(0.98);
}

/* Focus State matching system accessibility outline */
.dashboard-summary-drilldown:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 1px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .dashboard-summary-card__actions {
    width: 100%;
  }
  .dashboard-summary-drilldown {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px !important;
    font-size: 12px !important;
  }
}

/* Credit card billing schedule classes */
.credit-schedule-today {
  color: #ef4444;
  font-weight: 600;
}
.credit-schedule-soon {
  color: #fb923c;
  font-weight: 500;
}
.credit-schedule-upcoming {
  color: #10b981;
  font-weight: 500;
}
.credit-schedule-not-set {
  color: var(--text-secondary);
  opacity: 0.8;
}

body.light-theme .credit-schedule-today {
  color: #dc2626;
  font-weight: 600;
}
body.light-theme .credit-schedule-soon {
  color: #ea580c;
  font-weight: 500;
}
body.light-theme .credit-schedule-upcoming {
  color: #059669;
  font-weight: 500;
}
body.light-theme .credit-schedule-not-set {
  color: #64748b;
  opacity: 0.8;
}

/* Account Activity Print Styling */
#account-activity-print-view {
  display: none;
}

@media print {
  body.printing-account-activity * {
    visibility: hidden !important;
  }
  body.printing-account-activity #account-activity-print-view,
  body.printing-account-activity #account-activity-print-view * {
    visibility: visible !important;
  }
  body.printing-account-activity #account-activity-print-view {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: white !important;
    color: #111827 !important;
    font-family: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  @page {
    size: A4;
    margin: 12mm;
  }
}

.print-container {
  padding: 20px;
  background: white;
  color: #111827;
}
.print-header {
  border-bottom: 2px solid #374151;
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.print-header h1 {
  margin: 0 0 4px 0;
  font-size: 22px;
  color: #111827;
}
.print-header p {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
}
.print-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
}
.print-meta-item {
  line-height: 1.5;
}
.print-meta-label {
  font-weight: 600;
  color: #374151;
}
.print-summary-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 20px;
}
.print-summary-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}
.print-summary-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.print-month-group {
  margin-bottom: 24px;
  break-inside: avoid;
}
.print-month-title {
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid #9ca3af;
  padding-bottom: 6px;
  margin-bottom: 10px;
  color: #111827;
}
.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12px;
}
.print-table th, .print-table td {
  border: 1px solid #d1d5db;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}
.print-table th {
  background: #f3f4f6;
  font-weight: 600;
}
.print-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
}
.print-badge-past {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}
.print-warning-text {
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
  margin-top: 15px;
}

/* Account Activity Modal Styles */
.activity-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}
.activity-header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
}
body.light-theme .activity-header-stats {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}
.activity-stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.activity-stat-label {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
  font-weight: 500;
}
.activity-stat-value {
  font-size: 16px;
  font-weight: 700;
}
.activity-stat-value.income {
  color: var(--emerald, #10b981);
}
.activity-stat-value.expense {
  color: var(--rose, #f43f5e);
}
.activity-stat-value.neutral {
  color: var(--text-color, #ffffff);
}
body.light-theme .activity-stat-value.neutral {
  color: #111827;
}

.activity-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.activity-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.activity-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color, #ffffff);
  font-size: 13px;
  transition: all 0.2s;
}
body.light-theme .activity-search-input {
  border-color: rgba(0, 0, 0, 0.15);
  background: #ffffff;
  color: #111827;
}
.activity-search-input:focus {
  outline: none;
  border-color: var(--blue, #3b82f6);
  background: rgba(255, 255, 255, 0.08);
}
body.light-theme .activity-search-input:focus {
  background: #ffffff;
  border-color: var(--blue, #3b82f6);
}
.activity-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #8b949e);
  font-size: 14px;
  pointer-events: none;
}
.activity-select-filter {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color, #ffffff);
  font-size: 13px;
  cursor: pointer;
}
body.light-theme .activity-select-filter {
  border-color: rgba(0, 0, 0, 0.15);
  background: #ffffff;
  color: #111827;
}
.activity-clear-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color, #ffffff);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
body.light-theme .activity-clear-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}
.activity-clear-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
body.light-theme .activity-clear-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.activity-action-buttons {
  display: flex;
  gap: 8px;
}
.activity-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color, #ffffff);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
body.light-theme .activity-action-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #111827;
}
.activity-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
body.light-theme .activity-action-btn:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.2);
}

.activity-list-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.activity-month-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}
body.light-theme .activity-month-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
.activity-month-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue, #3b82f6);
}
.activity-month-summary {
  display: flex;
  gap: 12px;
  font-size: 11px;
}
.activity-month-summary span {
  font-weight: 500;
}
.activity-month-summary span.positive {
  color: var(--emerald, #10b981);
}
.activity-month-summary span.negative {
  color: var(--rose, #f43f5e);
}

.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: all 0.2s;
}
body.light-theme .activity-row {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.04);
}
.activity-row:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}
body.light-theme .activity-row:hover {
  background: rgba(0, 0, 0, 0.03);
}
.activity-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.activity-row-title-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.activity-row-category {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color, #ffffff);
}
body.light-theme .activity-row-category {
  color: #111827;
}
.activity-row-date {
  font-size: 10px;
  color: var(--text-muted, #8b949e);
}
.activity-row-badges {
  display: flex;
  gap: 4px;
}
.activity-row-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 500;
}
.activity-row-badge.type-income {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald, #10b981);
}
.activity-row-badge.type-expense {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose, #f43f5e);
}
.activity-row-badge.type-transfer-out {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}
.activity-row-badge.type-transfer-in {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue, #3b82f6);
}
.activity-row-badge.badge-past {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #8b949e);
}
body.light-theme .activity-row-badge.badge-past {
  background: rgba(0, 0, 0, 0.05);
}
.activity-row-note {
  font-size: 11px;
  color: var(--text-muted, #8b949e);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
}
.activity-row-amount {
  font-size: 14px;
  font-weight: 700;
}
.activity-row-amount.income {
  color: var(--emerald, #10b981);
}
.activity-row-amount.expense {
  color: var(--rose, #f43f5e);
}
.activity-row-amount.transfer-out {
  color: #eab308;
}
.activity-row-amount.transfer-in {
  color: var(--blue, #3b82f6);
}

.activity-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.activity-row:hover .activity-row-actions {
  opacity: 1;
}
.activity-row-action-btn {
  background: none;
  border: none;
  color: var(--text-muted, #8b949e);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}
.activity-row-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color, #ffffff);
}
body.light-theme .activity-row-action-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}
.activity-row-action-btn.btn-delete:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose, #f43f5e);
}

.activity-empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted, #8b949e);
}
.activity-empty-state i {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}
.activity-empty-state p {
  font-size: 13px;
}

.activity-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}
body.light-theme .activity-pagination {
  border-top-color: rgba(0, 0, 0, 0.08);
}
.activity-page-info {
  font-size: 12px;
  color: var(--text-muted, #8b949e);
}
.activity-pagination-buttons {
  display: flex;
  gap: 6px;
}
.activity-page-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-color, #ffffff);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
body.light-theme .activity-page-btn {
  border-color: rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #111827;
}
.activity-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.activity-page-btn:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.08);
}
body.light-theme .activity-page-btn:not(:disabled):hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Card Badge button override */
.account-activity-btn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-color, #ffffff);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}
body.light-theme .account-activity-btn-badge {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
  color: #111827;
}
.account-activity-btn-badge:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}
body.light-theme .account-activity-btn-badge:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
}

@media print {
  body.activity-print-mode * {
    visibility: hidden !important;
  }
  #modal-print-preview, #modal-print-preview * {
    visibility: visible !important;
  }
  #modal-print-preview {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: white !important;
    color: black !important;
    overflow: visible !important;
  }
}

/* ====================================================
   PLANNED OBLIGATIONS STYLING (ภาระค่าใช้จ่ายที่กำลังจะถึงกำหนด)
   ==================================================== */
.obligations-tab-btn, .obligations-type-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.obligations-tab-btn:hover, .obligations-type-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.04);
}
.obligations-tab-btn.active, .obligations-type-btn.active {
  color: white;
  background: rgba(255, 255, 255, 0.12) !important;
  font-weight: 600;
}
body.light-theme .obligations-tab-btn:hover, body.light-theme .obligations-type-btn:hover {
  color: black;
  background: rgba(0, 0, 0, 0.04);
}
body.light-theme .obligations-tab-btn.active, body.light-theme .obligations-type-btn.active {
  color: black;
  background: rgba(0, 0, 0, 0.08) !important;
}

.obligation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 8px;
  gap: 12px;
}
.obligation-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
body.light-theme .obligation-row {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .obligation-row:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

.obligation-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  flex-grow: 1;
}
.obligation-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.obligation-title {
  font-weight: 600;
  font-size: 13.5px;
  color: white;
}
body.light-theme .obligation-title {
  color: #1e293b;
}

.obligation-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.obligation-amount-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.obligation-amount-val {
  font-weight: 700;
  font-size: 14.5px;
  color: white;
}
body.light-theme .obligation-amount-val {
  color: #1e293b;
}

.obligation-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.obligation-badge.due-days-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.obligation-badge.due-days-orange {
  background: rgba(245, 158, 11, 0.15);
  color: #fb923c;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.obligation-badge.due-days-yellow {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.25);
}
.obligation-badge.due-days-green {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.obligation-badge.status-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.obligation-badge.status-cancelled {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* ====================================================
   OBLIGATION CALENDAR VIEW STYLES
   ==================================================== */
.calendar-day-header {
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
}

.calendar-day-cell {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  min-height: 90px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  text-align: left;
  width: 100%;
}

.calendar-day-cell:hover, .calendar-day-cell:focus {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
}

.calendar-day-cell.calendar-day-today {
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.calendar-day-cell.calendar-day-selected {
  border-color: var(--secondary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 8px var(--secondary-glow);
}

.calendar-day-cell.calendar-day-other-month {
  opacity: 0.35;
}

.calendar-day-cell.calendar-day-weekend {
  background: rgba(255,255,255,0.01);
}

.calendar-cell-date-num {
  font-size: 12.5px;
  font-weight: 700;
  color: white;
}

.calendar-cell-amount {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-align: right;
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-cell-items-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  flex-grow: 1;
  width: 100%;
}

.calendar-cell-item {
  font-size: 9.5px;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.calendar-cell-item.item-status-planned {
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border-left: 2px solid #3b82f6;
}

.calendar-cell-item.item-status-completed {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border-left: 2px solid #10b981;
}

.calendar-cell-item.item-status-cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: #d1d5db;
  border-left: 2px solid #6b7280;
}

.calendar-cell-item-more {
  font-size: 9px;
  color: var(--text-secondary);
  font-style: italic;
  padding-left: 2px;
}

/* Mobile specific styling */
@media (max-width: 768px) {
  .calendar-day-cell {
    min-height: 48px;
    padding: 4px;
    align-items: center;
    justify-content: center;
  }
  .calendar-cell-items-list, .calendar-cell-amount {
    display: none !important;
  }
  .calendar-day-cell.calendar-day-selected {
    box-shadow: none;
  }
  .calendar-cell-date-num {
    font-size: 13.5px;
  }
  .calendar-mobile-dots-wrapper {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 2px;
  }
  .calendar-mobile-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
  }
  .calendar-mobile-dot.dot-status-planned {
    background: #3b82f6;
  }
  .calendar-mobile-dot.dot-status-completed {
    background: #10b981;
  }
  .calendar-mobile-dot.dot-status-cancelled {
    background: #6b7280;
  }
}





