/* === Base Reset & Variables === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1419;
  --bg-card: #1a2332;
  --bg-card-hover: #1e2a3a;
  --bg-input: #0d1117;
  --border: #2d3a4a;
  --border-accent: #1a6b4a;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --accent: #2ea87a;
  --accent-light: #3fc68e;
  --accent-dark: #1a6b4a;
  --gold: #d4a843;
  --gold-light: #e8c76a;
  --danger: #f85149;
  --info: #58a6ff;
  --font: -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Traditional Arabic', 'Segoe UI', serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* RTL support for Arabic */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .nav { flex-direction: row-reverse; }
[dir="rtl"] .heir-row { flex-direction: row-reverse; }
[dir="rtl"] .heir-controls { flex-direction: row-reverse; }
[dir="rtl"] .message-content { text-align: right; }
[dir="rtl"] .user-message { flex-direction: row; }
[dir="rtl"] .bot-message { flex-direction: row-reverse; }
[dir="rtl"] .result-card::before { left: auto; right: 0; }
[dir="rtl"] .steps-list { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .guide-toc ol { padding-left: 0; padding-right: 20px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.ar { font-family: var(--font-ar); font-size: 0.9em; color: var(--gold); }
.ar-small { font-family: var(--font-ar); font-size: 0.85em; color: var(--text-muted); }
.ar-text { font-family: var(--font-ar); direction: rtl; text-align: right; color: var(--gold); }

/* === Header === */
.header {
  background: linear-gradient(135deg, #0d1117 0%, #1a2332 100%);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.header-content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 2em; color: var(--gold); }
.logo-title { font-size: 1.4em; font-weight: 700; letter-spacing: 2px; }
.logo-subtitle { font-size: 0.8em; color: var(--text-muted); }
.nav { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  font-weight: 500; font-size: 0.85em;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--accent-light); background: var(--accent-dark); }

/* Language Selector */
.lang-selector select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.82em;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
}
.lang-selector select:focus { border-color: var(--accent); }

/* Visitor Badge */
.visitor-badge {
  display: flex; align-items: center; gap: 4px;
  background: rgba(46, 168, 122, 0.1);
  border: 1px solid var(--accent-dark);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8em;
  color: var(--accent-light);
}
.visitor-icon { font-size: 1.1em; }

/* === Admin Stats === */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}
.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 16px 14px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.admin-stat-icon {
  font-size: 1.6em;
  margin-bottom: 4px;
  color: var(--accent-light);
}
.admin-stat-value {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.1;
}
.admin-stat-label {
  font-size: 0.82em;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Panels === */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel-title {
  font-size: 1.2em; font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-dark);
  color: var(--accent-light);
}

/* === Calculator Layout === */
.calc-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 0; }
@media (max-width: 900px) { .calc-layout { grid-template-columns: 1fr; } }

/* === Form Elements === */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9em; }
.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 1em; font-family: var(--font);
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.client-contact-section {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(46, 168, 122, 0.04);
}
.client-contact-section .section-title {
  margin-bottom: 10px;
}
.required-mark {
  color: var(--gold-light);
}
.form-hint {
  color: var(--text-dim);
  display: block;
  font-size: 0.84em;
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 8px;
}

.section-title {
  font-size: 1em; font-weight: 600; color: var(--gold);
  margin: 20px 0 12px; text-transform: uppercase; letter-spacing: 1px;
}
.subsection-title {
  font-size: 0.9em; font-weight: 600; color: var(--accent-light);
  margin: 16px 0 8px;
}

/* === Estate Composition === */
.estate-section { margin-bottom: 20px; }

.estate-add-buttons {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px;
}
.btn-add-estate {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: rgba(46, 168, 122, 0.08);
  border: 1px solid var(--accent-dark);
  border-radius: 20px;
  color: var(--accent-light);
  font-size: 0.78em;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-add-estate:hover { background: var(--accent-dark); color: white; }
.add-icon { font-weight: 700; font-size: 1.1em; }

.estate-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease;
}
.estate-item-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.estate-item-label {
  font-size: 0.85em; font-weight: 600; color: var(--accent-light);
}
.btn-remove-estate {
  background: none; border: none;
  color: var(--text-dim); font-size: 1.3em;
  cursor: pointer; padding: 0 4px;
  transition: color 0.2s;
}
.btn-remove-estate:hover { color: var(--danger); }

