/* Batiya Program — visual mock PM shell (Innago-class layout, Batiya brand) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0a1628;
  --navy-2: #122033;
  --navy-3: #1a2d45;
  --gold: #c4a35a;
  --gold-soft: #d4bc7a;
  --blue: #2b7de9;
  --blue-hover: #1f6ad0;
  --bg: #f0f3f7;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #5c6b7a;
  --line: #e2e8f0;
  --ok: #22a06b;
  --warn: #e2a03f;
  --danger: #de350b;
  --sidebar-w: 240px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.04);
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
}

html, body { height: 100%; }
body.prog-body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }

/* —— Gate (no password) —— */
.prog-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--navy) 0%, #152a45 55%, #0d1f33 100%);
  padding: 1.5rem;
}
.prog-gate-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 2rem 1.75rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center;
}
.prog-gate-logo {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  border-radius: 14px; background: var(--navy); padding: 8px;
  object-fit: contain;
}
.prog-gate h1 { font-size: 1.35rem; margin-bottom: .35rem; color: var(--navy); }
.prog-gate p { color: var(--muted); font-size: .95rem; margin-bottom: 1.4rem; }
.prog-gate .btn { width: 100%; justify-content: center; }
.prog-gate-note { margin-top: 1rem; font-size: .8rem; color: var(--muted); }
.prog-gate-exit { display: inline-block; margin-top: 1rem; color: var(--blue); font-size: .9rem; font-weight: 600; }

/* —— App layout —— */
.prog-app { display: none; height: 100vh; }
.prog-app.is-on { display: flex; }

.prog-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  color: #dbe7f5;
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.prog-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.1rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.prog-brand img {
  width: 40px; height: 40px; border-radius: 8px;
  background: rgba(255,255,255,.06); padding: 4px; object-fit: contain;
}
.prog-brand strong { display: block; font-size: .95rem; color: #fff; letter-spacing: .02em; }
.prog-brand span { font-size: .72rem; color: var(--gold-soft); text-transform: uppercase; letter-spacing: .08em; }

.prog-profile {
  display: flex; align-items: center; gap: .7rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.prog-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), #8a7030);
  color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9rem;
}
.prog-profile .name { font-size: .88rem; color: #fff; font-weight: 600; }
.prog-profile .role { font-size: .75rem; color: #93a8c0; }

.prog-nav { flex: 1; overflow-y: auto; padding: .6rem 0; }
.prog-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .72rem 1.1rem;
  font-size: .82rem; font-weight: 600; letter-spacing: .03em;
  color: #b7c7d9; text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: .15s ease;
}
.prog-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.prog-nav a.is-active {
  background: rgba(196,163,90,.12);
  color: #fff;
  border-left-color: var(--gold);
}
.prog-nav .ico { width: 1.15rem; text-align: center; opacity: .9; font-size: .95rem; }

.prog-side-foot {
  display: flex; gap: .35rem; padding: .75rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.prog-side-foot button, .prog-side-foot a {
  flex: 1; height: 40px; border-radius: 8px;
  display: grid; place-items: center;
  color: #b7c7d9; background: rgba(255,255,255,.04);
  font-size: 1rem;
}
.prog-side-foot button:hover, .prog-side-foot a:hover { background: rgba(255,255,255,.1); color: #fff; }

.prog-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.prog-top {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  min-height: 60px;
}
.prog-menu-btn {
  display: none; width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--line); font-size: 1.1rem;
}
.prog-top h1 { font-size: 1.25rem; font-weight: 700; color: var(--navy); flex: 1; }
.prog-top-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.prog-content {
  flex: 1; overflow: auto;
  padding: 1.1rem 1.25rem 2rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 40px; padding: 0 1rem;
  border-radius: 8px; font-weight: 600; font-size: .9rem;
  border: 1px solid transparent; white-space:nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-danger { background: #fff; border-color: #f5c6c0; color: var(--danger); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-sm { min-height: 32px; padding: 0 .7rem; font-size: .82rem; }

/* —— Cards / layout helpers —— */
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
}
.card h2, .card h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: .75rem; font-weight: 700;
}
.card-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .85rem;
}
.card-title-row h2 { margin: 0; }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1rem; color: var(--muted); min-height: 220px;
}
.empty .empty-ico { font-size: 2.6rem; opacity: .35; margin-bottom: .75rem; }
.empty p { margin-bottom: 1rem; font-size: .95rem; }

