:root{
  --navy:#102A43;
  --navy2:#163B5C;
  --teal:#1B7F7A;
  --teal2:#2FA39D;
  --bg:#F5F7FA;
  --card:#FFFFFF;
  --text:#1F2933;
  --muted:#64748B;
  --border:#E2E8F0;
  --green:#1E7F4F;
  --green-bg:#E6F4EA;
  --red:#B42318;
  --red-bg:#FDECEC;
  --amber:#B45309;
  --amber-bg:#FFF4E5;
  --blue:#3730A3;
  --blue-bg:#EEF2FF;
  --purple:#6D28D9;
  --purple-bg:#F3E8FF;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.app-shell{
  min-height:100vh;
  background:var(--bg);
}

.hidden{display:none!important}

.signin-screen{
  min-height:100vh;
  background:linear-gradient(160deg,var(--navy),#071A2E);
  color:white;
  padding:28px 24px;
  display:none;
}

.signin-screen.active{
  display:flex;
  justify-content:center;
  align-items:center;
}

.signin-card{
  width:100%;
  max-width:430px;
}

.logo-large{
  width:170px;
  height:170px;
  object-fit:contain;
  margin:0 auto 24px;
  display:block;
  background:white;
  border-radius:28px;
  padding:18px;
  box-shadow:0 8px 24px rgba(0,0,0,.22);
}

.signin-title{
  text-align:center;
  font-size:34px;
  font-weight:700;
  margin:0;
}

.signin-title span{color:var(--teal2)}

.signin-subtitle{
  text-align:center;
  color:#BFEAE7;
  font-size:12px;
  font-weight:700;
  letter-spacing:.8px;
  text-transform:uppercase;
  margin:8px 0 34px;
}

.app-header{
  display:none;
  background:linear-gradient(135deg,var(--navy),var(--navy2));
  color:white;
  padding:14px 20px;
  align-items:center;
  justify-content:space-between;
  box-shadow:0 4px 18px rgba(15,23,42,.15);
  position:sticky;
  top:0;
  z-index:100;
}

.app-header.active{display:flex}

.top-left,.top-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.logo-small{
  width:34px;
  height:34px;
  object-fit:contain;
  border-radius:8px;
  background:white;
}

.brand{
  font-size:22px;
  font-weight:700;
  letter-spacing:-.4px;
}

.brand span{color:var(--teal2)}

.icon-btn{
  background:transparent;
  color:white;
  border:none;
  font-size:24px;
  cursor:pointer;
  padding:4px 6px;
}

.pill-control{
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  padding:7px 12px;
  font-size:12px;
  font-weight:600;
  color:white;
  background:rgba(255,255,255,.10);
  backdrop-filter:blur(6px);
  cursor:pointer;
}

.pill-control option{
  color:var(--navy);
  background:white;
}

.menu-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.35);
  z-index:190;
}

.side-menu{
  position:fixed;
  top:0;
  left:0;
  width:285px;
  height:100%;
  background:white;
  box-shadow:4px 0 24px rgba(0,0,0,.18);
  z-index:200;
  padding:20px;
  overflow:auto;
}

.menu-header{
  padding-bottom:18px;
  margin-bottom:12px;
  border-bottom:1px solid var(--border);
}

.menu-user-name{
  font-weight:700;
  font-size:17px;
  color:var(--navy);
}

.menu-user-role{
  font-size:13px;
  color:var(--muted);
  margin-top:4px;
}

.menu-section-label{
  font-size:11px;
  color:var(--muted);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.5px;
  margin:18px 0 8px;
}

.menu-item{
  padding:12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:10px;
}

.menu-item:hover{
  background:#F1F5F9;
}

.menu-item.danger{
  background:var(--red);
  color:white;
}

.menu-item.danger:hover{
  background:#991B1B;
  color:white;
}

.menu-divider{
  height:1px;
  background:var(--border);
  margin:14px 0;
}

.main-layout{
  display:none;
  max-width:1200px;
  margin:0 auto;
  padding:24px 24px 95px;
}

.main-layout.active{display:block}

.screen{display:none}
.screen.active{display:block}

.dashboard-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.content-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:18px;
}

