:root {
  --ink: #14252b; --muted: #64767d; --line: #dbe4e7; --canvas: #f3f6f7; --card: #ffffff;
  --primary: #0f6b79; --primary-dark: #084c58; --primary-soft: #e5f2f3;
  --accent: #ea7b4a; --accent-soft: #fff0e9; --green: #24896a; --green-soft: #e6f5ef;
  --yellow: #a06d0c; --yellow-soft: #fff6d9; --red: #b5494b; --red-soft: #fdeced;
  --shadow: 0 16px 40px rgba(20, 47, 55, .08); --radius: 16px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: "Segoe UI", Tahoma, Arial, "Noto Sans Arabic", sans-serif; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }

/* Login & setup */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: white; }
.login-art { min-height: 100vh; position: relative; overflow: hidden; display: grid; place-items: center; padding: 60px; color: white; background: linear-gradient(145deg, #072f38, #0d6876 58%, #19889a); }
.login-art::before { content: ""; position: absolute; width: 680px; height: 680px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; inset: -260px auto auto -180px; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.018); }
.login-art::after { content: "✈"; position: absolute; font-size: 290px; opacity: .05; transform: rotate(-18deg); inset: auto 2% -11% auto; }
.login-art-content { position: relative; z-index: 1; max-width: 560px; }
.login-art .eyebrow { color: #9de0e8; }
.login-art h1 { font-size: clamp(36px, 4.5vw, 60px); line-height: 1.2; margin: 14px 0; }
.login-art p:not(.eyebrow) { font-size: 17px; line-height: 1.8; color: #d7eff2; }
.login-card { align-self: center; width: min(440px, calc(100% - 48px)); margin: auto; padding: 38px; position: relative; }
.login-card h2 { font-size: 30px; margin: 0 0 8px; }
.login-card > label { display: grid; gap: 8px; margin-top: 20px; font-weight: 700; font-size: 13px; }
.login-card input, .field input, .field select, .field textarea, .filter-control, .restore-box input[type=file], .actions input[type=file] { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); padding: 11px 13px; outline: none; transition: .2s; }
.login-card input:focus, .field input:focus, .field select:focus, .field textarea:focus, .filter-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,107,121,.11); }
.login-card .language-pill { position: absolute; inset: 0 auto auto 0; }
.version-note { margin-top: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 30px; }
.mobile-brand .brand-mark { box-shadow: 0 0 0 1px var(--line); }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: white; padding: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.18); flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-mark.large { width: 84px; height: 84px; border-radius: 20px; padding: 9px; box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.login-logo { display: block; width: min(300px, 70%); margin: 0 auto 8px; }

/* Shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 272px 1fr; }
.sidebar { direction: rtl; height: 100vh; position: sticky; top: 0; color: #dcebed; background: linear-gradient(180deg, #092f38, #0b4652); padding: 18px 12px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { display: flex; direction: ltr; align-items: center; gap: 12px; padding: 2px 9px 18px; color: white; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { color: #92bec5; margin-top: 3px; font-size: 11px; }
.sidebar nav { overflow-y: auto; padding-inline: 2px; scrollbar-width: thin; }
.nav-label { display: flex; align-items: center; gap: 8px; color: #f3c37a; font-size: 13.5px; font-weight: 900; letter-spacing: .2px; margin: 20px 6px 8px; padding: 0 6px 6px; border-bottom: 1px solid rgba(243,195,122,.28); }
.nav-label::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: #f3c37a; flex: 0 0 auto; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; color: #cce0e3; background: transparent; padding: 9px 12px; border-radius: 9px; text-align: start; margin: 1px 0; transition: .16s; font-size: 14px; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: white; color: var(--primary-dark); font-weight: 800; box-shadow: 0 10px 20px rgba(0,0,0,.12); }
.nav-item b { margin-inline-start: auto; min-width: 22px; height: 20px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--accent); font-size: 11px; padding: 0 5px; }
.nav-item b:empty { display: none; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 10px 2px; display: flex; align-items: center; gap: 8px; color: #96c0c6; font-size: 11px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #5dd39e; box-shadow: 0 0 0 5px rgba(93,211,158,.12); }
.main-column { min-width: 0; direction: rtl; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 26px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; backdrop-filter: blur(14px); }
.topbar-title p { margin: 0; color: var(--muted); font-size: 11px; }
.topbar-title h1 { margin: 3px 0 0; font-size: 20px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.language-pill, .icon-button { min-width: 38px; height: 38px; border: 1px solid var(--line); background: white; color: var(--primary); border-radius: 10px; font-weight: 800; }
.notification-button { position: relative; }
.notification-button span { position: absolute; inset: -6px -6px auto auto; background: var(--accent); color: white; border-radius: 8px; min-width: 18px; padding: 2px 5px; font-size: 9px; }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--ink); text-align: start; padding: 4px; }
.profile-button strong, .profile-button small { display: block; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-button small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.avatar { width: 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.profile-menu { position: absolute; top: 48px; inset-inline-end: 0; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 30; }
.profile-menu button { width: 100%; background: transparent; border: 0; padding: 10px; color: var(--ink); text-align: start; border-radius: 7px; }
.profile-menu button:hover { background: var(--canvas); }
.profile-menu .danger-text { color: var(--red); }

main { padding: 24px 26px 60px; max-width: 1700px; margin: auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions.end { justify-content: end; margin-top: 12px; }
.actions.wrap input[type=file] { width: auto; }
.button { border: 0; border-radius: 9px; padding: 10px 15px; font-weight: 800; color: var(--ink); background: #e8edef; transition: .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.button:hover { filter: brightness(.97); }
.button.primary { background: var(--primary); color: white; box-shadow: 0 8px 16px rgba(15,107,121,.17); }
.button.secondary { background: var(--primary-soft); color: var(--primary); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.success { background: var(--green); color: white; }
.button.ghost { background: white; border: 1px solid var(--line); }
.button.small { padding: 6px 9px; font-size: 11px; border-radius: 7px; }
.button.wide { width: 100%; margin-top: 22px; justify-content: center; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.link-button { border: 0; background: transparent; color: var(--primary); font-weight: 700; text-decoration: underline; padding: 0; }
.hint-line { margin: 0 0 14px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats-grid.two { grid-template-columns: repeat(2, minmax(180px, 300px)); }
.stat-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-height: 112px; box-shadow: 0 7px 24px rgba(27,64,74,.04); }
.stat-card[role=button] { cursor: pointer; }
.stat-card[role=button]:hover { border-color: #aacbd0; }
.stat-card::after { content: ""; width: 70px; height: 70px; border-radius: 50%; position: absolute; top: -28px; inset-inline-end: -22px; background: var(--primary-soft); opacity: .55; z-index: 0; pointer-events: none; }
.stat-card > * { position: relative; z-index: 1; }
.stat-card.orange::after { background: var(--accent-soft); }
.stat-card.green::after { background: var(--green-soft); }
.stat-card .stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 14px; }
.stat-card strong { font-size: 26px; display: block; margin-top: 10px; letter-spacing: -.5px; }
.stat-card small { color: var(--muted); font-weight: 650; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.7fr); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(27,64,74,.04); overflow: hidden; margin-bottom: 16px; }
.card.padded { padding: 18px 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fafcfc; }
.card-header h3 { margin: 0; font-size: 15px; }
.card-body { padding: 16px 18px; }
.table-wrap { overflow: auto; }
.table-wrap.tall { max-height: 60vh; }
.table-wrap.tall thead th { position: sticky; top: 0; z-index: 1; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 10px 12px; text-align: start; color: var(--muted); font-size: 11px; letter-spacing: .2px; background: #f4f7f8; border-bottom: 1px solid var(--line); font-weight: 800; }
td { padding: 10px 12px; border-bottom: 1px solid #edf1f2; font-size: 13px; vertical-align: middle; }
table.dense td { padding: 7px 10px; font-size: 12px; }
td.num { direction: ltr; text-align: end; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fafcfc; }
tbody tr:last-child td { border-bottom: 0; }
tr.inactive-row td { color: var(--muted); background: #fbfbfb; }
tr.saved-row td { background: var(--green-soft); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; display: inline-block; unicode-bidi: isolate; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.draft { color: #66757b; background: #eef2f3; }
.status.ops_review { color: #3f668f; background: #e7f0fa; }
.status.submitted { color: var(--yellow); background: var(--yellow-soft); }
.status.returned, .status.cancelled { color: var(--red); background: var(--red-soft); }
.status.approved { color: var(--green); background: var(--green-soft); }
.status.invoiced, .status.issued { color: var(--primary); background: var(--primary-soft); }
.status.open { color: var(--green); background: var(--green-soft); }
.status.archived { color: #67599a; background: #eeebfb; }
.filters { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(130px,.7fr)); gap: 10px; margin-bottom: 14px; align-items: end; }
.filters.five { grid-template-columns: 1.4fr 1fr 1fr 1fr auto; }
.filter-control.static { background: #f7fafa; color: var(--muted); }
.search-field { position: relative; }
.search-field input { padding-inline-start: 36px; }
.search-field::before { content: "⌕"; position: absolute; inset-inline-start: 12px; top: 9px; color: var(--muted); font-size: 16px; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state b { color: var(--ink); display: block; font-size: 15px; margin-bottom: 6px; }
.progress-list { display: grid; gap: 13px; }
.progress-item { display: grid; grid-template-columns: 130px 1fr 42px; gap: 10px; align-items: center; font-size: 11px; }
.progress-track { height: 8px; background: #eaf0f1; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #22a1b2); }
.review-stack { display: grid; gap: 12px; }
.review-card { border: 1px solid var(--line); border-radius: 14px; background: white; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.review-card h3 { margin: 0 0 6px; font-size: 15px; }
.review-card p { margin: 3px 0; color: var(--muted); font-size: 12px; }
.metric-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.metric { padding: 6px 9px; border-radius: 8px; background: #f2f6f7; font-size: 11px; }
.queue-count { min-width: 32px; height: 28px; padding: 0 9px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--primary); font-size: 12px; font-weight: 900; }
.category-count { min-width: 32px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--primary-dark); background: white; border: 1px solid var(--line); font-size: 12px; font-weight: 900; }
.price { font-weight: 900; color: var(--primary-dark); white-space: nowrap; }
.category-label { padding: 3px 7px; background: #eef3f4; border-radius: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.product-airline-grid { display: grid; grid-template-columns: repeat(3,minmax(240px,1fr)); gap: 14px; }
.product-airline-folder { appearance: none; width: 100%; padding: 18px; color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s; margin: 0; }
.product-airline-folder:hover { transform: translateY(-3px); border-color: #aacbd0; box-shadow: 0 18px 38px rgba(15,107,121,.11); }
.product-folder-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.airline-code { min-width: 44px; height: 44px; padding: 0 8px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }
.airline-code.small { min-width: 36px; height: 32px; font-size: 11px; border-radius: 9px; }
.airline-logo { display: block; height: 44px; max-width: 150px; object-fit: contain; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; }
.airline-logo.small { height: 34px; max-width: 110px; }
.airline-logo.folder { height: 52px; max-width: 170px; }
.logo-field { grid-column: 1 / -1; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fbfdfd; }
.logo-preview { min-height: 90px; display: grid; place-items: center; background: white; border: 1px dashed var(--line); border-radius: 10px; padding: 8px; }
.logo-preview img { max-width: 100%; max-height: 110px; object-fit: contain; }
.logo-controls .field { margin: 0; }
.logo-controls .button { margin-top: 8px; }
.folder-arrow { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); font-size: 16px; font-weight: 900; }
.product-airline-folder h3 { margin: 14px 0 4px; font-size: 17px; }
.product-airline-folder > p { margin: 0; color: var(--muted); font-size: 12px; }
.product-folder-counts { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; margin: 14px 0; }
.product-folder-counts span { min-width: 0; padding: 8px 4px; border-radius: 9px; background: #f5f8f8; text-align: center; }
.product-folder-counts b, .product-folder-counts small { display: block; }
.product-folder-counts b { color: var(--primary-dark); font-size: 15px; }
.product-folder-counts small { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: normal; }
.folder-open { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border-radius: 8px; color: white; background: var(--primary); font-size: 12px; font-weight: 850; }
.product-category-card .card-header { background: linear-gradient(90deg,var(--primary-soft),white); }
.report-toolbar { display: grid; grid-template-columns: repeat(3,minmax(130px,1fr)) repeat(2,minmax(140px,.8fr)) auto auto; align-items: end; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.report-title { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.report-title h3, .report-title p { margin: 0; }
.invoice-sections { display: grid; gap: 4px; }
.stacked-card-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.permission-count { display: inline-grid; min-width: 30px; min-height: 26px; padding: 3px 8px; place-items: center; border-radius: 8px; color: var(--primary-dark); background: var(--primary-soft); font-weight: 900; font-size: 12px; }
.permission-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.permission-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; background: #f5f9f9; border-bottom: 1px solid var(--line); }
.permission-head b, .permission-head span { display: block; }
.permission-head > div > span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: var(--line); }
.permission-option { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; background: white; font-size: 12px; font-weight: 700; cursor: pointer; }
.permission-option input, .check-field input { width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; }
.manager-access-note { display: grid; gap: 5px; padding: 14px; color: var(--primary-dark); background: var(--primary-soft); }
.manager-access-note span, .field-help { color: var(--muted); font-size: 12px; }
.field-help { margin: 12px 0 0; }
.check-field { display: flex; align-items: center; gap: 9px; align-self: end; min-height: 42px; font-size: 12px; font-weight: 800; }
.check-field.inline { min-height: auto; padding: 8px 4px; }
.readonly-field { display: grid; gap: 7px; }
.readonly-field > span { font-size: 12px; font-weight: 800; }
.readonly-field > strong { min-height: 43px; display: flex; align-items: center; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #f5f8f8; }
.warning-list { margin: 8px 0 0; padding-inline-start: 18px; color: var(--yellow); font-size: 12px; max-height: 240px; overflow: auto; }
.restore-box h3 { margin: 0 0 10px; font-size: 15px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(3,25,30,.6); padding: 22px; backdrop-filter: blur(3px); }
.modal { width: min(980px, 100%); max-height: calc(100vh - 44px); overflow: auto; background: white; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.28); display: flex; flex-direction: column; }
.modal.wide { width: min(1280px, 100%); }
.modal.medium { width: min(780px, 100%); }
.modal.small { width: min(480px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 22px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { border: 0; background: #eef3f4; width: 32px; height: 32px; border-radius: 9px; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: end; gap: 8px; padding: 14px 22px; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-text { font-size: 15px; margin: 0; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.form-grid.one { grid-template-columns: 1fr; }
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 800; align-content: start; }
.field.full { grid-column: 1 / -1; }
.products-editor { margin-top: 18px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.products-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #f7fafa; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.product-section td { background: #eaf2f3; color: var(--primary-dark); font-weight: 900; padding: 8px 12px; }
.qty-input, .returned-input, .discount-input, .price-input { width: 96px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; text-align: center; direction: ltr; }
.note-input { width: 180px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; }
.price-from, .price-to { border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.order-editor td { padding: 6px 10px; }
.order-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 0 0 16px; }
.summary-box { background: #f3f7f8; border-radius: 10px; padding: 10px 12px; }
.summary-box small, .summary-box strong { display: block; }
.summary-box small { color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.summary-box strong { font-size: 13px; }
.comment-box { border-inline-start: 4px solid var(--accent); background: var(--accent-soft); color: #714228; padding: 12px; border-radius: 9px; margin-bottom: 14px; font-size: 13px; }
.comment-box.neutral { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.consumed-value { font-weight: 800; color: var(--green); }
.consumed-value.invalid, td.invalid { color: var(--red); font-weight: 800; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 18px; justify-content: center; border-top: 1px solid var(--line); }
.pager-item { border: 1px solid var(--line); background: white; border-radius: 8px; min-width: 34px; padding: 6px 10px; font-weight: 700; }
.pager-item.active { background: var(--primary); color: white; border-color: var(--primary); }
.pager-item:disabled { opacity: .4; cursor: default; }
.pager-gap { padding: 6px 4px; color: var(--muted); }
.toast-region { position: fixed; z-index: 999; inset: 18px auto auto 18px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 430px; padding: 13px 15px; border-radius: 11px; color: white; background: var(--primary-dark); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { background: var(--red); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }
.mobile-only { display: none; }

html[dir="ltr"] .sidebar, html[dir="ltr"] .main-column, html[dir="ltr"] .login-screen { direction: ltr; }

@media (max-width: 1150px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .product-airline-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .report-toolbar { grid-template-columns: repeat(3,1fr); }
  .filters, .filters.five { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .mobile-brand { display: flex; }
  .login-card { padding: 30px 0; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-105%); transition: .2s; box-shadow: var(--shadow); }
  html[dir="rtl"] .sidebar { inset: 0 0 0 auto; transform: translateX(105%); }
  .sidebar.open { transform: translateX(0) !important; }
  .mobile-only { display: grid; place-items: center; }
  .topbar { padding: 0 14px; height: 64px; }
  .topbar-title p { display: none; }
  .topbar-title h1 { font-size: 16px; }
  .profile-button > span:not(.avatar) { display: none; }
  main { padding: 18px 12px 45px; }
  .page-head { align-items: start; flex-direction: column; }
  .stats-grid, .stats-grid.two { grid-template-columns: repeat(2,1fr); }
  .filters, .filters.five, .form-grid { grid-template-columns: 1fr; }
  .product-airline-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); border-radius: 14px; }
  .order-summary { grid-template-columns: repeat(2,1fr); }
  .permission-grid { grid-template-columns: 1fr; }
  .review-card { grid-template-columns: 1fr; }
  .report-toolbar { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid, .stats-grid.two { grid-template-columns: 1fr; }
  .topbar-actions { gap: 4px; }
  .notification-button { display: none; }
}
@media print {
  body { background: white; }
  .sidebar, .topbar, .page-head .actions, .filters, .report-toolbar, .toast-region, .pager { display: none !important; }
  .app-shell { display: block; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* Finance review: discounts and totals */
.review-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: #fafcfc; }
.bulk-discount { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bulk-discount select, .bulk-discount input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.bulk-discount input { width: 110px; direction: ltr; text-align: center; }
.bulk-discount small { flex-basis: 100%; }
.totals { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.totals b { font-variant-numeric: tabular-nums; }
.review-table .discount-input { width: 96px; }
.review-table .mode-input { border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.field-help.full { grid-column: 1 / -1; margin: 0; }
.legacy-box h3 { margin: 0 0 6px; font-size: 16px; }
.legacy-progress { margin-top: 14px; }
.legacy-progress .progress-track { height: 10px; }
.legacy-progress p { margin: 8px 0 0; font-size: 13px; }

.section-title { font-size: 14px; margin: 18px 0 8px; color: var(--primary-dark); }

.test-banner { position: sticky; top: 0; z-index: 60; background: #b45309; color: #fff; text-align: center; font-weight: 800; font-size: 13px; padding: 7px 12px; }

/* Staff affairs */
.notice-text { white-space: pre-wrap; line-height: 1.9; font-size: 13.5px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-family: Arial, Tahoma, sans-serif; }
.notice-editor { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font: 13.5px/1.9 Arial, Tahoma, sans-serif; color: var(--ink); resize: vertical; }
.notice-editor:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(15,107,121,.11); }
.hr-preview { margin: 16px 0; padding: 14px 16px; border: 1px dashed #b5c5c9; border-radius: 12px; background: #fbfdfd; }
.hr-preview .order-summary { margin-bottom: 8px; }
.prior-list { margin: 4px 0 0; padding-inline-start: 18px; font-size: 12px; }
.prior-list li { margin: 3px 0; }
.ladder-editor td, .ladder-editor th { padding: 8px 10px; }
.ladder-editor input, .ladder-editor select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.day-group { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.day-group label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.flag { display: inline-block; margin: 1px 2px; padding: 3px 7px; border-radius: 7px; font-size: 10.5px; font-weight: 800; background: #eef2f3; color: #4c5b60; }
.flag.late, .flag.absent, .flag.early_leave { background: var(--red-soft); color: var(--red); }
.flag.wrong_shift, .flag.missing_punch, .flag.worked_off_day { background: var(--yellow-soft); color: var(--yellow); }
.flag.overtime { background: var(--green-soft); color: var(--green); }
.alert-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.alert-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--yellow-soft); font-size: 12.5px; font-weight: 700; }
.alert-list li.info { background: #eef2f3; }
.alert-list li.danger { background: var(--red-soft); }
.upload-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.upload-box input[type=file] { flex: 1 1 320px; }

.group-row td { background: var(--primary-dark, #0f6978); color: #fff; font-weight: 800; font-size: 13px; padding: 9px 12px; }
.group-row td .count, .subgroup-row td .count { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 6px; margin-inline-start: 8px; border-radius: 7px; background: rgba(255,255,255,.22); font-size: 11px; }
.subgroup-row td { background: #eef4f5; color: var(--primary-dark, #0f6978); font-weight: 800; font-size: 12px; padding: 7px 12px 7px 24px; }
.subgroup-row td .count { background: rgba(15,105,120,.12); }
tbody tr.group-row:hover td, tbody tr.subgroup-row:hover td { background-color: inherit; }

.link-button.strong { font-weight: 800; font-size: 13px; }
tbody tr.selected-row td { background: var(--primary-soft); }

.station-input { width: 90px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; text-align: center; direction: ltr; text-transform: uppercase; }
.station-input.station-empty { border: 2px solid #d97706; background: #fff7ed; }
.search-hidden { display: none !important; }
.list-search-bar { grid-template-columns: minmax(220px, 420px) auto; margin-bottom: 14px; }
.modal .list-search-bar { margin-bottom: 10px; }

/* Equipment department */
.equip-photo { display: inline-grid; place-items: center; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f6f8f8; color: var(--muted); }
.equip-photo.small { width: 42px; height: 42px; }
.equip-photo.large { width: 150px; height: 150px; flex: 0 0 auto; }
.equip-photo.empty { font-size: 18px; }
.equip-card { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.equip-card h3 { margin: 0 0 4px; }
td.num { text-align: center; direction: ltr; }
td.loss { color: #b42318; font-weight: 700; }
.negative { color: #b42318; }
.equip-lines .qty-input { width: 72px; }
.equip-lines .note-input { width: 130px; }
tr.line-error td { background: #fff1f0; }
tr.line-error .eq-shortage { color: #b42318; font-weight: 800; }

.attach-upload { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.attach-upload label.button { cursor: pointer; }
.attach-list { display: grid; gap: 10px; }
.attach-tile { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: white; }
.attach-tile img { width: 110px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }
.attach-tile b, .attach-tile small { display: block; }
.attach-pdf { width: 110px; height: 80px; display: grid; place-items: center; border-radius: 8px; background: #fde8e8; color: #b42318; font-weight: 900; }
.attach-missing { color: #d97706; font-weight: 800; }

.scan-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--primary); border-radius: 12px; background: #f3fafb; }
.scan-box label.button { cursor: pointer; }
.qty-input.ai-filled { background: #fff8db; border-color: #e0b400; }
.qty-input.ai-unclear { background: #ffe8d6; border-color: #d97706; border-width: 2px; }

/* A table cell must stay a table cell even when it carries an inline style class such as .mono;
   otherwise the browser merges it with the next cell and every column after it shifts. */
td.mono, th.mono, td.status, td.num { display: table-cell; }

tr.total-row td { background: #f1f5f6; font-weight: 800; border-top: 2px solid var(--line); }
