:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.2rem; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff; font-weight: 800;
}
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: all 0.15s; }
.main-nav a:hover { color: var(--text); background: var(--bg); }
.main-nav a.active { color: var(--primary); background: var(--primary-light); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-user { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; background: var(--card); color: var(--text);
  cursor: pointer; font-family: var(--font); flex-shrink: 0;
}
.lang-select + .lang-select { margin-inline-start: 8px; }

/* Confirmation modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  max-width: 420px; width: 100%; box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 1.15rem; margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 6px; font-size: 0.9rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s; gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

/* Main */
.main-content { flex: 1; padding: 32px 20px; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.25rem; margin-bottom: 16px; }
.card h3 { font-size: 1.1rem; margin-bottom: 12px; }

/* Page hero */
.page-hero { text-align: center; padding: 48px 0 32px; }
.page-hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 12px; }
.page-hero p { font-size: 1.15rem; color: var(--text-muted); max-width: 640px; margin: 0 auto; }

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Summary cards */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.summary-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.summary-card .label { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.summary-card .value { font-size: 1.6rem; font-weight: 800; }
.summary-card.income .value { color: var(--success); }
.summary-card.expense .value { color: var(--danger); }
.summary-card.net .value { color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.95rem; font-family: var(--font);
  background: #fff; color: var(--text);
}
.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-light);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Transaction list */
.transaction-list { list-style: none; }
.transaction-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.transaction-item:last-child { border-bottom: none; }
.transaction-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.transaction-cat {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; font-size: 1rem;
  background: var(--primary-light); flex-shrink: 0;
}
.transaction-details .name { font-weight: 600; font-size: 0.95rem; }
.transaction-details .meta { font-size: 0.8rem; color: var(--text-muted); }
.transaction-amount { font-weight: 700; font-size: 0.95rem; }
.transaction-amount.income { color: var(--success); }
.transaction-amount.expense { color: var(--danger); }
.transaction-actions { display: flex; gap: 6px; }

/* Budget progress */
.budget-item { margin-bottom: 20px; }
.budget-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.9rem; }
.budget-header .budget-name { font-weight: 600; }
.budget-bar { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 5px; transition: width 0.3s; }
.budget-fill.ok { background: var(--success); }
.budget-fill.warn { background: var(--warning); }
.budget-fill.over { background: var(--danger); }

/* Charts */
.chart-container { position: relative; height: 300px; }
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }

/* Month nav */
.month-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 24px; }
.month-nav .month-label { font-size: 1.2rem; font-weight: 700; min-width: 180px; text-align: center; }
.month-nav button {
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem; color: var(--text);
}
.month-nav button:hover { background: var(--bg); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 0.95rem; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* FAQ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-question {
  width: 100%; text-align: left; padding: 16px; background: var(--card);
  border: none; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--text);
  display: flex; justify-content: space-between; align-items: center;
}
.faq-question:hover { background: var(--bg); }
.faq-answer { padding: 0 16px 16px; color: var(--text-muted); display: none; }
.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.contact-list { margin: 0; padding-inline-start: 22px; display: grid; gap: 14px; }
.contact-list li { display: grid; gap: 2px; }
.contact-list span { color: var(--text-muted); font-size: 0.9rem; }
.faq-toggle { font-size: 1.2rem; transition: transform 0.2s; }

