/* ===========================================================================
   Digital Ten X — Doha HR Portal · UI theme
   Brand tokens lifted from digital10x design-system.html
   =========================================================================== */

:root {
  --ink: #0C0B0A;
  --panel: #141210;
  --panel2: #1B1815;
  --line: #2A2620;
  --line2: #3A342B;
  --fg: #F5F0E8;
  --muted: #9B968C;
  --dim: #6B6761;
  --accent: #00D68F;
  --accent2: #5DECB3;
  --gold: #E8B94E;
  --danger: #F2715B;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }
hr.divider { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 24px 0; }

/* --- Typography ----------------------------------------------------------- */
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.label-mono { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { font-family: var(--sans); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.serif { font-family: var(--serif); }
em.accent, .accent-em { font-family: var(--serif); font-style: italic; color: var(--accent); font-variation-settings: 'wght' 500, 'SOFT' 80; }
.text-muted { color: var(--muted); }
.text-dim { color: var(--dim); }
.text-accent { color: var(--accent); }

/* --- App shell ------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.sidebar .brand img { height: 30px; width: auto; }
.sidebar .brand .tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); border-left: 1px solid var(--line); padding-left: 9px; }
.nav-group { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm); color: var(--muted); font-size: 14px; transition: color .15s, background .15s; }
.nav-link svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; flex: 0 0 auto; }
.nav-link:hover { color: var(--fg); background: var(--panel); }
.nav-link.is-active { color: var(--accent); background: rgba(0,214,143,0.08); }
.sidebar .spacer { flex: 1; }
.sidebar .signout { margin-top: auto; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 30px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(12,11,10,0.85); backdrop-filter: blur(8px); z-index: 5; }
.topbar h1 { font-size: 20px; }
.topbar .who { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.topbar .who b { color: var(--fg); font-weight: 500; }
.content { padding: 30px; max-width: 1180px; width: 100%; }

/* --- Cards ----------------------------------------------------------------- */
.card { background: linear-gradient(180deg, rgba(245,240,232,0.02), rgba(245,240,232,0)); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card:hover { border-color: var(--line2); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* --- Stat cells ------------------------------------------------------------ */
.stat { padding: 22px; background: #0E0D0C; border: 1px solid var(--line); border-radius: var(--r-lg); }
.stat .v { font-family: var(--serif); font-style: italic; font-variation-settings: 'wght' 500, 'SOFT' 80; color: var(--accent); font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-top: 10px; }

/* --- Buttons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 14px; font-weight: 500; padding: 10px 18px; border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer; transition: all .18s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent2); box-shadow: 0 10px 30px -12px rgba(0,214,143,0.5); }
.btn-secondary { background: var(--panel); color: var(--fg); border-color: var(--line2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); background: var(--panel); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(242,113,91,0.4); }
.btn-danger:hover { background: rgba(242,113,91,0.12); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --- Forms ----------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 13px; color: var(--fg); font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .2s; box-sizing: border-box;
}
.input:hover, .select:hover { border-color: var(--line2); }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); }
.input[dir="rtl"] { text-align: right; }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 6px; }
.field.has-err .input, .field.has-err .select { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-section { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.form-actions { display: flex; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

/* --- Tables ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--fg); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--panel); }
table.data .muted { color: var(--muted); }
table.data .mono { font-family: var(--mono); font-size: 12.5px; }

/* --- Badges ---------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }
.badge.ok { color: var(--accent); border-color: rgba(0,214,143,0.4); background: rgba(0,214,143,0.07); }
.badge.bad { color: var(--danger); border-color: rgba(242,113,91,0.4); background: rgba(242,113,91,0.07); }
.badge.warn { color: var(--gold); border-color: rgba(232,185,78,0.4); background: rgba(232,185,78,0.07); }
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* --- Flash ----------------------------------------------------------------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash.success { color: var(--accent); border-color: rgba(0,214,143,0.4); background: rgba(0,214,143,0.06); }
.flash.error { color: var(--danger); border-color: rgba(242,113,91,0.4); background: rgba(242,113,91,0.07); }

/* --- Empty state ----------------------------------------------------------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { width: 46px; height: 46px; margin: 0 auto 16px; opacity: .5; }
.empty h3 { font-family: var(--serif); font-size: 20px; color: var(--fg); margin-bottom: 8px; }

/* --- Page header ----------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search .input { padding-left: 36px; min-width: 240px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; stroke: var(--dim); fill: none; stroke-width: 1.7; }

.pill-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.pill-tabs a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; padding: 6px 14px; border-radius: 999px; color: var(--muted); }
.pill-tabs a.is-active { background: var(--accent); color: var(--ink); }

/* --- Pagination ------------------------------------------------------------ */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.pager-info { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }

/* --- Language switch ------------------------------------------------------- */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 4px 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); transition: background .15s, color .15s; }
.lang-switch a.is-active { background: var(--accent); color: var(--ink); }
.lang-switch a:not(.is-active):hover { color: var(--fg); }

/* --- RTL (Arabic UI) ------------------------------------------------------- */
[dir="rtl"] body { font-family: 'Cairo', 'Inter Tight', system-ui, sans-serif; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .nav-link, [dir="rtl"] .sidebar .brand { flex-direction: row-reverse; }
[dir="rtl"] .stat .k, [dir="rtl"] .label-mono, [dir="rtl"] .eyebrow { letter-spacing: 0; }
[dir="rtl"] table.data th, [dir="rtl"] table.data td { text-align: right; }
[dir="rtl"] .page-head, [dir="rtl"] .card-head, [dir="rtl"] .form-actions { flex-direction: row-reverse; }

/* =========================================================================
   Standalone pages (login + public verification) — no app shell
   ========================================================================= */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(0,214,143,0.10), transparent 55%),
    var(--ink); }
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 28px; }
.auth-brand img { height: 42px; }
.auth-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 32px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box h1 em { font-family: var(--serif); font-style: italic; color: var(--accent); }
.auth-box .sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-foot { text-align: center; margin-top: 22px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

/* Verification result */
.verify-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% -10%, rgba(0,214,143,0.08), transparent 55%), var(--ink); }
.verify-card { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.verify-status { padding: 40px 32px 28px; text-align: center; border-bottom: 1px solid var(--line); }
.verify-status .seal { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; border: 2px solid; }
.verify-status .seal svg { width: 38px; height: 38px; stroke-width: 2.4; fill: none; }
.verify-status h1 { font-family: var(--serif); font-style: italic; font-size: 30px; margin-bottom: 6px; }
.verify-status p { color: var(--muted); font-size: 14px; }
.v-valid .seal { border-color: var(--accent); color: var(--accent); background: rgba(0,214,143,0.08); }
.v-valid h1 { color: var(--accent); }
.v-bad .seal { border-color: var(--danger); color: var(--danger); background: rgba(242,113,91,0.08); }
.v-bad h1 { color: var(--danger); }
.v-warn .seal { border-color: var(--gold); color: var(--gold); background: rgba(232,185,78,0.08); }
.v-warn h1 { color: var(--gold); }
.verify-rows { padding: 8px 32px 24px; }
.v-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.v-row:last-child { border-bottom: 0; }
.v-row .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.v-row .val { color: var(--fg); text-align: right; }
.verify-foot { padding: 18px 32px; background: var(--ink); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; justify-content: center; }
.verify-foot img { height: 22px; }
.verify-foot span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .spacer, .nav-group { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .content { padding: 20px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
}
