/* ============================================================
   TEAM FALCON — TERMINAL OPS  (Design A: Mission Control)
   Theme system: all app-chrome colors come from CSS variables.
   Dark is the default; body.theme-light remaps every variable,
   so the whole UI adapts automatically when the theme flips.
   Sheet / print ("paper") styles below stay fixed on purpose.
   ============================================================ */
:root {
  --sb-w: 220px;
  --bg: #05060a;
  --panel: #0b0d13;
  --panel-2: #090b10;
  --panel-3: #12151d;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --border-dashed: rgba(255,255,255,0.12);
  --text: #F2F0EA;
  --text-2: #C3C9D6;
  --muted: #8B93A4;
  --faint: #5C6473;
  --accent: #C99A3A;
  --accent-text: #E6C583;
  --accent-soft: rgba(230,197,131,0.13);
  --blue: #C99A3A;
  --blue-hover: #B0842E;
  --blue-soft: rgba(230,197,131,0.14);
  --gold: #E6C583;
  --amber: #F0A54A;
  --amber-soft: rgba(240,165,74,0.10);
  --red-text: #FF8272;
  --red-soft: rgba(255,130,114,0.14);
  --red-border: rgba(255,130,114,0.32);
  --chip-red-bg: rgba(255,130,114,0.14);
  --chip-red-border: rgba(255,130,114,0.32);
  --tab-active: #E6C583;
  --shadow-paper: 0 10px 30px rgba(0,0,0,0.9);
  --shadow-modal: 0 30px 70px rgba(0,0,0,0.6);
  --input-focus: rgba(230,197,131,0.28);
}
body.theme-light {
  --bg: #f0f4f9;
  --panel: #ffffff;
  --panel-2: #f8faff;
  --panel-3: #eef2ff;
  --border: rgba(37, 99, 235, 0.12);
  --border-strong: rgba(37, 99, 235, 0.22);
  --border-dashed: rgba(37, 99, 235, 0.20);
  --text: #0f2440;
  --text-2: #2c3e58;
  --muted: #5b6d85;
  --faint: #93a3b8;
  --accent: #2563eb;
  --accent-text: #1d4ed8;
  --accent-soft: rgba(37,99,235,0.10);
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: rgba(37,99,235,0.10);
  --gold: #2563eb;
  --amber: #d97706;
  --amber-soft: rgba(217,119,6,0.10);
  --red-text: #c0392b;
  --red-soft: rgba(192,57,43,0.10);
  --red-border: rgba(192,57,43,0.28);
  --chip-red-bg: rgba(192,57,43,0.10);
  --chip-red-border: rgba(192,57,43,0.28);
  --tab-active: #2563eb;
  --shadow-paper: 0 10px 30px rgba(37, 99, 235, 0.08);
  --shadow-modal: 0 30px 70px rgba(37, 99, 235, 0.12);
  --input-focus: rgba(37,99,235,0.22);
}

/* designation dropdown in admin user list */
.desig-select { padding: 4px 6px; font-size: 11px; border-radius: 6px; background: var(--panel); color: var(--gold); border: 1px solid var(--gold); outline: none; cursor: pointer; font-family: inherit; max-width: 160px; }

/* ----- reset & base ----- */
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  transition: background-color .25s ease, color .25s ease;
}
/* smooth theme flip on the main chrome */
#sidebar, .workflow-panel, .td-panel, .modal-card, .login-card, .card-chrome,
.dropzone, .gate-drop, .cs-eml-tile, input, textarea, select, .admin-user-item {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

/* ---------- login overlay ---------- */
#loginOverlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.login-card {
  background: var(--panel); border: 1px solid var(--border); padding: 44px; border-radius: 18px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-modal);
  text-align: center; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.login-logo {
  width: 60px; height: 60px; background: var(--accent-soft); border: 1px solid rgba(45,212,191,.55);
  color: var(--accent-text); font-size: 22px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; margin: 0 auto 16px;
}
.login-card h2 { margin: 0 0 8px; font-size: 24px; font-weight: 800; }
.login-card p { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 18px; text-align: left; }
.login-form label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.login-form input, #appMCS .field input, #adminUserManagement input, #adminUserManagement select,
.modal-card .field input, .modal-card .field select {
  width: 100%; padding: 12px 14px; font-size: 14px; background: var(--panel); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px; transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}
.login-form input:focus, #appMCS .field input:focus, #adminUserManagement input:focus, #adminUserManagement select:focus,
.modal-card .field input:focus, .modal-card .field select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--input-focus);
}
.modal-card .field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.modal-card .field input::placeholder { color: var(--faint); }

.pw-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.pw-wrap input { padding-right: 40px !important; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: transparent; border: none; border-radius: 6px; color: var(--muted); cursor: pointer; padding: 0; transition: color .2s, background .2s; outline: none; }
.pw-toggle:hover { color: var(--text); background: var(--border); }

.login-btn { background: var(--blue); color: #FFF; border: none; padding: 14px; font-weight: 700; border-radius: 8px; cursor: pointer; transition: 0.2s; margin-top: 6px; }
.login-btn:hover { background: var(--blue-hover); }
#loginError { color: var(--red-text); background: var(--red-soft); border: 1px solid var(--red-border); padding: 12px; border-radius: 8px; font-size: 13px; font-weight: 600; display: none; margin-bottom: 18px; }

/* ---------- SIDEBAR ---------- */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sb-w); z-index: 9000;
  background: var(--panel); border-right: 1px solid var(--border);
  display: none; flex-direction: column; padding: 20px 14px;
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sb-brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--accent-soft); border: 1px solid rgba(45,212,191,.55);
  color: var(--accent-text); font-weight: 800; font-size: 14px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
}
.sb-brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.sb-brand-sub { font-size: 11px; color: var(--faint); font-weight: 500; letter-spacing: .4px; text-transform: uppercase; }
.sb-nav { flex: 1; overflow-y: auto; }
.sb-label { font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; color: var(--faint); text-transform: uppercase; padding: 14px 12px 8px; }
.sb-item + .sb-label { border-top: 1px solid var(--border-strong); margin: 10px 4px 0; padding-top: 16px; }
.sb-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 6px;
  border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 13.5px;
  cursor: pointer; border: 1px solid var(--border); background: var(--bg); transition: all .15s; user-select: none;
}
.sb-item:hover { background: var(--panel-2); color: var(--text); }
.sb-item.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.sb-item .ico { width: 18px; text-align: center; font-size: 14px; }
.sb-lock { margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: .5px; padding: 2px 7px; border-radius: 99px; background: rgba(212,175,55,.1); color: var(--gold); border: 1px solid rgba(212,175,55,.3); }
.sb-foot { padding-top: 14px; border-top: 1px solid var(--border); }
.sb-theme {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 12px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  font-family: inherit; font-size: 12.5px; font-weight: 600; transition: all .15s;
}
.sb-theme:hover { color: var(--text); border-color: var(--border-strong); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.sb-user:hover { background: var(--panel-2); }
.sb-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(145deg, #3B82F6, #1E40AF);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.sb-user-info { min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-desig { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-del-btn { background: none; border: 1px solid transparent; color: var(--faint); font-size: 11px; cursor: pointer; padding: 2px 6px; border-radius: 5px; line-height: 1; }
.ov-del-btn:hover { color: var(--red-text, #FCA5A5); border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }

.sb-user-timer { font-size: 10.5px; font-weight: 700; color: var(--amber); margin-top: 2px; white-space: nowrap; letter-spacing: .01em; }
.sb-user-timer:empty { display: none; }
.sb-user-timer.urgent { color: var(--red-text); }


/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--panel); border: 1px solid var(--amber);
  color: var(--amber); padding: 12px 24px; border-radius: 6px; font-size: 10.5pt; font-weight: 700;
  opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none; z-index: 11000;
  transform: translateY(10px); box-shadow: var(--shadow-modal);
  display: flex; align-items: center; gap: 12px;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-undo { background: var(--amber); color: #000; border: none; padding: 4px 10px; border-radius: 4px; font-weight: 800; cursor: pointer; font-size: 11px; }
.toast-undo:hover { background: #fff; }

/* ========== MCS GENERATOR ========== */
#appMCS { display: none; padding: 28px 36px 60px; margin-left: var(--sb-w); }
#appMCS .app-container { max-width: 1100px; margin: 0 auto 40px; }

/* module tab bar — underline tabs on a clear divider */
#appMCS .switcher-wrapper {
  display: none; /* modules switch via sidebar only — one module visible at a time */
}
#appMCS .switch-btn {
  appearance: none; background: transparent; border: none; border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; padding: 11px 4px; border-radius: 0;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: 0.2s; font-family: inherit;
}
#appMCS .switch-btn:hover { color: var(--text); }
#appMCS .switch-btn.active { background: none; color: var(--tab-active); border-bottom-color: var(--tab-active); box-shadow: none; }

#appMCS .workflow-panel { display: none; background: var(--panel); border-radius: 14px; border: 1px solid var(--border); padding: 32px; animation: fadeIn 0.3s ease-out; }
#appMCS .workflow-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
#appMCS .panel-intro { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
#appMCS .panel-intro h2 { font-size: 19px; margin: 0; font-weight: 800; }
#appMCS .panel-intro p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
#appMCS .form-row { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; }
#appMCS .form-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 240px; }
#appMCS label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
#appMCS select, #appMCS textarea { font: inherit; font-size: 14px; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); transition: 0.2s; width: 100%; }
#appMCS select:focus, #appMCS textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--input-focus); }
#appMCS textarea { min-height: 150px; font-family: ui-monospace, monospace; font-size: 13px; resize: vertical; }
#appMCS .dropzone { border: 2px dashed var(--border-dashed); border-radius: 14px; background: var(--panel); padding: 48px 20px; text-align: center; cursor: pointer; transition: 0.2s; }
#appMCS .dropzone:hover { background: var(--panel-2); border-color: var(--accent); }
#appMCS .dropzone-icon { font-size: 38px; display: block; margin-bottom: 14px; }
#appMCS .dropzone h3 { font-size: 16px; margin: 0 0 6px; font-weight: 700; }
#appMCS .dropzone p { font-size: 13px; color: var(--muted); margin: 0; }
#appMCS .dropzone-slim { padding: 16px 18px; }
#appMCS .dropzone-slim h3 { font-size: 14px; display: inline; }
#appMCS .dropzone-slim p { margin-top: 4px; }
#appMCS .dropzone-slim .file-badge { margin-top: 10px; }
#appMCS .excl-bar { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
#appMCS .excl-bar input { flex: 0 0 220px; background: var(--panel); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 9px 12px; font-size: 13px; text-transform: uppercase; }
#appMCS .excl-bar input:focus { outline: none; border-color: var(--accent); }
#appMCS .excl-btn { background: var(--panel-3); border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
#appMCS .excl-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
#appMCS .excl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#appMCS .excl-chip { background: var(--chip-red-bg); border: 1px solid var(--chip-red-border); color: var(--red-text); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
#appMCS .excl-chip:hover { filter: brightness(1.15); }
#appMCS .file-badge { display: none; margin-top: 18px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent); padding: 10px 16px; border-radius: 8px; font-weight: 700; font-size: 13px; text-align: center; }
#appMCS .btn-primary { background: var(--blue); color: #FFF; border: none; padding: 14px 26px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
#appMCS .btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
#appMCS .btn-secondary { background: var(--panel); border: 1.5px solid var(--border); color: var(--text); padding: 11px 20px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; transition: 0.2s; }
#appMCS .btn-secondary:hover { background: var(--panel-3); border-color: var(--border-strong); }
#appMCS .toolbar-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
#appMCS #sheetWrap { display: none; margin: 40px auto; flex-direction: column; align-items: center; gap: 30px; }
#appMCS .empty-state { color: var(--muted); text-align: center; padding: 48px; border: 2px dashed var(--border-dashed); border-radius: 14px; font-weight: 600; background: var(--panel); width: 100%; max-width: 800px; margin: 0 auto; }

/* ===== Manual Handover entry (Airside) ===== */
#appMCS .handover-toggle { width: 100%; padding: 12px 16px; background: var(--amber-soft); border: 1px dashed var(--amber); color: var(--amber); border-radius: 10px; font-weight: 800; font-size: 13px; letter-spacing: 0.5px; cursor: pointer; transition: 0.2s; text-align: center; }
#appMCS .handover-toggle:hover { filter: brightness(1.1); }
#appMCS #handoverPanel { margin-top: 12px; background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: 12px; padding: 16px 18px; }
#appMCS .ho-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
#appMCS .ho-head h3 { margin: 0; color: var(--amber); font-size: 15px; letter-spacing: 2px; }
#appMCS .ho-head p { font-size: 12px; color: var(--muted); margin: 4px 0 0 0; }
#appMCS .ho-clear-btn { padding: 8px 14px; font-size: 12px; font-weight: 700; background: var(--red-soft); color: var(--red-text); border: 1px solid var(--red-border); border-radius: 8px; cursor: pointer; }
#appMCS .ho-clear-btn:hover { filter: brightness(1.1); }
#appMCS .ho-grid { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr 34px; gap: 8px; align-items: center; }
#appMCS .ho-grid-head { margin-bottom: 6px; }
#appMCS .ho-grid-head span { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
#appMCS .ho-grid-row { margin-bottom: 8px; }
#appMCS .ho-grid-row input { width: 100%; padding: 9px 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; background: var(--panel-2); border: 1px solid var(--border-dashed); color: var(--text); border-radius: 8px; outline: none; text-align: center; box-sizing: border-box; }
#appMCS .ho-grid-row input:focus { border-color: var(--amber); }
#appMCS .ho-del-btn { width: 34px; height: 34px; background: var(--red-soft); color: var(--red-text); border: 1px solid var(--red-border); border-radius: 8px; cursor: pointer; font-size: 12px; }
#appMCS .ho-del-btn:hover { filter: brightness(1.1); }
#appMCS .ho-add-btn { margin-top: 4px; padding: 9px 18px; font-size: 12px; font-weight: 800; background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber); border-radius: 8px; cursor: pointer; }
#appMCS .ho-add-btn:hover { filter: brightness(1.1); }

/* ========== TRANSFER DESK ========== */
#appTD { display: none; background: var(--bg); color: var(--text); padding: 28px 36px 60px; margin-left: var(--sb-w); min-height: 100vh; }
#appTD .td-container { max-width: 1100px; margin: 0 auto 40px; }

/* module tab bar — underline tabs on a clear divider */
#appTD .td-switcher {
  display: none; /* modules switch via sidebar only — one module visible at a time */
}
#appTD .td-switch-btn {
  appearance: none; background: transparent; border: none; border-bottom: 2.5px solid transparent;
  margin-bottom: -2px; padding: 11px 4px; border-radius: 0;
  font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; transition: 0.2s;
  font-family: inherit; text-align: center; white-space: nowrap;
}
#appTD .td-switch-btn:hover { color: var(--text); }
#appTD .td-switch-btn.active { background: none; color: var(--tab-active); border-bottom-color: var(--tab-active); box-shadow: none; }

#appTD .td-panel {
  display: none; background: var(--panel); border-radius: 14px; border: 1px solid var(--border);
  padding: 32px; animation: fadeIn 0.3s ease-out;
}
#appTD .td-panel.active { display: block; }
#appTD .td-panel-intro { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
#appTD .td-panel-intro h2 { font-size: 19px; margin: 0; font-weight: 800; }
#appTD .td-panel-intro p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