.three-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.card{
  background:white;
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
  margin-bottom:16px;
  box-shadow:0 3px 12px rgba(15,23,42,.05);
}

.input, select, textarea{
  width:100%;
  padding:14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:white;
  color:#111827;
  font-size:16px;
  margin-bottom:12px;
}

textarea{
  min-height:84px;
  font-family:Arial, sans-serif;
}

label{
  display:block;
  font-size:13px;
  font-weight:700;
  color:var(--navy);
  margin-bottom:6px;
}

.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.btn{
  width:100%;
  border:none;
  border-radius:14px;
  padding:15px;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
  margin-top:10px;
}

.primary{
  background:linear-gradient(135deg,var(--teal),var(--teal2));
  color:white;
}

.secondary{
  background:white;
  color:var(--navy);
  border:1px solid var(--border);
}

.danger{
  background:var(--red);
  color:white;
}

.ghost{
  background:#EEF7F6;
  color:var(--teal);
}

.greeting{
  font-size:24px;
  font-weight:700;
  margin-bottom:2px;
}

.role-text{
  color:var(--muted);
  font-size:14px;
  margin-bottom:18px;
}

.action-card{
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px;
  cursor:pointer;
  min-height:108px;
}

.action-card:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 18px rgba(15,23,42,.10);
}

.action-icon{
  width:48px;
  height:48px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  background:rgba(16,42,67,.08);
  color:var(--navy);
  flex-shrink:0;
}

.action-icon.teal{background:rgba(27,127,122,.10);color:var(--teal);}
.action-icon.amber{background:var(--amber-bg);color:var(--amber);}
.action-icon.green{background:var(--green-bg);color:var(--green);}
.action-icon.purple{background:var(--purple-bg);color:var(--purple);}

.action-body{flex:1}

.action-title{
  font-size:17px;
  font-weight:700;
  margin-bottom:4px;
}

.action-subtitle{
  font-size:13px;
  color:var(--muted);
  line-height:1.35;
}

.chevron{
  font-size:26px;
  color:#94A3B8;
}

.page-title{
  font-size:23px;
  font-weight:700;
  margin-bottom:14px;
  color:var(--navy);
}

.section-title{
  font-size:17px;
  font-weight:700;
  margin-bottom:10px;
  color:var(--navy);
}

.subtle{
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.status{
  display:inline-block;
  margin-top:8px;
  padding:6px 12px;
  border-radius:999px;
  font-weight:700;
  font-size:12px;
}

.status.not-started{background:var(--blue-bg);color:var(--blue)}
.status.progress{background:var(--amber-bg);color:var(--amber)}
.status.complete{background:var(--green-bg);color:var(--green)}
.status.open{background:var(--amber-bg);color:var(--amber)}
.status.filled{background:var(--green-bg);color:var(--green)}
.status.pending{background:var(--blue-bg);color:var(--blue)}
.status.overdue{background:var(--red-bg);color:var(--red)}
.status.approved{background:var(--green-bg);color:var(--green)}
.status.denied{background:var(--red-bg);color:var(--red)}
.status.info{background:var(--blue-bg);color:var(--blue)}

.info-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px solid #EDF2F4;
  font-size:14px;
}

.info-row:last-child{border-bottom:none}

.info-label{color:var(--muted)}
.info-value{font-weight:700;text-align:right}

.metric{text-align:center;}

.metric-title{
  font-size:13px;
  color:var(--muted);
}

.metric-value{
  font-size:30px;
  color:var(--teal);
  font-weight:700;
  margin:8px 0 2px;
}

.metric-change{
  font-size:12px;
  color:var(--green);
}

.list{
  padding-left:22px;
  margin:8px 0 0;
}

.list li{
  margin-bottom:10px;
  line-height:1.4;
}

.qr-box{
  background:#0F172A;
  border-radius:22px;
  padding:18px;
  margin:18px 0;
  min-height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:white;
  overflow:hidden;
}

#qr-reader{
  width:100%;
  border-radius:18px;
  overflow:hidden;
}

.manual-box{
  display:flex;
  gap:8px;
}

.manual-box input{
  flex:1;
  margin:0;
}

.room-title{
  font-size:24px;
  font-weight:700;
  color:var(--navy);
  margin-bottom:4px;
}

