/* ============================================================
   Thai Lion Air Ground Operations TQM & CRM System
   Global Stylesheet — Dark Theme with Red Airline Accent
   Version 1.0 | Thai Lion Air Ground Operations DMK
   ============================================================ */

:root {
  color-scheme: dark;
  --bg-primary:   #07090f;
  --bg-secondary: #0d1117;
  --bg-card:      #161b27;
  --bg-card-alt:  #1c2333;
  --bg-hover:     #252d3d;
  --bg-input:     #0d1117;
  --red:          #dc2626;
  --red-dark:     #991b1b;
  --red-light:    #ef4444;
  --red-glow:     rgba(220,38,38,0.18);
  --green:        #16a34a;
  --green-light:  #22c55e;
  --green-bg:     rgba(22,163,74,0.12);
  --yellow:       #d97706;
  --yellow-light: #f59e0b;
  --yellow-bg:    rgba(217,119,6,0.12);
  --red-bg:       rgba(220,38,38,0.12);
  --grey:         #4b5563;
  --grey-light:   #9ca3af;
  --blue:         #2563eb;
  --blue-light:   #3b82f6;
  --blue-bg:      rgba(37,99,235,0.12);
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-accent:    #ef4444;
  --border:         #1e2d40;
  --border-accent:  #dc2626;
  --border-subtle:  #1a2235;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.6);
  --shadow-red: 0 0 20px rgba(220,38,38,0.25);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --alert-bar-bg: linear-gradient(90deg,#2d0b0b,#1a0606);
  --login-bg: radial-gradient(ellipse at top,#1a0808 0%,var(--bg-primary) 60%);
  --scrollbar-thumb: #2b3648;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Segoe UI',system-ui,-apple-system,sans-serif;background:var(--bg-primary);color:var(--text-primary);line-height:1.6;min-height:100vh;font-size:15px;-webkit-font-smoothing:antialiased}
a{color:var(--red-light);text-decoration:none}
a:hover{color:var(--red)}
h1{font-size:2rem;font-weight:700;line-height:1.2}
h2{font-size:1.5rem;font-weight:700;line-height:1.3}
h3{font-size:1.2rem;font-weight:600}
h4{font-size:1rem;font-weight:600}

/* UTILITY */
.flex{display:flex}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}
.items-center{align-items:center}.items-start{align-items:flex-start}
.justify-between{justify-content:space-between}.justify-center{justify-content:center}
.gap-1{gap:.5rem}.gap-2{gap:.75rem}.gap-3{gap:1rem}.gap-4{gap:1.5rem}.gap-5{gap:2rem}
.grow{flex-grow:1}.shrink-0{flex-shrink:0}
.grid{display:grid}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.w-full{width:100%}.h-full{height:100%}
.p-1{padding:.5rem}.p-2{padding:.75rem}.p-3{padding:1rem}.p-4{padding:1.5rem}.p-5{padding:2rem}
.mt-2{margin-top:.75rem}.mt-3{margin-top:1rem}.mt-4{margin-top:1.5rem}.mt-5{margin-top:2rem}
.mb-2{margin-bottom:.75rem}.mb-3{margin-bottom:1rem}.mb-4{margin-bottom:1.5rem}
.hidden{display:none!important}
.relative{position:relative}.absolute{position:absolute}.sticky{position:sticky}.top-0{top:0}
.z-10{z-index:10}.z-50{z-index:50}
.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}
.text-center{text-align:center}.text-right{text-align:right}
.text-sm{font-size:.82rem}.text-xs{font-size:.72rem}.text-lg{font-size:1.1rem}
.text-muted{color:var(--text-muted)}.text-sec{color:var(--text-secondary)}
.text-red{color:var(--red-light)}.text-green{color:var(--green-light)}
.text-yellow{color:var(--yellow-light)}.text-blue{color:var(--blue-light)}
.fw-bold{font-weight:700}.fw-600{font-weight:600}.font-mono{font-family:'Courier New',monospace}
.container{width:100%;max-width:1400px;margin:0 auto;padding:0 1rem}
.container-sm{max-width:600px;margin:0 auto;padding:0 1rem}
.container-md{max-width:900px;margin:0 auto;padding:0 1rem}
.span-2{grid-column:span 2}.span-3{grid-column:span 3}
.divider{border:none;border-top:1px solid var(--border);margin:1rem 0}

/* HEADER */
.site-header{background:var(--bg-secondary);border-bottom:2px solid var(--red);padding:.75rem 1.5rem;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100;box-shadow:var(--shadow-md)}
.brand{display:flex;align-items:center;gap:.75rem}
.brand-logo{width:42px;height:42px;background:var(--red);border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.1rem;color:white;letter-spacing:-1px;box-shadow:var(--shadow-red)}
.brand-name{font-size:.9rem;font-weight:700;line-height:1.2}
.brand-sub{font-size:.7rem;color:var(--text-muted);font-weight:400}
.nav-user{display:flex;align-items:center;gap:.75rem}
.role-badge{padding:.2rem .7rem;border-radius:20px;font-size:.72rem;font-weight:700;letter-spacing:.5px;text-transform:uppercase;border:1px solid}
.role-badge.manager{color:var(--red-light);border-color:var(--red);background:var(--red-bg)}
.role-badge.duty-mgr{color:var(--yellow-light);border-color:var(--yellow);background:var(--yellow-bg)}
.role-badge.coordinator{color:var(--blue-light);border-color:var(--blue);background:var(--blue-bg)}
.role-badge.leader{color:var(--green-light);border-color:var(--green);background:var(--green-bg)}

/* LAYOUT */
.app-layout{display:flex;min-height:calc(100vh - 65px)}
.sidebar{width:230px;flex-shrink:0;background:var(--bg-secondary);border-right:1px solid var(--border);padding:1.25rem 0;display:flex;flex-direction:column;gap:.25rem;overflow-y:auto}
.sidebar-section{padding:.5rem 1rem .25rem;font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:1px;color:var(--text-muted);margin-top:.5rem}
.sidebar-item{display:flex;align-items:center;gap:.75rem;padding:.6rem 1.25rem;color:var(--text-secondary);font-size:.88rem;font-weight:500;cursor:pointer;transition:all .15s;border-left:3px solid transparent;text-decoration:none}
.sidebar-item:hover{background:var(--bg-hover);color:var(--text-primary)}
.sidebar-item.active{background:var(--red-bg);color:var(--red-light);border-left-color:var(--red)}
.sidebar-item .icon{font-size:1rem;width:20px;text-align:center}
.sidebar-badge{margin-left:auto;background:var(--red);color:white;font-size:.65rem;font-weight:700;padding:.1rem .4rem;border-radius:10px;min-width:18px;text-align:center}
.main-content{flex:1;padding:1.5rem;overflow-y:auto;overflow-x:hidden}

/* CARDS */
.card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:1.25rem;transition:border-color .2s}
.card:hover{border-color:var(--border-accent)}
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;padding-bottom:.75rem;border-bottom:1px solid var(--border)}
.card-title{font-size:.85rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary);display:flex;align-items:center;gap:.5rem}
.card-title .icon{color:var(--red-light)}
.kpi-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:1.25rem;position:relative;overflow:hidden;transition:transform .15s,border-color .15s}
.kpi-card:hover{transform:translateY(-2px);border-color:var(--red)}
.kpi-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--red)}
.kpi-card.green::before{background:var(--green)}
.kpi-card.yellow::before{background:var(--yellow)}
.kpi-card.blue::before{background:var(--blue)}
.kpi-card.grey::before{background:var(--grey)}
.kpi-label{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted);margin-bottom:.5rem}
.kpi-value{font-size:2.2rem;font-weight:800;line-height:1;color:var(--text-primary)}
.kpi-value.red{color:var(--red-light)}.kpi-value.green{color:var(--green-light)}.kpi-value.yellow{color:var(--yellow-light)}
.kpi-unit{font-size:1rem;font-weight:400;color:var(--text-muted)}
.kpi-sub{font-size:.75rem;color:var(--text-muted);margin-top:.35rem}
.kpi-icon{position:absolute;right:1rem;top:50%;transform:translateY(-50%);font-size:2rem;opacity:.12}