#appTD .td-form-row { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 22px; flex-wrap: wrap; }
#appTD .td-form-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 240px; }
#appTD .td-form-group label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
#appTD .td-form-group textarea, #appTD .td-form-group input, #appTD .td-form-group select {
  font: inherit; font-size: 14px; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text); transition: 0.2s; width: 100%;
}
#appTD .td-form-group select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B9BB4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
#appTD .td-form-group select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--input-focus);
}
body.theme-light #appTD .td-form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366707f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
#appTD .td-form-group textarea:focus, #appTD .td-form-group input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px var(--input-focus);
}
#appTD .td-form-group textarea { min-height: 150px; font-family: ui-monospace, monospace; font-size: 13px; resize: vertical; }

#appTD .cs-eml-tile { background: var(--panel); border: 2px dashed var(--border-dashed); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: 0.2s; }
#appTD .cs-eml-tile:hover { border-color: var(--accent); background: var(--panel-2); }
#appTD .cs-eml-tile b { font-size: 13px; color: var(--text-2); }
#appTD .cs-eml-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
#appTD .cs-eml-badge { display: none; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--accent-text); }
#appTD .cs-eml-alt { font-size: 11px; color: var(--muted); margin-top: 6px; }
#appTD .cs-eml-alt a { color: var(--accent-text); text-decoration: none; }
#appTD .td-btn-primary {
  background: var(--blue); color: #FFF; border: none; padding: 14px 26px; border-radius: 10px;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
#appTD .td-btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
#appTD .td-btn-secondary {
  background: var(--panel); border: 1.5px solid var(--border); color: var(--text); padding: 11px 20px;
  border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; transition: 0.2s;
}
#appTD .td-btn-secondary:hover { background: var(--panel-3); border-color: var(--border-strong); }

#appTD .td-toolbar { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border-strong); flex-wrap: wrap; }

/* table section chrome (the table wrap below it is the printable white paper) */
#appTD .td-table-section {
  background: var(--panel-2); border-radius: 14px; border: 1px solid var(--border); overflow: hidden;
  display: none; padding-bottom: 24px; margin-top: 24px;
}
#appTD .td-table-header {
  padding: 14px 20px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; gap: 12px;
}
#appTD .td-counter { font-weight: 700; font-size: 11pt; color: var(--amber); letter-spacing: 0.5px; }
#appTD .td-table-wrap {
  overflow: auto; max-height: 80vh; width: 210mm; max-width: 95%;
  margin: 24px auto 0; padding: 12mm 8mm; background: #fff; color: #262626;
  border-radius: 3px; box-shadow: var(--shadow-paper);
}
#appTD table { width: 100%; border-collapse: collapse; font-size: var(--sheetFontSize, 12pt); color: #262626; font-family: var(--sheetFontFamily, 'Arial Narrow', Arial, sans-serif); }
#appTD th, #appTD td { padding: 5px 6px; text-align: center; border: 1px solid #7f7f7f; white-space: nowrap; }
#appTD th { background-color: #000000; color: #fff; font-weight: 700; position: sticky; top: 0; border: 1px solid #222; z-index: 10; }
#appTD tr:nth-child(even) { background-color: #f9fbfd; }
#appTD tr:hover { background-color: #eef4fa; }
#appTD .cs-spacer td { height: 7px; padding: 0 !important; border-left: none; border-right: none; border-top: none; background: #fff; }
#appTD .cs-red td { color: #c0392b; }
#appTD .cs-bold td { font-weight: 700; }
#appTD .cs-grow td:first-child { border-left: 3px solid #333; }
#appTD .cs-grow td:last-child { border-right: 3px solid #333; }
#appTD .cs-gtop td { border-top: 3px solid #333; }
#appTD .cs-gbot td { border-bottom: 3px solid #333; }
#appTD .cs-subtotal td { background: #eef3f9; padding: 4px 10px !important; text-align: left; white-space: normal; border-left: 3px solid #333; border-right: 3px solid #333; }
#appTD .cs-summary { display: flex; flex-wrap: wrap; margin: 0 0 12px; border: 1.5px solid #8a8a8a; border-radius: 8px; background: #f8fafc; overflow: hidden; }
#appTD .cs-stat { flex: 1; min-width: 110px; padding: 8px 12px; text-align: center; background: transparent; }
#appTD .cs-stat:not(:last-child) { border-right: 1.5px solid #c4c4c4; }
#appTD .cs-stat .n { font-size: 16pt; font-weight: 800; line-height: 1; }
#appTD .cs-stat .l { font-size: 8pt; color: #555; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
#appTD .cs-stat.mis .n { color: #c0392b; }
#appTD .cs-stat.fast .n { color: #333333; }
#appTD .cs-stat.gate .n { color: #333333; }
#appTD .cs-stat.total .n { color: #000; }
#appTD .cs-chip { display: inline-block; font-weight: 700; margin-right: 16px; }
#appTD .cs-chip.mis { color: #c0392b; }
#appTD .cs-chip.fast { color: #333333; }
#appTD .cs-chip.gate { color: #333333; }
#appTD .ft-report-title { text-align: center; font-weight: 800; color: #000; font-size: 13pt; padding: 2px 0 7px; letter-spacing: 0.3px; }
#appTD .ft-report-title .cs-gen { font-weight: 500; font-size: 8.5pt; color: #777; letter-spacing: 0.2px; }
#appTD .cs-table th, #appTD .cs-table td { padding: 3px 4px; }
#appTD .cs-table th { padding-top: 3px; padding-bottom: 3px; line-height: 1.1; color: var(--csHeadTxt, #ffffff); background: var(--csHeadBg, #000000); }
/* Welfare header follows the per-table color picker (defaults to black) */
#appTD #resultTable th { background: var(--tdHeadBg, #000000); color: var(--tdHeadTxt, #ffffff); }
#appTD .cs-table td.cs-wrap { white-space: normal; }
#appTD .cs-table .cs-narrow { white-space: normal; }
#appTD .cs-table td.cs-cnx-low { color: #c0392b; font-weight: 800; }
#appTD .cs-table td.cs-dcode { color: #c0392b; font-weight: 700; }
#appTD .cs-table .cs-x { color: #c0392b; font-weight: 800; }
#appTD .ft-table td.tot, #appTD .ft-table th.tot { font-weight: 800; }

/* Black & white plain table (Visa with Format) */
#appTD table.bw-plain th { background: #fff !important; color: #000 !important; border-color: #555 !important; font-weight: 400 !important; }
#appTD table.bw-plain tr:nth-child(even) { background-color: #fff; }
#appTD table.bw-plain tr { background-color: #fff; }
#appTD table.bw-plain tr:hover { background-color: #fff; }
#appTD table.bw-plain td { color: #000; border-color: #555; }

