/* F1 IT Reports — internal tool, Arabic RTL, phone first. */
:root {
  --bg: #07060d;
  --panel: #13101d;
  --panel-2: #1a1627;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f1e8;
  --muted: #a7a2b8;
  --dim: #6d6880;
  --gold: #d0ab5d;
  --gold-hi: #f6d58e;
  --cyan: #2ee6ff;
  --ok: #3ee89a;
  --warn: #ffc247;
  --danger: #ff5d73;
  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background:
    radial-gradient(620px 420px at 100% 0%, rgba(208,171,93,.13), transparent 70%),
    radial-gradient(720px 520px at 0% 100%, rgba(157,92,255,.12), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 15px;
  border-radius: 11px; cursor: pointer; white-space: nowrap; font-size: 14.5px; font-weight: 500;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.04);
  transition: border-color .2s, background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { border-color: rgba(208,171,93,.55); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: #1b1406; border-color: transparent; box-shadow: 0 0 18px rgba(208,171,93,.28); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: rgba(255,93,115,.6); }
.btn-sm { height: 32px; padding: 0 11px; border-radius: 9px; font-size: 13px; }
.btn-block { width: 100%; }

.input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; outline: 0;
  background: rgba(0,0,0,.3); border: 1px solid var(--line-strong);
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
select.input { padding-inline-end: 8px; }
.input:focus { border-color: rgba(208,171,93,.7); box-shadow: 0 0 0 3px rgba(208,171,93,.14); }
.field { display: grid; gap: 6px; width: 100%; text-align: start; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 42px; }
.pw-toggle { position: absolute; left: 4px; top: 4px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-size: 15px; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: min(390px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center;
  padding: 30px 24px; border-radius: 22px; background: rgba(19,16,29,.85); border: 1px solid var(--line-strong);
  box-shadow: 0 0 60px rgba(157,92,255,.16);
}
.login-card img { filter: drop-shadow(0 0 14px rgba(208,171,93,.6)); }
.login-card h1 { margin: 2px 0 0; font-size: 23px; letter-spacing: .02em; }
.login-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.login-card .btn { width: 100%; height: 46px; margin-top: 4px; }
.form-error { min-height: 20px; color: var(--danger); font-size: 13px; }

/* shell */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: rgba(7,6,13,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.bar-brand { display: flex; align-items: center; gap: 10px; }
.bar-brand b { display: block; line-height: 1.15; font-size: 15px; }
.bar-brand small { color: var(--muted); font-size: 11.5px; }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.who { font-size: 13px; color: var(--muted); }
.who b { color: var(--gold-hi); font-weight: 500; }
.nav { display: flex; gap: 6px; max-width: 980px; margin: 0 auto; padding: 12px 16px 0; overflow-x: auto; }
.nav button {
  height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; white-space: nowrap;
}
.nav button[aria-current="true"] { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: #1b1406; border-color: transparent; font-weight: 600; }
.main { max-width: 980px; margin: 0 auto; padding: 16px 16px 90px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.pad { padding: 16px; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.head h2 { margin: 0; font-size: 19px; }
.head .grow, .grow { flex: 1; }
.hint { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }

.chip { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.chip.ok { color: var(--ok); border-color: rgba(62,232,154,.45); }
.chip.warn { color: var(--warn); border-color: rgba(255,194,71,.45); }
.chip.off { color: var(--dim); }

/* progress */
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transition: width .3s; }
.progress.full > span { background: linear-gradient(90deg, #27c47f, var(--ok)); }

/* report head */
.rep-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.rep-head .input { width: auto; }
.save-state { font-size: 12.5px; color: var(--dim); min-width: 80px; }
.save-state.saved { color: var(--ok); }
.save-state.saving { color: var(--warn); }

/* checklist grid */
.all-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.area { margin-bottom: 16px; overflow: hidden; }
.area-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.area-head b { font-size: 16px; }
.area-head .hint { width: 100%; }
.grid { display: grid; grid-template-columns: 54px repeat(3, 1fr); }
.grid > div { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; min-height: 46px; }
.grid .gh {
  position: sticky; top: 58px; z-index: 2; min-height: 54px; flex-direction: column; gap: 2px; padding: 4px;
  background: var(--panel-2); font-size: 12px; color: var(--muted); text-align: center; line-height: 1.25;
}
.grid .gh button { font-size: 10.5px; height: 20px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--cyan); cursor: pointer; }
.grid .dev { font-weight: 600; color: var(--gold-hi); background: rgba(255,255,255,.02); }
.cell { cursor: pointer; }
.cell[aria-disabled="true"] { cursor: default; }
.box {
  width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; font-size: 15px; color: transparent; transition: all .15s;
}
.cell:hover .box { border-color: rgba(208,171,93,.6); }
.cell[aria-checked="true"] .box { background: rgba(62,232,154,.16); border-color: var(--ok); color: var(--ok); }
.row-done .dev { color: var(--ok); }

/* deep cleaning */
.deep-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.deep-item:last-child { border-bottom: 0; }
.deep-item b { display: block; font-weight: 500; }
.deep-item small { color: var(--muted); font-size: 12.5px; }

/* reports list */
.day-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 14px;
  background: rgba(255,255,255,.035); border-bottom: 1px solid var(--line);
}
.day-head b { color: var(--gold-hi); }
.rep-row + .day-head { border-top: 1px solid var(--line); }
.rep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rep-row:last-child { border-bottom: 0; }
.rep-row .day { min-width: 112px; }
.rep-row .day b { display: block; font-size: 15px; }
.rep-row .day small { color: var(--dim); font-size: 12px; }
.rep-row .bar-wrap { flex: 1; min-width: 130px; display: grid; gap: 4px; }
.rep-row .acts { display: flex; gap: 6px; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav b { min-width: 104px; text-align: center; }

/* users */
.user-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row .u { flex: 1; min-width: 160px; }
.user-row .u b { display: block; }
.user-row .u small { color: var(--muted); font-size: 12.5px; direction: ltr; display: block; text-align: start; }
.gen-row { display: flex; gap: 8px; }
.gen-row .input { direction: ltr; text-align: start; }

.toast {
  position: fixed; bottom: 20px; left: 50%; translate: -50% 0; z-index: 60; padding: 10px 18px; border-radius: 12px;
  background: #1c1730; border: 1px solid rgba(208,171,93,.5); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; max-width: 92vw; text-align: center;
}
.toast.error { border-color: rgba(255,93,115,.6); color: #ffc2cb; }

@media (max-width: 520px) {
  .main { padding: 12px 10px 90px; }
  .grid { grid-template-columns: 46px repeat(3, 1fr); }
  .grid .gh { font-size: 11px; }
  .box { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
