:root {
  --primary: #0DA8EB; --primary-dark: #0077B6; --primary-soft: #E4F5FD; --primary-border: #A8DDF7;
  --navy: #072C3C; --bg: #F4F8FB; --surface: #fff; --text: #072C3C; --muted: #6B7A85; --border: #E2EAF0;
  --success: #3D8B5A; --success-soft: #E6F4EA; --danger: #D93F44; --danger-soft: #FDECEC; --warn: #B7791F; --warn-soft: #FFF4E0;
  --radius: 14px; --shadow: 0 4px 14px rgba(11, 53, 80, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 500 14px/1.45 Manrope, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-dark); }

/* Layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.brand b { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.brand small { display: block; color: #9CC6DA; font-size: 11px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #CFE3EC; text-decoration: none; font-weight: 600; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; }
.nav a .count { margin-left: auto; background: #fff; color: var(--primary-dark); border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; }
.side .me { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 8px 0; font-size: 12px; color: #9CC6DA; }
.side .me b { display: block; color: #fff; font-size: 13px; }
.side .me button { background: none; border: 0; color: #9CC6DA; padding: 0; margin-right: 12px; cursor: pointer; text-decoration: underline; font-size: 12px; }
.main { padding: 28px 32px 60px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.6px; margin: 0; margin-right: auto; }
.btn.burger { display: none; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--primary-border); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { height: 40px; padding: 0 12px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface); width: 100%; outline: none; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search { width: 260px; }
.tabs { max-width: 100%; overflow-x: auto; display: inline-flex; background: #EAF0F4; border-radius: 12px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* Cards & tables */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.card h2 { font-size: 16px; font-weight: 800; margin: 0 0 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; }
.kpi .sub { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted, .muted { color: var(--muted); font-size: 12px; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--primary-soft); display: block; }
.cellflex { display: flex; align-items: center; gap: 10px; }
.code { font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.reserved, .pill.on { background: var(--primary-soft); color: var(--primary-dark); }
.pill.picked { background: var(--success-soft); color: var(--success); }
.pill.cancelled, .pill.off { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.gray { background: #EEF3F6; color: var(--muted); }

/* Chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar i { display: block; width: 100%; max-width: 28px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar span { font-size: 10px; color: var(--muted); }
.bar b { font-size: 11px; }

/* Modal */
.backdrop { position: fixed; inset: 0; background: rgba(7, 44, 60, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 560px; padding: 22px 24px; box-shadow: 0 20px 50px rgba(7, 44, 60, .25); }
.modal h3 { margin: 0 0 16px; font-size: 20px; font-weight: 800; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.upload { display: flex; align-items: center; gap: 12px; }
.upload img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--primary-soft); }
.error { color: var(--danger); font-size: 13px; font-weight: 600; margin-top: 10px; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 30px 28px; }
.login img { width: 120px; display: block; margin: 0 auto 6px; }
.login h1 { text-align: center; font-size: 20px; font-weight: 800; margin: 0 0 20px; }
.login form { display: grid; gap: 12px; }
.login .btn { height: 44px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; z-index: 99; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .btn.burger { display: inline-flex; }
  .main { padding: 18px 16px 50px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .form { grid-template-columns: 1fr; }
}