/* Duplicate Resolution UI - Cards */
#csDupOptions { background: var(--panel); border: 1px dashed var(--amber); border-radius: 14px; padding: 20px; }
.dup-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.dup-header { background: var(--panel-3); padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.dup-route { font-weight: 800; font-size: 13px; color: var(--text); letter-spacing: 0.5px; }
.dup-guests { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.dup-options-wrap { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.dup-option {
  position: relative; display: flex; align-items: center; padding: 12px 14px;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.dup-option:hover { border-color: var(--border-strong); background: var(--panel-2); }
.dup-option input[type="radio"] { display: none; }
.dup-option:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.dup-option:has(input:checked)::after { content: '✓'; position: absolute; right: 14px; color: var(--blue); font-size: 16px; font-weight: 900; }
.dup-details { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 10px; width: 100%; }
.dup-row-badge { font-size: 10px; background: var(--panel-3); padding: 3px 6px; border-radius: 4px; color: var(--muted); font-weight: 700; text-transform: uppercase; }

/* gate OCR & PDF compact row */
.gate-compact-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.gate-compact-row .gate-drop {
  flex: 1 1 0; min-width: 120px; padding: 12px 8px; font-size: 11px;
  border-radius: 14px; background: var(--panel); border: 2px dashed var(--border-dashed);
  text-align: center; cursor: pointer; transition: 0.2s;
}
.gate-compact-row .gate-drop:hover { border-color: var(--accent); background: var(--panel-2); }
.gate-compact-row .gate-drop .gd-title { font-weight: 700; font-size: 11px; color: var(--text); }
.gate-compact-row .gate-drop .gd-sub { font-size: 9px; color: var(--muted); }
.gate-compact-row .gate-drop .gd-status { font-size: 8.5px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.gate-compact-row .gate-drop .gate-progress { height: 3px; background: var(--border-strong); border-radius: 2px; margin-top: 4px; overflow: hidden; display: none; }
.gate-compact-row .gate-drop .gate-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* gate preview chips */
.gate-preview { margin-top: 14px; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 8px; padding: 12px 14px; display: none; }
.gate-preview h4 { font-size: 9.5pt; color: var(--text); margin-bottom: 8px; font-weight: 800; }
.gate-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gate-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-3); border: 1px solid var(--border-strong); border-radius: 6px; padding: 3px 6px 3px 8px; font-size: 9pt; }
.gate-chip b { color: var(--text); font-weight: 700; }
.gate-chip input { width: 46px; padding: 2px 4px; font-size: 9pt; text-align: center; text-transform: uppercase; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 4px; color: var(--amber); font-weight: 800; }

.gate-manual { margin-top: 12px; display: none; }
.gate-manual textarea { min-height: 60px; font-family: monospace; font-size: 9pt; width: 100%; padding: 8px; background: var(--panel); color: var(--text); border: 1px solid var(--border-strong); border-radius: 4px; }
.gate-hint { font-size: 8.5pt; color: var(--muted); background: var(--blue-soft); border-left: 3px solid var(--blue); padding: 8px 10px; border-radius: 4px; margin-top: 10px; line-height: 1.4; }
.help-text { font-size: 8.5pt; color: var(--muted); margin-top: 6px; line-height: 1.3; }

/* ---------- profile / bug modals ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-modal); animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.modal-close { background: transparent; border: none; color: var(--muted); font-size: 24px; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: 0.2s; }
.modal-close:hover { color: var(--text); background: var(--panel-3); }
.modal-body { padding: 24px 26px; }
.profile-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.profile-hero .user-avatar { width: 54px; height: 54px; font-size: 22px; border-radius: 50%; background: linear-gradient(145deg, #3B82F6, #1E40AF); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.profile-hero-info strong { display: block; font-size: 18px; font-weight: 800; }
.profile-hero-info .pm-desig { display: block; font-size: 12.5px; color: var(--gold); font-weight: 600; margin: 1px 0; }
.profile-hero-info span { font-size: 13px; color: var(--muted); }
.modal-section { margin-bottom: 20px; }

/* --- account settings polish --- */
.pf-hero { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 20px; background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); border-radius: 14px; }
.pf-hero .pf-avatar { width: 56px; height: 56px; font-size: 23px; border-radius: 14px; background: linear-gradient(145deg, #3B82F6, #1E40AF); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; box-shadow: 0 4px 14px rgba(59,130,246,.3); }
.pf-hero-info strong { display: block; font-size: 18px; font-weight: 800; }
.pf-hero-info .pm-desig { display: inline-block; font-size: 11px; color: var(--gold); font-weight: 700; margin: 4px 0 2px; padding: 2px 9px; border: 1px solid rgba(212,175,55,.35); background: rgba(212,175,55,.08); border-radius: 999px; }
.pf-hero-info > span:last-child { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pf-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.pf-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pf-card-head h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 800; }
.pf-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(13,148,136,.15); color: #2DD4BF; border: 1px solid rgba(13,148,136,.3); }
.pf-quota-num { font-size: 22px; font-weight: 800; color: var(--blue); }
.pf-quota-sub { font-size: 11px; color: var(--muted); margin: 3px 0 10px; }
.pf-quota-track { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.pf-quota-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3B82F6, #2DD4BF); transition: width .4s ease; }
.pf-mini-btn { padding: 5px 12px; font-size: 11px; }
.modal-section > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin: 0 0 14px; font-weight: 800; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }

.form-msg { display: none; padding: 10px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-top: 4px; }
.form-msg.ok { display: block; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent); }
.form-msg.err { display: block; color: var(--red-text); background: var(--red-soft); border: 1px solid var(--red-border); }

.btn-primary { background: var(--blue); color: #FFF; border: none; padding: 14px 26px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--panel); border: 1.5px solid var(--border); color: var(--text); padding: 11px 20px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; transition: 0.2s; }
.btn-secondary:hover { background: var(--panel-3); border-color: var(--border-strong); }

/* Admin user list items */
.admin-user-item { display:flex; justify-content:space-between; align-items:center; background:var(--panel); padding:10px 14px; border:1px solid var(--border); border-radius:8px; margin-bottom: 8px; }

#adminLogsList::-webkit-scrollbar { width: 6px; }
#adminLogsList::-webkit-scrollbar-track { background: var(--panel); }
#adminLogsList::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
#adminLogsList::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ========== OVERVIEW (admin only) ========== */
#appOV { display: none; padding: 28px 36px 60px; margin-left: var(--sb-w); min-height: 100vh; }
#appAdmin { padding: 28px 36px 60px; margin-left: var(--sb-w); min-height: 100vh; }
#appOV .ov-container { max-width: 1100px; margin: 0 auto; }
#appOV .ov-head { margin-bottom: 20px; }
#appOV .ov-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.3px; margin: 0; }
#appOV .ov-head p { font-size: 13px; color: var(--muted); margin: 3px 0 0; }
#appOV .ov-banner {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 11px; margin-bottom: 22px;
  background: rgba(212,175,55,.07); border: 1px solid rgba(212,175,55,.25); font-size: 12.5px; color: var(--gold); font-weight: 500;
}
#appOV .ov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
#appOV .ov-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
#appOV .ov-stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#appOV .ov-label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; }
#appOV .ov-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--accent-soft); }
#appOV .ov-val { font-size: 27px; font-weight: 800; letter-spacing: -.8px; font-family: 'JetBrains Mono', ui-monospace, monospace; }
#appOV .ov-val-text { font-size: 19px; letter-spacing: -.3px; font-family: inherit; line-height: 1.25; }
#appOV .ov-sub { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
#appOV .ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
#appOV .ov-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; margin-bottom: 18px; }
#appOV .ov-grid .ov-card { margin-bottom: 0; }
#appOV .ov-card h3 { font-size: 13px; font-weight: 700; margin: 0 0 16px; }
#appOV .ov-empty { color: var(--faint); font-size: 12.5px; text-align: center; padding: 16px; }
#appOV .ov-bar-row { margin-bottom: 14px; }
#appOV .ov-bar-row:last-child { margin-bottom: 0; }
#appOV .ov-bar-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
#appOV .ov-bar-head .n { font-weight: 600; }
#appOV .ov-bar-head .c { color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }
#appOV .ov-bar-track { height: 7px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
#appOV .ov-bar-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s ease; }
#appOV .ov-user-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
#appOV .ov-user-row:last-child { border-bottom: none; }
#appOV .ov-user-ava { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: linear-gradient(145deg, #3B82F6, #1E40AF); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
#appOV .ov-user-name { font-size: 13px; font-weight: 600; }
#appOV .ov-user-desig { font-size: 11px; color: var(--faint); }
#appOV .ov-user-cnt { margin-left: auto; font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700; color: var(--accent-text); }
#appOV .ov-table { width: 100%; border-collapse: collapse; }
#appOV .ov-table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--border); }
#appOV .ov-table td { padding: 9px 10px; font-size: 12.5px; border-bottom: 1px solid var(--border); color: var(--text-2); }
#appOV .ov-table tr:last-child td { border-bottom: none; }
#appOV .ov-table td.t { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--muted); }
#appOV .ov-action-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 700; background: var(--blue-soft); color: var(--blue); }

/* ===== MCS sheet paper (screen preview of the printable sheet) ===== */
#appMCS .sheet { background: #fff; box-shadow: var(--shadow-paper); font-family: var(--sheetFontFamily, 'Arial Narrow', Arial, sans-serif); font-size: var(--sheetFontSize, 12px); width: 210mm; min-height: 297mm; display: flex; flex-direction: column; border: 1px solid #CCC; padding: 4mm; /* matches the even 4mm print margin */ }
#appMCS .top-bar { display: flex; align-items: center; justify-content: space-between; background: var(--asTopBg, #000000); color: var(--asTopTxt, #ffffff); border-bottom: 2px solid #D4AF37; min-height: 4mm; padding: 0.6mm 3mm; flex: none; }
#appMCS .top-bar .breakdown { font-weight: 800; font-size: 11.5px; letter-spacing: 0.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#appMCS .top-bar .meta { background: var(--asMetaBg, #111111); color: var(--asMetaTxt, #ffffff); padding: 1px 5px; border-radius: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; border: 1px solid rgba(255,255,255,0.15); white-space: nowrap; display: inline-block; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: none; max-width: 45%; }
#appMCS .cols { display: grid; grid-template-columns: 1fr 3px 1fr; flex: 1 1 100%; align-content: stretch; margin-top: 1mm; width: 100%; height: 100%; }
#appMCS .cols > div { display: flex; flex-direction: column; height: 100%; }
#appMCS .gap { background: #000; width: 2px; margin: 0 auto; opacity: 0.4; }
#appMCS table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--sheetFontFamily, 'Arial Narrow', Arial, sans-serif); font-size: var(--sheetFontSize, 12px); }
/* Stretch each column's group tables with flexbox so they share the full column
   height on SCREEN as well as in print — rows reach the bottom margin instead of
   ending mid-page with a white gap. (With plain height:100% every table in a
   multi-group column claimed the full column height and overflowed.) */
#appMCS .cols > div > table { flex: 1 1 auto; height: auto; min-height: 0; }
#appMCS .cols > div > .sp { flex: none; }
/* While fitMcsSheetHeight() measures the natural content height, stretch and
   fixed sheet heights are switched off — otherwise the stretch would mask any
   vertical overflow. ID + two classes outranks the !important print rules. */
#appMCS .sheet.mcs-measure { height: auto !important; min-height: 0 !important; max-height: none !important; }
#appMCS .sheet.mcs-measure .cols { height: auto !important; flex: none !important; }
#appMCS .sheet.mcs-measure .cols > div { height: auto !important; }
#appMCS .sheet.mcs-measure .cols > div > table { flex: none !important; height: auto !important; }
#appMCS td { line-height: 0.95 !important; overflow: hidden; padding: 0 3px !important; text-align: center; vertical-align: middle; word-wrap: break-word; }
#appMCS tr { page-break-inside: avoid !important; break-inside: avoid !important; }
/* Group titles + column headers intentionally ignore --fontScale: the font picker scales only data rows */
#appMCS .ghead td { color: #fff; font-weight: 800; font-size: var(--fGroup, 12px); text-align: center; border: 1px solid #000; border-bottom: none; letter-spacing: 1px; height: var(--rowH); }

/* Per-pier flight breakdown tile inside the group header bar (Piers report only).
   Pier name sits on the left, small shift-style tile on the right; both clip with
   ellipsis so nothing ever spills out of the column. */
#appMCS .ghead-inner { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 6px; height: 100%; box-sizing: border-box; }
#appMCS .ghead-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#appMCS .ghead-tile { flex: none; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.35); color: #fff; border-radius: 3px; padding: 0 6px; font-size: 0.78em; font-weight: 800; letter-spacing: 0.3px; line-height: 1.6; }
#appMCS tr.gsub { height: var(--rowH); }
#appMCS tr.gsub td { color: inherit; font-weight: 800; font-size: var(--fHead, 10px); border: 1px solid #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appMCS tr.gsub td.ntl { text-align: center; }
#appMCS tr.d { height: var(--rowH); }
#appMCS tbody td { border: 1px solid #000; font-size: calc(var(--fData, 11px) * var(--fontScale, 1)); font-weight: 700; color: #111; }
#appMCS tbody td span.cell-text { display: inline-block; transform: scaleY(0.95); letter-spacing: 0.3px; }
#appMCS td.nt { background: #fff; }
#appMCS td.nt span.cell-text { transform: none; letter-spacing: normal; }
#appMCS tr.d.alt td:not(.nt) { background: #F6F8FC; }
#appMCS tr.d.hl td:not(.nt) { color: #C53030; }
#appMCS .sp { height: calc(var(--rowH) * 0.5); width: 100%; background: #fff; border: none; flex: none; }

/* OAL sheet */
#appMCS .sheet.oal-sheet { font-family: 'Arial', sans-serif; height: auto !important; }
#appMCS .oal-title-bar { background: var(--oalHead, #1E3A2F); color: var(--oalHeadTxt, #FFFFFF); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; border: 2px solid #000000; border-bottom: none; }
#appMCS .oal-title-bar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#appMCS .oal-title-bar .oal-badges { display: flex; gap: 12px; align-items: center; }
#appMCS .oal-badge-date { font-size: 13px; color: #E8F0EB; font-weight: bold; }
#appMCS .oal-badge-shift { font-size: 12px; font-weight: 900; padding: 5px 12px; border-radius: 4px; color: var(--oalShiftTxt, #fff); letter-spacing: 0.5px; }
#appMCS .oal-badge-shift.night { background: var(--oalShiftBg, #1E3060); border: 1px solid #4B6396; }
#appMCS .oal-badge-shift.day { background: var(--oalShiftBg, #8B3A3A); border: 1px solid #B65858; }
#appMCS .oal-stats-bar { background: var(--oalSub, #F7F5F1); color: var(--oalSubTxt, #111111); font-weight: 800; font-size: 13px; text-align: center; padding: 8px; border: 2px solid #000000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appMCS table.oal-table { width: 100%; height: auto !important; border-collapse: collapse; border: 2px solid #000000; margin-top: 6px; }
#appMCS table.oal-table th { background: var(--oalHead, #243B30); color: var(--oalHeadTxt, #FFFFFF); font-size: 12px; font-weight: 800; padding: 5px 6px !important; line-height: 1.15 !important; border: 1px solid #000000; }
#appMCS table.oal-table td { font-size: calc(12px * var(--fontScale, 1)); padding: 3px 6px !important; line-height: 1.15 !important; border: 1px solid #000000; color: #000000; height: 19px !important; }
#appMCS tr.oal-row-3l.odd td { background: #FFF0F0; }
#appMCS tr.oal-row-3l.even td { background: #FFE5E5; }
#appMCS tr.oal-row-3l td.flt { color: #D31117; font-weight: 900; font-size: 13px; }
#appMCS tr.oal-row-6e.odd td { background: #F0F5FF; }
#appMCS tr.oal-row-6e.even td { background: #E2ECFF; }
#appMCS tr.oal-row-6e td.flt { color: #0044CC; font-weight: 900; font-size: 13px; }
#appMCS tr.oal-row-oal.odd td { background: #FFFFFF; }
#appMCS tr.oal-row-oal.even td { background: #F3F4F6; }
#appMCS tr.oal-row-oal td.flt { color: #0F172A; font-weight: 800; }
#appMCS tr.oal-row-empty td { background: #FAFAFA; color: #999; border: 1px solid #000000; }

/* EY sheet */
#appMCS .sheet.ey-sheet { font-family: 'Arial', sans-serif; height: auto !important; }
#appMCS .ey-title-bar { background: var(--eyHead, #8b641e); color: var(--eyHeadTxt, #FFFFFF); padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; border: 2px solid #000000; border-bottom: none; }
#appMCS .ey-title-bar h1 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#appMCS .ey-title-bar .ey-meta { background: var(--eyMetaBg, rgba(0,0,0,0.35)); color: var(--eyMetaTxt, inherit); padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.5px; border: 1px solid rgba(255,255,255,0.25); white-space: nowrap; }
#appMCS .ey-sub-bar { background: var(--eySub, #b98c32); color: var(--eySubTxt, #FFFFFF); font-weight: 800; font-style: italic; font-size: 13px; text-align: center; padding: 5px; border: 2px solid #000000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#appMCS table.ey-table { width: 100%; height: auto !important; border-collapse: collapse; border: 2px solid #000000; margin-top: 5px; }
#appMCS table.ey-table th { background: var(--eyHead, #8b641e); color: var(--eyHeadTxt, #FFFFFF); font-size: 11px; font-weight: 800; padding: 5px 3px !important; line-height: 1.1 !important; border: 1px solid #000000 !important; }
#appMCS table.ey-table td { font-size: calc(var(--eyFSize, 10px) * var(--fontScale, 1)); padding: 0 3px !important; line-height: 1 !important; border: 1px solid #000000 !important; color: #000000; height: var(--eyRowH, 4.3mm) !important; box-sizing: border-box !important; vertical-align: middle !important; }
#appMCS tr.ey-row.odd td { background: #FFFFFF; }
#appMCS tr.ey-row.even td { background: #FAFAFA; }
#appMCS tr.ey-row td.neg-avail { color: #B40000 !important; font-weight: bold !important; }
#appMCS tr.ey-row td.muted-cell { color: #444444; }

/* Handover marking on the Gates/OTP sheet (screen + print) */
#appMCS tr.d.ho td:not(.nt) { background: #FFF3CD; }
#appMCS tr.d.ho.alt td:not(.nt) { background: #FFECB5; }
#appMCS td.nt .ho-tag { color: #8A6D00; font-weight: 900; font-size: 0.85em; letter-spacing: 0.5px; float: right; margin-right: 4px; }
/* Flight note in the NOTES cell — small, right-aligned */
#appMCS td.nt .mcs-note { float: right; margin-right: 4px; font-size: 0.78em; font-weight: 600; color: #333; letter-spacing: 0.2px; transform: none; }

/* ---------- print overrides ---------- */

/* Sheet header color pickers (OAL / EY / Connection Summary only) */
.sheet-colorbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px; padding:7px 12px; border:1px dashed var(--border); border-radius:10px; }
.sc-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; color: var(--faint); }
.sc-row { display:flex; gap:6px; align-items:center; flex-wrap:wrap; row-gap:6px; max-width:520px; }
.sc-sw { width:20px; height:20px; border-radius:50%; border:2px solid rgba(128,128,128,0.45); cursor:pointer; padding:0; transition: transform 0.12s ease; }
.sc-sw:hover { transform: scale(1.18); }
.sc-sw.on { outline:2px solid var(--accent); outline-offset:2px; }
.sc-reset { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; background:none; border:none; color: var(--faint); cursor:pointer; text-decoration:underline; padding:2px 4px; margin-left:auto; }
.sc-reset:hover { color: var(--accent-text); }
/* Colors button + popover */
.sc-openbar { display:flex; margin:10px 0 4px; }
.sc-open-btn { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; padding:7px 14px; border-radius:8px; border:1.5px solid var(--border); background:var(--panel); color:var(--text); cursor:pointer; }
.sc-open-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.cpop-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:12000; }
.cpop { display:none; position:fixed; z-index:12001; top:50%; left:50%; transform:translate(-50%,-50%); width:min(430px,92vw); max-height:88vh; overflow:auto; background:var(--panel,#111); color:var(--text,#fff); border:1px solid var(--border); border-radius:14px; padding:18px 18px 14px; box-shadow:0 20px 60px rgba(0,0,0,0.5); }
.cpop-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cpop-head span { font-size:15px; font-weight:800; }
.cpop-x { background:none; border:none; color:var(--muted); font-size:18px; cursor:pointer; line-height:1; padding:2px 6px; }
.cpop-x:hover { color:var(--text); }
.cpop-lbl { display:block; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; color:var(--faint); margin:12px 0 6px; }
.cpop-sel { width:100%; padding:10px 12px; font-size:13px; border-radius:8px; background:var(--bg,#000); color:var(--text,#fff); border:1.5px solid var(--border); outline:none; cursor:pointer; }
.cpop-grid { display:flex; flex-wrap:wrap; gap:8px; }
.cpop-sw { width:26px; height:26px; border-radius:50%; border:2px solid rgba(128,128,128,0.45); cursor:pointer; padding:0; transition:transform .12s ease; }
.cpop-sw.font-btn { width:auto; min-width:80px; height:32px; border-radius:6px; font-size:12px; font-weight:600; background:var(--panel-3); color:var(--text); padding:0 10px; }
.cpop-sw.font-btn:hover { transform:scale(1.04); }
.cpop-sw.font-btn.on { outline:2px solid var(--accent); outline-offset:2px; }
.cpop-sw:hover { transform:scale(1.16); }
.cpop-sw.on { outline:2px solid var(--accent); outline-offset:2px; }
.cpop-foot { display:flex; justify-content:space-between; align-items:center; margin-top:16px; gap:10px; }
.cpop-reset { background:none; border:none; color:var(--faint); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; text-decoration:underline; cursor:pointer; }
.cpop-reset:hover { color:var(--accent-text); }
.cpop-done { background:var(--accent,#2563eb); color:#fff; border:none; border-radius:8px; padding:8px 18px; font-size:13px; font-weight:700; cursor:pointer; }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Page margin is controlled at print time by <style id="dynPage"> (0 for Gates,
     a small margin for EY/OAL landside so multi-page tables aren't clipped). */
  @page { size: A4 portrait; }

  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; width: 100%; height: 100%; }
  #appMCS { padding: 0 !important; margin: 0 !important; }
  #loginOverlay, #sidebar, #appOV, .toast, #profileModal, #bugModal, .dashboard-header, .switcher-wrapper, .workflow-panel, .sheet-colorbar, .sc-openbar, .cpop, .cpop-backdrop { display: none !important; }
  #ocmReportSection, .ocm-enable-bar, .ocm-enable-btn, .cs-more-wrap { display: none !important; }  /* OCM never prints with the summary */

  body.mode-mcs #appTD { display: none !important; }
  body.mode-mcs #appMCS .app-container { display: none !important; }
  body.mode-mcs #appMCS #missingGatesPanel { display: none !important; }
  body.mode-mcs #appMCS #sheetWrap { margin: 0 !important; padding: 0 !important; gap: 0 !important; width: 100% !important; display: block !important; overflow: visible !important; }

  /* The sheet itself acts as the A4 page, inset so the outer borders sit inside
     the printer's printable zone — 6mm on ALL four sides (198mm wide +
     centered = 6mm L/R; 6mm top margin + 285mm height = 6mm bottom). No zoom,
     so text size is untouched. min-height must be reset or it would override
     max-height (min-height wins over max-height in CSS) and push past the page. */
  body.mode-mcs #appMCS .sheet {
    box-shadow: none !important; border: none !important;
    page-break-after: always !important; page-break-inside: avoid !important;
    width: 198mm !important; height: 285mm !important; min-height: 0 !important; max-height: 285mm !important;
    margin: 6mm auto 0 !important;
    padding: 0 !important; /* margin is handled by the sheet box itself: 4mm even on all sides */
    box-sizing: border-box !important; overflow: hidden !important; display: flex !important;
  }

  /* In print, stretch each column's tables with flexbox instead of height:100%.
     With height:100% every group table in a multi-group column claimed the FULL
     column height, overflowing the sheet and leaving the last row flush against
     the bottom paper edge (clipped by printers). Flex-grow makes the tables share
     exactly the column height — page stays filled, bottom margin guaranteed. */
  body.mode-mcs #appMCS .cols > div { display: flex !important; flex-direction: column !important; }
  body.mode-mcs #appMCS .cols > div > table { flex: 1 1 auto !important; height: auto !important; min-height: 0 !important; }
  body.mode-mcs #appMCS .cols > div > .sp { flex: none !important; }

  body.mode-mcs #appMCS .sheet:last-child { page-break-after: auto !important; }

  /* Landside EY/OAL sheets are single tables that can exceed one page.
     Let them size to content and FLOW onto further pages instead of being
     capped to one sheet (which left a blank 2nd page). */
  body.mode-mcs #appMCS .sheet.oal-sheet,
  body.mode-mcs #appMCS .sheet.ey-sheet {
    width: 100% !important; max-width: 100% !important;
    height: auto !important; min-height: 0 !important; max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 auto !important;             /* per-page inset comes from @page (set in printEY/printOAL) */
    box-sizing: border-box !important; display: block !important;
    box-shadow: none !important; border: none !important;
    page-break-inside: auto !important; page-break-after: auto !important;
  }
  /* repeat the column header on every printed page, and never split a row */
  body.mode-mcs #appMCS table.ey-table thead,
  body.mode-mcs #appMCS table.oal-table thead { display: table-header-group !important; }
  body.mode-mcs #appMCS table.ey-table tr,
  body.mode-mcs #appMCS table.oal-table tr {
    page-break-inside: avoid !important; break-inside: avoid !important;
  }

  body.mode-td #appMCS { display: none !important; }
  body.mode-td #appTD { background: white !important; color: #000 !important; padding: 0; margin: 0 !important; }
  body.mode-td #appTD .td-header, body.mode-td #appTD .td-switcher, body.mode-td #appTD .td-panel-intro,
  body.mode-td #appTD .td-form-row, body.mode-td #appTD .td-form-group, body.mode-td #appTD .td-toolbar,
  body.mode-td #appTD .td-table-header, body.mode-td #appTD .gate-ocr-card,
  body.mode-td #appTD .gate-drop, body.mode-td #appTD .gate-preview, body.mode-td #appTD .gate-manual,
  body.mode-td #appTD .gate-hint, body.mode-td #appTD .help-text { display: none !important; }

  body.mode-td #appTD .td-container { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  body.mode-td #appTD .td-panel { background: white !important; border: none !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; }
  body.mode-td #appTD .td-table-section { border: none !important; box-shadow: none !important; background: white !important; display: block !important; margin: 0 !important; padding: 0 !important; }

  body.mode-td #appTD .td-table-wrap {
  max-height: none !important; overflow: hidden !important; width: 210mm !important;
  padding: 2mm 2mm !important; /* Reduced padding to maximize space */
  margin: 0 auto !important; box-shadow: none !important; border: none !important; box-sizing: border-box !important;
}

  body.mode-td #appTD table { width: 100% !important; font-size: 10pt !important; color: #000 !important; }
  body.mode-td #appTD td { padding: 4px 5px !important; border: 1px solid #555 !important; color: #000 !important; }
  body.mode-td #appTD th { padding: 4px 5px !important; border: 1px solid #555 !important; color: #fff !important; }
  body.mode-td #appTD .cs-table { table-layout: fixed !important; width: 100% !important; margin: 0 auto !important; box-sizing: border-box !important; border-collapse: collapse !important; }
  body.mode-td #appTD .cs-table th:nth-child(1) { width: 5.4% !important; }
  body.mode-td #appTD .cs-table th:nth-child(2) { width: 5.2% !important; }
  body.mode-td #appTD .cs-table th:nth-child(3) { width: 4.7% !important; }
  body.mode-td #appTD .cs-table th:nth-child(4) { width: 6.2% !important; }
  body.mode-td #appTD .cs-table th:nth-child(5) { width: 3.9% !important; }
  body.mode-td #appTD .cs-table th:nth-child(6) { width: 3.4% !important; }
  body.mode-td #appTD .cs-table th:nth-child(7) { width: 3.9% !important; }
  body.mode-td #appTD .cs-table th:nth-child(8) { width: 5.4% !important; }
  body.mode-td #appTD .cs-table th:nth-child(9) { width: 4.7% !important; }
  body.mode-td #appTD .cs-table th:nth-child(10) { width: 4.7% !important; }
  body.mode-td #appTD .cs-table th:nth-child(11) { width: 8.3% !important; }
  body.mode-td #appTD .cs-table th:nth-child(12) { width: 13.2% !important; }
  body.mode-td #appTD .cs-table th:nth-child(13) { width: 3.9% !important; }
  body.mode-td #appTD .cs-table th:nth-child(14) { width: 27.1% !important; }
  body.mode-td #appTD .cs-table th, body.mode-td #appTD .cs-table td { white-space: nowrap !important; word-break: normal !important; overflow-wrap: normal !important; font-size: 7.5pt !important; padding: 2px 2px !important; overflow: hidden !important; }
  body.mode-td #appTD .cs-table th.cs-narrow { white-space: normal !important; }
  body.mode-td #appTD .cs-table .cs-subtotal td { white-space: normal !important; }
  body.mode-td #appTD .cs-table td.cs-cnx-low, body.mode-td #appTD .cs-table td.cs-dcode { color: #c0392b !important; font-weight: 800 !important; }
  body.mode-td #appTD .cs-table .cs-x { color: #c0392b !important; font-weight: 800 !important; }
}