.meta{
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.stopwatch-card{
  text-align:center;
  background:linear-gradient(180deg,#F0FDFA,#FFFFFF);
  border:2px solid rgba(27,127,122,.24);
}

.stopwatch-time{
  font-size:58px;
  font-weight:700;
  color:var(--navy);
  letter-spacing:1px;
  margin:18px 0;
}

.stopwatch-room{
  font-size:20px;
  font-weight:700;
  color:var(--navy);
}

.audit-score{
  display:flex;
  align-items:center;
  gap:18px;
}

.audit-questions{
  margin-top:16px;
}

.score-circle{
  width:112px;
  height:112px;
  border-radius:50%;
  background:conic-gradient(var(--teal) 0 92%, #E5E7EB 92% 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  color:var(--navy);
  font-weight:700;
  flex-shrink:0;
}

.score-circle span{font-size:30px;}

.audit-status{
  font-size:18px;
  font-weight:700;
  color:var(--green);
}

.question{
  border:1px solid var(--border);
  background:white;
  border-radius:14px;
  padding:14px;
  margin-bottom:12px;
}

.question.fail-highlight{
  border-color:var(--red);
  background:var(--red-bg);
}

.choice-row{
  display:flex;
  gap:8px;
  margin-top:12px;
}

.choice{
  flex:1;
  border:2px solid var(--border);
  border-radius:10px;
  background:white;
  padding:10px;
  font-weight:700;
  cursor:pointer;
}

.choice.selected.pass{background:var(--green);color:white;border-color:var(--green);}
.choice.selected.fail{background:var(--red);color:white;border-color:var(--red);}
.choice.selected.na{background:var(--muted);color:white;border-color:var(--muted);}

.table-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.record-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  background:#fff;
}

.record-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.record-title{
  font-weight:700;
  color:var(--navy);
  font-size:16px;
}

.record-subtitle{
  color:var(--muted);
  font-size:13px;
  margin-top:4px;
  line-height:1.4;
}

.inline-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}

.inline-actions .btn{
  margin-top:0;
  padding:11px;
  font-size:14px;
}

.ai-box{
  background:linear-gradient(180deg,#F8FAFC,#FFFFFF);
  border:1px solid var(--border);
  border-radius:16px;
  padding:15px;
}

.ai-title{
  font-weight:700;
  color:var(--navy);
  margin-bottom:8px;
}

.badge-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}

.badge{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#F1F5F9;
  color:#334155;
}

.signature-box{
  border:1px dashed #94A3B8;
  min-height:80px;
  border-radius:12px;
  display:flex;
  justify-content:center;
  align-items:center;
  color:var(--muted);
  background:#F8FAFC;
  margin-bottom:12px;
}

.bottom-nav{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  height:72px;
  background:white;
  border-top:1px solid var(--border);
  display:none;
  justify-content:center;
  align-items:center;
  gap:34px;
  box-shadow:0 -4px 18px rgba(15,23,42,.08);
  z-index:99;
}

.bottom-nav.active{display:flex}

.nav-item{
  font-size:11px;
  color:#334155;
  text-align:center;
  cursor:pointer;
  min-width:58px;
}

.nav-icon{
  font-size:21px;
  display:block;
  margin-bottom:3px;
}

.nav-item.active{
  color:var(--teal);
  font-weight:700;
}

.toast{
  position:fixed;
  left:50%;
  bottom:90px;
  transform:translateX(-50%);
  background:var(--green);
  color:white;
  padding:14px 18px;
  border-radius:14px;
  font-weight:700;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
  z-index:300;
  max-width:90%;
  text-align:center;
}

.app-error-box{
  position:fixed;
  top:10px;
  left:10px;
  right:10px;
  z-index:9999;
  background:#fff;
  color:var(--red);
  border:2px solid var(--red);
  border-radius:12px;
  padding:12px;
  font-size:13px;
  white-space:pre-wrap;
}

.qco-daily-toolbar{
  display:flex;
  gap:10px;
  align-items:end;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.qco-daily-toolbar .input{
  margin:0;
  min-width:180px;
}

.qco-daily-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(140px,1fr));
  gap:10px;
}

.qco-daily-kpis .card{
  margin-bottom:0;
  padding:14px 16px;
  border-radius:8px;
}

