/* ==========================================================================
   Ovdim — application UI design system (Hebrew RTL SaaS)
   Part of the Ovdim proprietary layer (ovdim_theme). See LICENSE-OVDIM.
   Companion to ovdim/templates/ovdim/*.html. Loaded by ovdim/base.html.

   Palette: an "indigo + teal" accent system on a warm-neutral canvas, tuned
   for light mode only (the pilot surface). Uses CSS logical properties so it
   is direction-agnostic and reads correctly in RTL (text-align: start etc.).
   ========================================================================== */

:root {
  /* --- brand / accents --- */
  --ovd-brand: #4f46e5;          /* indigo-600 */
  --ovd-brand-2: #0ea5b7;        /* teal-600 */
  --ovd-brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #0ea5b7 100%);
  --ovd-brand-soft: #eef2ff;     /* indigo-50 */
  --ovd-accent: #0b5fff;
  --ovd-accent-2: #0ea5b7;

  /* --- surfaces --- */
  --ovd-bg: #f6f7fb;
  --ovd-surface: #ffffff;
  --ovd-surface-2: #fafbfe;
  --ovd-border: #e6e8ef;
  --ovd-border-strong: #d5d9e4;

  /* --- text --- */
  --ovd-text: #16181d;
  --ovd-text-2: #4b5565;
  --ovd-text-3: #8a93a3;
  --ovd-on-brand: #ffffff;

  /* --- semantic --- */
  --ovd-ok: #16a34a;
  --ovd-ok-soft: #ecfdf3;
  --ovd-warn: #d97706;
  --ovd-warn-soft: #fffbeb;
  --ovd-danger: #dc2626;
  --ovd-danger-soft: #fef2f2;

  /* --- radii / shadow --- */
  --ovd-r-sm: 10px;
  --ovd-r-md: 16px;
  --ovd-r-lg: 22px;
  --ovd-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --ovd-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --ovd-shadow-lg: 0 24px 60px -20px rgba(79, 70, 229, 0.35);

  /* --- type --- */
  --ovd-font: "Heebo", "Assistant", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ovd-lh: 1.6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ovd-font);
  line-height: var(--ovd-lh);
  color: var(--ovd-text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 58, 237, 0.08), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(14, 165, 183, 0.07), transparent 55%),
    var(--ovd-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ovd-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- top navigation ------------------------------------------------------ */
.ovd-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 28px;
  height: 64px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ovd-border);
}
.ovd-nav .spacer { flex: 1; }
.ovd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.2px;
  color: var(--ovd-text);
  margin-inline-end: 22px;
}
.ovd-brand .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--ovd-brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--ovd-shadow-sm);
}
.ovd-nav a.navlink {
  color: var(--ovd-text-2);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.ovd-nav a.navlink:hover { background: var(--ovd-brand-soft); color: var(--ovd-brand); text-decoration: none; }
.ovd-nav a.navlink.active { background: var(--ovd-brand-soft); color: var(--ovd-brand); }

/* --- layout shell -------------------------------------------------------- */
.ovd-shell { max-width: 1120px; margin: 0 auto; padding: 34px 28px 80px; }
.ovd-page-title { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.4px; }
.ovd-page-sub { margin: 0 0 26px; color: var(--ovd-text-3); font-size: 15px; }

/* --- card ----------------------------------------------------------------- */
.ovd-card {
  background: var(--ovd-surface);
  border: 1px solid var(--ovd-border);
  border-radius: var(--ovd-r-md);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--ovd-shadow-sm);
}
.ovd-card h2 { margin: 0 0 18px; font-size: 19px; font-weight: 700; }
.ovd-card h3 { margin: 26px 0 4px; font-size: 15px; font-weight: 700; color: var(--ovd-text-2); }
.ovd-card h3:first-child { margin-top: 0; }

/* --- stat cards ----------------------------------------------------------- */
.ovd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 0 0 26px;
}
.ovd-stat {
  position: relative;
  overflow: hidden;
  background: var(--ovd-surface);
  border: 1px solid var(--ovd-border);
  border-radius: var(--ovd-r-md);
  padding: 22px 22px 20px;
  box-shadow: var(--ovd-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.ovd-stat:hover { transform: translateY(-3px); box-shadow: var(--ovd-shadow-md); }
.ovd-stat .glow {
  position: absolute; inset-inline-start: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.14), transparent 70%);
  pointer-events: none;
}
.ovd-stat .n { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; color: var(--ovd-text); }
.ovd-stat .n small { font-size: 14px; font-weight: 600; color: var(--ovd-text-3); }
.ovd-stat .l { color: var(--ovd-text-3); font-size: 13px; font-weight: 500; margin-top: 4px; }
.ovd-stat .ico { font-size: 20px; }