/* BADGES */
.badge{display:inline-flex;align-items:center;gap:.3rem;padding:.2rem .6rem;border-radius:20px;font-size:.72rem;font-weight:700;white-space:nowrap}
.badge-green{background:var(--green-bg);color:var(--green-light);border:1px solid var(--green)}
.badge-yellow{background:var(--yellow-bg);color:var(--yellow-light);border:1px solid var(--yellow)}
.badge-red{background:var(--red-bg);color:var(--red-light);border:1px solid var(--red)}
.badge-grey{background:rgba(75,85,99,.2);color:var(--grey-light);border:1px solid var(--grey)}
.badge-blue{background:var(--blue-bg);color:var(--blue-light);border:1px solid var(--blue)}
.dot{width:7px;height:7px;border-radius:50%;display:inline-block}
.dot-green{background:var(--green-light);box-shadow:0 0 6px var(--green)}
.dot-yellow{background:var(--yellow-light)}
.dot-red{background:var(--red-light);box-shadow:0 0 6px var(--red)}
.dot-grey{background:var(--grey-light)}
@keyframes pulse-red{0%,100%{opacity:1}50%{opacity:.5}}
.pulse{animation:pulse-red 1.8s infinite}

/* ALERTS */
.alert-bar{background:var(--alert-bar-bg);border:1px solid var(--red-dark);border-radius:var(--radius-sm);padding:.6rem 1rem;display:flex;align-items:center;gap:.75rem;font-size:.82rem;color:var(--red-light);margin-bottom:1.25rem}
.alert-item{display:flex;align-items:flex-start;gap:.75rem;padding:.7rem 1rem;border-radius:var(--radius-sm);margin-bottom:.5rem;font-size:.83rem}
.alert-item.critical{background:var(--red-bg);border-left:3px solid var(--red)}
.alert-item.warning{background:var(--yellow-bg);border-left:3px solid var(--yellow)}
.alert-item.info{background:var(--blue-bg);border-left:3px solid var(--blue)}
.alert-item .al-icon{font-size:1rem;margin-top:1px;flex-shrink:0}
.alert-item.critical .al-icon{color:var(--red-light)}
.alert-item.warning .al-icon{color:var(--yellow-light)}
.alert-item.info .al-icon{color:var(--blue-light)}
.alert-time{font-size:.72rem;color:var(--text-muted);margin-top:2px}