.qco-daily-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:12px;
}

.qco-daily-gauge-card{
  border:1px solid var(--border);
  background:#fff;
  border-radius:8px;
  padding:14px;
  text-align:left;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}

.qco-daily-gauge-card:hover{
  border-color:var(--teal);
  transform:translateY(-1px);
}

.qco-daily-gauge{
  width:128px;
  height:128px;
  border-radius:50%;
  display:grid;
  place-items:center;
  margin:0 auto 12px;
  background:conic-gradient(var(--teal) var(--p), #e2e8f0 0);
}

.qco-daily-gauge>div{
  width:94px;
  height:94px;
  border-radius:50%;
  background:#fff;
  display:grid;
  place-items:center;
  text-align:center;
}

.qco-daily-gauge strong{
  font-size:26px;
  color:var(--teal);
  line-height:1;
}

.qco-daily-gauge span{
  display:block;
  font-size:12px;
  color:var(--muted);
}

.qco-daily-detail{
  display:grid;
  grid-template-columns:minmax(280px,380px) 1fr;
  gap:14px;
  margin-top:14px;
}

.qco-daily-room-table{
  display:grid;
  grid-template-columns:1.1fr 1.2fr .7fr 1fr;
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
}

.qco-daily-room-table>div{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:#fff;
}

.qco-daily-room-table>div:nth-last-child(-n+4){
  border-bottom:0;
}

.qco-daily-room-head{
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  color:#334155;
  background:#f8fafc!important;
}

.scanner-page{
  min-height:100vh;
  background:#f3f6fa;
}

.scanner-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:18px;
}

.scanner-card{
  width:min(520px,100%);
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:20px;
  box-shadow:0 10px 28px rgba(15,23,42,.08);
}

.scanner-card h1{
  margin:14px 0 6px;
  font-size:28px;
  color:var(--text);
}

.scanner-box{
  overflow:hidden;
  border-radius:8px;
  background:#0f172a;
  margin:16px 0 12px;
}

.scanner-open{
  overflow:hidden;
}

.scanner-overlay{
  position:fixed;
  inset:0;
  z-index:1000;
  background:rgba(15,23,42,.64);
  display:grid;
  place-items:center;
  padding:14px;
}

.scanner-overlay-panel{
  width:min(560px,100%);
  height:min(760px,92vh);
  background:#fff;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 18px 46px rgba(15,23,42,.28);
}

.scanner-frame{
  width:100%;
  height:100%;
  border:0;
  display:block;
  background:#f3f6fa;
}

@media(max-width:900px){
  .dashboard-grid,
  .content-grid,
  .three-grid{
    grid-template-columns:1fr;
  }

  .top-right{gap:6px}

  .pill-control{
    padding:6px 9px;
    font-size:11px;
  }

  .qco-daily-detail{grid-template-columns:1fr}
  .qco-daily-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .qco-daily-room-table{grid-template-columns:1fr}
  .qco-daily-room-head{display:none}
  .qco-daily-room-table>div{border-bottom:0}
  .qco-daily-room-table>div:nth-child(4n){border-bottom:1px solid var(--border)}
}

@media(max-width:560px){
  .app-header{padding:12px}
  .brand{font-size:18px}
  .logo-small{width:30px;height:30px;}
  .main-layout{padding:16px 14px 90px;}
  .bottom-nav{gap:14px}
  .stopwatch-time{font-size:46px}
  .signin-title{font-size:30px}
  .logo-large{width:150px;height:150px;}
  .side-menu{width:260px;}
  .form-row{grid-template-columns:1fr;gap:0;}
  .audit-score{align-items:flex-start;}
  .score-circle{width:92px;height:92px;}
}