.estate-value-input {
  padding: 8px 12px;
  font-size: 0.95em;
}

/* Deductions */
.deductions-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.deduction-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.deduction-row .form-label {
  flex: 1; margin-bottom: 0; font-size: 0.85em;
}
.deduction-input {
  max-width: 150px;
  padding: 8px 10px;
  font-size: 0.9em;
}

/* Estate Total */
.estate-total-section {
  margin-top: 16px;
  padding: 14px;
  background: rgba(46, 168, 122, 0.05);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-sm);
}
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 0.9em;
}
.total-label { color: var(--text-muted); }
.total-value { font-weight: 600; color: var(--text); }
.total-deductions { color: var(--danger); }
.net-row { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--border); }
.total-net { color: var(--gold-light); font-size: 1.15em; font-weight: 700; }

/* === Heir Groups === */
.heir-group {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.heir-group-title {
  padding: 10px 16px;
  background: rgba(46, 168, 122, 0.08);
  font-weight: 600; font-size: 0.9em;
  color: var(--accent-light);
  border-bottom: 1px solid var(--border);
}
.toggle-group { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.toggle-icon { font-size: 1.2em; font-weight: 300; transition: transform 0.2s; }
.toggle-group.open .toggle-icon { transform: rotate(45deg); }

.heir-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(45, 58, 74, 0.5);
  transition: background 0.15s;
}
.heir-row:last-child { border-bottom: none; }
.heir-row:hover { background: var(--bg-card-hover); }
.heir-label { flex: 1; }
.heir-name { font-size: 0.9em; }

.heir-controls { display: flex; align-items: center; gap: 8px; }
.btn-minus, .btn-plus {
  width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text);
  font-size: 1.1em; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.btn-minus:hover, .btn-plus:hover { background: var(--accent-dark); border-color: var(--accent); }
.heir-count {
  min-width: 28px; text-align: center;
  font-weight: 700; font-size: 1.1em; color: var(--gold);
}
.heir-count.active { color: var(--accent-light); }

.hidden { display: none; }

/* === Buttons === */
.btn-calculate {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border: none; border-radius: var(--radius-sm);
  color: white; font-size: 1.1em; font-weight: 600;
  cursor: pointer; margin-top: 20px;
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(46, 168, 122, 0.3);
}
.btn-calculate:hover { background: linear-gradient(135deg, var(--accent), var(--accent-light)); transform: translateY(-1px); }

.btn-reset {
  width: 100%; padding: 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: 0.9em; cursor: pointer; margin-top: 8px;
  font-family: var(--font); transition: all 0.2s;
}
.btn-reset:hover { border-color: var(--danger); color: var(--danger); }

/* === Results === */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 3em; margin-bottom: 16px; opacity: 0.3; }

.results-header { margin-bottom: 20px; }
.results-total {
  font-size: 1.4em; font-weight: 700; color: var(--gold);
  margin-bottom: 8px;
}
.results-info { font-size: 0.85em; color: var(--text-muted); }

.result-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--accent);
}
.result-card:hover { border-color: var(--accent-dark); transform: translateX(2px); }

.result-heir-name { font-weight: 600; font-size: 1.05em; margin-bottom: 4px; }
.result-heir-ar { font-family: var(--font-ar); color: var(--gold); font-size: 0.95em; }
.result-fraction { color: var(--accent-light); font-weight: 600; font-size: 1.1em; }
.result-amount { font-size: 1.3em; font-weight: 700; color: var(--gold-light); margin: 8px 0; }
.result-per-person { font-size: 0.85em; color: var(--text-muted); }
.result-reason {
  font-size: 0.8em; color: var(--text-dim);
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-style: italic;
}

.result-bar {
  height: 6px; background: var(--border);
  border-radius: 3px; margin-top: 10px; overflow: hidden;
}
.result-bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent-light));
  transition: width 0.6s ease;
}

.explanations {
  margin-top: 20px; padding: 16px;
  background: rgba(88, 166, 255, 0.05);
  border: 1px solid rgba(88, 166, 255, 0.15);
  border-radius: var(--radius-sm);
}
.explanations h4 { color: var(--info); margin-bottom: 8px; font-size: 0.95em; }
.explanations p { font-size: 0.85em; color: var(--text-muted); margin-bottom: 4px; }

