/* ============================================================
   ORANGE MONEY ANALYZER — Thème orange / fond clair
   ============================================================ */

:root {
  --orange: #ff7900;
  --orange-dark: #e56a00;
  --orange-darker: #c45800;
  --orange-light: #ffb066;
  --orange-pale: #fff3e6;
  --orange-soft: #ffe6cc;

  --bg: #fdf8f3;
  --card: #ffffff;
  --text: #2b2118;
  --text-soft: #5c4d40;
  --muted: #8a7a6b;
  --border: #f0e4d6;

  --green: #2e9e5b;
  --red: #e14b4b;

  --shadow-sm: 0 2px 8px rgba(255, 121, 0, 0.06);
  --shadow: 0 4px 20px rgba(255, 121, 0, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 500px at 90% -10%, rgba(255, 121, 0, 0.10), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(255, 176, 102, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
  padding: 24px 16px 40px;
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ================= HEADER ================= */
.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 4px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(255, 121, 0, 0.35);
  flex-shrink: 0;
}
.brand-text h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.brand-text h1 span { color: var(--orange); }
.brand-text p { font-size: 13px; color: var(--muted); font-style: italic; }

.header-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.datetime {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--orange-soft);
  color: var(--orange-dark);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.15s ease;
  padding: 0;
}
.icon-btn:hover { background: var(--orange-pale); border-color: var(--orange); transform: rotate(45deg); }
.icon-btn:active { transform: rotate(180deg) scale(0.95); }

.lang-switch {
  display: inline-flex;
  background: #fff;
  border: 1.5px solid var(--orange-soft);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 121, 0, 0.35);
}
.lang-btn:not(.active):hover { color: var(--orange-dark); }

/* ================= PAGE NAVIGATION ================= */
.page-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.page-nav-btn {
  border: 1.5px solid var(--orange-soft);
  background: #fff;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.page-nav-btn:hover { background: var(--orange-pale); border-color: var(--orange-light); color: var(--orange-dark); }
.page-nav-btn.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  border-color: var(--orange);
  box-shadow: 0 3px 12px rgba(255, 121, 0, 0.35);
}

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* ================= CARDS ================= */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.1px;
}
.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--orange-darker);
  margin: 14px 4px 4px;
  letter-spacing: -0.2px;
}

/* ================= UPLOAD ================= */
.upload-card { padding: 20px; }
.dropzone {
  display: block;
  border: 2px dashed var(--orange-light);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffaf5, #fff);
  padding: 38px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--orange);
  background: var(--orange-pale);
  transform: translateY(-1px);
}
.dz-icon { font-size: 40px; margin-bottom: 8px; }
.dz-title { font-size: 16px; font-weight: 700; color: var(--text); }
.dz-sub { font-size: 14px; color: var(--text-soft); margin-top: 4px; }
.dz-sub .link { color: var(--orange); font-weight: 700; text-decoration: underline; }
.dz-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

.upload-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.privacy-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; font-weight: 600; }

