:root {
  --primary: #00897B;
  --primary-dark: #00695C;
  --primary-light: #4DB6AC;
  --primary-bg: #E0F2F1;
  --accent: #FF6F00;
  --danger: #E53935;
  --success: #43A047;
  --warning: #FFA000;
  --info: #1E88E5;
  --text: #263238;
  --text-secondary: #546E7A;
  --text-light: #90A4AE;
  --bg: #F5F7FA;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-modal: #FFFFFF;
  --bg-landing: #FFFFFF;
  --bg-auth: #FFFFFF;
  --bg-header: rgba(255,255,255,0.95);
  --border: #E0E0E0;
  --border-light: #F0F0F0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 10px 15px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --primary: #4DB6AC;
  --primary-dark: #00897B;
  --primary-light: #80CBC4;
  --primary-bg: #1A3A36;
  --accent: #FFB74D;
  --danger: #EF5350;
  --success: #66BB6A;
  --warning: #FFB300;
  --info: #42A5F5;
  --text: #ECEFF1;
  --text-secondary: #B0BEC5;
  --text-light: #78909C;
  --bg: #121212;
  --bg-card: #1E1E1E;
  --bg-sidebar: #1A1A1A;
  --bg-input: #2A2A2A;
  --bg-modal: #242424;
  --bg-landing: #121212;
  --bg-auth: #1E1E1E;
  --bg-header: rgba(18,18,18,0.95);
  --border: #333333;
  --border-light: #2A2A2A;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.3), 0 10px 15px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--border-light); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C62828; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #2E7D32; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.checkbox-label { display: flex !important; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 400 !important; cursor: pointer; line-height: 1.4; color: var(--text-secondary) !important; margin-bottom: 0 !important; }
.checkbox-label input[type="checkbox"] { width: auto; margin-top: 2px; flex-shrink: 0; }
.checkbox-label a { color: var(--primary); text-decoration: underline; }
.form-control, .form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--text); background: var(--bg-input); transition: border-color var(--transition);
  font-family: inherit;
}
.form-control:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg);
}
.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; padding: 8px 12px; background: #FFEBEE; border-radius: var(--radius-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* ===== LANDING PAGE ===== */
.landing-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--bg-header); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-light); }
.navbar { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-links a:not(.btn) { color: var(--text-secondary); font-size: 14px; font-weight: 500; padding: 8px 12px; }
.nav-links a:not(.btn):hover { color: var(--primary); }

.hero { padding: 140px 0 80px; background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%); }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.hero h1 { font-size: 44px; font-weight: 800; line-height: 1.15; color: var(--text); margin-bottom: 16px; }
.hero-subtitle { font-size: 18px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { display: flex; justify-content: center; }
.hero-card { width: 100%; max-width: 360px; background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.hero-card-header { display: flex; gap: 8px; padding: 14px 16px; background: var(--bg); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.hero-card-body { padding: 24px; }
.mini-stat { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.mini-label { font-size: 14px; color: var(--text-secondary); }
.mini-value { font-size: 18px; font-weight: 700; }
.mini-bar { margin-top: 16px; height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 4px; transition: width 0.5s ease; }

@media (max-width: 768px) {
  .hero { padding: 100px 0 60px; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero h1 { font-size: 32px; }
  .hero-actions { justify-content: center; }
  .hero-visual { display: none; }
  .nav-links a:not(.btn) { display: none; }
}

.features { padding: 80px 0; background: var(--bg-landing); }
.section-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 48px; color: var(--text); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card { padding: 32px; border-radius: var(--radius); border: 1px solid var(--border-light); transition: all var(--transition); text-align: center; }
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.how-it-works { padding: 80px 0; background: var(--bg); }
.steps { display: flex; align-items: flex-start; justify-content: center; gap: 0; max-width: 900px; margin: 0 auto; flex-wrap: wrap; }
.step { text-align: center; padding: 24px; flex: 1; min-width: 160px; max-width: 220px; }
.step-number { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.step h3 { font-size: 16px; margin-bottom: 8px; }
.step p { font-size: 13px; color: var(--text-secondary); }
.step-connector { width: 40px; height: 2px; background: var(--primary-light); margin-top: 24px; flex-shrink: 0; }
@media (max-width: 768px) { .step-connector { display: none; } .step { max-width: 50%; } }

.cta-section { padding: 80px 0; text-align: center; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; }
.cta-section h2 { font-size: 32px; margin-bottom: 12px; }
.cta-section p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; }
.cta-section .btn-primary { background: #fff; color: var(--primary); }
.cta-section .btn-primary:hover { background: var(--primary-bg); }

.landing-footer { padding: 32px 0; border-top: 1px solid var(--border-light); background: var(--bg-landing); }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-brand strong { font-size: 16px; color: var(--text); }
.footer-brand p { font-size: 13px; color: var(--text-light); }
.footer-links { font-size: 13px; color: var(--text-light); }

/* ===== AUTH PAGES ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%); }
.auth-container { width: 100%; max-width: 400px; background: var(--bg-auth); padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.auth-logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--primary); justify-content: center; margin-bottom: 24px; }
.auth-container h2 { text-align: center; font-size: 24px; margin-bottom: 24px; }
.auth-form .btn { margin-top: 8px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }

/* ===== APP LAYOUT ===== */
.app-layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
  height: 100vh; height: 100dvh; z-index: 50; transition: transform var(--transition);
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 4px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav ul { list-style: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all var(--transition); border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--primary-bg); color: var(--primary); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-divider { padding: 16px 20px 8px; }
.nav-divider span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); font-weight: 600; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.user-name { font-size: 14px; font-weight: 500; }
.user-role { font-size: 12px; color: var(--text-light); text-transform: capitalize; }

.main-content { flex: 1; margin-left: var(--sidebar-width); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; min-width: 0; min-height: 0; }
.main-content::-webkit-scrollbar { display: none; }
.page-container { padding: 24px; }

.page-loading { display: flex; align-items: center; justify-content: center; padding: 80px 0; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); position: fixed; z-index: 200; height: 100dvh; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-header .sidebar-toggle { display: none; }
  .main-content { margin-left: 0; }
  .page-container { padding: 16px; padding-top: 56px; }
}
.mobile-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 150;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; cursor: pointer; color: var(--text-secondary); box-shadow: var(--shadow);
}
@media (max-width: 768px) {
  .mobile-toggle { display: flex; align-items: center; justify-content: center; }
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150;
}
@media (max-width: 768px) {
  .sidebar-overlay.open { display: block; }
}

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border-light); min-width: 0; }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-card-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-card-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text); overflow-wrap: break-word; word-break: break-word; }