/* Search */
.search-box { display: flex; gap: 8px; margin-bottom: 24px; }
.search-box input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 1rem; font-family: var(--font);
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-result {
  display: flex; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; text-decoration: none; color: var(--text); background: var(--card);
  transition: all 0.15s; align-items: flex-start;
}
.search-result:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.result-thumb {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; background: var(--bg);
  font-size: 1.3rem; flex-shrink: 0;
}
.result-body { display: block; min-width: 0; }
.result-body .result-title { display: block; font-weight: 700; margin-bottom: 4px; }
.search-result .result-title mark { background: var(--warning-light); color: var(--warning); padding: 0 2px; border-radius: 2px; }
.search-result .result-desc { display: block; font-size: 0.9rem; color: var(--text-muted); }
.search-result .result-meta { display: block; font-size: 0.8rem; color: var(--primary); margin-top: 6px; }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 16px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.page-info { font-size: 0.9rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.filter-chip {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--card); cursor: pointer; font-size: 0.85rem; color: var(--text-muted);
}
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.search-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.suggestion-chip {
  padding: 6px 12px; border-radius: 20px; background: var(--primary-light);
  color: var(--primary); font-size: 0.85rem; cursor: pointer; border: none;
}
.suggestion-chip:hover { background: var(--primary); color: #fff; }
.loading-indicator { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner {
  width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status page */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.status-dot.operational { background: var(--success); }
.status-dot.degraded { background: var(--warning); }
.status-dot.down { background: var(--danger); }
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.status-badge.operational { background: var(--success-light); color: var(--success); }
.status-badge.degraded { background: var(--warning-light); color: var(--warning); }
.status-badge.down { background: var(--danger-light); color: var(--danger); }
.uptime-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.uptime-fill { height: 100%; background: var(--success); border-radius: 4px; }

/* Timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 24px; }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
  border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item .date { font-size: 0.85rem; color: var(--text-muted); }
.timeline-item h4 { margin: 4px 0; }

/* Team */
.team-member { text-align: center; }
.team-avatar {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; color: #fff;
}
.team-member h3 { font-size: 1rem; margin-bottom: 2px; }
.team-member .role { font-size: 0.85rem; color: var(--text-muted); }

/* Feature cards */
.feature-card { text-align: center; padding: 32px 24px; }
.feature-icon {
  width: 56px; height: 56px; border-radius: 12px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
  font-weight: 700; color: var(--primary); background: var(--primary-light);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }
.feature-benefit { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin-top: 8px; }

/* Testimonials */
.testimonial {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.testimonial .quote { font-style: italic; color: var(--text); margin-bottom: 12px; }
.testimonial .author { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }

/* Security / compliance */
.compliance-item {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px;
  background: var(--card);
}
.compliance-logo {
  width: 48px; height: 48px; border-radius: 8px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; font-weight: 800;
  color: var(--primary); flex-shrink: 0; font-size: 0.8rem; text-align: center;
}
.compliance-item h4 { margin-bottom: 2px; }
.compliance-item p { font-size: 0.9rem; color: var(--text-muted); }

/* Legal */
.legal-section { margin-bottom: 32px; }
.legal-section h2 { font-size: 1.4rem; margin-bottom: 12px; }
.legal-section h3 { font-size: 1.1rem; margin: 16px 0 8px; }
.legal-section p, .legal-section li { color: var(--text-muted); margin-bottom: 8px; }
.legal-section ul { padding-left: 20px; }
.legal-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.version-item { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.version-item .version-date { font-size: 0.85rem; color: var(--text-muted); }
.version-item .version-summary { font-size: 0.9rem; margin-top: 4px; }

/* 404 */
.notfound { text-align: center; padding: 80px 0; }
.notfound .code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.notfound h1 { font-size: 2rem; margin: 16px 0 8px; }
.notfound p { color: var(--text-muted); margin-bottom: 24px; }
.notfound-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.notfound-art { font-size: 3rem; margin-bottom: 16px; }

/* Auth */
.auth-container { max-width: 440px; margin: 40px auto; }
.auth-card { padding: 32px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 8px; text-align: center; }
.auth-card .auth-desc { text-align: center; color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 0.9rem; }
.auth-links a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }
.auth-perks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: 0.9rem; color: var(--text-muted); }
.auth-perks li::before { content: '✓'; color: var(--success); font-weight: 700; margin-inline-end: 8px; }
.auth-side { margin-top: 16px; display: grid; gap: 16px; }
.auth-side-card { text-align: center; padding: 20px; }
.auth-side-card .feature-icon { margin-bottom: 8px; }
.auth-quote { margin: 0 0 8px; font-size: 0.9rem; color: var(--text-muted); font-style: italic; }
.auth-quote-author { font-size: 0.85rem; color: var(--primary); font-weight: 700; }
@media (min-width: 1024px) {
  .auth-layout { max-width: 960px; display: grid; grid-template-columns: 440px 1fr; gap: 24px; align-items: start; justify-content: center; }
  .auth-layout .auth-container { max-width: none; margin: 0; }
  .auth-layout .auth-side { margin-top: 0; }
}
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 0.85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.social-btn {
  width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); cursor: pointer; font-size: 0.9rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px;
}
.social-btn:hover { background: var(--bg); }
.social-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.social-note { font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 8px; }
.demo-badge {
  display: inline-block; margin-inline-start: 8px; padding: 2px 8px;
  background: var(--warning); color: #fff; border-radius: 999px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  vertical-align: middle;
}
.demo-badge.hero { margin-inline-start: 10px; font-size: 0.7rem; }
.password-strength { height: 6px; background: var(--bg); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.password-strength .fill { height: 100%; width: 0; transition: all 0.3s; }
.password-strength .fill.weak { width: 33%; background: var(--danger); }
.password-strength .fill.medium { width: 66%; background: var(--warning); }
.password-strength .fill.strong { width: 100%; background: var(--success); }
.password-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.stats-banner {
  background: var(--primary-light); border-radius: var(--radius); padding: 12px 16px;
  text-align: center; font-size: 0.9rem; color: var(--primary); font-weight: 600; margin-bottom: 20px;
}

/* Backup */
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.backup-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; }
.backup-reminder { font-size: 0.85rem; color: var(--warning); margin-top: 6px; }

/* Onboarding */
.onboard-card { background: linear-gradient(135deg, var(--primary-light), var(--card)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.onboard-card h3 { margin-bottom: 4px; }
.onboard-card p { color: var(--text-muted); margin-bottom: 14px; }
.onboard-steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.onboard-steps li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.onboard-steps .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.onboard-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.pub-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pub-list li::before { content: '✓'; color: var(--success); font-weight: 700; margin-inline-end: 8px; }

.legal-version-row { display: grid; grid-template-columns: 90px 130px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); }
.legal-version-head { font-weight: 700; color: var(--text); }
@media (max-width: 640px) {
  .legal-version-row { grid-template-columns: 70px 100px 1fr; gap: 8px; font-size: 0.8rem; }
}

/* Features page */
.feature-group { margin-bottom: 32px; }
.feature-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.feature-inline-cta { color: var(--primary); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.feature-inline-cta:hover { text-decoration: underline; }
.feature-visual { display: flex; justify-content: center; align-items: center; height: 92px; margin-bottom: 12px; border-radius: 10px; background: var(--bg); }
.feature-quote {
  margin: 14px 0 0; padding: 10px 12px; border-inline-start: 3px solid var(--primary);
  background: var(--bg); border-radius: 0 8px 8px 0; font-size: 0.85rem; color: var(--text-muted);
}

/* About page */
.team-card { text-align: center; }
.team-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%; margin-bottom: 12px;
  color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.5px;
}
.timeline { display: grid; gap: 0; }
.timeline-item { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; position: relative; }
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  flex-shrink: 0; align-self: center; position: relative; top: 1px;
}
.timeline-year { font-weight: 800; color: var(--primary); min-width: 56px; }
.timeline-text { color: var(--text-muted); }

/* Status page */
.status-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.status-item:last-child { border-bottom: none; }
.status-item-desc { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.status-incident-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.status-date { font-size: 0.85rem; color: var(--text-muted); }
.status-update { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.9rem; }
.update-time { color: var(--text-muted); font-size: 0.8rem; min-width: 76px; font-variant-numeric: tabular-nums; }
.update-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.update-dot.warning { background: var(--warning); }
.update-dot.operational { background: var(--success); }
.update-text { color: var(--text-muted); }
.status-maintenance { padding: 10px 0; border-bottom: 1px solid var(--border); }
.status-maintenance:last-child { border-bottom: none; }
.subscribe-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.subscribe-row label { font-size: 0.9rem; font-weight: 600; min-width: 60px; }

/* Security page */
.cert-card { text-align: center; }
.cert-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 14px; margin-bottom: 12px;
  background: var(--primary-light); color: var(--primary);
  font-weight: 800; font-size: 0.95rem; letter-spacing: 0.5px;
}
.incident-table { display: grid; grid-template-columns: 1fr 2fr 2fr; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.incident-row { display: contents; }
.incident-row > span { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-muted); }
.incident-head > span { font-weight: 700; color: var(--text); background: var(--bg); }
.incident-row:last-child > span { border-bottom: none; }
@media (max-width: 640px) {
  .incident-table { grid-template-columns: 1fr; }
  .incident-row > span { border-bottom: 1px solid var(--border); }
  .incident-head { display: none; }
}

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-danger { background: var(--danger-light); color: var(--danger); }
.alert-info { background: var(--primary-light); color: var(--primary); }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* AI report */
.ai-cta {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
  padding: 20px 24px; border: 1px solid var(--primary-light);
  background: linear-gradient(135deg, var(--card), var(--primary-light));
}
.ai-cta-icon {
  width: 48px; height: 48px; border-radius: 12px; font-size: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,0.08); flex-shrink: 0;
}
.ai-cta-text { flex: 1; }
.ai-cta-text h3 { font-size: 1.05rem; margin-bottom: 4px; }
.ai-cta-text p { color: var(--text-muted); font-size: 0.9rem; }
.ai-cta-btn { flex-shrink: 0; }
.report-progress { text-align: center; padding: 48px 24px; }
.report-progress .steps { color: var(--text-muted); font-size: 0.95rem; }
.health-score { text-align: center; padding: 8px 0 20px; }
.score-ring {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800; color: #fff;
}
.score-ring.score-good { background: linear-gradient(135deg, var(--success), #2ecc71); box-shadow: 0 4px 16px rgba(46,204,113,0.35); }
.score-ring.score-fair { background: linear-gradient(135deg, var(--warning), #e67e22); box-shadow: 0 4px 16px rgba(230,126,34,0.35); }
.score-ring.score-poor { background: linear-gradient(135deg, var(--danger), #c0392b); box-shadow: 0 4px 16px rgba(231,76,60,0.35); }
.score-label { font-size: 1.2rem; font-weight: 700; }
.category-bar-row { display: grid; grid-template-columns: 110px 1fr 110px; align-items: center; gap: 12px; margin-bottom: 12px; }
.category-bar-label { font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-bar-track { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.category-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--primary), #8e44ad); transition: width 0.5s; }
.category-bar-value { font-size: 0.85rem; color: var(--text-muted); text-align: right; }
.status-badge.over { background: var(--danger-light); color: var(--danger); }
.status-badge.warn { background: var(--warning-light); color: var(--warning); }
.status-badge.ok { background: var(--success-light); color: var(--success); }
.trend-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.trend-row:last-child { border-bottom: none; }
.tip-card {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  margin-bottom: 12px; border: 1px solid var(--border); background: var(--card);
}
.tip-card .tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-card h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.tip-card p { font-size: 0.92rem; color: var(--text-muted); }
.tip-card.danger { border-left: 4px solid var(--danger); background: var(--danger-light); }
.tip-card.warn { border-left: 4px solid var(--warning); background: var(--warning-light); }
.tip-card.good { border-left: 4px solid var(--success); background: var(--success-light); }
.tip-card.info { border-left: 4px solid var(--primary); background: var(--primary-light); }
.tip-card.danger h4 { color: var(--danger); }
.tip-card.warn h4 { color: var(--warning); }
.tip-card.good h4 { color: var(--success); }
.tip-card.info h4 { color: var(--primary); }

/* Footer */
.site-footer { background: var(--card); border-top: 1px solid var(--border); margin-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; padding: 40px 20px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 8px; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 16px 20px;
  display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--card); border-bottom: 1px solid var(--border); flex-direction: column; padding: 12px; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-actions { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 2rem; }
}

/* RTL adjustments for Arabic */
[dir="rtl"] .month-nav button:nth-child(1) { transform: scaleX(-1); }
[dir="rtl"] .month-nav button:nth-child(3) { transform: scaleX(-1); }
[dir="rtl"] .budget-item > div:last-child { text-align: left !important; }
[dir="rtl"] .transaction-actions { flex-direction: row-reverse; }
[dir="rtl"] .category-bar-value { text-align: left; }
[dir="rtl"] .tip-card { border-left: 1px solid var(--border); border-right-width: 4px; border-right-style: solid; }
[dir="rtl"] .tip-card.danger { border-right-color: var(--danger); }
[dir="rtl"] .tip-card.warn { border-right-color: var(--warning); }
[dir="rtl"] .tip-card.good { border-right-color: var(--success); }
[dir="rtl"] .tip-card.info { border-right-color: var(--primary); }