/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --input-bg: #334155;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(30, 41, 59, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 40px;
}

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

.title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  color: transparent;
}

a.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg-secondary);
  transition: all 0.2s;
}

a.nav-link:hover {
  background: var(--input-bg);
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.event-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.event-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-gap: 15px;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

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

.form-input, .form-select {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent);
}

.btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  line-height: normal;
}

.sync-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: white;
}

.spinner {
  border: 4px solid rgba(255,255,255,0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.warning-icon {
  color: var(--danger);
  margin-left: 8px;
  font-size: 1.1em;
}

.event-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s;
  gap: 15px;
}

.event-list-item:hover {
  background: rgba(255,255,255,0.05);
}

.event-list-item.is-today {
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid var(--accent);
  padding-left: 11px;
}

.event-info-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1;
  min-width: 0;
}

.event-date-box {
  flex: 0 0 240px;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .event-list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 15px;
  }

  .event-info-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .event-date-box {
    flex: none;
    font-size: 0.8rem;
    opacity: 0.9;
  }

  .event-title {
    font-size: 1.1rem;
    white-space: normal; /* Allow title to wrap on mobile */
    overflow: visible;
  }

  .event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
  }
}

.event-detail-card {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  transition: all 0.2s;
}

.detail-info-side {
  flex: 0 0 250px;
  padding-top: 5px;
}

@media (max-width: 768px) {
  .event-detail-card {
    flex-direction: column;
    gap: 15px;
  }
  
  .detail-info-side {
    flex: none;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
  }
}

.list-container {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-secondary {
  background-color: var(--bg-secondary);
  z-index: 10;
}
.finance-table th.sticky-col {
  z-index: 11;
}
.btn-secondary {
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.field-error {
  border-color: #ff4d4f !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1);
}

.field-error:focus {
  border-color: #ff7875 !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

/* ========================================
   CHEMS DASHBOARD
   ======================================== */

.chems-page {
  padding-bottom: 40px;
}

/* Hero Counter */
.chems-hero {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.15), rgba(96, 165, 250, 0.10));
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 20px;
  padding: 40px 30px;
  margin-bottom: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.chems-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(167, 139, 250, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(96, 165, 250, 0.06) 0%, transparent 50%);
  animation: chems-glow 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes chems-glow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(5%, -3%); }
}

.chems-hero-inner {
  position: relative;
  z-index: 1;
}

.chems-hero-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.chems-hero-counter {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.counter-number {
  font-size: 4.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1;
  animation: counter-pulse 3s ease-in-out infinite;
}

.counter-number.counter-small {
  font-size: 2.8rem;
}

.counter-unit {
  font-size: 1.3rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-right: 8px;
}

@keyframes counter-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Stats Row */
.chems-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 24px;
}

.chems-stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chems-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.25);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

/* Charts Grid */
.chems-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 20px;
  gap: 20px;
}

.chart-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.chart-card-full {
  grid-column: 1 / -1;
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.chart-canvas-container {
  width: 100%;
  height: 280px;
  position: relative;
}

.chart-canvas-container canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.chart-canvas-tall {
  height: 360px;
}

.chart-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Chart Tooltip */
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 14px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: tooltip-in 0.15s ease-out;
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translate(12px, -50%) scale(0.95); }
  to { opacity: 1; }
}

.chart-tooltip-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.chart-tooltip-value {
  font-size: 1.1rem;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
  .chems-hero {
    padding: 30px 20px;
  }

  .counter-number {
    font-size: 3rem;
  }

  .counter-number.counter-small {
    font-size: 2rem;
  }

  .counter-unit {
    font-size: 1rem;
  }

  .chems-stats-row {
    grid-template-columns: 1fr;
  }

  .chems-charts-grid {
    grid-template-columns: 1fr;
  }

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

  .chart-canvas-container {
    height: 220px;
  }
}

/* ========================================
   MEDS DASHBOARD
   ======================================== */

.meds-page {
  padding-bottom: 40px;
}

.meds-section {
  margin-bottom: 36px;
}

.meds-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.meds-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .meds-stats-row {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   SETTINGS / PARAMETERS PAGE
   ======================================== */

.param-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.param-pill:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(51, 65, 85, 0.9);
}

.param-value {
  cursor: pointer;
}