/* ---------- responsive: collapse sidebar on narrow screens ---------- */
@media (max-width: 900px) {
  #sidebar { width: 72px; padding: 16px 8px; }
  #sidebar .sb-brand-name, #sidebar .sb-brand-sub, #sidebar .sb-label,
  #sidebar .sb-item .sb-txt, #sidebar .sb-lock, #sidebar .sb-user-info, #sidebar .sb-theme .th-txt { display: none; }
  #sidebar .sb-brand { justify-content: center; padding-bottom: 14px; }
  #sidebar .sb-item { justify-content: center; padding: 10px; }
  #sidebar .sb-item .ico { width: auto; font-size: 17px; }
  #appMCS, #appTD, #appOV, #appAdmin { margin-left: 72px; padding: 20px 16px 60px; }
  #appOV .ov-stats, #appOV .ov-grid { grid-template-columns: 1fr; }
}

/* disabled state inside More Options menus */
.more-menu button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--faint);
}
.more-menu button:disabled:hover {
  background: none;
  color: var(--faint);
}

/* Gates MCS — Aircraft Type column toggle (Piers page only) */
#appMCS .mcs-type-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; padding: 0 4px; user-select: none; white-space: nowrap; }
#appMCS .mcs-type-toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; }
#appMCS .mcs-type-toggle:hover { color: var(--accent-text); }