.blocked-heirs {
  margin: 16px 0;
  padding: 14px 16px;
  background: rgba(248, 81, 73, 0.05);
  border: 1px solid rgba(248, 81, 73, 0.22);
  border-radius: var(--radius-sm);
}
.blocked-heirs h4 {
  color: var(--danger);
  font-size: 0.95em;
  margin-bottom: 10px;
}
.blocked-heir-row {
  padding: 8px 0;
  border-top: 1px solid rgba(248, 81, 73, 0.14);
}
.blocked-heir-row:first-of-type { border-top: none; }
.blocked-heir-row p {
  color: var(--text-muted);
  font-size: 0.82em;
  margin-top: 4px;
}
.blocked-heirs-compact {
  margin-top: 14px;
}

/* === Chat / Consultant === */
.consultant-layout { padding: 24px 0; max-width: 800px; margin: 0 auto; }
.chat-panel { min-height: 70vh; display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; max-height: 60vh; padding: 16px 0; }

.message { display: flex; gap: 12px; margin-bottom: 16px; animation: fadeIn 0.3s ease; }
.message-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2em; flex-shrink: 0;
}
.bot-message .message-avatar { background: var(--accent-dark); color: var(--gold); }
.user-message .message-avatar { background: var(--border); color: var(--text); }
.user-message { flex-direction: row-reverse; }

.message-content {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  max-width: 80%;
  font-size: 0.95em; line-height: 1.7;
}
.user-message .message-content { background: var(--accent-dark); border-color: var(--accent); }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.suggestion-btn {
  padding: 6px 14px; border-radius: 20px;
  background: rgba(46, 168, 122, 0.1);
  border: 1px solid var(--accent-dark);
  color: var(--accent-light); font-size: 0.82em;
  cursor: pointer; font-family: var(--font);
  transition: all 0.2s;
}
.suggestion-btn:hover { background: var(--accent-dark); color: white; }