.param-edit-input {
  background: transparent;
  border: none;
  color: white;
  width: 120px;
  outline: none;
  font-size: 0.85rem;
  font-family: 'Outfit', sans-serif;
}

.param-usage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.param-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.param-delete:hover {
  opacity: 1;
}

.param-delete-disabled {
  color: var(--text-secondary);
  opacity: 0.3;
  cursor: not-allowed;
}

.param-delete-disabled:hover {
  opacity: 0.3;
}

.settings-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #fca5a5;
  font-size: 0.9rem;
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   AGEN পিছিয়ে (AGENDA) PAGE
   ======================================== */

.agenda-page {
  padding-bottom: 40px;
}

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

.year-selector {
  font-size: 1.2rem;
  font-weight: bold;
  padding: 8px 16px;
  background: var(--bg-secondary);
}

.agenda-grid-container {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  /* Custom scrollbar for grid */
}

.agenda-grid-container::-webkit-scrollbar {
  height: 8px;
}
.agenda-grid-container::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}
.agenda-grid-container::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.agenda-month-col {
  flex: 0 0 280px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.agenda-month-header {
  background: rgba(59, 130, 246, 0.15);
  font-weight: 600;
  text-align: center;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.agenda-days {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.agenda-day-cell {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}

.agenda-day-cell:hover {
  background: rgba(255, 255, 255, 0.05);
}

.agenda-day-cell.is-weekend {
  background: rgba(148, 163, 184, 0.25); /* Darker gray to better highlight weekend */
}

.agenda-day-cell.is-holiday {
  background: rgba(167, 139, 250, 0.2); /* Violet background for holidays */
  border-left: 3px solid #a78bfa;
  padding-left: 9px;
}

.agenda-day-cell.is-confirmed-leave {
  background: rgba(22, 163, 74, 0.6); /* Even darker, solid green */
  border-left: 4px solid #16a34a;
  padding-left: 8px;
}

.agenda-day-cell.is-pending-leave {
  background: rgba(74, 222, 128, 0.25); /* Stronger pastel green */
  border-left: 2px dashed #34d399; /* Stronger dashed border */
  padding-left: 10px;
}

.agenda-day-cell.is-sick-leave {
  background: rgba(249, 115, 22, 0.25); /* Orange for MAL */
  border-left: 3px solid #f97316;
  padding-left: 9px;
}

.agenda-day-label {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 6px;
  height: 24px;
}

.agenda-day-label.is-past {
  background: rgba(59, 130, 246, 0.5); /* Blue highlight for past/today */
  color: white;
  font-weight: 600;
}

.day-name {
  color: var(--text-secondary);
  width: 14px;
  display: inline-block;
}

.day-num {
  font-weight: 500;
}

.agenda-day-inputs {
  display: flex;
  gap: 6px;
  flex: 1 1;
}

.agenda-select {
  background: var(--input-bg);
  border: 1px solid transparent;
  color: var(--text-primary);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.75rem;
  width: 60px;
  outline: none;
}

.agenda-select.has-value {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  font-weight: 600;
}

.agenda-input-wrapper {
  position: relative;
  flex: 1 1;
}

.agenda-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  width: 100%;
  padding: 2px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
  outline: none;
}

.agenda-input:focus {
  background: var(--input-bg);
  border-color: var(--accent);
}

.saving-dot {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-saving 1s infinite alternate;
}

@keyframes pulse-saving {
  from { opacity: 0.3; transform: translateY(-50%) scale(0.8); }
  to { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

.agenda-dashboard {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dashboard-card.year-card {
  flex: 0 0 160px;
  min-width: 160px;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  justify-content: center;
  align-items: center;
}

.year-selector-container {
  flex: 1 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.year-selector-dash {
  font-size: 1.5rem;
  font-weight: 800;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  width: 100%;
  text-align: center;
}

.year-selector-dash:focus {
  border-color: var(--accent-hover);
}
.dashboard-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  flex: 1 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.dashboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.dashboard-input {
  background: var(--input-bg);
  border: 1px solid transparent;
  color: var(--text-primary);
  border-radius: 6px;
  padding: 4px 8px;
  width: 80px;
  text-align: right;
  outline: none;
  font-size: 0.95rem;
}

.dashboard-input:focus {
  border-color: var(--accent);
}

.dashboard-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.stat-item .stat-val {
  font-weight: 600;
  font-size: 1.1rem;
}

.text-danger {
  color: #ef4444 !important;
}

/* --- FINANCE DASHBOARD --- */
.finance-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.finance-table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  max-height: calc(100vh - 180px);
}

.finance-table {
  border-collapse: collapse;
  min-width: 100%;
  white-space: nowrap;
}

.finance-table th, .finance-table td {
  padding: 10px 16px;
  text-align: right;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

.finance-table th {
  background: rgba(43, 62, 102, 0.6);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.finance-table td.sticky-col, .finance-table th.sticky-col {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 20;
  text-align: left;
  background: #172136; /* solid background so scrolled columns don't show under */
  border-right: 2px solid rgba(255, 255, 255, 0.1);
  min-width: 250px;
}

.finance-table th.sticky-col {
  z-index: 30; /* above dates and below columns */
}

.finance-table .section-row td {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 16px;
}

.finance-table .account-name {
  color: var(--text-primary);
  font-weight: 500;
}

.finance-table .currency-cell {
  font-family: 'Inter', monospace;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.finance-table .summary-row td {
  background: rgba(30, 41, 59, 1);
}
.finance-table .summary-row .sticky-col {
  background: #1a2333;
}

.finance-table .summary-label {
  font-weight: 700;
  color: var(--text-primary);
}

.finance-table .summary-val {
  font-weight: 700;
}

.finance-table .eur-text { color: #60a5fa; }
.finance-table .aud-text { color: #34d399; }

.finance-table .rate-cell {
  color: #fbbf24;
}

.finance-table .global-row td {
  background: rgba(20, 29, 46, 1);
  font-size: 1.1rem;
}
.finance-table .global-row .sticky-col {
  background: #111827;
}

.finance-table .global-label {
  color: var(--text-primary);
  font-weight: 800;
}

.finance-table .global-val {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 1.15rem;
}

/* --- FINANCE TOGGLE --- */
.view-toggle {
  display: flex;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 4px;
}
.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.toggle-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
}

.circle-btn {
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.circle-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* --- MODAL CONFIGURATION --- */
.finance-config-modal {
  width: 100%;
  max-width: 500px;
}
.config-list {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
}
.config-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}
.config-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.custom-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.snapshot-action-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-size: 0.9rem;
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  border-radius: 4px;
}
.finance-table th:hover .snapshot-action-btn, 
.snapshot-action-btn:focus {
  opacity: 1;
}
.snapshot-action-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.finance-analytics {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-gap: 20px;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 900px) {
  .finance-analytics {
    grid-template-columns: 1fr;
  }
}
.analytics-card {
  padding: 20px;
}
.analytics-title {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* Subscriptions Table & Sticky setup */
.subs-table-wrapper {
  max-height: 70vh;
  overflow: auto;
  position: relative;
  background: var(--bg-primary);
  border-radius: 12px;
}

.subs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px; /* Force horizontal scroll */
}

.subs-table th, .subs-table td {
  padding: 12px 16px; /* Aération */
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.subs-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10; /* Stick above rows */
  border-bottom: 2px solid var(--border-color);
}

/* Make first Two columns sticky on X axis */
.subs-table th.sticky-col, .subs-table td.sticky-col {
  position: -webkit-sticky;
  position: sticky;
  background: var(--bg-primary);
  z-index: 5; /* higher than normal cells, lower than header */
}

/* Header sticky cols need higher z-index to stay above both scrolling rows and sticky cols */
.subs-table thead th.sticky-col {
  z-index: 20; 
}

.sticky-col-1 {
  left: 0;
  z-index: 5;
  border-right: 1px solid var(--border-color);
}

.sticky-col-2 {
  left: 60px; /* Traité est petit */
  z-index: 5;
  border-right: 1px solid var(--border-color);
}

.sticky-col-3 {
  left: 160px; /* Statut: 100px */
  z-index: 5;
  border-right: 2px solid var(--border-color); /* Separator from scrollable */
}

.subs-table thead th.sticky-col-1, 
.subs-table thead th.sticky-col-2,
.subs-table thead th.sticky-col-3 {
  z-index: 20;
}

/* Floating Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 15px;
  gap: 15px;
  margin-bottom: 20px;
}
.form-group-full {
  grid-column: 1 / -1;
}
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 0;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