/* --- table ----------------------------------------------------------------- */
.ovd-table-wrap { overflow-x: auto; border-radius: var(--ovd-r-md); border: 1px solid var(--ovd-border); }
table.ovd-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.ovd-table thead th {
  text-align: start;
  background: var(--ovd-surface-2);
  color: var(--ovd-text-3);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ovd-border);
}
.ovd-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ovd-border);
  font-size: 14px;
  vertical-align: middle;
}
.ovd-table tbody tr:last-child td { border-bottom: 0; }
.ovd-table tbody tr:hover { background: #fafbff; }
.ovd-emp { display: flex; align-items: center; gap: 10px; }
.ovd-avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
  background: var(--ovd-brand-grad);
}
.ovd-emp .nm { font-weight: 600; }
.ovd-pill {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.ovd-pill.ok { background: var(--ovd-ok-soft); color: var(--ovd-ok); }
.ovd-pill.warn { background: var(--ovd-warn-soft); color: var(--ovd-warn); }
.ovd-pill.mut { background: #f1f3f7; color: var(--ovd-text-3); }

/* --- forms ----------------------------------------------------------------- */
label.ovd-label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: 13.5px; color: var(--ovd-text-2); }
input.ovd-input, select.ovd-input, textarea.ovd-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--ovd-border-strong);
  border-radius: var(--ovd-r-sm);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input.ovd-input:focus, select.ovd-input:focus, textarea.ovd-input:focus {
  outline: none;
  border-color: var(--ovd-brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
input[type="checkbox"].ovd-check { width: auto; accent-color: var(--ovd-brand); }
.ovd-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 22px; }

/* --- buttons ---------------------------------------------------------------- */
.ovd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--ovd-r-sm);
  color: var(--ovd-on-brand);
  background: var(--ovd-brand-grad);
  background-size: 160% 100%;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, 0.6);
  transition: background-position .25s ease, transform .12s ease, box-shadow .2s ease;
}
.ovd-btn:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(79, 70, 229, 0.7); }
.ovd-btn:active { transform: translateY(0); }
.ovd-btn.ghost { background: #fff; color: var(--ovd-brand); border: 1px solid var(--ovd-border-strong); box-shadow: none; }
.ovd-btn.ghost:hover { background: var(--ovd-brand-soft); box-shadow: none; }
.ovd-btn.block { width: 100%; justify-content: center; margin-top: 22px; }

/* --- messages --------------------------------------------------------------- */
.ovd-msg { padding: 13px 16px; border-radius: var(--ovd-r-sm); margin: 0 0 18px; font-size: 14px; font-weight: 500; }
.ovd-msg.success { background: var(--ovd-ok-soft); color: var(--ovd-ok); }
.ovd-msg.error { background: var(--ovd-danger-soft); color: var(--ovd-danger); }
.ovd-msg.warning { background: var(--ovd-warn-soft); color: var(--ovd-warn); }

/* --- hero / empty state ------------------------------------------------------ */
.ovd-hero {
  background: var(--ovd-brand-grad);
  color: #fff;
  border-radius: var(--ovd-r-lg);
  padding: 40px 36px;
  margin-bottom: 26px;
  box-shadow: var(--ovd-shadow-lg);
  position: relative;
  overflow: hidden;
}
.ovd-hero::after {
  content: "";
  position: absolute; inset-inline-end: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
}
.ovd-hero h1 { margin: 0 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -0.4px; }
.ovd-hero p { margin: 0; opacity: 0.92; font-size: 16px; max-width: 60ch; }
.ovd-empty { text-align: center; padding: 40px 20px; color: var(--ovd-text-3); }
.ovd-empty .big { font-size: 40px; }

/* --- misc -------------------------------------------------------------------- */
.ovd-muted { color: var(--ovd-text-3); }
.ovd-foot-note { margin-top: 30px; color: var(--ovd-text-3); font-size: 12.5px; }

/* --- payroll export card ---------------------------------------------------- */
.ovd-export-card { margin-bottom: 22px; }
.ovd-export-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.ovd-export-row h2 { margin: 0 0 4px; font-size: 19px; }
.ovd-export-row p { margin: 0; font-size: 14px; }
.ovd-export-form { display: flex; align-items: center; gap: 10px; }
.ovd-export-form input[type="month"] {
  height: 44px; padding: 0 12px; font: inherit; font-size: 14.5px;
  color: var(--ovd-text); background: var(--ovd-surface-2);
  border: 1.5px solid var(--ovd-border-strong); border-radius: var(--ovd-r-sm);
}
.ovd-export-form input[type="month"]:focus {
  outline: none; border-color: var(--ovd-brand);
  box-shadow: 0 0 0 4px var(--ovd-brand-soft); background: var(--ovd-surface);
}
.ovd-btn-export {
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--ovd-r-sm);
  background: var(--ovd-brand-grad); color: var(--ovd-on-brand);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: var(--ovd-shadow-md); white-space: nowrap;
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.ovd-btn-export:hover { filter: brightness(1.06); box-shadow: var(--ovd-shadow-lg); }
.ovd-btn-export:active { transform: translateY(1px); }

/* Visually-hidden but screen-reader-accessible label. */
.ovd-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .ovd-shell { padding: 22px 16px 60px; }
  .ovd-hero { padding: 28px 22px; }
  .ovd-nav { padding: 0 14px; }
  .ovd-brand .txt { display: none; }
}