/* TABLES */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:.83rem}
thead th{background:var(--bg-card-alt);color:var(--text-muted);font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;padding:.6rem .9rem;text-align:left;white-space:nowrap;border-bottom:1px solid var(--border)}
tbody tr{border-bottom:1px solid var(--border-subtle);transition:background .1s}
tbody tr:hover{background:var(--bg-hover)}
tbody td{padding:.6rem .9rem;color:var(--text-secondary);vertical-align:middle}
tbody td.highlight{color:var(--text-primary);font-weight:600}
tbody tr.row-red{background:rgba(220,38,38,.05)}
tbody tr.row-yellow{background:rgba(217,119,6,.05)}
tbody tr.row-green{background:rgba(22,163,74,.05)}

/* FORMS */
.form-group{margin-bottom:1.1rem}
.form-label{display:block;font-size:.8rem;font-weight:600;color:var(--text-secondary);margin-bottom:.4rem;text-transform:uppercase;letter-spacing:.3px}
.form-label .required{color:var(--red-light);margin-left:3px}
.form-control{width:100%;background:var(--bg-input);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.65rem .9rem;color:var(--text-primary);font-size:.9rem;font-family:inherit;transition:border-color .15s,box-shadow .15s;appearance:none;-webkit-appearance:none}
.form-control:focus{outline:none;border-color:var(--red);box-shadow:0 0 0 3px rgba(220,38,38,.15)}
.form-control::placeholder{color:var(--text-muted)}
select.form-control{cursor:pointer;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M6 8L0 0h12z' fill='%2364748b'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .8rem center;padding-right:2.2rem}
textarea.form-control{resize:vertical;min-height:90px}
.form-control.error{border-color:var(--red)}
.form-error{color:var(--red-light);font-size:.75rem;margin-top:.3rem;display:flex;align-items:center;gap:4px}
.input-group{display:flex;align-items:stretch;gap:0}
.input-group .form-control{border-radius:var(--radius-sm) 0 0 var(--radius-sm)}
.input-group-text{background:var(--bg-card-alt);border:1px solid var(--border);border-left:none;padding:0 .75rem;color:var(--text-muted);font-size:.85rem;display:flex;align-items:center;border-radius:0 var(--radius-sm) var(--radius-sm) 0;white-space:nowrap}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.form-grid-3{grid-template-columns:1fr 1fr 1fr;gap:1rem}
.check-group{display:flex;flex-direction:column;gap:.6rem}
.check-item{display:flex;align-items:center;gap:.75rem;cursor:pointer;padding:.55rem .75rem;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-input);transition:all .15s;font-size:.88rem;color:var(--text-secondary)}
.check-item:hover{border-color:var(--red);background:var(--red-bg)}
.check-item input[type=checkbox],.check-item input[type=radio]{display:none}
.check-box{width:18px;height:18px;border:2px solid var(--grey);border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s}
.check-item.checked .check-box{background:var(--red);border-color:var(--red)}
.check-item.checked .check-box::after{content:'✓';color:white;font-size:12px;font-weight:700}
.check-item.checked{color:var(--text-primary);border-color:var(--red);background:var(--red-bg)}
.severity-selector{display:flex;gap:.5rem}
.severity-btn{flex:1;padding:.65rem;border:2px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-input);color:var(--text-muted);font-size:.8rem;font-weight:700;text-align:center;cursor:pointer;transition:all .15s;text-transform:uppercase;letter-spacing:.5px}
.severity-btn:hover{border-color:var(--grey-light);color:var(--text-primary)}
.severity-btn.minor.active{border-color:var(--yellow);background:var(--yellow-bg);color:var(--yellow-light)}
.severity-btn.major.active{border-color:#f97316;background:rgba(249,115,22,.12);color:#fb923c}
.severity-btn.critical.active{border-color:var(--red);background:var(--red-bg);color:var(--red-light)}
.upload-area{border:2px dashed var(--border);border-radius:var(--radius-md);padding:2rem;text-align:center;cursor:pointer;transition:all .2s;background:var(--bg-input);color:var(--text-muted)}
.upload-area:hover,.upload-area.dragover{border-color:var(--red);background:var(--red-bg);color:var(--red-light)}
.upload-area .upload-icon{font-size:2rem;margin-bottom:.5rem}
.upload-area .upload-text{font-size:.85rem}

/* BUTTONS */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;padding:.7rem 1.5rem;border-radius:var(--radius-sm);font-size:.88rem;font-weight:700;font-family:inherit;cursor:pointer;border:2px solid transparent;transition:all .15s;white-space:nowrap;text-decoration:none;letter-spacing:.3px}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn-primary{background:var(--red);color:white;border-color:var(--red);box-shadow:var(--shadow-sm)}
.btn-primary:hover:not(:disabled){background:var(--red-dark);border-color:var(--red-dark);box-shadow:var(--shadow-red)}
.btn-secondary{background:#f1f5f9;color:#0f172a;border-color:#f1f5f9}
.btn-secondary:hover:not(:disabled){background:#e2e8f0;border-color:#e2e8f0}
#department{border-color:var(--red)}
.btn-outline{background:transparent;color:var(--red-light);border-color:var(--red)}
.btn-outline:hover:not(:disabled){background:var(--red-bg)}
.btn-ghost{background:transparent;color:var(--text-secondary);border-color:var(--border)}
.btn-ghost:hover:not(:disabled){background:var(--bg-hover);color:var(--text-primary)}
.btn-success{background:var(--green);color:white;border-color:var(--green)}
.btn-success:hover:not(:disabled){background:#15803d}
.btn-warning{background:var(--yellow);color:white;border-color:var(--yellow)}
.btn-lg{padding:1rem 2rem;font-size:1rem}
.btn-sm{padding:.4rem .9rem;font-size:.78rem}
.btn-xl{padding:1.1rem 2.5rem;font-size:1.1rem;border-radius:var(--radius-md)}
.btn-block{width:100%}

/* PROGRESS */
.progress-bar{height:8px;background:var(--bg-card-alt);border-radius:20px;overflow:hidden;margin-top:.5rem}
.progress-fill{height:100%;border-radius:20px;transition:width .5s ease;background:var(--green)}
.progress-fill.warning{background:var(--yellow)}
.progress-fill.danger{background:var(--red)}
.score-circle{width:80px;height:80px;border-radius:50%;border:4px solid var(--border);display:flex;align-items:center;justify-content:center;flex-direction:column;font-weight:800;font-size:1.3rem;position:relative;background:var(--bg-card-alt)}
.score-circle.high{border-color:var(--green);color:var(--green-light)}
.score-circle.med{border-color:var(--yellow);color:var(--yellow-light)}
.score-circle.low{border-color:var(--red);color:var(--red-light)}
.score-circle-sub{font-size:.6rem;font-weight:500;color:var(--text-muted);margin-top:-2px}

/* TIME STATUS */
.time-window{background:var(--bg-card-alt);border-radius:var(--radius-md);padding:1.25rem;text-align:center;border:2px solid var(--border)}
.time-window.open{border-color:var(--green);background:var(--green-bg)}
.time-window.closed{border-color:var(--red);background:var(--red-bg)}
.time-window.early{border-color:var(--grey);background:rgba(75,85,99,.1)}
.time-window.late{border-color:var(--yellow);background:var(--yellow-bg)}
.time-display{font-size:2.5rem;font-weight:800;font-family:'Courier New',monospace;letter-spacing:2px}
.time-status{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:1px;margin-top:.3rem}

/* CRM FLOW */
.crm-flow{display:flex;flex-direction:column;gap:.6rem}
.crm-flow-item{display:flex;align-items:center;gap:.75rem;padding:.7rem 1rem;background:var(--bg-card-alt);border-radius:var(--radius-sm);border:1px solid var(--border);font-size:.83rem}
.crm-dept{padding:.25rem .7rem;border-radius:4px;font-weight:700;font-size:.78rem;min-width:80px;text-align:center}
.crm-dept.checkin{background:rgba(37,99,235,.2);color:var(--blue-light)}
.crm-dept.gate{background:rgba(217,119,6,.2);color:var(--yellow-light)}
.crm-dept.makeup{background:rgba(139,92,246,.2);color:#a78bfa}
.crm-dept.airside{background:rgba(220,38,38,.2);color:var(--red-light)}
.crm-dept.ramp{background:rgba(22,163,74,.2);color:var(--green-light)}
.crm-dept.breakdown{background:rgba(249,115,22,.2);color:#fb923c}
.crm-dept.gse{background:rgba(16,185,129,.2);color:#34d399}
.crm-dept.laf{background:rgba(99,102,241,.2);color:#818cf8}
.crm-arrow{color:var(--red-light);font-size:1rem}
.crm-count{margin-left:auto;background:var(--red-bg);color:var(--red-light);padding:.15rem .5rem;border-radius:12px;font-size:.75rem;font-weight:700}
.crm-issue{color:var(--text-muted);font-size:.75rem;flex:1}

/* SECTION */
.section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}
.section-title{font-size:.82rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--text-secondary);display:flex;align-items:center;gap:.5rem}
.section-title::before{content:'';display:inline-block;width:3px;height:14px;background:var(--red);border-radius:2px}
.page-header{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:1.25rem 1.5rem;margin-bottom:1.5rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}
.page-title-wrap h2{font-size:1.2rem;color:var(--text-primary)}
.page-title-wrap p{font-size:.8rem;color:var(--text-muted);margin-top:.25rem}
.page-header-actions{display:flex;gap:.5rem;flex-shrink:0}
.timestamp-lock{display:flex;align-items:center;gap:.5rem;padding:.5rem .85rem;background:var(--bg-card-alt);border:1px solid var(--border);border-radius:var(--radius-sm);font-size:.78rem;color:var(--text-muted);font-family:'Courier New',monospace}
.timestamp-lock .lock-icon{color:var(--yellow-light)}

/* MOBILE NAV */
.mobile-nav{display:none;position:fixed;bottom:0;left:0;right:0;background:var(--bg-secondary);border-top:2px solid var(--red);padding:.5rem 0;z-index:200}
.mobile-nav-items{display:flex;justify-content:space-around}
.mobile-nav-item{display:flex;flex-direction:column;align-items:center;gap:.2rem;padding:.35rem .5rem;color:var(--text-muted);font-size:.6rem;font-weight:600;text-transform:uppercase;cursor:pointer;text-decoration:none}
.mobile-nav-item .nav-icon{font-size:1.3rem}
.mobile-nav-item.active{color:var(--red-light)}
.mobile-nav-badge{background:var(--red);color:white;font-size:.55rem;font-weight:700;padding:.1rem .35rem;border-radius:8px;margin-left:.2rem}

/* MANPOWER */
.manpower-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin-bottom:1rem}
.manpower-stat{background:var(--bg-card-alt);border-radius:var(--radius-sm);padding:.75rem;text-align:center;border:1px solid var(--border)}
.manpower-stat .stat-val{font-size:1.8rem;font-weight:800}
.manpower-stat .stat-lbl{font-size:.7rem;color:var(--text-muted);text-transform:uppercase}

/* BTU */
.btu-card{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;padding:1rem;background:var(--bg-card-alt);border-radius:var(--radius-sm);border:1px solid var(--border);margin-bottom:1rem}
.btu-metric{text-align:center}
.btu-metric .btu-val{font-size:1.5rem;font-weight:800}
.btu-metric .btu-lbl{font-size:.7rem;color:var(--text-muted)}

/* LOGIN */
.login-page{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2rem 1rem;background:var(--login-bg)}
.login-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-xl);padding:2.5rem;width:100%;max-width:420px;box-shadow:var(--shadow-lg)}
.login-logo{text-align:center;margin-bottom:2rem}
.login-logo-box{width:70px;height:70px;background:var(--red);border-radius:18px;display:flex;align-items:center;justify-content:center;font-size:1.8rem;font-weight:900;color:white;margin:0 auto 1rem;box-shadow:var(--shadow-red)}
.login-title{font-size:1.3rem;font-weight:800;margin-bottom:.2rem}
.login-sub{font-size:.82rem;color:var(--text-muted)}
.role-grid{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin-bottom:1.5rem}
.role-card{background:var(--bg-input);border:2px solid var(--border);border-radius:var(--radius-sm);padding:.85rem;text-align:center;cursor:pointer;transition:all .15s}
.role-card:hover{border-color:var(--blue-light);background:var(--blue-bg)}
.role-card.selected{border-color:var(--blue-light);background:var(--blue-bg)}
.role-card .role-icon{font-size:1.5rem;margin-bottom:.25rem}
.role-card .role-name{font-size:.8rem;font-weight:700}
.role-card .role-dept{font-size:.68rem;color:var(--text-muted)}

/* PASSENGER PAGE */
.pax-page{background:#f8f9fa;min-height:100vh;color:#1a1a2e;font-family:'Segoe UI',sans-serif}
.pax-header{background:linear-gradient(135deg,#cc0000,#8b0000);color:white;padding:1.5rem 1rem;text-align:center}
.pax-body{padding:1.5rem 1rem;max-width:500px;margin:0 auto}
.pax-card{background:white;border-radius:12px;padding:1.5rem;margin-bottom:1rem;box-shadow:0 2px 8px rgba(0,0,0,.1)}
.pax-label{font-size:.8rem;font-weight:600;color:#666;text-transform:uppercase;margin-bottom:.4rem;display:block}
.pax-input{width:100%;border:1.5px solid #ddd;border-radius:8px;padding:.75rem 1rem;font-size:1rem;font-family:inherit;color:#1a1a2e;transition:border-color .15s;margin-bottom:.75rem}
.pax-input:focus{outline:none;border-color:#cc0000}
.pax-btn{width:100%;background:#cc0000;color:white;border:none;border-radius:10px;padding:1rem;font-size:1.05rem;font-weight:700;cursor:pointer;margin-top:.5rem}
.pax-btn:hover{background:#b91c1c}

/* RESPONSIVE */
@media(max-width:1024px){.sidebar{width:200px}.grid-4{grid-template-columns:repeat(2,1fr)}.btu-card{grid-template-columns:repeat(2,1fr)}}
@media(max-width:768px){body{font-size:14px}.sidebar{display:none}.main-content{padding:1rem;padding-bottom:5rem}.mobile-nav{display:block}.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}.form-grid,.form-grid-3{grid-template-columns:1fr}.span-2,.span-3{grid-column:span 1}.page-header{flex-direction:column;align-items:flex-start}.btn-lg{width:100%}.severity-selector{flex-direction:column}.btu-card{grid-template-columns:repeat(2,1fr)}.crm-flow-item{flex-wrap:wrap}table{font-size:.78rem}thead th,tbody td{padding:.5rem}}
@media(max-width:480px){.login-card{padding:1.75rem 1.25rem}.kpi-value{font-size:1.8rem}.site-header{padding:.65rem 1rem}.brand-logo{width:36px;height:36px;font-size:.9rem}}

/* ============================================================
   DMK THEME SYSTEM v2
   Dark is the default (:root above). html.theme-soft-light
   overrides every token — including the status "-light" text
   colors, which must be DARKER in light mode to stay readable.
   ============================================================ */

/* ── Theme: Soft Light ── */
html.theme-soft-light {
  color-scheme: light;
  --bg-primary:   #eef2f7;
  --bg-secondary: #ffffff;
  --bg-card:      #ffffff;
  --bg-card-alt:  #f1f5f9;
  --bg-hover:     #e2e8f0;
  --bg-input:     #f8fafc;
  --red-glow:     rgba(220,38,38,0.10);
  --green-light:  #15803d;
  --green-bg:     rgba(22,163,74,0.10);
  --yellow-light: #b45309;
  --yellow-bg:    rgba(217,119,6,0.10);
  --red-light:    #b91c1c;
  --red-bg:       rgba(220,38,38,0.08);
  --grey:         #94a3b8;
  --grey-light:   #475569;
  --blue-light:   #1d4ed8;
  --blue-bg:      rgba(37,99,235,0.08);
  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-accent:    #b91c1c;
  --border:         #cbd5e1;
  --border-subtle:  #e2e8f0;
  --shadow-sm:  0 1px 3px rgba(15,23,42,0.08);
  --shadow-md:  0 4px 12px rgba(15,23,42,0.08);
  --shadow-lg:  0 8px 24px rgba(15,23,42,0.12);
  --shadow-red: 0 2px 10px rgba(220,38,38,0.20);
  --alert-bar-bg: linear-gradient(90deg,#fee2e2,#fef2f2);
  --login-bg: radial-gradient(ellipse at top,#fbe4e4 0%,var(--bg-primary) 60%);
  --scrollbar-thumb: #b6c2d1;
}

/* Light-mode fixes for components with hardcoded dark-mode colors */
html.theme-soft-light .alert-bar{color:#991b1b;border-color:#fca5a5}
html.theme-soft-light .btn-secondary{background:#1e293b;color:#f8fafc;border-color:#1e293b}
html.theme-soft-light .btn-secondary:hover:not(:disabled){background:#0f172a;border-color:#0f172a}
html.theme-soft-light .btn-warning{background:var(--yellow);color:#fff}
html.theme-soft-light .badge-grey{background:rgba(100,116,139,.12);color:#475569;border-color:#94a3b8}
html.theme-soft-light .severity-btn.major.active{color:#c2410c}
html.theme-soft-light .crm-dept.makeup{background:rgba(139,92,246,.12);color:#6d28d9}
html.theme-soft-light .crm-dept.breakdown{background:rgba(249,115,22,.12);color:#c2410c}
html.theme-soft-light .crm-dept.gse{background:rgba(16,185,129,.12);color:#047857}
html.theme-soft-light .crm-dept.laf{background:rgba(99,102,241,.12);color:#4338ca}
html.theme-soft-light .time-window.early{background:rgba(100,116,139,.08)}
html.theme-soft-light tbody tr.row-red{background:rgba(220,38,38,.06)}
html.theme-soft-light tbody tr.row-yellow{background:rgba(217,119,6,.06)}
html.theme-soft-light tbody tr.row-green{background:rgba(22,163,74,.06)}
html.theme-soft-light .dot-green{box-shadow:0 0 4px rgba(21,128,61,.5)}
html.theme-soft-light .dot-red{box-shadow:0 0 4px rgba(185,28,28,.5)}
html.theme-soft-light .site-header,html.theme-soft-light .mobile-nav{box-shadow:var(--shadow-sm)}

/* Themed scrollbars (both themes) */
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:6px;border:2px solid var(--bg-primary)}
::-webkit-scrollbar-thumb:hover{background:var(--grey)}
*{scrollbar-width:thin;scrollbar-color:var(--scrollbar-thumb) transparent}

/* Smooth cross-fade while switching themes (class added briefly by theme.js) */
html.theme-switching, html.theme-switching *,
html.theme-switching *::before, html.theme-switching *::after{
  transition:background-color .25s ease,color .25s ease,border-color .25s ease,box-shadow .25s ease!important;
}

/* ── Soft Light: remap pastel accent text set via inline styles ──
   Pages (and JS-generated markup) widely use Tailwind 300/400-level
   colors as inline `style="color:#xxx"` — readable on dark, washed
   out on light. Attribute-substring selectors remap them to their
   600/700-level equivalents without touching any page markup. */
html.theme-soft-light [style*="color:#f87171"],html.theme-soft-light [style*="color: #f87171"],
html.theme-soft-light [style*="color:#fca5a5"],html.theme-soft-light [style*="color: #fca5a5"],
html.theme-soft-light [style*="color:#ef4444"],html.theme-soft-light [style*="color: #ef4444"]{color:#b91c1c!important}
html.theme-soft-light [style*="color:#34d399"],html.theme-soft-light [style*="color: #34d399"],
html.theme-soft-light [style*="color:#6ee7b7"],html.theme-soft-light [style*="color: #6ee7b7"]{color:#047857!important}
html.theme-soft-light [style*="color:#4ade80"],html.theme-soft-light [style*="color: #4ade80"],
html.theme-soft-light [style*="color:#86efac"],html.theme-soft-light [style*="color: #86efac"],
html.theme-soft-light [style*="color:#22c55e"],html.theme-soft-light [style*="color: #22c55e"]{color:#15803d!important}
html.theme-soft-light [style*="color:#fbbf24"],html.theme-soft-light [style*="color: #fbbf24"],
html.theme-soft-light [style*="color:#f59e0b"],html.theme-soft-light [style*="color: #f59e0b"]{color:#b45309!important}
html.theme-soft-light [style*="color:#fde68a"],html.theme-soft-light [style*="color: #fde68a"],
html.theme-soft-light [style*="color:#fcd34d"],html.theme-soft-light [style*="color: #fcd34d"]{color:#a16207!important}
html.theme-soft-light [style*="color:#38bdf8"],html.theme-soft-light [style*="color: #38bdf8"],
html.theme-soft-light [style*="color:#7dd3fc"],html.theme-soft-light [style*="color: #7dd3fc"],
html.theme-soft-light [style*="color:#90cdf4"],html.theme-soft-light [style*="color: #90cdf4"],
html.theme-soft-light [style*="color:#67e8f9"],html.theme-soft-light [style*="color: #67e8f9"]{color:#0369a1!important}
html.theme-soft-light [style*="color:#60a5fa"],html.theme-soft-light [style*="color: #60a5fa"],
html.theme-soft-light [style*="color:#93c5fd"],html.theme-soft-light [style*="color: #93c5fd"],
html.theme-soft-light [style*="color:#63b3ed"],html.theme-soft-light [style*="color: #63b3ed"],
html.theme-soft-light [style*="color:#3b82f6"],html.theme-soft-light [style*="color: #3b82f6"]{color:#1d4ed8!important}
html.theme-soft-light [style*="color:#c4b5fd"],html.theme-soft-light [style*="color: #c4b5fd"],
html.theme-soft-light [style*="color:#a78bfa"],html.theme-soft-light [style*="color: #a78bfa"]{color:#6d28d9!important}
html.theme-soft-light [style*="color:#c7d2fe"],html.theme-soft-light [style*="color: #c7d2fe"]{color:#4338ca!important}
html.theme-soft-light [style*="color:#818cf8"],html.theme-soft-light [style*="color: #818cf8"]{color:#4f46e5!important}
html.theme-soft-light [style*="color:#fb923c"],html.theme-soft-light [style*="color: #fb923c"],
html.theme-soft-light [style*="color:#fdba74"],html.theme-soft-light [style*="color: #fdba74"]{color:#c2410c!important}
html.theme-soft-light [style*="color:#f472b6"],html.theme-soft-light [style*="color: #f472b6"]{color:#be185d!important}
html.theme-soft-light [style*="color:#f1f5f9"],html.theme-soft-light [style*="color: #f1f5f9"],
html.theme-soft-light [style*="color:#f8fafc"],html.theme-soft-light [style*="color: #f8fafc"]{color:#0f172a!important}
html.theme-soft-light [style*="color:#e2e8f0"],html.theme-soft-light [style*="color: #e2e8f0"]{color:#1e293b!important}
html.theme-soft-light [style*="color:#cbd5e1"],html.theme-soft-light [style*="color: #cbd5e1"]{color:#334155!important}
html.theme-soft-light [style*="color:#94a3b8"],html.theme-soft-light [style*="color: #94a3b8"]{color:#475569!important}
html.theme-soft-light [style*="color:#9ca3af"],html.theme-soft-light [style*="color: #9ca3af"]{color:#4b5563!important}
/* Subtle white-overlay backgrounds → subtle dark overlays in light mode */
html.theme-soft-light [style*="background:rgba(255,255,255,.03"],
html.theme-soft-light [style*="background:rgba(255,255,255,.04"],
html.theme-soft-light [style*="background:rgba(255,255,255,.06"],
html.theme-soft-light [style*="background:rgba(255,255,255,.08"]{background:rgba(15,23,42,.05)!important}

/* Floating theme toggle (injected by theme.js on pages without #dmkThemeBtn) */
#dmkThemeFab{position:fixed;bottom:1rem;left:1rem;z-index:600;width:44px;height:44px;border-radius:50%;border:1px solid var(--border);background:var(--bg-card);color:var(--text-primary);box-shadow:var(--shadow-md);cursor:pointer;font-size:1.15rem;line-height:1;display:flex;align-items:center;justify-content:center;transition:transform .15s,border-color .15s}
#dmkThemeFab:hover{transform:scale(1.08);border-color:var(--red)}
@media(max-width:768px){#dmkThemeFab{bottom:5.25rem;width:40px;height:40px}}

/* ── PRINT ──────────────────────────────────────────────────────
   theme.js forces the light theme during printing (beforeprint),
   so all soft-light rules apply; this block strips interactive
   chrome and makes layout flow for paper. */
@media print{
  #dmkThemeFab,.mobile-nav,.sidebar,.page-header-actions,.gop-export-actions{display:none!important}
  body{background:#fff!important}
  .site-header{position:static!important;box-shadow:none!important}
  .app-layout{display:block!important;min-height:0!important}
  .main-content{padding:0!important;overflow:visible!important}
  *{box-shadow:none!important;text-shadow:none!important}
  .card,.kpi-card,.alert-item,tr{break-inside:avoid}
  table,thead th,tbody td,.badge,.dot,.progress-bar,.progress-fill,.kpi-card::before{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  a{color:inherit;text-decoration:none}
}
