/* BrainWave Bahrain HR — palette: pearl, ink, lagoon, sand */
:root {
  --pearl: #f2f5f6;
  --surface: #ffffff;
  --ink: #10242b;
  --ink-2: #33474e;
  --muted: #637680;
  --line: #dbe3e6;
  --line-2: #eaeff1;
  --lagoon: #0b6a6f;
  --lagoon-d: #08545a;
  --lagoon-soft: #e3f1f1;
  --sand: #d9a441;
  --sand-soft: #fbf3e2;
  --side: #10242b;
  --radius: 10px;
  --radius-s: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-d: "Segoe UI Variable Display", "SF Pro Display", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --t-green: #1f7a4f; --t-green-bg: #e4f4ea;
  --t-amber: #8a5a00; --t-amber-bg: #fdf0d2;
  --t-red: #b42318; --t-red-bg: #fde7e4;
  --t-blue: #22579e; --t-blue-bg: #e3edfb;
  --t-orange: #a5490f; --t-orange-bg: #fdeadc;
  --t-purple: #6b3fa8; --t-purple-bg: #efe7fa;
  --t-grey: #4d5b63; --t-grey-bg: #edf1f3;
  --t-teal: #0b6a6f; --t-teal-bg: #dff0f0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--pearl); font-variant-numeric: tabular-nums; }
a { color: var(--lagoon); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-d); margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ───── Shell ───── */
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side); color: #c9d6da; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; gap: 10px; align-items: center; padding: 20px 18px 16px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 36px; height: 36px; color: var(--sand); }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand small { color: #8fa6ad; font-size: 12px; }
.side nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-s); color: #c9d6da; font-size: 14px; position: relative; }
.side nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.side nav a.on { background: rgba(217,164,65,.14); color: #fff; }
.side nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--sand); }
.side nav a.on .ico { color: var(--sand); }
.nav-h { margin: 18px 10px 6px; font-size: 12px; color: #7f969d; }
.pill { margin-left: auto; font-style: normal; background: var(--sand); color: var(--ink); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 10px; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 18px 18px; font-size: 13px; display: grid; gap: 6px; }
.side-foot .who b { color: #fff; display: block; font-size: 14px; }
.side-foot .who small { color: #8fa6ad; }
.side-foot a, .linkish { color: #a9bcc2; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.side-foot a:hover, .linkish:hover { color: #fff; }

.main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(242,245,246,.92); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 14px; padding: 14px 32px; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 20px; font-weight: 650; flex: 1; }
.bell { position: relative; color: var(--ink-2); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; }
.bell:hover { background: var(--line-2); }
.bell .ico { width: 21px; height: 21px; }
.bell em { position: absolute; top: 2px; right: 0; background: var(--t-red); color: #fff; font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 9px; }
.burger { display: none; background: none; border: 0; width: 38px; height: 38px; padding: 9px 8px; cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }
.content { padding: 24px 32px 60px; max-width: 1280px; width: 100%; }
.content.wide { max-width: none; }
.scrim { display: none; }

/* ───── Page parts ───── */
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.ph h2 { font-size: 22px; font-weight: 650; }
.ph p { margin: 4px 0 0; color: var(--muted); }
.ph-a { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel > header h3 { font-size: 15.5px; font-weight: 650; }
.panel .pb { padding: 16px 18px; }
.panel .pb > .tbl-wrap, .panel .pb > .empty { margin: -16px -18px; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Stats: grouped rows with a colored rule, not floating cards */
.sg { margin-bottom: 22px; }
.sg > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.sg h2 { font-size: 15px; font-weight: 650; color: var(--ink-2); }
.sg header a { font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; flex-direction: column; padding: 14px 16px 13px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); color: var(--ink); position: relative; min-height: 86px; }
a.stat:hover { background: #f8fbfb; text-decoration: none; }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 2px 2px 0; background: var(--line); }
.stat.good::before { background: var(--t-green); } .stat.warn::before { background: var(--sand); } .stat.bad::before { background: var(--t-red); } .stat.info::before { background: var(--lagoon); }
.st-l { font-size: 13px; color: var(--muted); }
.st-v { font-family: var(--font-d); font-size: 26px; font-weight: 650; line-height: 1.2; margin-top: 4px; letter-spacing: -0.02em; }
.st-v.long { font-size: 19px; letter-spacing: -0.01em; }
.st-s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Tables */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8fafb; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafcfc; }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line); background: #f8fafb; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl td.act { text-align: right; white-space: nowrap; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; line-height: 1.5; }
.badge[data-dot] { background: color-mix(in srgb, var(--c) 13%, white); color: color-mix(in srgb, var(--c) 85%, black); }
.badge[data-dot]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.t-green { color: var(--t-green); background: var(--t-green-bg); } .t-amber { color: var(--t-amber); background: var(--t-amber-bg); }
.t-red { color: var(--t-red); background: var(--t-red-bg); } .t-blue { color: var(--t-blue); background: var(--t-blue-bg); }
.t-orange { color: var(--t-orange); background: var(--t-orange-bg); } .t-purple { color: var(--t-purple); background: var(--t-purple-bg); }
.t-grey { color: var(--t-grey); background: var(--t-grey-bg); } .t-teal { color: var(--t-teal); background: var(--t-teal-bg); }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--lagoon); color: #fff; border: 1px solid var(--lagoon); border-radius: var(--radius-s); padding: 8px 16px; font: 600 14px/1.3 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--lagoon-d); text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { background: var(--surface); color: var(--t-red); border-color: #f1c4bf; }
.btn.danger:hover { background: var(--t-red-bg); }
.btn.ok { background: var(--t-green); border-color: var(--t-green); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.fld > span { font-weight: 600; color: var(--ink-2); }
.fld small, .chk small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
input, select, textarea { font: 14.5px/1.4 var(--font); color: var(--ink); background: #fff; border: 1px solid #c9d4d8; border-radius: var(--radius-s); padding: 8px 10px; width: 100%; min-height: 38px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--lagoon) 35%, transparent); border-color: var(--lagoon); }
input[type=checkbox] { width: 17px; height: 17px; min-height: 0; accent-color: var(--lagoon); }
.chk { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }
.chk span { display: flex; flex-direction: column; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
.form-h { grid-column: 1 / -1; font-size: 14.5px; font-weight: 650; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.form-h:first-child { margin-top: 0; padding-top: 0; border: 0; }
.actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); min-width: 140px; }
.filters label.grow { flex: 1; min-width: 180px; }
.filters input, .filters select { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.f-act { display: flex; gap: 6px; flex-wrap: wrap; }

.flash { padding: 11px 14px; border-radius: var(--radius-s); margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--t-green-bg); color: var(--t-green); border-color: #bfe3cc; }
.flash.err { background: var(--t-red-bg); color: var(--t-red); border-color: #f4c7c1; }
.flash.info { background: var(--t-blue-bg); color: var(--t-blue); border-color: #c5d8f4; }
.note { background: var(--sand-soft); border: 1px solid #f0dcae; border-radius: var(--radius-s); padding: 10px 14px; font-size: 13.5px; color: #6b4e12; margin-bottom: 16px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-color: var(--lagoon); }
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 22px; margin: 0; }
.dl dt { font-size: 12.5px; color: var(--muted); }
.dl dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 14px 0; font-size: 13.5px; color: var(--muted); }

/* ───── Check-in: the one bold moment ───── */
.punch { background: var(--side); color: #fff; border-radius: 16px; padding: 30px 28px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-bottom: 20px; position: relative; overflow: hidden; }
.punch::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 220px; background: radial-gradient(closest-side, rgba(217,164,65,.22), transparent); pointer-events: none; }
.punch .date { color: #9fb4ba; font-size: 15px; }
.clock { font-family: var(--font-d); font-size: clamp(56px, 11vw, 92px); font-weight: 300; letter-spacing: -0.04em; line-height: 1; margin: 6px 0 10px; }
.clock small { font-size: .32em; letter-spacing: 0; margin-left: 6px; color: var(--sand); font-weight: 500; }
.punch .shift { color: #c9d6da; }
.punch .shift b { color: #fff; }
.punch form { position: relative; z-index: 1; }
.punch-btn { width: 168px; height: 168px; border-radius: 50%; border: 0; cursor: pointer; font: 700 20px/1.2 var(--font-d); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: transform .12s; }
.punch-btn small { font: 500 13px var(--font); opacity: .8; }
.punch-btn:active { transform: scale(.97); }
.punch-btn.in { background: var(--sand); color: var(--ink); box-shadow: 0 0 0 10px rgba(217,164,65,.18); }
.punch-btn.out { background: #fff; color: var(--ink); box-shadow: 0 0 0 10px rgba(255,255,255,.12); }
.punch-done { text-align: center; color: #c9d6da; }
.punch-done b { display: block; color: #fff; font-size: 18px; }
.punch-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.punch-row div { background: var(--surface); padding: 12px 16px; }
.punch-row span { display: block; font-size: 12.5px; color: var(--muted); }
.punch-row b { font-size: 18px; font-family: var(--font-d); font-weight: 600; }

/* ───── Calendars ───── */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dh { background: #f8fafb; padding: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: center; }
.cal .d { background: var(--surface); min-height: 92px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.cal .d.out { background: #f7f9fa; color: #a2b1b6; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--sand); }
.cal .d .n { font-weight: 650; font-size: 13px; }
.cal .d .tm { color: var(--muted); font-size: 12px; }
.cal .chip { border-radius: 5px; padding: 2px 6px; font-weight: 600; font-size: 11.5px; background: color-mix(in srgb, var(--c) 13%, white); color: color-mix(in srgb, var(--c) 85%, black); border-left: 3px solid var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.navbar h3 { font-size: 17px; font-weight: 650; min-width: 170px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }

/* Roster grid (all employees × days) */
.roster { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.roster table { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.roster th, .roster td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; text-align: center; }
.roster thead th { background: #f8fafb; padding: 6px 4px; font-weight: 600; color: var(--muted); position: sticky; top: 0; min-width: 44px; }
.roster thead th.today { color: var(--ink); box-shadow: inset 0 -3px 0 var(--sand); }
.roster thead th.we { background: #f1f4f5; }
.roster .emp { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 6px 12px; min-width: 170px; z-index: 2; font-size: 13px; white-space: nowrap; }
.roster .emp small { display: block; color: var(--muted); font-size: 11.5px; }
.roster thead .emp { z-index: 3; background: #f8fafb; }
.roster .cell { display: block; min-height: 40px; padding: 4px 2px; background: color-mix(in srgb, var(--c) 11%, white); color: color-mix(in srgb, var(--c) 85%, black); border-left: 3px solid var(--c); font-weight: 600; line-height: 1.25; }
.roster .cell:hover { text-decoration: none; filter: brightness(.96); }
.roster .cell small { display: block; font-weight: 500; font-size: 10.5px; }
.roster .cell.explicit { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--c) 45%, white); }

/* Week view */
.week { display: grid; grid-template-columns: 170px repeat(7, minmax(110px, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
.week > div { background: var(--surface); padding: 8px 10px; font-size: 13px; }
.week .wh { background: #f8fafb; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.week .wh.today { color: var(--ink); box-shadow: inset 0 -3px 0 var(--sand); }

/* Timeline (approval workflow) */
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.flow li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.flow li::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.flow li:last-child::before { display: none; }
.flow .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--t-grey-bg); color: var(--t-grey); font-size: 13px; font-weight: 700; }
.flow .done .dot { background: var(--t-green-bg); color: var(--t-green); }
.flow .rej .dot { background: var(--t-red-bg); color: var(--t-red); }
.flow .now .dot { background: var(--sand-soft); color: #8a5a00; box-shadow: 0 0 0 3px #f6e2b5; }
.flow b { display: block; }
.flow small { color: var(--muted); }
.flow p { margin: 4px 0 0; font-size: 13.5px; background: #f6f8f9; padding: 6px 10px; border-radius: 6px; }

.calc { display: grid; gap: 0; max-width: 420px; font-size: 14.5px; }
.calc div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.calc div.tot { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; padding-top: 9px; }
.calc .neg { color: var(--t-red); }
.policy-body { white-space: pre-wrap; line-height: 1.65; max-width: 72ch; }
.notif { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.notif.unread { background: #f4fafa; }
.notif.unread b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lagoon); margin-right: 7px; vertical-align: 2px; }
.notif div { flex: 1; }
.notif p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.notif small { color: var(--muted); font-size: 12.5px; }
.perm-grid th:not(:first-child), .perm-grid td:not(:first-child) { text-align: center; }

/* Login */
body.bare { background: var(--side); }
body.bare .main { margin: 0; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--surface); width: 100%; max-width: 400px; border-radius: 14px; padding: 32px 30px; }
.login-card .logo { width: 44px; height: 44px; color: var(--lagoon); }
.login-card h1 { font-size: 22px; margin: 14px 0 2px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.login-card form { display: grid; gap: 14px; }
.login-card .btn { padding: 11px; }

/* ───── Phones ───── */
@media (max-width: 960px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; width: 270px; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16,36,43,.45); z-index: 30; }
  .main { margin-left: 0; }
  .burger { display: block; margin-left: -8px; }
  .top { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .top h1 { font-size: 18px; }
  .content { padding: 16px 14px 70px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 76px; padding: 12px 14px; }
  .st-v { font-size: 22px; }
  .punch { grid-template-columns: 1fr; text-align: center; padding: 26px 18px; }
  .punch form { justify-self: center; }
  .punch-row { grid-template-columns: 1fr 1fr; }
  .filters label { min-width: calc(50% - 5px); flex: 1; }
  /* tables become labelled cards */
  .tbl-wrap:not(.keep) { background: none; border: 0; overflow: visible; }
  .tbl-wrap:not(.keep) .tbl thead { display: none; }
  .tbl-wrap:not(.keep) .tbl, .tbl-wrap:not(.keep) .tbl tbody, .tbl-wrap:not(.keep) .tbl tr, .tbl-wrap:not(.keep) .tbl td, .tbl-wrap:not(.keep) .tbl tfoot { display: block; width: 100%; }
  .tbl-wrap:not(.keep) .tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .tbl-wrap:not(.keep) .tbl td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 6px 14px; text-align: right; }
  .tbl-wrap:not(.keep) .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; max-width: 45%; }
  .tbl-wrap:not(.keep) .tbl td:empty { display: none; }
  .tbl-wrap:not(.keep) .tbl td.act { justify-content: flex-end; }
  .tbl-wrap:not(.keep) .tbl td.act::before { display: none; }
  .tbl-wrap:not(.keep) .tbl tfoot tr { background: #f8fafb; }
  .panel .pb > .tbl-wrap { margin: 0; }
  .cal .d { min-height: 64px; padding: 4px; }
  .cal .chip { font-size: 10px; padding: 1px 3px; }
  .cal .d .tm { display: none; }
  .ph h2 { font-size: 19px; }
}
@media print {
  .side, .top, .filters, .ph-a, .actions, .scrim, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .tbl-wrap, .panel { border: 0; }
  .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-head { display: block !important; }
}
.print-head { display: none; margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Per-day hours editor */
.week-grid { display: grid; gap: 6px; margin-top: 6px; max-width: 520px; }
.wk-row { display: grid; grid-template-columns: 140px 1fr auto 1fr; gap: 8px; align-items: center; }
.wk-row input[type=time] { min-height: 34px; padding: 4px 8px; }
@media (max-width: 480px) { .wk-row { grid-template-columns: 1fr 1fr; } .wk-row > .muted { display: none; } .wk-row .chk { grid-column: 1 / -1; } }

/* ───── Trainer timetable (weekly grid like the schedule sheet) ───── */
.tt-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tt { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: 12.5px; table-layout: fixed; }
.tt.day { min-width: 980px; }
.tt th, .tt td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); vertical-align: top; padding: 4px; }
.tt thead th { background: #f8fafb; color: var(--ink-2); font-weight: 650; text-align: left; padding: 7px 8px; position: sticky; top: 0; z-index: 1; }
.tt thead th small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.tt thead th.today { box-shadow: inset 0 -3px 0 var(--sand); }
.tt thead th.closed { background: #f1ece2; }
.tt .tt-h { width: 74px; background: #f8fafb; color: var(--muted); font-weight: 600; font-size: 12px; position: sticky; left: 0; z-index: 2; }
.tt.day .tt-h { width: 150px; }
.tt .tt-h small { display: block; font-weight: 500; font-size: 11px; }
.tt td { height: 46px; }
.tt td.shift { background: #f4faf9; }
.tt-e { display: block; border-radius: 5px; padding: 3px 6px; margin-bottom: 3px; line-height: 1.25; text-decoration: none; color: var(--ink); border-left: 3px solid; font-size: 12px; overflow: hidden; }
a.tt-e:hover { text-decoration: none; filter: brightness(.97); }
.tt-e small { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-e .kind { font-style: normal; font-weight: 700; background: var(--ink); color: #fff; border-radius: 3px; padding: 0 4px; font-size: 10px; }
.s-sch { background: var(--lagoon-soft); border-color: var(--lagoon); }
.s-ok { background: var(--t-green-bg); border-color: var(--t-green); }
.s-bad { background: #fbd5d0; border-color: var(--t-red); }
.s-inf { background: var(--t-orange-bg); border-color: var(--t-orange); }
.s-mov { background: var(--t-blue-bg); border-color: var(--t-blue); }
.tt-e.act { background: color-mix(in srgb, var(--c) 12%, white); border-color: var(--c); }
.tt-e.pend, i.lg.pend { border: 1.5px dashed var(--sand); border-left-width: 3px; background: var(--sand-soft); }
i.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border-left: 3px solid; margin-right: 5px; vertical-align: -1px; }
/* Progress bars */
.bar { height: 8px; background: var(--line-2); border-radius: 6px; overflow: hidden; min-width: 90px; }
.bar > span { display: block; height: 100%; background: var(--lagoon); border-radius: 6px; }
.bar.warn > span { background: var(--sand); }
.bar.done > span { background: var(--t-green); }
.pkg { display: grid; gap: 10px; }
.pkg-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.pkg-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.pkg-head h4 { margin: 0; font-size: 15px; }
.pkg-nums { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0; font-size: 13.5px; }
.pkg-nums b { font-family: var(--font-d); font-size: 18px; display: block; }
/* Bahrain Status board */
.ms-board { font-size: 12.5px; }
.ms-board th { white-space: normal !important; min-width: 76px; vertical-align: bottom; font-size: 11.5px !important; line-height: 1.25; }
.ms-board td { padding: 6px 8px !important; }
.ms-chip { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.inbox-sec { margin-bottom: 26px; }
.ms-form { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.ms-form select, .ms-form input { width: auto; min-height: 32px; padding: 4px 6px; font-size: 13px; }
.ms-form input[name=notes] { width: 130px; }
details > summary { cursor: pointer; color: var(--lagoon); padding: 4px 0; }
.comp-choice { border: 1px solid rgba(255,255,255,.2); border-radius: 10px; padding: 8px 12px; margin: 0 0 14px; color: #dfe8ea; font-size: 13px; display: grid; gap: 4px; text-align: left; }
.comp-choice legend { padding: 0 4px; color: var(--sand); font-weight: 600; }
.comp-choice label { display: flex; gap: 8px; align-items: center; }
.comp-choice input { width: auto; min-height: 0; }

.ms-board td:nth-child(1) { white-space: nowrap; }
.ms-board td:nth-child(2) { min-width: 170px; }

/* My calendar & meetings */
.cal-connect { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-list { display: flex; flex-direction: column; }
.cal-ev { display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cal-ev:last-child { border-bottom: 0; }
.cal-when { display: flex; flex-direction: column; font-size: 14px; }
.cal-when span { color: var(--muted, #667); font-size: 13px; }
.cal-add { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; padding: 6px 0; }
.ms-form input[type=time] { width: auto; }
@media (max-width: 640px) {
  .cal-ev { grid-template-columns: 1fr; gap: 6px; }
  .cal-add { justify-content: flex-start; }
}
