:root {
  --navy: #2C313D; --blue: #98CAEC; --wash: #EAF4FB; --bruin: #653818;
  --green: #00953b; --amber: #f28b00; --red: #e1261c; --line: #d6dee6;
  --ink: #1d1d1b; --muted: #6b7785;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink);
       background: var(--wash); line-height: 1.45; }
.hidden { display: none !important; }

header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
         background: var(--navy); color: #fff; padding: 10px 16px; }
header .brand { font-size: 18px; }
header .me { margin-left: auto; font-size: 14px; display: flex; gap: 8px; align-items: center; }
#nav { display: flex; gap: 4px; flex-wrap: wrap; }
#nav a { color: #cdd6e0; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; cursor: pointer; }
#nav a.active, #nav a:hover { background: rgba(255,255,255,.15); color: #fff; }

main { max-width: none; margin: 14px 0; padding: 0 20px; }
/* text-heavy views stay readable; the map + editor go full width (.maplayout) */
.narrow { max-width: 1100px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px;
        padding: 16px; margin-bottom: 14px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 140px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 3px; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
button { background: var(--navy); color: #fff; border: 0; border-radius: 8px;
         padding: 9px 14px; cursor: pointer; }
button.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
button.ok { background: var(--green); } button.bad { background: var(--red); }
button:disabled { opacity: .5; cursor: not-allowed; }
.err { color: var(--red); font-size: 14px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* floor map */
.maplayout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 820px){ .maplayout { grid-template-columns: 1fr; } }
svg.map { width: 100%; height: auto; max-height: 84vh; background: #f3f7d9; border: 1px solid var(--line); border-radius: 12px;
          user-select: none; -webkit-user-select: none; -moz-user-select: none; }
svg.map text { user-select: none; -webkit-user-select: none; pointer-events: none; }
.cell { cursor: pointer; }
.cell:hover { opacity: .85; }
.cell.sel { fill: rgba(152, 202, 236, .5); stroke: #fff; stroke-width: 5; }
.numtext.numsel { fill: var(--navy); }
/* map editor */
.editmap { touch-action: none; }
.editmap .ezbody { cursor: move; }
.editmap .ezhandle { cursor: nwse-resize; }
.item.selrow { border-color: var(--amber); background: #fff7e6; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.legend span::before { content: "■ "; }
.lg-free::before { color: var(--green); } .lg-draft::before { color: var(--amber); } .lg-appr::before { color: var(--red); }
.lg-block::before { color: #9a9a9a; }

/* lists */
.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
         background: var(--wash); color: var(--navy); }
.badge.draft { background: #fde9cf; color: #8a4d00; }
.badge.approved { background: #d6f3df; color: #036c2a; }
.badge.rejected, .badge.cancelled { background: #f6d6d3; color: #97160d; }
.badge.recurring { background: #e4e1fb; color: #4634a6; }

/* day timeline (block / Gantt board, like the Excel rooster) */
.tl-scroll { overflow-x: auto; }
.tl-grid { display: grid; border: 1px solid var(--line); border-radius: 8px;
           overflow: hidden; font-size: 11px; min-width: 640px; }
.tl-cell { padding: 6px 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tl-corner { border-left: 0; background: var(--wash); }
.tl-head { font-weight: 700; color: var(--navy); text-align: center; background: var(--wash);
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-gutter { position: relative; }
.tl-hour { position: absolute; right: 5px; color: var(--muted); font-size: 10px; transform: translateY(-6px); }
.tl-lane { position: relative; border-left: 1px solid var(--line); background: #fff; }
.tl-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tl-half { border-top-style: dotted; opacity: .55; }
.tl-now { position: absolute; left: 0; right: 0; border-top: 2px solid #d33; z-index: 3; }
.tl-slot { position: absolute; left: 0; right: 0; background: rgba(152, 202, 236, .28); }
.tl-block { position: absolute; border-radius: 5px; padding: 2px 5px; overflow: hidden;
            border: 1px solid rgba(0, 0, 0, .18); color: #1d1d1b; line-height: 1.25; }
.tl-block b { font-weight: 700; }
.tl-block .tl-p { opacity: .7; margin-left: 3px; }
.tl-draft { opacity: .68; border-style: dashed; }
.warn { color: #8a4d00; font-size: 13px; margin-top: 6px; }
.tchip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
         color: #1d1d1b; border: 1px solid rgba(0,0,0,.12); white-space: nowrap; }
.cbrow { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; }
.cbx { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink); margin: 0; }
.cbx input { width: auto; }
.seg { display: inline-flex; margin: 2px 0 10px; }
.seg button { padding: 4px 12px; font-size: 13px; background: #fff; color: var(--navy); border: 1px solid var(--line); }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.grph { font-weight: bold; margin: 12px 0 5px; padding-top: 6px; border-top: 1px solid var(--line); }
.login-wrap { max-width: 380px; margin: 8vh auto; }
#toast-wrap { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; }