/* —— Stats —— */
.stat-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.stat-pill {
  flex: 1; min-width: 110px;
  border: 1px solid var(--line); border-radius: 10px; padding: .65rem .75rem;
  background: #fafbfc;
}
.stat-pill .lab { font-size: .72rem; color: var(--muted); font-weight: 600; }
.stat-pill .val { font-size: 1.1rem; font-weight: 700; margin-top: .15rem; }
.stat-pill.ok .val { color: var(--ok); }
.stat-pill.warn .val { color: var(--warn); }
.stat-pill.danger .val { color: var(--danger); }
.stat-pill.blue .val { color: var(--blue); }

.donut-wrap { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.donut {
  width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--line) 0 100%);
  display: grid; place-items: center; position: relative;
}
.donut::after {
  content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #fff;
}
.donut span { position: relative; z-index: 1; font-weight: 700; font-size: .95rem; text-align: center; line-height: 1.15; }

.quick-filters { display: flex; flex-direction: column; gap: .5rem; }
.qf {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem;
  background: #fff; font-size: .88rem; font-weight: 600;
}
.qf .n { font-variant-numeric: tabular-nums; }
.qf.vacant { border-left: 3px solid var(--danger); }
.qf.overdue { border-left: 3px solid var(--warn); }
.qf.maint { border-left: 3px solid var(--blue); }
.qf.open { border-left: 3px solid var(--blue); }
.qf.resolved { border-left: 3px solid var(--ok); }
.qf.sched { border-left: 3px solid var(--warn); }
.qf.urgent { border-left: 3px solid var(--danger); }

