/* Default (EN): Manrope */
@font-face {
  font-family: "Manrope";
  src: url("/public/assets/vendor/fonts/manrope-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/public/assets/vendor/fonts/manrope-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Persian (FA): IranSans – local woff from vendor/fonts/iransans/ */
@font-face {
  font-family: "IRANSans";
  src: url("/public/assets/vendor/fonts/iransans/IRANSansWeb.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IRANSans";
  src: url("/public/assets/vendor/fonts/iransans/IRANSansWeb_Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Arabic (AR-Oman): Noto Sans Arabic – local woff2 from vendor/fonts/noto-arabic/ */
@font-face {
  font-family: "NotoSansArabic";
  src: url("/public/assets/vendor/fonts/noto-arabic/noto-sans-arabic-arabic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NotoSansArabic";
  src: url("/public/assets/vendor/fonts/noto-arabic/noto-sans-arabic-arabic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --brand: #005f73;
  --accent: #ee9b00;
  --error: #b91c1c;
  --line: #d9e2ec;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Manrope", "Segoe UI", sans-serif; background: radial-gradient(circle at top right, #d8f3dc, #f2f5f9 35%, #f2f5f9); color: var(--text); }
body.lang-en { font-family: "Manrope", "Segoe UI", sans-serif; }
body.lang-fa { font-family: "IRANSans", "Tahoma", sans-serif; }
body.lang-ar_om { font-family: "NotoSansArabic", "Segoe UI", sans-serif; }
.theme-dark {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand: #0ea5a5;
  --accent: #f59e0b;
  --error: #ef4444;
  --line: #334155;
}
.theme-dark body,
body.theme-dark {
  background: radial-gradient(circle at top right, #1f2937, #0f172a 35%, #0f172a);
}
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 10px 35px rgba(15,23,42,.06); }
.brand-logo { object-fit: contain; margin-bottom: 12px; }
label { display: block; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
input, button, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
button { background: var(--brand); color: #fff; border: 0; cursor: pointer; }
button:hover { filter: brightness(1.03); }
.error { background: #fee2e2; color: var(--error); border: 1px solid #fecaca; padding: 10px; border-radius: 8px; margin-bottom: 12px; }
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #0b1f32; color: #e2e8f0; padding: 20px; display: grid; gap: 8px; align-content: start; }
.sidebar-top { display: grid; gap: 8px; justify-items: start; margin-bottom: 8px; }
.sidebar-logo { object-fit: contain; max-width: 100%; }
.sidebar a { color: #cbd5e1; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.sidebar a:hover { background: #153451; }
.sidebar a.active { background: #153451; color: #fff; }
.sidebar-brand { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.content { padding: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; }
.cards article { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.invoice-wizard { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 10px; align-items: end; }
.wizard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#search-results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 220px; overflow: auto; }
#search-results li { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
#search-results li:hover { background: #f8fafc; }
.muted { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px; }
.logout-form { margin-top: 16px; }
.summary-card { text-align: center; }
.summary-card strong { font-size: 18px; display: block; margin-top: 4px; }
.summary-income { border-left: 4px solid #16a34a; }
.summary-expense { border-left: 4px solid #dc2626; }
.summary-net { border-left: 4px solid var(--brand); }
.app-footer {
  text-align: center;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

html[dir="rtl"] .layout { grid-template-columns: 1fr 260px; }
html[dir="rtl"] .sidebar { order: 2; }
html[dir="rtl"] .content { order: 1; }
html[dir="rtl"] th, html[dir="rtl"] td, html[dir="rtl"] input, html[dir="rtl"] label { text-align: right; }

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-top { grid-column: 1 / -1; }
  .wizard-grid { grid-template-columns: 1fr; }
}