/* Toggle tiles (Exclusions / Manual Paste) — open state indicator */
#appMCS .btn-secondary.tile-open { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }


/* Overview expandable stat tiles */
#appOV .ov-stat.ov-click { cursor: pointer; transition: border-color .15s; }
#appOV .ov-stat.ov-click:hover { border-color: var(--border-strong); }
#appOV .ov-stat.ov-click.open { border-color: var(--accent); }
#appOV .ov-detail { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
#appOV .ov-det-title { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; color: var(--faint); text-transform: uppercase; margin-bottom: 6px; }
#appOV .ov-det-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12.5px; color: var(--text-2); }
#appOV .ov-det-dim { color: var(--faint); font-weight: 400; }

/* ---------- MCS simplified main tiles + More Options menu ---------- */
#appMCS .mcs-main-tiles { align-items: stretch; }
#appMCS .mcs-main-tiles .form-group { flex: 1 1 0; min-width: 200px; }
#appMCS .mcs-main-tiles .dropzone { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
#appMCS .ho-tile { border-color: rgba(245,166,35,.45); }
#appMCS .ho-tile:hover { border-color: var(--amber); }
#appMCS .ho-tile h3 { color: var(--amber); }
#appMCS .ho-tile .ho-chev { font-size: 12px; margin-left: 4px; }
.more-wrap { position: relative; }
.more-menu { position: absolute; bottom: calc(100% + 8px); right: 0; min-width: 220px; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-modal); z-index: 60; }
.more-menu button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text-2); padding: 10px 12px; font-size: 13px; font-weight: 600; border-radius: 8px; cursor: pointer; font-family: inherit; }
.more-menu button:hover { background: var(--accent-soft); color: var(--accent-text); }
.more-menu button.tile-open { color: var(--accent-text); }
.more-menu button.more-danger { color: var(--red-text); }
.more-menu button.more-danger:hover { background: var(--red-soft); color: var(--red-text); }
.more-menu .menu-sep { height: 1px; background: var(--border); margin: 4px 8px; }
/* Table-header More Options menus sit at the TOP of an overflow:hidden table
   section. Opening upward gets clipped behind the form/data box above them, so
   these specific menus open downward. (Top-bar menus elsewhere still open up.) */