/* ================= BUTTONS ================= */
.btn { border: none; border-radius: 10px; padding: 10px 18px; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: all 0.15s ease; font-family: inherit; }
.btn-primary { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: #fff; box-shadow: 0 4px 14px rgba(255, 121, 0, 0.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 121, 0, 0.45); }
.btn-ghost { background: #fff; color: var(--orange-dark); border: 1.5px solid var(--orange-soft); }
.btn-ghost:hover { background: var(--orange-pale); border-color: var(--orange-light); }

/* ================= STATUS / ERROR ================= */
.status { margin-top: 14px; background: var(--orange-pale); border: 1px solid var(--orange-soft); color: var(--orange-darker); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; text-align: center; }
.error-box { margin-top: 14px; background: #fff0f0; border: 1px solid #ffd0d0; color: #b52a2a; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; text-align: center; }
.hidden { display: none !important; }

/* ================= KPI ================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--orange), var(--orange-light)); }
.kpi.in::before { background: linear-gradient(90deg, var(--green), #7ed6a0); }
.kpi.out::before { background: linear-gradient(90deg, var(--red), #ff9d9d); }
.kpi-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
.kpi-value.in { color: var(--green); }
.kpi-value.out { color: var(--red); }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ================= INSIGHTS ================= */
.insights { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.insights li { background: var(--orange-pale); border-left: 3px solid var(--orange); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; color: var(--text-soft); }
.insights li strong { color: var(--orange-darker); }

/* ================= STATS DESCRIPTIVES ================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-item { background: linear-gradient(180deg, #fffaf5, #fff); border: 1px solid var(--orange-soft); border-left: 3px solid var(--orange); padding: 12px 14px; border-radius: 10px; transition: transform 0.15s ease; }
.stat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 5px; }
.stat-value { font-size: 17px; font-weight: 800; color: var(--orange-darker); font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.stat-sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ================= FILTERS ================= */
.filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.field input, .field select { font-family: inherit; font-size: 13.5px; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); outline: none; transition: border-color 0.15s; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.12); }
.field-btn { justify-content: flex-end; }

/* ================= CHARTS ================= */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.chart-card.wide { grid-column: span 2; }
.chart-box { position: relative; width: 100%; height: 280px; }
.chart-box-tall { height: 340px; }
.chart-card.wide .chart-box { height: 320px; }

/* ================= TABLES ================= */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.table-wrap.scrollable { max-height: 560px; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead { position: sticky; top: 0; background: var(--orange-pale); z-index: 1; }
.data-table th { text-align: left; padding: 11px 14px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--orange-darker); border-bottom: 1px solid var(--orange-soft); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f7efe5; color: var(--text-soft); vertical-align: middle; }
.data-table tbody tr:hover { background: #fffaf3; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.amt-in { color: var(--green); font-weight: 700; }
.amt-out { color: var(--red); font-weight: 700; }
.cat-tag { display: inline-block; background: var(--orange-pale); color: var(--orange-darker); border: 1px solid var(--orange-soft); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.table-head .card-title { margin-bottom: 0; }
.badge { display: inline-block; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }

/* ================= ABOUT / CONTACT / DISCLAIMER ================= */
#page-about .card h3,
#page-contact .card h3,
#page-disclaimer .card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange-darker);
  margin: 18px 0 8px;
}
#page-about .card p,
#page-contact .card p,
#page-disclaimer .card p {
  font-size: 13.5px;
  color: var(--text-soft);
  margin-bottom: 12px;
  line-height: 1.7;
}
#page-about .card ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
#page-about .card ul li {
  background: var(--orange-pale);
  border-left: 3px solid var(--orange);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.contact-item {
  background: linear-gradient(180deg, #fffaf5, #fff);
  border: 1px solid var(--orange-soft);
  border-left: 3px solid var(--orange);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.contact-icon { font-size: 28px; margin-bottom: 8px; }
.contact-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.contact-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--orange-darker);
  word-break: break-all;
}
.contact-note {
  background: var(--orange-pale);
  border-left: 3px solid var(--orange);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 14px;
}

.disclaimer-content h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--orange-darker);
  margin: 20px 0 8px;
}
.disclaimer-content h3:first-child { margin-top: 0; }

/* ================= FOOTER ================= */
.app-footer { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.footer-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--orange); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); color: var(--text-soft); font-size: 12.5px; line-height: 1.7; }
.footer-card h3 { font-size: 13px; font-weight: 800; color: var(--orange-darker); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-card p { margin-bottom: 10px; }
.footer-card p:last-child { margin-bottom: 0; }
.footer-card strong { color: var(--text); }
.footer-copy { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 10px 0; }

/* Countries */
.countries-card { border-left-color: var(--green); }
.countries-card h3 { color: var(--green); }
.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.country-item {
  background: #f0faf3;
  border: 1px solid #c8e6d0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e6b3a;
  text-align: center;
}
.countries-note {
  font-size: 11.5px !important;
  color: var(--muted) !important;
  font-style: italic;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: span 1; }
  .filters { grid-template-columns: 1fr 1fr; }
  .field-btn { grid-column: span 2; }
}
@media (max-width: 620px) {
  body { padding: 14px 10px 30px; }
  .card { padding: 16px; }
  .brand-text h1 { font-size: 18px; }
  .datetime { font-size: 11.5px; padding: 6px 11px; }
  .filters { grid-template-columns: 1fr; }
  .field-btn { grid-column: span 1; }
  .kpi-value { font-size: 17px; }
  .stat-value { font-size: 15px; }
  .dz-title { font-size: 14px; }
  .app-header { gap: 10px; }
  .page-nav-btn { font-size: 12px; padding: 6px 12px; }
  .countries-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
