/* Controls are visible on both the sign-in screen and authenticated pages. */
.theme-toggle { flex: none; white-space: nowrap; background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.theme-toggle:hover { background: #e8f1ff; border-color: #1d6fff; color: #1d6fff; }
body:not(:has(nav)) > header .language-control { margin-left: auto; }
.language-control { display: flex; align-items: center; gap: 6px; flex: none; color: #475569; font-size: 12px; }
.language-control select { margin: 0; min-height: 42px; padding: 7px 8px; }
html[data-theme="dark"] .language-control { color: #c5c9d0; }
@media (max-width: 700px) {
  header { flex-wrap: wrap; gap: 8px; }
  .brand { margin-right: auto; }
  .workspace-toolbar { flex-basis: 100%; order: 2; }
  .language-control { font-size: 0; }
  .language-control select { font-size: 12px; min-height: 36px; }
  .theme-toggle { min-height: 36px; }
}
@media (max-width: 600px) {
  html[lang="fr"] .receipt-form td:nth-child(1)::before { content:'Produit'; }
  html[lang="fr"] .receipt-form td:nth-child(2)::before { content:'Quantité'; }
  html[lang="fr"] .receipt-form td:nth-child(3)::before { content:'Prix unitaire HT'; }
  html[lang="fr"] .payment-review-table td:nth-child(1)::before { content:'Inclure / source'; }
  html[lang="fr"] .payment-review-table td:nth-child(2)::before { content:'Société'; }
  html[lang="fr"] .payment-review-table td:nth-child(3)::before { content:'Référence / description'; }
  html[lang="fr"] .payment-review-table td:nth-child(4)::before { content:'Montant (DT)'; }
  html[lang="fr"] .payment-review-table td:nth-child(5)::before { content:'Échéance'; }
  html[lang="fr"] .payment-review-table td:nth-child(6)::before { content:'Priorité'; }
}

/* Charcoal surfaces and soft blue accents shared with the Windows app. */
html[data-theme="dark"] { color-scheme: dark; --navy: #e8eaed; --teal: #a7c7f9; --border: #40444b; --muted: #b3b8c1; }
html[data-theme="dark"] body { background: #22242a; color: #e8eaed; }
html[data-theme="dark"] header, html[data-theme="dark"] nav { background: #22242a; border-color: #40444b; }
html[data-theme="dark"] .brand img { background: #fff; border-radius: 7px; padding: 3px; }
html[data-theme="dark"] header strong, html[data-theme="dark"] h1, html[data-theme="dark"] h2,
html[data-theme="dark"] .card strong, html[data-theme="dark"] .workspace-location strong { color: #e8eaed; }
html[data-theme="dark"] header small, html[data-theme="dark"] .workspace-location,
html[data-theme="dark"] .workspace-loading, html[data-theme="dark"] nav::before { color: #b3b8c1; }
html[data-theme="dark"] nav a { color: #c5c9d0; }
html[data-theme="dark"] nav a:hover, html[data-theme="dark"] nav a[aria-current="page"] { background: #343d4b; color: #c7dcff; }
html[data-theme="dark"] button, html[data-theme="dark"] .button { background: #a7c7f9; border-color: #a7c7f9; color: #18283f; }
html[data-theme="dark"] button:hover, html[data-theme="dark"] .button:hover { background: #c4d9fb; border-color: #c4d9fb; }
html[data-theme="dark"] button:focus-visible, html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] input:focus-visible, html[data-theme="dark"] select:focus-visible { outline-color: #a7c7f9; }
html[data-theme="dark"] input[type=checkbox] { accent-color: #a7c7f9; }
html[data-theme="dark"] .workspace-shortcut, html[data-theme="dark"] .secondary,
html[data-theme="dark"] .signout button, html[data-theme="dark"] .theme-toggle { background: #303339; border-color: #555a63; color: #d8e6ff; }
html[data-theme="dark"] .workspace-shortcut:hover, html[data-theme="dark"] .secondary:hover,
html[data-theme="dark"] .signout button:hover, html[data-theme="dark"] .theme-toggle:hover { background: #3a3e45; border-color: #a7c7f9; }
html[data-theme="dark"] a { color: #a7c7f9; }
html[data-theme="dark"] .card, html[data-theme="dark"] .scroll, html[data-theme="dark"] table { background: #2b2e33; border-color: #40444b; }
html[data-theme="dark"] th { background: #303339; color: #c5c9d0; border-color: #40444b; }
html[data-theme="dark"] td { border-color: #40444b; }
html[data-theme="dark"] tbody tr:hover { background: #383c43; }
html[data-theme="dark"] label { color: #c5c9d0; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #26292e; border-color: #555a63; color: #e8eaed; }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #b3b8c1; }
html[data-theme="dark"] input[type=file]::file-selector-button { background: #41454c; color: #e8eaed; }
html[data-theme="dark"] .note { background: #303741; color: #d8e6ff; border-color: #4c596b; }
html[data-theme="dark"] .muted, html[data-theme="dark"] .payment-paid-date,
html[data-theme="dark"] .payment-empty { color: #b3b8c1; }
html[data-theme="dark"] .receipt-form .receipt-total { background: #353d49; color: #d8e6ff; }
html[data-theme="dark"] .receipt-details summary { color: #a7c7f9; }
html[data-theme="dark"] .payment-template { background: #1d4946; color: #b6f2e8; }
html[data-theme="dark"] .payment-template:hover { background: #27625d; }
html[data-theme="dark"] .payment-paid { background: #214b3a; color: #b5efd0; }
html[data-theme="dark"] .payment-upcoming { background: #24425c; color: #cae6ff; }
html[data-theme="dark"] .payment-overdue { background: #5d302e; color: #ffcec7; }
html[data-theme="dark"] .payment-import summary { color: #e8eaed; }
html[data-theme="dark"] .payment-review-toolbar #review-selection { color: #c5c9d0; }
@media (max-width: 600px) {
  html[data-theme="dark"] .payment-review-table tr, html[data-theme="dark"] .receipt-form tr { background: #2b2e33; border-color: #40444b; }
  html[data-theme="dark"] .payment-review-table td::before, html[data-theme="dark"] .receipt-form td::before { color: #c5c9d0; }
  .theme-toggle { font-size: 12px; padding: 7px 8px; }
}