#appTD .td-table-header .more-menu { top: calc(100% + 8px); bottom: auto; z-index: 200; }


/* ========== OCM REPORT (Admin Only) ========== */
.ocm-pub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.ocm-pub-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.ocm-pub-card label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); }
.ocm-pub-card input { width: 100%; padding: 10px 12px; font-size: 15px; font-weight: 800; background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.ocm-pub-card input:focus { outline: none; border-color: var(--gold); }
.ocm-pub-unit { font-size: 11px; color: var(--muted); font-weight: 600; }

.ocm-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.ocm-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin: 0 0 10px; }
.ocm-list-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; min-height: 80px; max-height: 200px; overflow-y: auto; }
.ocm-grid-list { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; font-size: 12px; align-items: center; }
.ocm-grid-list .ocm-dest { font-weight: 700; color: var(--text); text-transform: uppercase; }
.ocm-grid-list .ocm-num { font-weight: 800; color: var(--red-text); text-align: right; }
.ocm-grid-list .ocm-num.ocm-amber { color: var(--amber); }
.ocm-grid-list .ocm-del { background: none; border: none; color: var(--red-text); cursor: pointer; font-size: 12px; padding: 0 2px; }
.ocm-grid-list .ocm-del:hover { color: var(--text); }

.ocm-add-row { display: flex; gap: 8px; margin-top: 10px; }
.ocm-add-row input { flex: 1; padding: 9px 12px; font-size: 13px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; text-transform: uppercase; }
.ocm-add-row input:focus { outline: none; border-color: var(--blue); }
.ocm-add-row input[type="number"] { flex: 0 0 80px; text-transform: none; }

.ocm-actual-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.ocm-actual-box h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent-text); margin: 0 0 12px; }
.ocm-breakdown { margin-bottom: 12px; }
.ocm-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-3); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; font-size: 12px; color: var(--text-2); }
.ocm-chip b { color: var(--gold); font-weight: 800; text-transform: uppercase; }
.ocm-actual-total { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: 0.3px; }
.ocm-actual-total span { color: var(--gold); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 22px; }

/* OCM v2 — flight breakdown, visas, resources, email preview */
.ocm-admin-badge { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--panel-3); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; vertical-align: middle; letter-spacing: 0.4px; }
.ocm-h4-note { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 10px; margin-left: 6px; }
.ocm-grid-flt { grid-template-columns: auto auto 1fr; }
.ocm-grid-2 { grid-template-columns: 1fr auto; }
.ocm-col { min-width: 0; }
.ocm-list-box { min-width: 0; overflow-x: hidden; }
.ocm-add-row { flex-wrap: wrap; }
.ocm-add-row input { min-width: 0; }
.ocm-add-row input[type="number"] { flex: 0 0 70px; }

/* Departure Manifest (admin) */
.dm-group-head td { background: var(--panel-3); font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--gold); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.dm-prem td { color: #EF4444 !important; font-weight: 700; }
.dm-prem-tag { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 800; letter-spacing: 0.6px; color: #fff; background: #DC2626; border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
/* DM summary tiles: 7 tiles in one row */
#appTD #dmSummaryBar .cs-stat { min-width: 0; padding: 8px 8px; }
#appTD #dmSummaryBar .cs-stat .n { font-size: 15pt; }
#appTD #dmSummaryBar .cs-stat .l { font-size: 7.5pt; letter-spacing: 0.4px; }
.dm-local-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.6px; color: var(--amber); border: 1px solid var(--amber); border-radius: 4px; padding: 1px 6px; }
.dm-status-visa { color: var(--red-text); font-weight: 800; }
.dm-status-staff { color: var(--muted); font-weight: 700; }
.dm-status-transit, .dm-status-local { color: var(--accent-text); font-weight: 700; }
@media print {
  .dm-prem td { color: #DC2626 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dm-prem-tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Departure Manifest: fit exactly A4 portrait like the other TD modules */
  body.mode-td #appTD #dmTable { table-layout: fixed !important; width: 100% !important; margin: 0 auto !important; box-sizing: border-box !important; border-collapse: collapse !important; }
  body.mode-td #appTD #dmTable th:nth-child(1) { width: 4% !important; }  /* S.NO */
  body.mode-td #appTD #dmTable th:nth-child(2) { width: 42% !important; } /* NAME — all remaining margin */
  body.mode-td #appTD #dmTable th:nth-child(3) { width: 5% !important; }  /* CLASS */
  body.mode-td #appTD #dmTable th:nth-child(4) { width: 6% !important; }  /* IB — fits 4 chars */
  body.mode-td #appTD #dmTable th:nth-child(5) { width: 8% !important; }  /* IB FLT NO */
  body.mode-td #appTD #dmTable th:nth-child(6) { width: 7% !important; }  /* ARR TIME — fits 6 chars */
  body.mode-td #appTD #dmTable th:nth-child(7) { width: 6% !important; }  /* NAT — fits 4 chars */
  body.mode-td #appTD #dmTable th:nth-child(8) { width: 12% !important; } /* PPT NO — adjusts to passport no */
  body.mode-td #appTD #dmTable th:nth-child(9) { width: 10% !important; } /* STATUS */
  body.mode-td #appTD #dmTable th, body.mode-td #appTD #dmTable td { white-space: nowrap !important; word-break: normal !important; overflow-wrap: normal !important; overflow: hidden !important; font-size: 8pt !important; padding: 2px 3px !important; }
  body.mode-td #appTD #dmTable .dm-group-head td { white-space: normal !important; }
  body.mode-td #appTD #dmTable .dm-prem-tag { font-size: 6.5pt !important; padding: 1px 4px !important; }
  body.mode-td #appTD #dmTable .dm-local-tag { font-size: 7pt !important; padding: 0 4px !important; }
}
.ocm-grid-list .ocm-flts { color: var(--muted); font-size: 11px; text-align: right; }
.ocm-pub-card input[readonly] { opacity: 0.9; cursor: default; border-style: dashed; }
.ocm-inline-row { display: flex; align-items: center; gap: 10px; }
.ocm-inline-row input[type="number"] { width: 110px; padding: 9px 12px; font-size: 14px; font-weight: 800; background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.ocm-inline-row input:focus { outline: none; border-color: var(--gold); }
.ocm-res-grid { display: grid; gap: 10px; }
.ocm-res-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ocm-res-item input[type="number"] { width: 80px; padding: 8px 10px; font-size: 13px; font-weight: 800; background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.ocm-res-item input[type="text"] { flex: 1; min-width: 140px; padding: 8px 10px; font-size: 12px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.ocm-res-item input:focus { outline: none; border-color: var(--gold); }
.ocm-email-box { margin-top: 20px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.ocm-email-box h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent-text); }
.ocm-email-preview { background: #ffffff; color: #000000; border-radius: 8px; padding: 16px 18px; font-size: 13px; line-height: 1.55; min-height: 120px; }

@media (max-width: 900px) {
  .ocm-pub-grid { grid-template-columns: 1fr; }
  .ocm-body-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PREMIUM LAYER — gold-on-midnight identity (additive)
   Sits on top of the token swap above. No structural CSS is
   changed; this only elevates the chrome, marks and accents.
   ============================================================ */

/* ambient aurora behind the whole app */
body::before{
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(640px 420px at 8% -12%, var(--accent-soft), transparent 70%),
    radial-gradient(560px 380px at 92% -8%, rgba(120,170,255,.10), transparent 72%);
}

/* distinctive display type for headings */
.login-card h2, .sb-brand-name, .panel-intro h2, .td-panel-intro h2,
.ov-head h1, .ov-container h1, .modal-head h2{
  font-family:'Space Grotesk','Inter',sans-serif; letter-spacing:-.015em;
}

/* gold crest + brand marks */
.login-logo, .sb-brand-mark{
  background:linear-gradient(145deg,var(--gold),var(--accent)) !important;
  border:none !important; color:#1a1206 !important;
  box-shadow:0 8px 22px rgba(201,154,58,.35);
}
.sb-avatar{
  background:linear-gradient(145deg,var(--gold),var(--accent)) !important;
  color:#1a1206 !important;
}

/* premium gold primary buttons — dark text for real contrast */
#appMCS .btn-primary, .modal-card .btn-primary, .btn-primary,
.td-btn-primary, .login-btn{
  background:linear-gradient(145deg,var(--gold),var(--accent)) !important;
  color:#1a1206 !important; border:none !important;
  box-shadow:0 8px 20px rgba(201,154,58,.28);
}
#appMCS .btn-primary:hover, .modal-card .btn-primary:hover, .btn-primary:hover,
.td-btn-primary:hover, .login-btn:hover{
  filter:brightness(1.05); transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(201,154,58,.42) !important;
}

/* active sidebar item — soft gold glow */
.sb-item.active{
  box-shadow:0 0 0 1px rgba(230,197,131,.35), 0 8px 24px rgba(230,197,131,.12);
}

/* light-catching gradient edges on key cards */
.login-card, .modal-card, #appMCS .workflow-panel{
  background:linear-gradient(var(--panel),var(--panel)) padding-box,
             linear-gradient(150deg,rgba(255,255,255,.14),rgba(255,255,255,.02) 46%) border-box !important;
  border:1px solid transparent !important;
}
body.theme-light .login-card, body.theme-light .modal-card,
body.theme-light #appMCS .workflow-panel{
  background:linear-gradient(var(--panel),var(--panel)) padding-box,
             linear-gradient(150deg,rgba(0,0,0,.09),rgba(0,0,0,.01) 46%) border-box !important;
}

/* consistent gold focus ring */
input:focus, textarea:focus, select:focus{ box-shadow:0 0 0 3px var(--input-focus); }

/* ---- SVG nav icons + hover / selection glow ---- */
.sb-item .ico{ display:flex; align-items:center; justify-content:center; }
.sb-item .ico svg{ width:17px; height:17px; }
.td-switch-btn svg, .switch-btn svg{ width:15px; height:15px; vertical-align:-3px; margin-right:6px; }

.sb-item{ transition:all .18s, box-shadow .18s; }
.sb-item:hover{ box-shadow:0 0 0 1px rgba(230,197,131,.20), 0 6px 18px rgba(230,197,131,.10); }
.sb-item.active{ box-shadow:0 0 0 1px rgba(230,197,131,.42), 0 10px 28px rgba(230,197,131,.20); }
.td-switch-btn.active{ box-shadow:0 6px 22px rgba(230,197,131,.18); }
body.theme-light .sb-item:hover{ box-shadow:0 0 0 1px rgba(37,99,235,.22), 0 6px 16px rgba(37,99,235,.10); }
body.theme-light .sb-item.active{ box-shadow:0 0 0 1px rgba(37,99,235,.40), 0 8px 22px rgba(37,99,235,.16); }

/* ---- darker panels: borders catch light on hover ---- */
#appMCS .workflow-panel, .modal-card, .pf-card, .gate-ocr-card,
.td-table-section, #appMCS .dropzone{
  transition:border-color .2s ease, box-shadow .2s ease, background-color .25s ease;
}
/* plain-border cards -> brighten border + soft gold glow */
.pf-card:hover, .gate-ocr-card:hover, .td-table-section:hover, #appMCS .dropzone:hover{
  border-color:rgba(230,197,131,.45) !important;
  box-shadow:0 0 0 1px rgba(230,197,131,.20), 0 16px 44px rgba(0,0,0,.55);
}
/* gradient-edge cards -> edge lights up to gold */
#appMCS .workflow-panel:hover, .modal-card:hover{
  background:linear-gradient(var(--panel),var(--panel)) padding-box,
             linear-gradient(150deg, rgba(230,197,131,.55), rgba(230,197,131,.08) 55%) border-box !important;
  box-shadow:0 0 0 1px rgba(230,197,131,.14), 0 18px 52px rgba(0,0,0,.6);
}

/* light theme parity */
body.theme-light .pf-card:hover, body.theme-light .gate-ocr-card:hover,
body.theme-light .td-table-section:hover, body.theme-light #appMCS .dropzone:hover,
body.theme-light .ov-card:hover, body.theme-light .ov-stat:hover {
  border-color: rgba(37, 99, 235, 0.35) !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 12px 32px rgba(37, 99, 235, 0.08);
  background-color: #ffffff;
}

body.theme-light #appMCS .workflow-panel:hover, body.theme-light .modal-card:hover {
  background: #ffffff !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12), 0 16px 40px rgba(37, 99, 235, 0.10) !important;
}