/* ===== CARDS ===== */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-light); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card-header h2, .card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); background: var(--bg); }

/* ===== TABLES ===== */
.table-container { overflow-x: auto; overflow-y: hidden; max-width: 100%; scrollbar-width: none; -ms-overflow-style: none; }
.table-container::-webkit-scrollbar { display: none; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 14px; }
th { font-weight: 600; color: var(--text-secondary); background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: var(--primary-bg); }
td .actions { display: flex; gap: 4px; }

/* ===== BADGES ===== */
.badge { display: inline-flex; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-pending { background: #FFF8E1; color: #F57F17; }
.badge-paid { background: #E8F5E9; color: #2E7D32; }
.badge-overdue { background: #FFEBEE; color: #C62828; }
.badge-future { background: #E3F2FD; color: #1565C0; }

.badge-tip { position:relative; cursor:default; }
.badge-tip:hover .badge-tip-text { opacity:1; visibility:visible; transform:translateX(-50%) translateY(0); }
.badge-tip-text {
  position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%) translateY(-4px);
  background:var(--text); color:var(--bg-card); font-size:12px; font-weight:500;
  padding:5px 10px; border-radius:6px; white-space:nowrap; pointer-events:none;
  opacity:0; visibility:hidden; transition:all 0.15s ease; z-index:100;
  box-shadow:0 2px 8px rgba(0,0,0,0.15);
}
.badge-tip-text::after {
  content:''; position:absolute; bottom:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-bottom-color:var(--text);
}

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; visibility: hidden; transition: all var(--transition); }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal { background: var(--bg-modal); border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform var(--transition); }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border-light); }
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-light); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-light); }
.empty-state svg { margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* ===== CHART TOOLTIP ===== */
.chart-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: var(--bg-card); border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15); border: 1px solid var(--border-light);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-width: 180px; display: none;
  animation: tooltipFade 0.15s ease-out;
}
@keyframes tooltipFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chart-tooltip svg { display: block; }