/* —— Toolbar —— */
.toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin-bottom: 1rem;
}
.toolbar .grow { flex: 1; min-width: 160px; }
.field, .select, .search {
  width: 100%; min-height: 40px; padding: 0 .75rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--ink);
}
.field:focus, .select:focus, .search:focus, textarea.field:focus {
  outline: 2px solid rgba(43,125,233,.25); border-color: var(--blue);
}
textarea.field { min-height: 88px; padding: .65rem .75rem; resize: vertical; }
label.lbl {
  display: block; font-size: .78rem; font-weight: 700; color: var(--muted);
  margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em;
}
.lbl .req { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
  display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap;
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.form-actions.space { justify-content: space-between; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.err { color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.field.is-err, .select.is-err { border-color: var(--danger); }

/* —— Tables —— */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: left; padding: .7rem .85rem; background: #f8fafc;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td {
  padding: .75rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fafbfd; }
table.data tr.is-click { cursor: pointer; }
.badge {
  display: inline-flex; align-items: center; padding: .15rem .5rem;
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: #eef2f7; color: var(--muted);
}
.badge.ok { background: #e3f5ec; color: var(--ok); }
.badge.warn { background: #fef4e4; color: #b7791f; }
.badge.danger { background: #fdecea; color: var(--danger); }
.badge.blue { background: #e8f1fc; color: var(--blue); }

/* —— Stepper —— */
.stepper {
  display: flex; gap: .25rem; flex-wrap: wrap;
  margin-bottom: 1.25rem; padding: .75rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.step {
  flex: 1; min-width: 110px; text-align: center; padding: .55rem .35rem;
  border-radius: 8px; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); border: 1px solid transparent;
}
.step .dot {
  width: 34px; height: 34px; margin: 0 auto .35rem; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center;
  background: #fff; font-size: .9rem;
}
.step.is-active { color: var(--navy); background: #f4f8ff; border-color: #d6e6fb; }
.step.is-active .dot { border-color: var(--blue); color: var(--blue); }
.step.is-done .dot { border-color: var(--ok); background: var(--ok); color: #fff; }

.wizard-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; }
.wizard-side {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem;
  align-self: start;
}
.wizard-side button {
  display: flex; width: 100%; align-items: center; gap: .5rem;
  text-align: left; padding: .65rem .7rem; border-radius: 8px;
  font-size: .88rem; font-weight: 600; color: var(--muted);
}
.wizard-side button.is-active { background: #eef5ff; color: var(--navy); }
.wizard-side button.is-done { color: var(--ok); }
.wizard-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.15rem; }

/* —— Category tiles —— */
.cat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem;
}
.cat-tile {
  border: 1px solid var(--line); border-radius: 10px; padding: .9rem .5rem;
  text-align: center; background: #fff; font-size: .85rem; font-weight: 600;
  color: var(--ink); transition: .12s ease;
}
.cat-tile:hover { border-color: var(--blue); }
.cat-tile.is-on { border-color: var(--blue); background: #eef5ff; color: var(--blue); }
.cat-tile .ci { display: block; font-size: 1.35rem; margin-bottom: .35rem; }

/* —— Settings —— */
.settings-layout { display: grid; grid-template-columns: 180px 1fr 260px; gap: 1rem; }
.settings-nav button {
  display: block; width: 100%; text-align: left;
  padding: .65rem .8rem; border-radius: 8px; font-weight: 600; font-size: .9rem;
  color: var(--muted);
}
.settings-nav button.is-active { background: #eef5ff; color: var(--navy); }
.toggle-row {
  display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start;
  padding: .95rem 0; border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row h4 { font-size: .95rem; margin-bottom: .2rem; }
.toggle-row p { font-size: .82rem; color: var(--muted); max-width: 36rem; }
.switch {
  position: relative; width: 46px; height: 26px; flex-shrink: 0;
  background: #cbd5e1; border-radius: 999px; transition: .15s;
}
.switch.is-on { background: var(--blue); }
.switch i {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.is-on i { left: 23px; }

.faq details {
  border-bottom: 1px solid var(--line); padding: .55rem 0;
}
.faq summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink); }
.faq p { font-size: .82rem; color: var(--muted); margin-top: .35rem; padding-left: .1rem; }

/* —— Status stack —— */
.status-stack { display: flex; flex-direction: column; gap: .45rem; }
.status-stack .s {
  border-radius: 8px; padding: .65rem .75rem; color: #fff; font-weight: 700;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  display: flex; justify-content: space-between;
}
.s.s1 { background: #64748b; }
.s.s2 { background: #22a06b; }
.s.s3 { background: #2b7de9; }
.s.s4 { background: #e2a03f; }
.s.s5 { background: #94a3b8; }

/* —— Tabs —— */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs button {
  padding: .7rem 1rem; font-weight: 700; font-size: .85rem;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.is-active { color: var(--blue); border-bottom-color: var(--blue); }

/* —— Modal —— */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-back.is-on { display: flex; }
.modal {
  width: min(720px, 100%); max-height: min(90vh, 900px);
  overflow: auto; background: #fff; border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-head h3 { font-size: 1.05rem; color: var(--navy); }
.modal-body { padding: 1.15rem; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .9rem 1.15rem; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: #fff;
}

/* —— Dropzone —— */
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 1.5rem;
  text-align: center; color: var(--muted); background: #fafbfc;
  font-size: .9rem;
}
.drop strong { color: var(--blue); }

/* —— Promo banner —— */
.banner {
  background: linear-gradient(90deg, #0f3d2e, #1a5c45);
  color: #e8fff5; border-radius: 10px; padding: .9rem 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.banner p { font-size: .88rem; opacity: .9; }
.banner h4 { margin-bottom: .2rem; }

/* —— Toast —— */
.toast {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 200;
  background: var(--navy); color: #fff; padding: .75rem 1rem;
  border-radius: 10px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translateY(120%); opacity: 0; transition: .25s ease;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast.is-on { transform: none; opacity: 1; }

.muted { color: var(--muted); }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-1 { margin-top: .5rem; }
.flex { display: flex; gap: .5rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.kpi-side { display: flex; flex-direction: column; gap: .55rem; }
.kpi-box {
  background: var(--navy); color: #fff; border-radius: 10px; padding: .85rem 1rem;
}
.kpi-box .lab { font-size: .72rem; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }
.kpi-box .val { font-size: 1.35rem; font-weight: 700; margin-top: .15rem; }

.template-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.template-list .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line); gap: .75rem;
}
.template-list .row:last-child { border-bottom: 0; }

.chip {
  display: inline-flex; padding: .2rem .55rem; border-radius: 6px;
  background: #eef2f7; font-size: .75rem; font-weight: 600; color: var(--muted);
}

.report-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.report-cards .card { text-align: center; }
.report-cards .big { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin-top: .25rem; }

.overlay-scrim {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30;
}
.overlay-scrim.is-on { display: block; }

@media (max-width: 1100px) {
  .grid-2, .grid-auto, .settings-layout, .wizard-layout { grid-template-columns: 1fr; }
  .report-cards { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .prog-sidebar {
    position: fixed; inset: 0 auto 0 0; transform: translateX(-105%);
    transition: transform .2s ease; width: min(280px, 86vw);
  }
  .prog-sidebar.is-open { transform: none; }
  .prog-menu-btn { display: grid; place-items: center; }
  .form-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
}