/* ---- Connection Summary: More Options toggle tile ---- */
.cs-more-toggle{
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:13px 16px; border-radius:12px; cursor:pointer;
  background:var(--panel-2); border:1px solid var(--border); color:var(--amber);
  font-family:inherit; font-size:14px; font-weight:700; transition:border-color .18s, box-shadow .18s, color .18s;
}
.cs-more-toggle:hover{ border-color:rgba(230,197,131,.45); box-shadow:0 0 0 1px rgba(230,197,131,.18); color:var(--gold); }
.cs-more-chev{ transition:transform .2s ease; color:var(--muted); font-size:12px; }
body.theme-light .cs-more-toggle:hover{ border-color:rgba(37,99,235,.45); box-shadow:0 0 0 1px rgba(37,99,235,.18); }


/* ---- AZE shield logo (replaces the text mark) + theme glow ---- */
:root{ --aze-logo:url("aze-logo.jpg"); }
.login-logo, .sb-brand-mark{
  background:#0a0c13 var(--aze-logo) center/cover no-repeat !important;
  border:1px solid rgba(230,197,131,.5) !important;
  color:transparent !important; font-size:0 !important;
  box-shadow:0 0 0 1px rgba(230,197,131,.28), 0 6px 22px rgba(230,197,131,.30), 0 0 26px rgba(230,197,131,.16) !important;
}
.login-logo{ box-shadow:0 0 0 1px rgba(230,197,131,.3), 0 8px 28px rgba(230,197,131,.34), 0 0 34px rgba(230,197,131,.20) !important; }

/* ---- pier breakdown tile: theme glow + big bold TOTAL ---- */
#appMCS .ghead-tile{ max-width:72%; font-size:0.68em; padding:0 4px; }
@media screen{
  #appMCS .ghead-tile{
    border-color:rgba(230,197,131,.6);
    box-shadow:0 0 0 1px rgba(230,197,131,.25), 0 0 12px rgba(230,197,131,.4);
  }
}
#appMCS .ghead-total{ font-size:1em; font-weight:900; line-height:1; vertical-align:middle; margin-right:5px; }

/* ============================================================
   MOBILE — top bar + swipeable module switcher (no drawer)
   ============================================================ */
#mobileBar, #mobileModules{ display:none; }

@media (max-width:900px){
  /* desktop sidebar is replaced by the switcher on mobile */
  #sidebar{ display:none !important; }

  /* top app bar: logo + theme + account (login overlay hides it pre-login) */
  #mobileBar{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    position:fixed; top:0; left:0; right:0; height:56px; z-index:9600; padding:0 14px;
    background:color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter:blur(14px) saturate(1.3); border-bottom:1px solid var(--border);
  }
  .mb-brand{ display:flex; align-items:center; gap:10px; font-family:'Space Grotesk',sans-serif; font-weight:600; font-size:16px; letter-spacing:-.01em; }
  .mb-mark{ width:30px; height:30px; border-radius:9px; flex:0 0 auto;
    background:#0a0c13 var(--aze-logo) center/cover no-repeat;
    box-shadow:0 0 0 1px rgba(230,197,131,.3), 0 0 14px rgba(230,197,131,.28); }
  .mb-actions{ display:flex; align-items:center; gap:9px; }
  .mb-ic{ width:38px; height:38px; border-radius:10px; border:1px solid var(--border);
    background:var(--panel); color:var(--muted); display:flex; align-items:center; justify-content:center; }
  .mb-ic:active{ background:var(--panel-2); color:var(--gold); }
  .mb-avatar{ width:38px; height:38px; border-radius:50%; border:none; font-weight:800; font-size:15px; color:#1a1206;
    background:linear-gradient(145deg,var(--gold),var(--accent)); box-shadow:0 4px 12px rgba(201,154,58,.32); }

  /* swipeable module switcher */
  #mobileModules{
    display:flex; gap:8px; align-items:center; position:fixed; top:56px; left:0; right:0; z-index:9590;
    padding:9px 12px; overflow-x:auto; scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch;
    background:color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter:blur(12px); border-bottom:1px solid var(--border);
  }
  #mobileModules{ scrollbar-width:none; }
  #mobileModules::-webkit-scrollbar{ display:none; }
  .mm-pill{ scroll-snap-align:center; flex:0 0 auto; display:inline-flex; align-items:center; gap:7px;
    padding:9px 15px; border-radius:999px; border:1px solid var(--border); background:var(--panel);
    color:var(--muted); font-family:inherit; font-size:13px; font-weight:600; white-space:nowrap; transition:.18s; }
  .mm-pill svg{ width:16px; height:16px; }
  .mm-pill:active{ transform:scale(.97); }
  .mm-pill.active{ background:linear-gradient(145deg,var(--gold),var(--accent)); color:#1a1206; border-color:transparent;
    box-shadow:0 5px 16px rgba(201,154,58,.32); }

  /* content clears both fixed bars, full width, stacked */
  #appMCS, #appTD, #appOV, #appAdmin{ margin-left:0 !important; padding:122px 14px 60px !important; }
  #appMCS .workflow-panel, #appTD .td-panel{ padding:18px 16px !important; }
  #appMCS .app-container, #appTD .td-container{ max-width:100% !important; }
  #appMCS .form-group{ min-width:100% !important; }
  #appMCS .form-row{ gap:12px; }

  /* print-format sheets scroll instead of breaking the layout */
  #sheetWrap{ overflow-x:auto !important; -webkit-overflow-scrolling:touch; }
}

/* ============================================================
   PRINT — never print the mobile top bar / module switcher.
   (During print the page width is A4-sized, which is < 900px,
    so the mobile rules would otherwise activate. This block is
    last in source order, so it wins.)
   ============================================================ */
@media print{
  #mobileBar, #mobileModules{ display:none !important; }
  #appMCS, #appTD, #appOV{ padding:0 !important; margin:0 !important; }
}

/* ============================================================
   BUTTON ICONS + GOLDEN GLOW / HOVER (all modules)
   ============================================================ */
/* gold line icons inside buttons (match the nav icons) */
.bic{ display:inline-block; width:15px; height:15px; vertical-align:-3px; margin-right:6px; }
#appMCS .btn-primary .bic, .td-btn-primary .bic{ margin-right:0; }   /* flex buttons: gap spaces it */
.btn-secondary .bic, .td-btn-secondary .bic, .cs-more-toggle .bic,
#appMCS .switch-btn .bic{
  color:var(--gold); filter:drop-shadow(0 0 3px rgba(230,197,131,.5));
}

/* smooth transitions on every action button */
.btn-primary, .btn-secondary, .td-btn-primary, .td-btn-secondary,
#moreOptsBtn, .more-wrap>.btn-secondary, .excl-btn, .ho-add-btn, .ho-clear-btn,
#appMCS .switch-btn, #appTD .td-switch-btn, .cs-more-toggle{
  transition: border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease, background-color .18s ease, filter .18s ease;
}
/* outline / utility buttons: gold border + glow + lift on hover */
.btn-secondary:hover, .td-btn-secondary:hover, #moreOptsBtn:hover,
.more-wrap>.btn-secondary:hover, .ho-add-btn:hover, .ho-clear-btn:hover{
  border-color:rgba(230,197,131,.55) !important;
  box-shadow:0 0 0 1px rgba(230,197,131,.20), 0 6px 18px rgba(230,197,131,.16) !important;
  color:var(--gold) !important;
  transform:translateY(-1px);
}
/* buttons that already fill on hover: add glow only (keep their colours) */
.excl-btn:hover, #appMCS .switch-btn:hover, #appTD .td-switch-btn:hover{
  box-shadow:0 4px 16px rgba(230,197,131,.24) !important;
}
/* primary buttons: reinforce the gold glow on hover */
#appMCS .btn-primary:hover, .td-btn-primary:hover{
  box-shadow:0 0 0 1px rgba(230,197,131,.28), 0 10px 26px rgba(201,154,58,.42) !important;
  transform:translateY(-1px);
}

/* ============================================================
   LIGHT THEME — white/blue brand marks & glows (gold stays dark-only)
   ============================================================ */