/* ===== CHARTS ===== */
.chart-container { margin-bottom: 24px; }
.chart-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 200px; padding: 8px 0; }
.bar-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 36px; border-radius: 4px 4px 0 0; background: var(--primary); transition: height 0.5s ease; min-height: 2px; position: relative; }
.bar:hover { opacity: 0.8; }
.bar-label { font-size: 10px; color: var(--text-light); margin-top: 4px; text-align: center; }
.bar-value { font-size: 10px; color: var(--text-secondary); margin-bottom: 2px; font-weight: 600; }

.distribution-chart { display: flex; flex-direction: column; gap: 12px; }
.dist-item { display: flex; align-items: center; gap: 12px; }
.dist-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dist-info { flex: 1; min-width: 0; }
.dist-name { font-size: 14px; font-weight: 500; }
.dist-bar { height: 8px; border-radius: 4px; margin-top: 4px; transition: width 0.5s ease; }
.dist-amount { font-size: 14px; font-weight: 600; color: var(--text); flex-shrink: 0; }

/* ===== CALENDAR ===== */
.calendar { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-light); overflow: hidden; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-light); }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-title { font-size: 18px; font-weight: 600; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekday { padding: 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-light); text-transform: uppercase; background: var(--bg); }
.calendar-day { min-height: 80px; padding: 6px; border: 1px solid var(--border-light); border-top: none; border-left: none; }
.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day.other-month { background: var(--bg); opacity: 0.5; }
.calendar-day.today { background: var(--primary-bg); }
.calendar-day-number { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.calendar-day.today .calendar-day-number { color: var(--primary); }
.calendar-events { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.calendar-dot { display:inline-block; width:8px; height:8px; border-radius:50%; cursor:pointer; flex-shrink:0; }


/* ===== CALENDAR LEGEND ===== */
.calendar-legend { display:flex;gap:16px;padding:12px 16px;border-top:1px solid var(--border-light);font-size:13px; }
.calendar-legend-item { display:flex;align-items:center;gap:6px; }
.calendar-legend-dot { width:10px;height:10px;border-radius:3px; }

@media (max-width: 600px) {
  .calendar-day { min-height: 50px; padding: 4px; }
  .calendar-event { font-size: 9px; padding: 1px 4px; }
  .calendar-weekday { padding: 6px; font-size: 10px; }
}

/* ===== SWITCH TOGGLE ===== */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: var(--transition); }
.slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: var(--transition); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===== ICON PICKER ===== */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-option { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); cursor: pointer; transition: all var(--transition); color: var(--text-secondary); }
.icon-option:hover { border-color: var(--primary); color: var(--primary); }
.icon-option.selected { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }

.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-option { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: all var(--transition); }
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: var(--text); transform: scale(1.15); }

/* ===== FILTER CHIPS ===== */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; transition: all var(--transition); background: var(--bg-card); color: var(--text-secondary); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.period-tab { font-size:12px;padding:4px 10px;border-radius:6px;border:1px solid var(--border);background:var(--bg-card);color:var(--text-secondary);cursor:pointer;transition:all var(--transition); }
.period-tab:hover { border-color:var(--primary);color:var(--primary); }
.period-tab.active { background:var(--primary);color:#fff;border-color:var(--primary); }

/* ===== TABLE FILTERS ===== */
.filter-row th {
  padding: 4px 8px;
  vertical-align: top;
  background: var(--bg-card);
}
.table-filter {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  background: #fff;
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1.4;
}
.table-filter:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}
.table-filter::placeholder {
  color: var(--text-light);
  font-size: 11px;
}
.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-light);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.4;
}
.btn-clear-filters:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #FFEBEE;
}
.filter-date-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0;
}
.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}
.table-filter-date {
  min-width: 130px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h1 { font-size: 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { flex-direction: column; align-items: center; }
  .step { max-width: 100%; }
  .filter-row { display: none; }
  .stat-card-value { font-size: 22px; }
  th, td { padding: 8px 10px; }
  #invoicesList th:nth-child(3), #invoicesList td:nth-child(3),
  #invoicesList th:nth-child(6), #invoicesList td:nth-child(6),
  .users-table th:nth-child(5), .users-table td:nth-child(5),
  .users-table th:nth-child(6), .users-table td:nth-child(6) {
    display: none;
  }
}
.view-field { display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border-light) }
.view-field:last-of-type { border-bottom:none }
.view-label { font-size:13px;color:var(--text-light) }
.view-value { font-size:14px;color:var(--text);font-weight:500;text-align:right }

.legal-section p, .legal-section li { text-align: left; }

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