.chat-input-container { display: flex; gap: 8px; margin-top: 16px; }
.chat-input {
  flex: 1; padding: 12px 16px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.95em; font-family: var(--font);
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.btn-send {
  width: 48px;
  background: var(--accent); border: none;
  border-radius: var(--radius-sm); color: white;
  font-size: 1.2em; cursor: pointer;
  transition: background 0.2s;
}
.btn-send:hover { background: var(--accent-light); }

/* === Guide === */
.guide-panel { max-width: 800px; margin: 24px auto; }

.guide-toc {
  background: rgba(46, 168, 122, 0.05);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.guide-toc h3 {
  color: var(--accent-light); font-size: 1em;
  margin-bottom: 10px;
}
.guide-toc ol {
  padding-left: 20px;
}
.guide-toc li {
  margin-bottom: 4px;
}
.guide-toc a {
  color: var(--info); text-decoration: none; font-size: 0.9em;
}
.guide-toc a:hover { text-decoration: underline; }

.guide-section {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.guide-section:last-child { border-bottom: none; }
.guide-section h3 {
  font-size: 1.1em; color: var(--gold);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.quran-verse {
  background: rgba(212, 168, 67, 0.05);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px; margin: 12px 0;
}

.guide-box {
  background: rgba(46, 168, 122, 0.04);
  border: 1px solid rgba(46, 168, 122, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 12px 0;
}
.guide-box h4 {
  color: var(--accent-light); font-size: 0.95em;
  margin-bottom: 8px;
}
.guide-box ol, .guide-box ul { padding-left: 20px; }
.guide-box li { margin-bottom: 6px; font-size: 0.9em; }
.guide-box.warning {
  background: rgba(248, 81, 73, 0.04);
  border-color: rgba(248, 81, 73, 0.15);
}
.guide-box.warning h4 { color: var(--danger); }
.guide-box.highlight {
  background: rgba(212, 168, 67, 0.06);
  border-color: rgba(212, 168, 67, 0.2);
}
.guide-box.highlight h4 { color: var(--gold); }

.guide-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 600px) { .guide-columns { grid-template-columns: 1fr; } }

.shares-table { overflow-x: auto; }
.shares-table table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.shares-table th, .shares-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.shares-table th { color: var(--accent-light); font-weight: 600; background: rgba(46, 168, 122, 0.05); }
.shares-table td:first-child { color: var(--gold); font-weight: 600; font-size: 1.1em; }

.steps-list { padding-left: 20px; }
.steps-list li { margin-bottom: 10px; font-size: 0.93em; line-height: 1.5; }

/* === Footer === */
.footer {
  text-align: center; padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  color: var(--text-dim); font-size: 0.85em;
}
.footer-note { margin-top: 8px; font-size: 0.78em; max-width: 600px; margin-left: auto; margin-right: auto; }

/* === Tabs === */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-card { animation: fadeIn 0.3s ease forwards; }

/* === Pie Chart === */
.chart-container { margin: 20px 0; text-align: center; }
.chart-container svg { max-width: 280px; }

/* === Payment / Paywall === */
.preview-blurred { opacity: 0.7; }
.blurred-amount {
  filter: blur(8px); user-select: none;
  color: var(--text-muted);
}
.preview-section { margin-bottom: 24px; }

.payment-section { margin-top: 8px; }
.payment-card {
  background: linear-gradient(135deg, rgba(46, 168, 122, 0.05) 0%, rgba(212, 168, 67, 0.05) 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.payment-header { margin-bottom: 20px; }
.payment-icon { font-size: 2.5em; color: var(--gold); margin-bottom: 8px; }
.payment-header h3 { font-size: 1.3em; color: var(--text); margin-bottom: 6px; }
.payment-subtitle { color: var(--text-muted); font-size: 0.9em; }

.payment-price { margin: 20px 0; }
.price-amount {
  font-size: 2.5em; font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 1px;
}
.price-currency {
  font-size: 1.2em; color: var(--text-muted);
  margin-left: 4px;
}

.payment-includes { text-align: left; margin: 20px auto; max-width: 360px; }
.payment-feature {
  padding: 6px 0; font-size: 0.9em; color: var(--text);
}
.payment-feature::first-letter { color: var(--accent-light); }

.payment-methods {
  text-align: left; margin: 24px 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.payment-methods h4 { margin-bottom: 12px; font-size: 0.95em; color: var(--text-muted); }

.payment-method {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.payment-method:hover { border-color: var(--accent-dark); background: rgba(46, 168, 122, 0.03); }

.method-radio {
  width: 20px; height: 20px;
  border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 2px;
  transition: all 0.2s;
}
.method-radio.selected {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg-card);
}

.method-name { font-weight: 600; font-size: 0.95em; margin-bottom: 4px; }
.method-details { font-size: 0.85em; color: var(--text-muted); line-height: 1.6; }
.kaspi-phone {
  font-size: 1.2em; font-weight: 700;
  color: var(--gold-light); letter-spacing: 1px;
}

.btn-payment {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--gold), #e8c76a);
  border: none; border-radius: var(--radius-sm);
  color: #1a2332; font-size: 1.1em; font-weight: 700;
  cursor: pointer; margin-top: 16px;
  font-family: var(--font);
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(212, 168, 67, 0.3);
}
.btn-payment:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4); }

.payment-note {
  font-size: 0.8em; color: var(--text-dim);
  margin-top: 12px; line-height: 1.5;
}
.payment-client-field {
  text-align: left;
  margin: 16px 0 4px;
}
.payment-client-field .payment-note {
  margin-top: 6px;
}
.payment-order-id {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8em; color: var(--text-dim);
}

.paid-badge {
  display: inline-block;
  background: var(--accent-dark);
  color: var(--accent-light);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid var(--accent);
}
.paid-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.paid-actions .paid-badge {
  margin-bottom: 0;
}
.btn-download-pdf {
  padding: 8px 14px;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font-family: var(--font);
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
}
.btn-download-pdf:hover {
  background: var(--gold);
  color: #1a2332;
}

/* === Responsive === */
@media (max-width: 700px) {
  .header-content { flex-direction: column; align-items: flex-start; }
  .header-right { width: 100%; justify-content: space-between; }
  .nav { width: 100%; overflow-x: auto; }
  .nav-link { padding: 8px 12px; font-size: 0.8em; white-space: nowrap; }
  .estate-add-buttons { gap: 4px; }
  .btn-add-estate { padding: 5px 8px; font-size: 0.72em; }
  .guide-panel { padding: 16px; }
  .deduction-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .deduction-input { max-width: 100%; }
}

/* === Print Styles === */
@media print {
  .header, .nav, .btn-calculate, .btn-reset, .footer, .lang-selector, .visitor-badge { display: none; }
  body { background: white; color: black; }
  .panel { border: 1px solid #ccc; box-shadow: none; }
}

/* === Tooltips (native title enhanced) === */
[title] { cursor: help; }
button[title] { cursor: pointer; }
