/* BYN Cleaning & Facilities: matches the BYN Catering look. */
:root {
  --navy: #0E1A3A; --navy-2: #111F45; --navy-line: #1E2C55; --navy-on: #1F3470;
  --ink: #0F172A; --muted: #475569; --line: #E3E8F2; --line-2: #EEF1F7;
  --bg: #F4F6FB; --card: #FFFFFF; --blue: #1A56DB; --blue-d: #1E429F; --field: #EEF3FD;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: var(--blue); }
a:hover { color: var(--blue-d); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 260px; max-width: 100%; background: var(--navy); color: #FFF; display: flex; flex-direction: column; }
.body { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 900px) {
  /* Fixed sidebar with its own scroll; the page scrolls separately. */
  .side { flex: 0 0 260px; position: sticky; top: 0; height: 100vh; overflow: hidden; }
  .shell { flex-wrap: nowrap; align-items: flex-start; }
}

.brand, .me { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--navy-line); color: #FFF; text-decoration: none; }
.brand:hover, .me:hover { color: #FFF; background: #13214A; }
.brand span:last-child, .me span:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand strong { font-size: 16px; font-weight: 800; }
.brand small { font-size: 11px; letter-spacing: .08em; color: #A9B6D6; }
.me strong { font-size: 15px; }
.me small { font-size: 13px; color: #A9B6D6; }
.brand-tile { width: 44px; height: 44px; border-radius: 10px; background: #14B8A6; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #4F6BED; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }

.side-search { display: flex; align-items: center; gap: 8px; height: 40px; margin: 14px 10px 6px; border: 1px solid #2A3A68; border-radius: 8px; padding: 0 12px; background: var(--navy-2); }
.side-search input { border: 0; outline: none; background: transparent; color: #FFF; font: inherit; font-size: 13px; width: 100%; }
.side-search input::placeholder { color: #8B9AC0; }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px 20px; }
.nav-row { display: flex; align-items: center; border-radius: 10px; }
.nav-row:hover { background: #18295A; }
.nav-link { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 44px; border-radius: 10px; color: #FFF; text-decoration: none; font-weight: 600; }
.nav-link:hover { color: #FFF; }
.nav-link.on { background: var(--navy-on); }
.nav-caret { flex: none; width: 36px; height: 44px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.nav-caret:hover { background: #22356B; }
.nav-caret svg { transition: transform .15s ease; }
.nav-group.open .nav-caret svg { transform: rotate(90deg); }
.nav-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 6px 25px; padding-left: 14px; border-left: 1px solid #2A3A68; }
.nav-group.open .nav-sub { display: flex; }
.nav-sub a { display: block; padding: 7px 10px; border-radius: 8px; color: #C3CDE6; text-decoration: none; font-size: 13px; font-weight: 500; }
.nav-sub a:hover { background: #18295A; color: #FFF; }
.nav-sub a.on { color: #FFF; background: #18295A; font-weight: 700; }
.nav .lbl { flex: 1 1 auto; }
.tile { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: #FFF; border-bottom: 1px solid var(--line); }
.top-l, .top-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.top-title { font-weight: 700; font-size: 18px; margin-left: 8px; }
.ibtn { width: 40px; height: 40px; border: 1px solid #DCE3EF; border-radius: 8px; background: #FFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ibtn:hover { background: #F1F4FA; }
.chip-plain { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid #DCE3EF; border-radius: 8px; }
.btn-out { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid #DCE3EF; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.btn-out:hover { background: #F1F4FA; color: var(--ink); }

.content { padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--blue); color: #FFF; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue-d); color: #FFF; }
.btn-ghost { background: #FFF; color: var(--ink); border: 1px solid #DCE3EF; font-weight: 600; }
.btn-ghost:hover { background: #F1F4FA; color: var(--ink); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid #DCE3EF; border-radius: 8px; background: #FFF; font-size: 13px; color: #334155; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; }

.flash { padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.flash-ok { background: #E3F5F2; color: #0F5F58; }
.flash-warn { background: #FEF3E2; color: #92400E; }
.flash-error { background: #FDECEC; color: #991B1B; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.card h2 { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #1D4ED8; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { display: flex; gap: 14px; align-items: center; background: #FFF; border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; text-decoration: none; color: var(--ink); }
.kpi:hover { color: var(--ink); border-color: #C9D6F2; }
.kpi .tile { width: 48px; height: 48px; border-radius: 12px; }
.kpi .k-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .k-lbl { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.kpi .k-val { font-size: 22px; font-weight: 800; white-space: nowrap; }
.kpi .k-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.dash-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.sec { padding-bottom: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); border-radius: 6px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #F7F9FD; color: var(--ink); }
.badge { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.row .r-txt { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.row .r-lbl { font-weight: 600; }
.row .r-sub { font-size: 12px; color: var(--muted); }
.row .r-val { font-size: 17px; font-weight: 800; white-space: nowrap; }

.insights { flex: 1 1 300px; background: var(--navy); color: #FFF; border-radius: 16px; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.insights h2 { margin: 0; font-size: 19px; font-weight: 800; }
.ins-head { display: flex; justify-content: space-between; align-items: center; }
.ins-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #DC2626; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ins-sec { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: #7FA6FF; }
.ins { display: flex; flex-direction: column; gap: 3px; padding-bottom: 12px; border-bottom: 1px solid var(--navy-line); }
.ins-top { display: flex; justify-content: space-between; font-size: 13px; color: #D6DEF0; }
.ins-val { font-size: 18px; font-weight: 800; }
.ins-prev { font-size: 12px; color: #A9B6D6; }
.up { color: #4ADE80; font-weight: 600; } .down { color: #FCA5A5; font-weight: 600; } .flat { color: #A9B6D6; }
.alert { display: flex; gap: 12px; align-items: flex-start; background: #14244D; border: 1px solid #24366A; border-radius: 10px; padding: 12px; }
.alert .tile { width: 32px; height: 32px; color: #FFF; font-weight: 800; }
.alert strong { display: block; font-size: 14px; }
.alert span { font-size: 12px; color: #C3CDE6; }

.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.count { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: #FFF; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.count.on { border: 2px solid var(--blue); }
.count:hover { color: var(--ink); }
.count .badge { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; font-weight: 800; }
.count small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.count strong { font-size: 22px; font-weight: 800; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 10px; }
.scroll { overflow-x: auto; position: relative; }
table.grid { width: 100%; border-collapse: collapse; min-width: 760px; }
table.grid th { text-align: left; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 10px; font-weight: 700; }
table.grid td { padding: 12px 10px; border-top: 1px solid var(--line-2); vertical-align: middle; }
table.grid tr:hover td { background: #F7F9FD; }
.sub { display: block; font-size: 12px; color: var(--muted); }
.empty { padding: 28px 10px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-green { background: #E3F5F2; color: #0F5F58; }
.pill-orange { background: #FDEEE4; color: #9A3412; }
.pill-blue { background: #E8EFFE; color: #1E40AF; }
.pill-red { background: #FDECEC; color: #991B1B; }
.pill-grey { background: #EEF1F7; color: #334155; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.field input, .field select, .field textarea, .inline-field { height: 42px; border: 1px solid #C9D6F2; border-radius: 10px; padding: 0 12px; font: inherit; font-weight: 400; color: var(--ink); background: var(--field); }
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; }
.field .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.inline-field { height: 40px; background: #FFF; border-color: #DCE3EF; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-actions form { margin: 0; }

/* Sign in */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; background: #F8FAFD; }
.auth-hero { flex: 1 1 520px; background: var(--navy); color: #FFF; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-hero .brand { padding: 0; border: 0; }
.auth-hero .brand:hover { background: transparent; }
.auth-hero h1 { margin: 0; font-size: 40px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; max-width: 560px; }
.auth-hero p { margin: 18px 0 20px; font-size: 17px; line-height: 1.55; color: #C3CDE6; max-width: 520px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid #2A3A68; border-radius: 999px; font-size: 13px; color: #E2E8F5; }
.chips i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.auth-foot { font-size: 13px; color: #8B9AC0; }
.auth-panel { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 400px; background: #FFF; border-radius: 16px; padding: 36px 32px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 12px 40px rgba(15, 23, 42, .08); }
.auth-card h2 { margin: 0; font-size: 26px; font-weight: 800; }
.auth-card .btn { height: 48px; font-size: 16px; border-radius: 10px; }
.auth-card .field input { height: 46px; }

/* Reports */
.bar { height: 8px; border-radius: 999px; background: #EEF1F7; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.bar i.over { background: #DC2626; }
.num { text-align: right; white-space: nowrap; }
table.grid th.num { text-align: right; }
table.grid tfoot td { font-weight: 800; border-top: 2px solid var(--line); }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.check-row select, .check-row input { height: 40px; border: 1px solid #C9D6F2; border-radius: 10px; padding: 0 10px; font: inherit; background: var(--field); min-width: 0; }
@media (max-width: 640px) { .check-row { grid-template-columns: 1fr; } }
@media print { .side, .top, .no-print, .actions { display: none !important; } .content { padding: 0 !important; } .card { break-inside: avoid; } .shell, .body, .content, .panels, .dash, .dash-main, .insights { height: auto !important; overflow: visible !important; } }

/* Phones and small tablets: the menu becomes a slide-in drawer. */
.menu-btn, .scrim { display: none; }
@media (max-width: 899px) {
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: 280px; max-width: 85vw; overflow-y: auto; transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .side { transform: none; }
  body.menu-open { overflow: hidden; }
  .scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .45); }
  body.menu-open .scrim { display: block; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
  .top-nav, .top-r .chip-plain, .top-r .muted { display: none; }
  .top-title { font-size: 16px; margin-left: 2px; }
  .btn-out { padding: 0 10px; }
  .content { padding: 16px 16px 32px; gap: 14px; }
  .page-head h1 { font-size: 24px; }
  .page-head .actions { width: 100%; }
  .counts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .count { padding: 10px; gap: 8px; }
  .count .badge { width: 32px; height: 32px; font-size: 13px; }
  .count strong { font-size: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpi .tile { width: 36px; height: 36px; }
  .kpi .k-val { font-size: 20px; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .toolbar form, .toolbar form label, .toolbar .inline-field { width: 100%; }
  .toolbar form .btn { flex: 1 1 auto; }
}

/* Public QR report page */
body.public { background: var(--bg); }
.pub { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
.pub-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 16px; }
.pub-card { padding: 22px 18px; }
.pub-card h1 { margin: 2px 0 10px; font-size: 24px; font-weight: 800; }
.pub-issues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pub-issue { position: relative; }
.pub-issue input { position: absolute; opacity: 0; }
.pub-issue span { display: flex; align-items: center; min-height: 64px; padding: 10px 12px; border: 1px solid #C9D6F2; border-radius: 12px; background: var(--field); font-weight: 600; cursor: pointer; }
.pub-issue input:checked + span { border: 2px solid var(--blue); background: #E8EFFE; color: #1E40AF; }
.pub-issue input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* QR sheet */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.qr-card { border: 1px solid var(--line); border-radius: 14px; background: #FFF; padding: 16px; text-align: center; break-inside: avoid; }
.qr-card .qr svg { width: 170px; height: 170px; }
.qr-card strong { display: block; font-size: 15px; margin-top: 6px; }
.qr-card .tagline { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
@media print { .qr-grid { grid-template-columns: repeat(3, 1fr); } .qr-card { border: 1px dashed #94A3B8; } }

/* My tasks */
.mt-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.mt-item:first-of-type { border-top: 0; }
.mt-main { flex: 1 1 220px; min-width: 0; }
.mt-main strong { display: block; font-size: 15px; }
.mt-actions { display: flex; gap: 8px; }
.mt-actions .btn { height: 46px; min-width: 96px; font-size: 15px; }

/* Fixed app frame on computers: sidebar, top bar and page title stay put; only the panels scroll. */
.panels { display: flex; flex-direction: column; gap: 18px; min-width: 0; position: relative; }
@media screen and (min-width: 900px) {
  .shell { height: 100vh; overflow: hidden; }
  .side { height: 100vh; }
  .body { height: 100vh; }
  .top { flex: none; }
  .content { flex: 1 1 auto; min-height: 0; overflow: hidden; padding-bottom: 0; }
  .page-head { flex: none; }
  .content > .flash { flex: none; }
  .panels { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 32px 0; margin-right: -8px; scrollbar-width: thin; scrollbar-color: #C9D6F2 transparent; }
  .panels::-webkit-scrollbar, .dash-main::-webkit-scrollbar { width: 8px; }
  .panels::-webkit-scrollbar-thumb, .dash-main::-webkit-scrollbar-thumb { background: #C9D6F2; border-radius: 4px; }
}
/* Dashboard on wide screens: the main panels and Insights & Alerts scroll separately. */
@media screen and (min-width: 1200px) {
  .page-dashboard .panels { overflow: hidden; padding-bottom: 0; }
  .page-dashboard .dash { flex: 1 1 auto; min-height: 0; flex-wrap: nowrap; align-items: stretch; }
  .page-dashboard .dash-main { overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 24px 0; scrollbar-width: thin; scrollbar-color: #C9D6F2 transparent; }
  .page-dashboard .insights { flex: 0 0 300px; overflow-y: auto; overscroll-behavior: contain; margin-bottom: 24px; scrollbar-width: thin; scrollbar-color: #2A3A68 transparent; }
}

/* Sidebar: logo, user and search stay fixed; only the menu list scrolls. */
.brand, .me, .side-search { flex: none; }
.nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2A3A68 transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: #2A3A68; border-radius: 3px; }
@media (max-width: 899px) { .side { overflow: hidden; } }
/* v0.9 alert bell and switched-off rows */
.bell { position: relative; }
.bell summary { list-style: none; cursor: pointer; position: relative; }
.bell summary::-webkit-details-marker { display: none; }
.bell-n { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #DC2626; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 300px; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid #DCE3EF; border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); padding: 12px; }
.bell-h { display: block; font-size: 13px; padding: 0 4px 6px; }
.bell-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font-size: 14px; }
.bell-item:hover { background: #F1F4FA; color: var(--ink); }
.row-off td { color: #94A3B8; }
.row-off td strong { color: #64748B; }
@media (max-width: 899px) { .bell-menu { position: fixed; right: 16px; top: 64px; } }
.fx { margin: 0; }
.fx select.chip-plain { width: 96px; font: inherit; font-weight: 600; color: var(--ink); background: #fff; cursor: pointer; padding: 0 10px; }
@media (max-width: 899px) { .top-r .fx { display: none; } }
