/* Airline Portal prototype — styles */
:root {
  --brand: #ba0c2f;          /* BAS crimson: the main colour (bas.com.bh Elementor primary, logo, footer) */
  --brand-2: #8c0923;        /* deep crimson */
  --brand-ink: #f8e7ea;
  --navy: #1f2a44;           /* BAS navy: secondary accent only (bas.com.bh --tg-blue) — completed and success marks */
  --accent: #ba0c2f;         /* BAS crimson (bas.com.bh logo) */
  --accent-ink: #ffffff;
  --accent-soft: #f8e7ea;
  --brand-soft: #f4f4f4;       /* neutral navy tint for bars and notices — crimson tints read as errors */
  --brand-line: #d3d4d5;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #f9fafa;
  --line: #e3e4e5;
  --line-2: #d3d4d5;
  --ink: #2e2e2e;
  --ink-2: #4a4c4d;
  --muted: #75787b;
  --chart-1: #ba0c2f;
  --chart-2: #1f2a44;
  --chart-3: #75787b;
  --chart-4: #d9798d;
  --chart-5: #848a98;
  --chart-6: #b3b5b6;
  --green: #1f2a44; --green-bg: #e9eaec; --green-line: #bcbfc7;
  --amber: #ba0c2f; --amber-bg: #fcf3f5; --amber-line: #eec2cb;
  --red: #8c0923; --red-bg: #f5dde2; --red-line: #e092a1;
  --blue: #4c5569; --blue-bg: #f2f2f4; --blue-line: #c7cad0;
  --grey: #555758; --grey-bg: #f4f4f4; --grey-line: #e3e4e5;
  --purple: #6d7585; --purple-bg: #f4f4f6; --purple-line: #d2d4da;
  --teal: #606264; --teal-bg: #f7f7f7; --teal-line: #d6d6d7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(46, 46, 46, .05);
  --shadow-lg: 0 12px 32px -8px rgba(46, 46, 46, .22), 0 4px 8px -4px rgba(46, 46, 46, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.spacer { flex: 1; }

/* requirement references — shown only when "Show requirement IDs" is on */
.req { display: none; font: 600 10px/1 var(--font); letter-spacing: .02em; color: #6d7585; background: #f4f4f6; border: 1px solid #d2d4da; padding: 3px 5px; border-radius: 4px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
body.show-reqs .req { display: inline-block; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--brand); color: var(--brand-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; gap: 11px; align-items: center; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; flex: none; }
.logo .ic { width: 20px; height: 20px; }
.side-brand b { display: block; font-size: 15px; color: #fff; }
.side-brand span { display: block; font-size: 11.5px; opacity: .7; }
.nav { padding: 12px 10px; flex: 1; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; color: var(--brand-ink); opacity: .82; font-weight: 500; margin-bottom: 1px; }
.nav a:hover { background: rgba(255,255,255,.07); opacity: 1; text-decoration: none; }
.nav a.on { background: rgba(255,255,255,.16); opacity: 1; color: #fff; box-shadow: inset 3px 0 0 #fff; }
.nav a .ic { width: 17px; height: 17px; opacity: .9; }
.nav a .n { margin-left: auto; background: #fff; color: var(--brand); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.nav a .n.warn { background: #cf556d; }
.side-foot { padding: 14px 18px; font-size: 11px; opacity: .6; border-top: 1px solid rgba(255,255,255,.08); line-height: 1.5; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; height: 60px; }
.top .menu-btn { display: none; }
.top-search { position: relative; width: min(340px, 34vw); }
.top-search .ic { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); }
.top-search input { width: 100%; height: 34px; padding: 0 10px 0 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.scope { display: flex; align-items: center; gap: 6px; }
.scope select { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 8px; max-width: 220px; }
.scope label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.proto { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #ba0c2f; background: #fcf3f5; border: 1px solid #eec2cb; border-radius: 20px; padding: 5px 10px; cursor: pointer; }
.proto .ic { width: 14px; height: 14px; }
.proto:hover { background: #faedef; }
.clock { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.clock b { color: var(--ink); font-weight: 600; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--grey-bg); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn .dot { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; font-size: 10.5px; font-weight: 700; color: #fff; background: #8c0923; border-radius: 9px; display: grid; place-items: center; border: 2px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 4px 6px; border-radius: 8px; cursor: pointer; text-align: left; }
.user-btn:hover { background: var(--grey-bg); }
.user-btn b { display: block; font-size: 13px; }
.user-btn span { display: block; font-size: 11.5px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-2); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.menu { position: absolute; right: 16px; top: 56px; width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--ink); cursor: pointer; font-size: 13.5px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--grey-bg); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-h { padding: 8px 10px 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.banner { display: flex; gap: 10px; align-items: center; padding: 9px 22px; background: var(--brand-soft); color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--brand-line); }
.banner .ic { color: var(--brand); }
.banner .ic { width: 16px; height: 16px; }
.airline-bar { height: 3px; }
.content { padding: 22px 24px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb .ic { width: 15px; height: 15px; }

/* ---------- cards and grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.card-f { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.g-side { grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.ico { display: grid; place-items: center; border: 1px solid; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; color: var(--ink); box-shadow: var(--shadow); position: relative; }
a.kpi:hover { border-color: var(--line-2); text-decoration: none; box-shadow: 0 2px 6px rgba(46, 46, 46,.08); }
.kpi-l { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-l .ic { width: 15px; height: 15px; }
.kpi-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.kpi.tone-amber .kpi-v { color: var(--amber); }
.kpi.tone-red .kpi-v { color: var(--red); }
.kpi.tone-green .kpi-v { color: var(--green); }
.kpi.tone-blue .kpi-v { color: var(--blue); }

/* ---------- badges, chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 2px 9px 2px 8px; border-radius: 20px; border: 1px solid; white-space: nowrap; line-height: 18px; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tone-green { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.tone-amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.tone-red { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.tone-blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
.tone-grey { color: var(--grey); background: var(--grey-bg); border-color: var(--grey-line); }
.tone-purple { color: var(--purple); background: var(--purple-bg); border-color: var(--purple-line); }
.tone-teal { color: var(--teal); background: var(--teal-bg); border-color: var(--teal-line); }
.al-chip { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.al-chip i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chan { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); background: var(--grey-bg); border-radius: 4px; padding: 2px 6px; margin-right: 4px; white-space: nowrap; }
.chan .ic { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); text-decoration: none !important; }
.btn:hover { background: var(--surface-2); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.94); }
.btn.success { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.success:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { background: #fff; border-color: var(--red-line); color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn.danger-solid { background: #8c0923; border-color: #8c0923; color: #fff; }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; }
.btn.ghost:hover { background: var(--grey-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
label.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field > small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=date], input[type=search], input[type=tel], input[type=color], select, textarea { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
input[type=color] { padding: 3px; width: 56px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 3px solid rgba(186, 12, 47, .22); border-color: var(--accent); outline-offset: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d3d4d5; border-radius: 22px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filters .search { position: relative; min-width: 240px; flex: 1; max-width: 360px; }
.filters .search .ic { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.filters .search input { padding-left: 32px; }
.filters select { width: auto; min-width: 150px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 10px 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-n { font-size: 11px; background: var(--grey-bg); color: var(--ink-2); border-radius: 10px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.tab.on .tab-n { background: var(--accent-soft); color: var(--accent); }
.card .tabs { margin: 0; padding: 0 12px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f8f8f8; }
.tbl tr.sel td { background: #f8f8f8; }
.tbl tr.group td { background: var(--surface-2); font-weight: 600; font-size: 13px; padding: 8px 12px; }
.tbl td.chk, .tbl th.chk { width: 36px; padding-right: 0; }
.tbl .sub { display: block; font-size: 12px; color: var(--muted); }
.tbl .t-strong { font-weight: 600; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.times { display: grid; grid-template-columns: 30px auto; column-gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.times i { font-style: normal; color: var(--muted); font-size: 11px; }
.times .late { color: var(--amber); font-weight: 600; }
.times .act { font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--brand-soft); border-bottom: 1px solid var(--brand-line); flex-wrap: wrap; font-size: 13px; }

/* ---------- progress, stepper, timeline ---------- */
.prog { height: 7px; border-radius: 6px; background: var(--grey-bg); overflow: hidden; border: 0; }
.prog i { display: block; height: 100%; border-radius: 6px; background: var(--blue); transition: width .6s ease; }
.prog.tone-green i { background: #1f2a44; }
.prog.tone-amber i { background: #cf556d; }
.prog.tone-red i { background: #ba0c2f; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; position: relative; }
.flow-s { position: relative; padding: 12px 14px 12px 16px; background: #fff; border: 1px solid var(--line); margin-right: 18px; border-radius: 8px; }
.flow-s:not(:last-child)::after { content: ""; position: absolute; right: -15px; top: 50%; width: 12px; height: 12px; border-top: 2px solid var(--line-2); border-right: 2px solid var(--line-2); transform: translateY(-50%) rotate(45deg); }
.flow-s:last-child { margin-right: 0; }
.flow-s .t { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.flow-s .n { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.flow-s .d { font-size: 12px; color: var(--muted); }
.flow-s.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(186,12,47,.12); }
a.flow-s:hover { text-decoration: none; border-color: var(--line-2); }
.stepper { display: flex; align-items: center; gap: 0; }
.stepper .st { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.stepper .st b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--grey-bg); color: var(--grey); border: 1px solid var(--line-2); }
.stepper .st.done b { background: #1f2a44; border-color: #1f2a44; color: #fff; }
.stepper .st.cur b { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .st.err b { background: #ba0c2f; border-color: #ba0c2f; color: #fff; }
.stepper .st.cur, .stepper .st.err { color: var(--ink); font-weight: 600; }
.stepper .ln { width: 22px; height: 2px; background: var(--line-2); margin: 0 6px; }
.stepper .ln.done { background: #1f2a44; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { position: relative; padding: 0 0 14px 28px; }
.tl li::before { content: ""; position: absolute; left: 7px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li .dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--line-2); }
.tl li.done .dot { background: #1f2a44; border-color: #1f2a44; }
.tl li.done::before { background: #bcbfc7; }
.tl li.cur .dot { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(186,12,47,.15); }
.tl li.cur .dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.tl .tl-t { font-weight: 600; font-size: 13.5px; }
.tl .tl-m { font-size: 12.5px; color: var(--muted); }
.gantt { position: relative; }
.gantt-row { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 10px; height: 30px; font-size: 12.5px; }
.gantt-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.gantt-track { position: relative; height: 16px; background: var(--surface-2); border-radius: 4px; }
.gantt-bar { position: absolute; top: 0; height: 16px; border-radius: 4px; background: #c7cad0; }
.gantt-bar.done { background: #1f2a44; }
.gantt-bar.run { background: var(--accent); }
.gantt-bar.cx { background: repeating-linear-gradient(45deg, #e092a1, #e092a1 4px, #fff 4px, #fff 8px); }
.gantt-now { position: absolute; top: -6px; bottom: -6px; width: 2px; background: #ba0c2f; z-index: 2; }
.gantt-now span { position: absolute; top: -16px; left: -18px; font-size: 10px; font-weight: 700; color: #ba0c2f; background: #fff; padding: 0 3px; }
.gantt-axis { display: grid; grid-template-columns: 210px 1fr; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.gantt-axis .ticks { position: relative; height: 14px; }
.gantt-axis .ticks span { position: absolute; transform: translateX(-50%); }

/* live turnaround rows */
.ta { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(160px, 1.6fr) minmax(110px, .8fr) auto; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ta:hover { background: #f8f8f8; }
.ta:last-child { border-bottom: 0; }
.ta .f { font-weight: 650; }
.ta .m { font-size: 12px; color: var(--muted); }
.ta .ms { font-size: 12.5px; margin-top: 5px; display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); }

/* key/value */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kv dd { margin: 2px 0 0; font-weight: 550; }

.list-i { display: flex; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list-i:last-child { border-bottom: 0; }
.list-i .ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.list-i .ico .ic { width: 16px; height: 16px; }
.list-i .t { font-weight: 600; font-size: 13.5px; }
.list-i .b { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.list-i.unread { background: #fcfcfc; }
.list-i.unread .t::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: middle; }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ic { width: 28px; height: 28px; margin-bottom: 8px; }
.empty-t { font-weight: 600; color: var(--ink-2); }
.empty-b { font-size: 13px; margin-top: 4px; }
.note { display: flex; gap: 10px; padding: 11px 13px; border-radius: 8px; background: var(--blue-bg); border: 1px solid var(--blue-line); color: #4c5569; font-size: 13px; }
.note .ic { width: 17px; height: 17px; margin-top: 1px; }
.note.warn { background: var(--amber-bg); border-color: var(--amber-line); color: #ba0c2f; }
.note.ok { background: var(--green-bg); border-color: var(--green-line); color: #1f2a44; }
.note.red { background: var(--red-bg); border-color: var(--red-line); color: #8c0923; }
.note.grey { background: var(--grey-bg); border-color: var(--grey-line); color: var(--ink-2); }

/* charts */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: #eaebeb; stroke-width: 1; }
svg.chart .tick { font-size: 11px; fill: #75787b; font-family: var(--font); }
svg.chart .target { stroke: #ba0c2f; stroke-dasharray: 5 4; stroke-width: 1.5; }
svg.chart .target-t { fill: #8c0923; font-weight: 600; }
svg.chart rect:hover { filter: brightness(.9); }
svg.donut .donut-c { font-size: 22px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
svg.donut .donut-s { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.spark { display: block; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(46, 46, 46, .45); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .16s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: .6; } }
.modal.sm { width: min(440px, 100%); }
.modal.lg { width: min(860px, 100%); }
.modal.xl { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16.5px; display: flex; align-items: center; gap: 6px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 12px 12px; flex-wrap: wrap; }
.sig-box { border: 1px dashed var(--line-2); border-radius: 8px; background: repeating-linear-gradient(0deg, #fff, #fff 23px, #f4f4f4 24px); position: relative; }
.sig-box canvas { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; }
.sig-box .sig-line { position: absolute; left: 18px; right: 18px; bottom: 34px; border-top: 1px solid #b3b5b6; pointer-events: none; }
.sig-box .sig-x { position: absolute; left: 10px; bottom: 36px; font-size: 16px; color: #b3b5b6; pointer-events: none; }
.email { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.email-h { background: var(--surface-2); padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.email-h div { display: flex; gap: 8px; }
.email-h b { width: 62px; color: var(--muted); font-weight: 500; flex: none; }
.email-b { padding: 18px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.email-brand { display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: #fff; background: var(--brand); }
.sms { max-width: 300px; margin: 6px auto; background: #eaebeb; border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-size: 14px; }
.sms-wrap { background: #f9fafa; border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; }
.sms-meta { text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 8px; }

/* ---------- toast ---------- */
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; gap: 11px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px 10px 12px 12px; animation: slidein .22s ease; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.toast.tone-warn { border-left-color: #cf556d; }
.toast.tone-danger { border-left-color: #ba0c2f; }
.toast.tone-ok { border-left-color: #1f2a44; }
.toast-ic { color: var(--muted); padding-top: 1px; }
.toast-main { flex: 1; min-width: 0; }
.toast-title { font-weight: 650; font-size: 13.5px; }
.toast-body { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.toast .chans { margin-top: 6px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-art { background: var(--brand); color: #fff; position: relative; overflow: hidden; padding: 44px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art svg.runway { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.login-art > * { position: relative; }
.login-art h1 { font-size: 34px; line-height: 1.15; max-width: 480px; letter-spacing: -.02em; }
.login-art p { opacity: .78; max-width: 460px; font-size: 15px; margin-top: 12px; }
.login-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 520px; }
.login-feats div { display: flex; gap: 9px; font-size: 13px; opacity: .9; }
.login-feats .ic { width: 16px; height: 16px; margin-top: 2px; color: #c7cad0; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 6vw, 80px); overflow-y: auto; }
.login-card { width: 100%; max-width: 440px; margin: 0 auto; }
.login-card h2 { font-size: 24px; margin-bottom: 4px; }
.personas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.persona { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 9px 10px; cursor: pointer; }
.persona:hover { border-color: var(--accent); background: #fcfcfc; }
.persona b { display: block; font-size: 12.5px; }
.persona span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.otp { display: flex; gap: 8px; }
.otp input { width: 48px; height: 54px; text-align: center; font-size: 22px; font-weight: 600; padding: 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.foot-note { font-size: 11.5px; color: var(--muted); margin-top: 22px; line-height: 1.55; }

/* public token page */
.public { min-height: 100vh; background: var(--bg); }
.public-top { background: var(--brand); color: #fff; padding: 14px 24px; display: flex; align-items: center; gap: 12px; }
.public-body { max-width: 980px; margin: 0 auto; padding: 26px 20px 60px; }

/* permission matrix */
.matrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: none; letter-spacing: 0; font-size: 12px; height: 190px; vertical-align: bottom; white-space: nowrap; padding: 8px 6px; text-align: left; }
.matrix td.c { text-align: center; }
.matrix tr.grp td { background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; overflow-x: auto; }
.method { display: inline-block; font: 700 10.5px/1 ui-monospace, Menlo, monospace; padding: 4px 6px; border-radius: 4px; min-width: 50px; text-align: center; }
.m-get { background: #f2f2f4; color: #4c5569; }
.m-post { background: #e9eaec; color: #1f2a44; }
.m-put { background: #fcf3f5; color: #ba0c2f; }
.m-del { background: #f5dde2; color: #8c0923; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--green); }
.health::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1f2a44; box-shadow: 0 0 0 3px #e4e5e9; }

/* demo panel */
.demo-sec + .demo-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.demo-sec h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.persona-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.persona.on { border-color: var(--accent); background: var(--accent-soft); }

/* delivery note preview */
.dn { border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.dn-h { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 12px; }
.sig-img { height: 60px; border-bottom: 1px solid var(--line-2); }

/* ---------- responsive (O01) ---------- */
@media (max-width: 1180px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-search { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 90; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(46, 46, 46,.4); z-index: 80; }
  .top .menu-btn { display: inline-grid; }
  .top { padding: 0 12px; gap: 8px; }
  .scope label, .clock, .user-btn .who { display: none; }
  .g2, .g3, .g-side { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 16px 16px 60px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .flow-s:nth-child(2)::after { display: none; }
  .ta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gantt-row, .gantt-axis { grid-template-columns: 120px 1fr; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .scope { display: none; }
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personas, .persona-list { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 19px; }
  .proto span { display: none; }
}
@media print {
  .side, .top, .banner, #toast-root, .btn { display: none !important; }
  .app { display: block; }
}

/* BAS logo (bas.com.bh) */
.brand-logo { height: 34px; width: auto; display: block; flex: none; }
.brand-logo.lg { height: 46px; }
.side-brand.with-logo { flex-direction: column; align-items: flex-start; gap: 12px; }
.brand-divider { border-left: 1px solid rgba(255, 255, 255, .28); padding-left: 14px; }

/* BAS colours only — also for what the browser draws itself (ticks, selection, focus rings, scrollbars) */
:root { accent-color: var(--brand); scrollbar-color: #b3b5b6 transparent; }
::selection { background: #f1ced5; color: var(--ink); }
:focus-visible { outline-color: var(--accent); }