/* Quality issue tracker */
.qco-issue-layout{display:block;margin-top:14px}
.qco-issue-create-panel{display:none;margin-bottom:14px}
.qco-issue-create-panel.active{display:block}
.qco-issue-form-panel{background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:14px;margin:12px 0}
.qco-issue-kpis{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:10px;margin-bottom:14px}
.qco-issue-kpis .card{margin-bottom:0;padding:14px 16px;border-radius:8px}
.qco-issue-kpis .metric-title{font-size:12px}
.qco-issue-kpis .metric-value{font-size:26px;line-height:1.1}
.qco-issue-kpis .metric-change{font-size:12px}
.qco-issue-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.qco-issue-form-grid .input{margin-bottom:4px}
.qco-issue-board-card{min-width:0}
.qco-issue-board-head{gap:12px;align-items:flex-start}
.qco-issue-toolbar{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.qco-issue-kanban{min-width:0}
.qco-issue-column{background:#f6f9fd;border:1px solid var(--border);border-radius:8px;padding:10px;min-height:180px}
.qco-issue-column-head{display:flex;align-items:center;justify-content:space-between;font-weight:900;margin-bottom:10px}
.qco-count{background:#e8eefc;color:#1b3b75;border-radius:999px;padding:3px 9px;font-size:12px}
.qco-issue-card{margin-bottom:10px;border-left:5px solid #d6e0ec}
.qco-issue-card.escalated{border-color:var(--red);background:#fff7f7}
.qco-issue-card.dueSoon{border-color:var(--amber);background:#fffaf0}
.qco-issue-card.resolved{border-color:var(--teal);background:#f4fffb}
.qco-issue-meta{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0;color:var(--muted);font-size:12px}
.qco-issue-chip{border-radius:999px;padding:4px 8px;background:#eef3f8;font-weight:800;color:#1c4265}
.qco-issue-chip.escalated{background:#ffe1e1;color:#9f1239}
.qco-issue-chip.dueSoon{background:#fff0cf;color:#92400e}
.qco-issue-chip.resolved{background:#dcfce7;color:#166534}
.qco-bulk-divider{height:1px;background:var(--border);margin:16px 0}
.qco-small-title{font-size:15px;margin-bottom:6px}
.qco-bulk-textarea{min-height:150px;font-size:14px;line-height:1.35}
.qco-import-actions{margin:8px 0 12px}
.qco-import-preview{background:#f8fafc;border:1px solid var(--border);border-radius:8px;padding:10px;max-height:180px;overflow:auto}
.qco-import-preview table{width:100%;border-collapse:collapse;font-size:12px}
.qco-import-preview th,.qco-import-preview td{border-bottom:1px solid var(--border);padding:6px;text-align:left;vertical-align:top}
.qco-issue-summary-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}
.qco-summary-pill{border:1px solid var(--border);background:#f8fafc;border-radius:8px;padding:10px;text-align:left;font-weight:800;color:var(--text);cursor:pointer}
.qco-summary-pill strong{float:right;font-size:18px;color:var(--teal)}
.qco-summary-pill.escalated{background:#fff7f7;border-color:#fecdd3}.qco-summary-pill.escalated strong{color:var(--red)}
.qco-summary-pill.dueSoon{background:#fffaf0;border-color:#fed7aa}.qco-summary-pill.dueSoon strong{color:var(--amber)}
.qco-summary-pill.resolved{background:#f4fffb;border-color:#bbf7d0}
.qco-issue-filter-row{display:grid;grid-template-columns:1.4fr .8fr .8fr;gap:10px;margin-bottom:10px}
.qco-issue-filter-row .input{margin-bottom:0}
.qco-issue-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:8px}
.qco-issue-table{width:100%;border-collapse:collapse;min-width:900px}
.qco-issue-table th{font-size:11px;text-transform:uppercase;color:var(--muted);background:#f8fafc;text-align:left;padding:10px;border-bottom:1px solid var(--border)}
.qco-issue-table td{padding:10px;border-bottom:1px solid var(--border);vertical-align:top}
.qco-issue-table tr.escalated td{background:#fffafa}
.qco-issue-table tr.dueSoon td{background:#fffdf5}
.qco-table-actions{gap:6px;flex-wrap:nowrap}
.qco-empty{padding:8px}
@media(max-width:800px){.qco-issue-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.qco-issue-summary-row,.qco-issue-filter-row{grid-template-columns:1fr 1fr}.qco-issue-search{grid-column:1/-1}}
@media(max-width:640px){.qco-issue-kpis,.qco-issue-form-grid,.qco-issue-summary-row,.qco-issue-filter-row{grid-template-columns:1fr}.qco-issue-toolbar{justify-content:flex-start}}