body.theme-light .login-logo, body.theme-light .sb-brand-mark{
  background:#0a0c13 var(--aze-logo) center/cover no-repeat !important;
  color:transparent !important; font-size:0 !important;
  border:1px solid rgba(37,99,235,.45) !important;
  box-shadow:0 8px 22px rgba(37,99,235,.25) !important;
}
body.theme-light .sb-avatar{
  background:linear-gradient(145deg,#3b82f6,#1d4ed8) !important;
  color:#ffffff !important;
}
body.theme-light #appMCS .btn-primary, body.theme-light .modal-card .btn-primary,
body.theme-light .btn-primary, body.theme-light .td-btn-primary, body.theme-light .login-btn{
  background:linear-gradient(145deg,#3b82f6,#1d4ed8) !important;
  color:#ffffff !important;
  box-shadow:0 8px 20px rgba(37,99,235,.26);
}
body.theme-light #appMCS .btn-primary:hover, body.theme-light .modal-card .btn-primary:hover,
body.theme-light .btn-primary:hover, body.theme-light .td-btn-primary:hover, body.theme-light .login-btn:hover{
  box-shadow:0 12px 28px rgba(37,99,235,.38) !important;
}
body.theme-light .btn-generate{ box-shadow:0 4px 18px rgba(37,99,235,.20); }
body.theme-light .btn-secondary .bic, body.theme-light .td-btn-secondary .bic,
body.theme-light .cs-more-toggle .bic, body.theme-light #appMCS .switch-btn .bic{
  color:var(--blue); filter:drop-shadow(0 0 3px rgba(37,99,235,.30));
}
body.theme-light .btn-secondary:hover, body.theme-light .td-btn-secondary:hover,
body.theme-light #moreOptsBtn:hover, body.theme-light .more-wrap>.btn-secondary:hover,
body.theme-light .ho-add-btn:hover, body.theme-light .ho-clear-btn:hover{
  border-color:rgba(37,99,235,.45) !important;
  box-shadow:0 0 0 1px rgba(37,99,235,.16), 0 6px 18px rgba(37,99,235,.12) !important;
}
body.theme-light .excl-btn:hover, body.theme-light #appMCS .switch-btn:hover,
body.theme-light #appTD .td-switch-btn:hover{
  box-shadow:0 4px 16px rgba(37,99,235,.18) !important;
}
body.theme-light #appMCS .btn-primary:hover, body.theme-light .td-btn-primary:hover{
  box-shadow:0 0 0 1px rgba(37,99,235,.25), 0 10px 26px rgba(37,99,235,.36) !important;
}
body.theme-light .mm-pill.active{
  background:linear-gradient(145deg,#3b82f6,#1d4ed8); color:#ffffff; border-color:transparent;
  box-shadow:0 5px 16px rgba(37,99,235,.28);
}
body.theme-light .mb-avatar{
  background:linear-gradient(145deg,#3b82f6,#1d4ed8); color:#ffffff;
  box-shadow:0 4px 12px rgba(37,99,235,.28);
}
body.theme-light .mb-mark{
  box-shadow:0 0 0 1px rgba(37,99,235,.25), 0 0 14px rgba(37,99,235,.20);
}

/* Connection Summary — Report Issue button stays red (inside More Options tile) */
.cs-report{ color:var(--red-text) !important; }
.cs-report:hover{
  color:var(--red-text) !important; border-color:var(--red-border) !important;
  box-shadow:0 0 0 1px rgba(255,130,114,.2), 0 6px 16px rgba(255,130,114,.18) !important;
}




/* ===== OCM Report — admin-only, clearly separated from the Connection Summary ===== */
.ocm-enable-bar{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:22px; padding:12px 16px; border:1px dashed var(--gold); border-radius:12px; background:var(--panel-2); }
.ocm-enable-left{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.ocm-enable-left strong{ display:flex; align-items:center; gap:6px; color:var(--gold); font-size:13px; letter-spacing:.3px; }
.ocm-enable-sub{ font-size:11px; color:var(--muted); }
.ocm-switch{ display:inline-flex; align-items:center; gap:8px; font-size:12px; font-weight:800; color:var(--text); cursor:pointer; white-space:nowrap; }
.ocm-switch input{ width:16px; height:16px; accent-color:var(--gold); cursor:pointer; }
.ocm-section{ margin-top:12px; background:var(--panel); border:1.5px solid var(--gold); border-radius:14px; padding:24px; }
.ocm-section .ocm-section-head{ margin:-24px -24px 18px; padding:14px 24px; background:var(--panel-2); border-bottom:2px solid var(--gold); border-radius:12px 12px 0 0; }

/* OCM enable toggle button (admin-only) */
.ocm-enable-btn{ margin-top:22px; display:inline-flex; align-items:center; gap:8px; }
#appTD .ocm-enable-btn.active{ border-color:var(--gold) !important; color:var(--gold); }

/* OAL Landside — amend rows panel */
.oal-amend-box{ margin-top:14px; background:var(--panel); border:1px solid var(--border); border-radius:14px; padding:16px 18px; }
.oal-amend-title{ font-size:11px; font-weight:700; letter-spacing:.4px; color:var(--muted); margin-bottom:12px; }
.oal-amend-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.oal-amend-box input{ width:100%; padding:9px 11px; background:var(--panel-2); border:1.5px solid var(--border); border-radius:8px; color:var(--text); font-family:inherit; font-size:13px; text-transform:uppercase; }
.oal-amend-box input::placeholder{ text-transform:none; }
.oal-amend-box input:focus{ outline:none; border-color:var(--gold); }
.oal-amend-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.oal-amend-status{ font-size:12px; color:var(--muted); margin-top:8px; min-height:16px; }
@media (max-width:640px){ .oal-amend-grid{ grid-template-columns:repeat(2,1fr); } }


/* ============================================================
   CONCEPT B — "CLEAN COMMAND" (2026-09-16)
   One toolbar per module, unified ⋯ menu, hero dropzone with
   file chips, options box with live badge, sidebar-only nav.
   ============================================================ */
.pi-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }

/* primary action promoted above the secondary noise */
.btn-generate { padding: 12px 22px; font-size: 14px; box-shadow: 0 4px 18px rgba(201,154,58,.22); }

/* one right-hand action cluster, identical in every module */
.uni-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-ico {
  appearance: none; background: var(--panel-3); color: var(--text-2);
  border: 1px solid var(--border-strong); width: 34px; height: 34px; border-radius: 9px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s; flex: none;
}
.btn-ico:hover { color: var(--accent-text); border-color: var(--accent); }
.btn-ico svg { width: 15px; height: 15px; }
.btn-more { min-width: 36px; justify-content: center; font-weight: 800; letter-spacing: 1px; }

/* unified floating ⋯ menu (single instance, repositioned per open) */
.uni-menu {
  position: fixed; z-index: 9990; min-width: 230px; display: none;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-modal); padding: 5px;
}
.uni-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font: 600 12.5px 'Inter', sans-serif;
  cursor: pointer; transition: background .12s, color .12s;
}
.uni-menu button:hover { background: var(--panel-3); color: var(--text); }
.uni-menu .more-danger { color: var(--red-text); }
.uni-menu .more-danger:hover { background: var(--red-soft); }
.uni-menu .menu-sep { height: 1px; background: var(--border); margin: 5px 8px; }

/* OAL status is rendered as a chip now — keep the legacy badge hidden */
#fileStatus.file-badge { display: none !important; }

/* airside Excel/PDF status text is shown as a chip — never as a raw line
   (module 03 forces display:inline-block inline; !important wins) */
.aocc-status { display: none !important; }

/* tucked-away CS gate/EML panel hide link */
.cs-hide-link {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font: 600 11px 'Inter', sans-serif; letter-spacing: .4px;
  padding: 2px 4px; border-radius: 6px; transition: color .12s;
}
.cs-hide-link:hover { color: var(--text); }

/* hero dropzone — both AOCC files land in one big target */
.hero-drop {
  margin: 12px 0 4px; background: var(--panel); border: 1.5px dashed var(--border-strong);
  border-radius: 12px; padding: 16px 20px; cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.hero-drop:hover, .hero-drop.over { border-color: var(--accent); background: var(--panel-3); }
.hero-drop .hd-ico { width: 18px; height: 18px; color: var(--accent-text); flex-shrink: 0; }
.hero-drop h3 { margin: 0; font-size: 13.5px; font-family: 'Inter', sans-serif; font-weight: 700; color: var(--text); }
.hero-drop .hd-browse { font-size: 13px; font-weight: 700; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* upload tile, then handover tile stacked below it */
.airside-top { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 4px; }
.airside-col { min-width: 0; }
.airside-top .hero-drop { margin-top: 0; }
.ho-tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; box-sizing: border-box;
}
.ho-tile .ho-head { margin-bottom: 10px; align-items: center; }
.ho-tile .ho-add-btn { margin-top: 4px; }

/* loaded files become proof chips */
.file-chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 2px; min-height: 4px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--panel-3);
  border: 1px solid rgba(95,191,143,.4); border-radius: 9px; padding: 7px 12px; font-size: 11.5px;
}
.file-chip svg { width: 13px; height: 13px; color: var(--green); flex: none; }
.file-chip b { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.file-chip span { color: var(--muted); font-size: 10.5px; }

/* options box — exclusions / paste / handover under one roof */
.opts-box { margin: 14px 0 4px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); overflow: hidden; }
.opts-row + .opts-row { border-top: 1px solid var(--border); }
.opts-head {
  display: flex; align-items: center; gap: 9px; width: 100%; background: transparent; border: 0;
  color: var(--text); font: 600 12.5px 'Inter', sans-serif; padding: 12px 14px; cursor: pointer; text-align: left;
}
.opts-head:hover { background: var(--panel-3); }
.opts-head .opts-count { margin-left: auto; font: 500 10px 'JetBrains Mono', monospace; color: var(--muted); }
.opts-head .chev { color: var(--faint); font-size: 11px; }
.opts-head .chev.tile-open { display: inline-block; transform: rotate(180deg); }
.opts-body { padding: 2px 14px 14px; }
.opts-body textarea { width: 100%; }

/* live count badge on the ⚙ Options button */
.badge-n { font: 800 9.5px 'Inter', sans-serif; background: var(--amber); color: #000; border-radius: 99px; padding: 1.5px 6.5px; margin-left: 6px; }
#airsideOptsBtn.open { border-color: var(--accent); color: var(--accent-text); }

/* handover panel keeps its own rhythm inside the options box */
.opts-body .ho-head { margin-top: 2px; }

@media (max-width: 720px) {
  .hero-drop { padding: 22px 14px; }
  .btn-generate { padding: 11px 16px; font-size: 13px; }
}
/* ============================================================
   PRINT BUTTON — promoted, accent-filled, consistent across
   every module toolbar (both .uni-actions and .td-toolbar).
   Purely presentational: primary actions (Process/Clear) keep
   the lead; the print button leads the ICON cluster (next to
   Colors) via flex order; the theme accent makes it the obvious
   tool (gold in dark, blue in light). No markup/handler changes;
   print output itself is unaffected.
   ============================================================ */
.uni-actions .td-btn-primary,
.uni-actions .td-btn-secondary:not(.btn-more),
.td-toolbar .td-btn-primary,
.td-toolbar .td-btn-secondary:not(.btn-more) { order: -2; }   /* keep primaries ahead of print */

.uni-actions .btn-ico[title^="Print"],
.td-toolbar .btn-ico[title^="Print"] {
  order: -1;                        /* lead the icon cluster, next to Colors */
  width: 38px; height: 38px;         /* a little bigger than the 34px icon buttons */
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.uni-actions .btn-ico[title^="Print"] svg,
.td-toolbar .btn-ico[title^="Print"] svg { width: 17px; height: 17px; }
.uni-actions .btn-ico[title^="Print"]:hover,
.td-toolbar .btn-ico[title^="Print"]:hover {
  filter: brightness(1.07);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
