:root { color: #142033; background: #dfe8e3; font-family: system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: #f4f7f5; }
.boot { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; }
.boot h1 { color: #087b45; letter-spacing: 0.08em; }
.tabbar { display: flex; gap: 4px; width: 100%; }
.tabbar .tab { flex: 1; min-height: 48px; border: 0; border-radius: 12px; background: transparent; font-weight: 700; font-size: 12px; padding: 0 2px; }
.tabbar .tab.active { background: #087b45; color: #fff; }
.action-row { display: flex; gap: 8px; margin: 8px 0 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.filters .choice { flex: 0 1 auto; min-height: 40px; border-radius: 999px; padding: 8px 12px; }
.filters .choice.active { border-color: #087b45; background: #e8f6ee; }
.choice { flex: 1; min-height: 64px; border: 1px solid #d7e5dc; background: #fff; border-radius: 16px; padding: 10px; text-align: left; }
.metric-grid { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.metric-grid enzym-button { display: block; width: 100%; }
.metric-grid enzym-button[variant="primary"] { color: #fff; }
.metric-grid enzym-button[variant="danger"] { color: #9b1c1c; }
.metric-grid enzym-button[variant="secondary"] { color: #0d5a34; }
.metric-body { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; text-align: left; }
.metric-body b { font-size: 32px; line-height: 1; min-width: 1.5ch; }
.metric-label { font-size: 18px; font-weight: 700; }
.metric-go { margin-left: auto; font-size: 30px; line-height: 1; font-weight: 400; }
.booking-facts { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; color: #142033; font-size: 14px; font-weight: 600; }
.search, .field input, .field textarea, .field select { width: 100%; min-height: 48px; border: 1px solid #d5e0da; border-radius: 14px; padding: 12px 14px; background: #fff; }
.search { margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 13px; font-weight: 700; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.list enzym-list-row { cursor: pointer; }
.empty, .muted { color: #5d6b7a; }
.chip { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #e7f5ec; color: #0d5a34; font-size: 12px; font-weight: 700; }
.chip.overdue, .chip.out { background: #fff4d8; color: #8a5a00; }
.notice { background: #eef6f1; border-radius: 14px; padding: 12px; margin: 10px 0; }
.notice.error { background: #fde8e8; }
.messages { display: flex; flex-direction: column; gap: 10px; min-height: 40vh; }
.bubble { background: #fff; border-radius: 16px; padding: 12px; white-space: pre-wrap; }
.message.user .bubble { background: #087b45; color: #fff; }
.chat-form, .chat-input-wrap { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-wrap textarea { flex: 1; min-height: 48px; border-radius: 14px; border: 1px solid #d5e0da; padding: 12px; }
.chat-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chat-upload, .file-btn { min-height: 48px; min-width: 48px; border-radius: 14px; border: 1px solid #d5e0da; background: #fff; display: grid; place-items: center; font-weight: 800; }
.chat-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
dialog { border: 0; padding: 0; width: min(480px, 100%); max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92dvh; }
dialog::backdrop { background: #14203366; }
.sheet-body { padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); overflow: auto; max-height: 80dvh; }
#toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: #142033; color: #fff; padding: 12px 14px; border-radius: 14px; width: min(440px, calc(100% - 24px)); opacity: 0; pointer-events: none; }
#toast.visible { opacity: 1; }
#toast.error { background: #9b1c1c; }
.form-error { margin-top: 8px; }
.linkish { background: none; border: 0; color: #087b45; font-weight: 700; min-height: 44px; padding: 0; text-align: left; }
.upload-area { border: 1.5px dashed #9dccb0; border-radius: 18px; padding: 18px; background: #fff; margin-bottom: 12px; }
.upload-area input { width: 100%; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.preview-table th, .preview-table td { padding: 8px 4px; border-bottom: 1px solid #e7eee9; text-align: left; }
.quixo-mark { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.quixo-logo { display: grid; width: 28px; height: 28px; }
.quixo-word { display: flex; flex-direction: column; line-height: 1.1; }
.quixo-word strong { color: #087b45; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.quixo-word small { color: #5d6b7a; font-size: 12px; }
.calendar { width: 100%; margin: 4px 0 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-head button { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: #fff; font-size: 22px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; width: 100%; }
.cal-dow { text-align: center; font-size: 11px; color: #5d6b7a; padding: 4px 0; }
.cal-day { min-height: 48px; border: 1px solid #d7e5dc; background: #fff; border-radius: 10px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cal-day.selected { border-color: #087b45; background: #e8f6ee; }
.cal-day .dots, .cal-legend { display: flex; gap: 4px; justify-content: center; align-items: center; min-height: 8px; }
.cal-legend { flex-wrap: wrap; gap: 10px; margin: 8px 0; font-size: 12px; color: #5d6b7a; }
.dot { width: 6px; height: 6px; border-radius: 99px; display: inline-block; }
.dot.scheduled { background: #087b45; }
.dot.return { background: #c47b00; }
.dot.pending { background: #1d4e89; }
.cal-options, .block-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.cal-options { grid-template-columns: 1fr; }
.cal-options label, .block-grid label, .checkline { display: flex; gap: 8px; align-items: center; min-height: 44px; background: #fff; border-radius: 12px; padding: 8px 10px; }
.section-label { font-size: 13px; margin: 12px 0 6px; }
@media (min-width: 800px) {
  dialog { margin: auto; border-radius: 20px; }
  .cal-day { min-height: 56px; }
}
.auth-body { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #dfe8e3; }
.auth-card { width: min(420px, 100%); background: #f4f7f5; border-radius: 20px; padding: 24px; }
.auth-card h1 { color: #087b45; letter-spacing: 0.08em; margin: 0 0 8px; }
.auth-card h2 { margin: 0 0 8px; font-size: 22px; }
.auth-submit { width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: #087b45; color: #fff; font-weight: 700; }
.auth-card a { color: #087b45; font-weight: 700; }

  body.layout-wide { background: #f5f7fa; color: #192a40; }
  body.layout-wide #app { max-width: none; min-height: 100vh; background: transparent; }
  body.layout-wide .desk { min-height: 100vh; }
  body.layout-wide .sidebar { width: 218px; background: #17263b; color: #afbdd2; position: fixed; inset: 0 auto 0 0; padding: 28px 16px 16px; display: flex; flex-direction: column; z-index: 20; }
  body.layout-wide .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; }
  body.layout-wide .brand-mark { width: 33px; height: 33px; border-radius: 9px; background: #fff; color: #17263b; display: grid; place-items: center; font-weight: 750; }
  body.layout-wide .wordmark { color: #fff; letter-spacing: 3px; font-weight: 750; font-size: 18px; line-height: 1.1; }
  body.layout-wide .brand-sub { font-size: 10px; letter-spacing: 1.1px; color: #a3b2c8; }
  body.layout-wide .nav-label { font-size: 9px; letter-spacing: 1.5px; margin: 16px 12px 8px; color: #7b8da7; }
  body.layout-wide .nav-item { display: flex; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 13px; font-weight: 650; min-height: 40px; }
  body.layout-wide .nav-item.active { background: #2d4564; color: #fff; box-shadow: inset 3px 0 #8eafe2; }
  body.layout-wide .sidebar-spacer { flex: 1; }
  body.layout-wide .profile { padding: 12px 8px; border-top: 1px solid #ffffff18; margin-top: 12px; }
  body.layout-wide .profile .name { color: #f3f7ff; font-size: 12px; font-weight: 650; }
  body.layout-wide .profile .role { font-size: 10px; text-transform: capitalize; }
  body.layout-wide .workspace { margin-left: 218px; min-height: 100vh; }
  body.layout-wide .topbar { height: 72px; padding: 0 36px; border-bottom: 1px solid #e6eaf0; background: #ffffffd9; display: flex; align-items: center; justify-content: space-between; }
  body.layout-wide .breadcrumb { font-size: 12px; color: #738094; }
  body.layout-wide .breadcrumb strong { color: #192a40; }
  body.layout-wide .breadcrumb span { padding: 0 8px; color: #bcc5d0; }
  body.layout-wide .sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #677d72; }
  body.layout-wide .sync .dot { width: 6px; height: 6px; border-radius: 50%; background: #559376; }
  body.layout-wide .content { max-width: 1580px; margin: 0 auto; padding: 32px 36px 48px; }
  body.layout-wide .page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
  body.layout-wide .page-head .eyebrow { color: #315dc8; font-size: 10px; font-weight: 750; letter-spacing: 1.6px; text-transform: uppercase; margin-bottom: 8px; }
  body.layout-wide .page-head h1 { font-size: 31px; letter-spacing: -1px; margin: 0; }
  body.layout-wide .page-head p { color: #738094; margin: 8px 0 0; }
  body.layout-wide .page-head .actions, body.layout-wide .booking-row .actions { display: flex; gap: 8px; flex-wrap: wrap; }
  body.layout-wide .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
  body.layout-wide .stats .stat { background: #fff; border: 1px solid #e6eaf0; border-radius: 14px; padding: 18px 20px; min-height: 0; text-align: left; }
  body.layout-wide .stat-top { color: #738094; font-size: 12px; }
  body.layout-wide .stat-number { font-size: 32px; letter-spacing: -1px; margin-top: 8px; font-weight: 650; }
  body.layout-wide .card { background: #fff; border: 1px solid #e6eaf0; border-radius: 14px; overflow: hidden; }
  body.layout-wide .card-head, body.layout-wide .table-toolbar { padding: 18px 20px; }
  body.layout-wide .card-head h2 { margin: 0; font-size: 16px; }
  body.layout-wide .card-head p, body.layout-wide .count { color: #738094; font-size: 12px; }
  body.layout-wide .table-toolbar { display: flex; gap: 10px; align-items: center; padding-top: 0; }
  body.layout-wide .table-toolbar .search { flex: 1; border: 0; background: transparent; padding: 0; min-height: 0; }
  body.layout-wide .table-toolbar .search input, body.layout-wide .table-toolbar select { width: 100%; min-height: 40px; border: 1px solid #dfe5ee; border-radius: 8px; padding: 8px 12px; background: #fff; }
  body.layout-wide .table-toolbar select { width: auto; min-width: 160px; }
  body.layout-wide .inventory-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  body.layout-wide .inventory-table th { text-align: left; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: #8190a3; background: #fafbfd; padding: 12px 14px; border-top: 1px solid #e6eaf0; border-bottom: 1px solid #e6eaf0; }
  body.layout-wide .inventory-table td { padding: 14px; border-bottom: 1px solid #eff2f6; vertical-align: middle; }
  body.layout-wide .device-cell b, body.layout-wide .device-cell small { display: block; }
  body.layout-wide .device-cell small { color: #738094; font-size: 11px; }
  body.layout-wide .text-link { background: none; border: 0; color: #315dc8; font-weight: 700; padding: 0; min-height: 32px; }
  body.layout-wide .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 10px 16px; border-radius: 9px; border: 0; font-size: 13px; font-weight: 650; }
  body.layout-wide .btn.primary { background: #315dc8; color: #fff; }
  body.layout-wide .btn.secondary { background: #fff; color: #192a40; border: 1px solid #e6eaf0; }
  body.layout-wide .btn.danger { background: #fff0f0; color: #b4464a; border: 1px solid #ecc8c8; }
  body.layout-wide .btn.desk-block { width: 100%; }
  body.layout-wide .booking-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
  body.layout-wide .booking-tabs .tab { min-height: 36px; padding: 7px 14px; border-radius: 8px; border: 1px solid #e6eaf0; background: #fff; }
  body.layout-wide .booking-tabs .tab.active { background: #edf2fc; color: #315dc8; font-weight: 700; }
  body.layout-wide .booking-list { display: grid; gap: 12px; }
  body.layout-wide .booking-row { background: #fff; border: 1px solid #e6eaf0; border-radius: 12px; display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) minmax(120px,.6fr) auto; gap: 16px; align-items: center; padding: 18px 20px; }
  body.layout-wide .booking-person small { display: block; color: #738094; }
  body.layout-wide .filters .choice { background: #fff; }
  body.layout-wide enzym-card { display: block; background: #fff; border: 1px solid #e6eaf0; border-radius: 14px; margin: 0 0 16px; }
  body.layout-wide dialog { width: min(640px, calc(100vw - 48px)); margin: auto; border-radius: 16px; max-height: calc(100dvh - 48px); }
  body.layout-wide #toast { bottom: 28px; }
  body.layout-wide .sidebar .brand { align-items: flex-start; }
  body.layout-wide .sidebar .quixo-mark { margin: 0; }
  body.layout-wide .sidebar .quixo-word strong { color: #fff; }
  body.layout-wide .sidebar .quixo-word small { color: #a3b2c8; }
  body.layout-wide .calendar, body.layout-wide .cal-options { max-width: 760px; }
  body.layout-wide .cal-day { min-height: 64px; }
