  :root {
    /* Tietoa Brand Colors */
    --sans: 'Outfit', 'Century Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'DM Mono', 'SF Mono', monospace;
    --bg: #EFEFEF;
    --surface: #FFFFFF;
    --surface-hover: #F8F8F8;
    --border: #E2E3DE;
    --border-light: #EFEFEF;
    --text: #242528;
    --text-secondary: #5A5A5C;
    --text-tertiary: #8A8A8C;
    /* Tietoa Primary */
    --primary: #F93838;
    --primary-light: #FEE8E8;
    --primary-mid: #FDCACA;
    --primary-dark: #D42F2F;
    /* Keep functional colors */
    --blue: #F93838;
    --blue-light: #FEE8E8;
    --blue-mid: #FDCACA;
    --green: #16A34A;
    --green-light: #F0FDF4;
    --green-border: #BBF7D0;
    --red: #DC2626;
    --red-light: #FEF2F2;
    --purple: #F93838;
    --amber: #D97706;
    --amber-light: #FFFBEB;
    --amber-border: #FDE68A;
    --pink: #F93838;
    --cyan: #F93838;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
  }

  button {
    cursor: pointer; border: none; background: none;
    color: inherit; font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  button:active { transform: scale(0.97); }

  .app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100dvh;
  }

  /* ─── Login Screen ─── */
  .login-screen {
    position: fixed; inset: 0; z-index: 1000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.4s, visibility 0.4s;
  }
  .login-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
  .login-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 24px; padding: 40px 36px; width: min(400px, 90vw);
    box-shadow: var(--shadow-lg); text-align: center;
  }
  .login-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: #F93838;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(249,56,56,0.3);
  }
  .login-card h2 {
    font-size: 22px; font-weight: 800; margin-bottom: 4px;
    letter-spacing: -0.5px;
  }
  .login-card .login-sub {
    font-size: 13px; color: var(--text-tertiary); margin-bottom: 28px; font-weight: 500;
  }

  /* Microsoft login button */
  .ms-login-btn {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; padding: 14px 20px; border-radius: var(--radius);
    background: #fff; border: 1.5px solid var(--border);
    font-family: var(--sans); font-size: 15px; font-weight: 600;
    color: var(--text); cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  }
  .ms-login-btn:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0,120,212,0.15);
  }
  .ms-login-btn:active { transform: scale(0.98); }
  .ms-login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
  .ms-login-btn svg { flex-shrink: 0; }

  .login-status {
    margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; display: none;
  }
  .login-status.loading {
    display: block; background: var(--blue-light); color: var(--blue);
    border: 1px solid var(--blue-mid);
  }
  .login-status.error {
    display: block; background: var(--red-light); color: var(--red);
    border: 1px solid rgba(220,38,38,0.3);
  }
  .login-status.not-found {
    display: block; background: var(--amber-light); color: #92400E;
    border: 1px solid var(--amber-border);
  }
  .login-spinner-sm {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: spin 0.6s linear infinite;
    vertical-align: middle; margin-right: 8px;
  }
  .login-btn {
    margin-top: 20px; padding: 15px 20px; border-radius: var(--radius);
    background: #F93838;
    color: #fff; font-size: 15px; font-weight: 700; width: 100%;
    letter-spacing: 0.3px; box-shadow: 0 6px 24px rgba(249,56,56,0.30);
    transition: box-shadow 0.2s, transform 0.15s;
  }
  .login-btn:hover { box-shadow: 0 8px 32px rgba(249,56,56,0.40); }
  .login-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
  .login-error {
    margin-top: 12px; font-size: 12px; color: var(--red); font-weight: 600;
    min-height: 18px;
  }
  .login-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: spin 0.6s linear infinite;
    vertical-align: middle; margin-right: 6px;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ─── Header ─── */
  .header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
  }
  .header-left { display: flex; align-items: center; gap: 12px; }
  .header-logo {
    height: 24px;
    width: auto;
  }
  .header h1 {
    font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
    color: var(--text);
  }
  .header-sub {
    font-size: 11px; color: var(--text-tertiary);
    font-weight: 500; margin-top: 1px;
  }
  .header-right { display: flex; align-items: center; gap: 8px; }
  .badge {
    padding: 5px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 4px;
  }
  .badge-free {
    background: var(--green-light);
    border: 1px solid var(--green-border);
    color: var(--green);
  }
  .badge-mine {
    background: var(--blue-light);
    border: 1px solid var(--blue-mid);
    color: var(--blue);
  }
  .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    font-family: var(--sans);
    box-shadow: var(--shadow-sm);
    cursor: pointer; position: relative;
  }
  .avatar.draggable {
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .avatar.draggable:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  .avatar.dragging {
    cursor: grabbing;
    transform: scale(1.2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1000;
  }
  .avatar-drag-hint {
    position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    font-size: 9px; color: var(--text-tertiary); white-space: nowrap;
    opacity: 0; transition: opacity 0.2s;
    pointer-events: none;
  }
  .avatar.draggable:hover .avatar-drag-hint { opacity: 1; }
  
  /* Drag ghost that follows cursor */
  .drag-ghost {
    position: fixed; pointer-events: none; z-index: 9999;
    width: 44px; height: 44px; border-radius: 50%;
    background-size: cover; background-position: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    display: none;
    border: 3px solid white;
  }
  .drag-ghost.active { display: block; }
  
  /* Drop zone highlight */
  .floorplan-viewport.drop-active {
    outline: 3px dashed var(--primary);
    outline-offset: -3px;
  }

  /* User menu */
  .user-menu {
    position: absolute; top: 100%; right: 0; margin-top: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 6px;
    box-shadow: var(--shadow-lg); z-index: 50; min-width: 200px;
    display: none;
  }
  .user-menu.active { display: block; }
  .user-menu-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    width: 100%; text-align: left; transition: background 0.1s;
  }
  .user-menu-item:hover { background: var(--bg); }
  .user-menu-item.danger { color: var(--red); }
  .user-menu-name {
    padding: 10px 14px; font-size: 13px; font-weight: 700;
    color: var(--text); border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
  }
  .test-mode-badge {
    display: inline-block; background: #F59E0B; color: #fff; font-size: 9px; font-weight: 700;
    padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; letter-spacing: 0.5px;
  }
  .test-user-list {
    max-height: 320px; overflow-y: auto; border-top: 1px solid var(--border-light);
    margin-top: 4px; padding-top: 4px;
  }
  .test-user-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: var(--radius-xs);
    font-size: 12px; cursor: pointer; transition: background 0.1s;
  }
  .test-user-item:hover { background: var(--bg); }
  .test-user-item.active { background: rgba(249,56,56,0.08); font-weight: 600; }
  .test-user-avatar {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: #fff; background-size: cover; background-position: center;
  }

  /* Connection status */
  .conn-dot {
    width: 8px; height: 8px; border-radius: 50%;
    position: absolute; bottom: 0; right: 0;
    border: 2px solid var(--surface);
  }
  .conn-dot.online { background: var(--green); }
  .conn-dot.offline { background: var(--red); animation: pulse 1.5s infinite; }

  /* ─── Floor plan area ─── */
  .floorplan-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg);
    touch-action: none;
    z-index: 0;
    contain: paint;
  }
  .floorplan-viewport {
    width: 100%; height: 100%;
    overflow: hidden; position: relative; cursor: grab;
    background: #e8e5e0;
  }
  .floorplan-viewport:active { cursor: grabbing; }
  .floorplan-canvas {
    position: absolute;
    transform-origin: 0 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .floorplan-canvas img {
    display: block; user-select: none;
    -webkit-user-drag: none; pointer-events: none;
  }
  .floorplan-svg {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; pointer-events: none;
    user-select: none; -webkit-user-select: none;
  }
  .floorplan-svg rect.hitarea {
    pointer-events: all; cursor: pointer;
    user-select: none; -webkit-user-select: none;
    fill: transparent;
    stroke: none;
  }
  @media (hover: hover) {
    .floorplan-svg rect.hitarea { transition: fill 0.15s; }
  }
  .floorplan-svg circle.hitarea {
    pointer-events: all; cursor: pointer;
    user-select: none; -webkit-user-select: none;
  }
  .floorplan-svg rect.hitarea:hover {
    fill: rgba(0,0,0,0.15);
  }
  .floorplan-svg rect.hitarea.free {
    fill: transparent;
  }
  .floorplan-svg rect.hitarea.free:hover {
    fill: rgba(0,0,0,0.15);
  }
  .floorplan-svg rect.hitarea.partial {
    fill: rgba(217,119,6,0.22);
  }
  .floorplan-svg rect.hitarea.partial:hover {
    fill: rgba(217,119,6,0.35);
  }
  .floorplan-svg rect.hitarea.full-booked {
    fill: rgba(220,38,38,0.22);
  }
  .floorplan-svg rect.hitarea.full-booked:hover {
    fill: rgba(220,38,38,0.35);
  }
  .floorplan-svg rect.hitarea.booked { }
  .floorplan-svg rect.hitarea.own {
    fill: rgba(37,99,235,0.20);
  }
  .floorplan-svg text.station-label {
    pointer-events: none; font-family: var(--sans);
    font-weight: 600; text-anchor: middle; dominant-baseline: central;
  }

  /* SVG tooltip */
  .svg-tooltip { pointer-events: none; }

  .zoom-hint {
    position: absolute; bottom: 16px; left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px; border-radius: 20px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-md); font-size: 11px;
    color: var(--text-tertiary); font-weight: 500;
    z-index: 5; opacity: 1; transition: opacity 0.4s ease;
    pointer-events: none; white-space: nowrap;
  }
  .zoom-hint.hidden { opacity: 0; }

  /* ─── Bottom date strip ─── */
  .date-bar {
    flex-shrink: 0; background: var(--surface);
    border-top: 1px solid var(--border);
    position: relative; z-index: 10;
    overflow: visible;
  }
  .date-bar-label {
    display: flex; align-items: center; justify-content: flex-start;
    padding: 6px 20px 0; gap: 6px;
    position: relative; z-index: 5;
  }
  .date-bar-month {
    font-size: 13px; font-weight: 700; color: var(--text);
    text-transform: capitalize;
  }
  .date-bar-year {
    font-size: 13px; font-weight: 500; color: var(--text-tertiary);
  }
  .date-strip-container {
    position: relative; overflow: visible;
  }
  .date-strip-indicator {
    position: absolute;
    left: 50%;
    top: 2px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--primary);
    z-index: 5;
    pointer-events: none;
  }
  .today-pill {
    display: none;
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    z-index: 10; padding: 3px 12px; border-radius: 12px;
    background: var(--blue); color: white; border: none;
    font-size: 11px; font-weight: 600; font-family: var(--sans);
    box-shadow: 0 2px 8px rgba(37,99,235,0.35);
    cursor: pointer; white-space: nowrap;
    animation: todayPillIn 0.2s ease-out;
  }
  .today-pill.visible { display: block; }
  @keyframes todayPillIn { from { opacity:0; transform: translateX(-50%) translateY(4px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
  .date-strip {
    padding: 4px 0 8px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; cursor: grab;
  }
  .date-strip::-webkit-scrollbar { display: none; }
  .date-strip:active { cursor: grabbing; }
  .date-strip-inner {
    display: flex; gap: 4px; min-width: max-content; padding: 0 calc(50% - 24px);
  }
  .date-btn {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 6px 6px; border-radius: var(--radius-sm);
    min-width: 48px; transition: all 0.15s; position: relative;
    border: 2px solid transparent; background: transparent;
  }
  .date-btn:hover:not(.weekend):not(.past) { background: var(--surface-hover); }
  .date-btn.selected { border-color: var(--blue); background: var(--blue-light); }
  .date-btn.weekend { opacity: 0.25; cursor: default; }
  .date-btn.past { opacity: 0.65; cursor: pointer; }
  .date-btn.past:hover { background: var(--surface-hover); opacity: 0.8; }
  .date-btn.past.weekend { opacity: 0.15; cursor: default; }
  .date-btn.past.weekend:hover { background: transparent; opacity: 0.15; }
  .date-day {
    font-size: 10px; color: var(--text-tertiary); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .date-btn.selected .date-day { color: var(--blue); }
  .date-num { font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--text); }
  .date-btn.weekend .date-num, .date-btn.past .date-num { color: var(--text-tertiary); }
  .date-btn.selected .date-num { color: var(--blue); }
  .date-today { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); margin-top: 2px; }
  .date-month-sep {
    display: flex; align-items: center; padding: 0 6px;
    font-size: 10px; font-weight: 700; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 1px; min-width: 36px;
    justify-content: center; border-left: 2px solid var(--border-light);
    margin-left: 4px; padding-left: 12px;
  }
  .date-bar-buttons {
    display: flex; flex-direction: row; align-items: center; gap: 6px; margin-left: auto;
  }
  .people-toggle {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
    color: var(--text-tertiary); background: transparent; border: 1px solid var(--border);
    cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap;
  }
  .people-toggle:hover { background: var(--surface-hover); color: var(--text); }
  .people-toggle.active { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
  #peopleFilterBtn { display: none; }
  #peopleFilterBtn.visible { display: flex; }
  @media (max-width: 600px) {
    #peopleFilterBtn.visible { display: none; }
  }

  /* ─── Week grid (inside popup) ─── */
  .week-grid {
    margin-bottom: 12px;
  }
  .week-grid-header {
    font-size: 11px; font-weight: 700; color: var(--text-secondary);
    padding: 4px 0 6px; display: flex; align-items: center; gap: 6px;
  }
  .week-grid-header .week-num {
    font-size: 9px; font-weight: 600; color: var(--text-tertiary);
    background: var(--bg); padding: 1px 6px; border-radius: 3px;
  }
  .week-row {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  }
  .week-cell {
    position: relative; padding: 6px 4px; border-radius: 6px;
    border: 2px solid var(--border-light); background: var(--surface);
    text-align: center; cursor: pointer; transition: all 0.15s;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
  }
  .week-cell:hover { border-color: var(--border); }
  .week-cell.today { border-color: var(--blue); }
  .week-cell.selected {
    background: var(--blue-light); border-color: var(--blue);
  }
  .week-cell.selected:hover { background: rgba(37,99,235,0.15); }
  .week-cell.booked-own {
    background: rgba(37,99,235,0.06); border-color: rgba(37,99,235,0.3);
  }
  .week-cell.booked-other {
    background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.25);
  }
  .week-cell-outlook {
    position: absolute; bottom: 1px; left: 0; right: 0;
    font-size: 6px; color: rgba(239,68,68,0.7); text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px;
  }
  .week-cell.past {
    opacity: 0.35; cursor: default; pointer-events: none;
  }
  .week-cell.past.past-deletable {
    opacity: 0.65; cursor: pointer; pointer-events: auto;
  }
  .week-cell.past.past-deletable:hover {
    border-color: var(--red); background: rgba(239,68,68,0.08);
  }
  .week-cell-day {
    font-size: 9px; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.3px;
  }
  .week-cell.selected .week-cell-day { color: var(--blue); }
  .week-cell-num {
    font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3;
  }
  .week-cell.selected .week-cell-num { color: var(--blue); }
  .week-cell-check {
    position: absolute; top: 2px; right: 3px; font-size: 9px; color: var(--blue);
  }
  .week-cell-existing {
    position: absolute; top: 2px; left: 3px; font-size: 8px; color: var(--text-tertiary);
  }
  .week-cell.deletable { cursor: pointer; }
  .week-cell.deletable:hover {
    border-color: var(--red); background: rgba(239,68,68,0.08);
  }
  .week-cell.bulk-selected {
    border-color: var(--red) !important; background: rgba(239,68,68,0.12) !important;
  }
  .user-week-scroll {
    max-height: min(360px, 50vh); overflow-y: auto; padding-right: 4px;
    -webkit-overflow-scrolling: touch;
  }
  #peopleOverlay {
    position: absolute; bottom: calc(100% + 32px); left: 0; right: 0;
    pointer-events: none; overflow: visible; z-index: 4;
    display: none;
  }
  #peopleOverlay.active { display: block; }
  .people-column {
    position: absolute; bottom: 0;
    display: flex; flex-direction: column; align-items: center;
    transform: translateX(-50%);
  }
  .date-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    font-size: 9px; font-weight: 700; color: #fff;
    display: flex; align-items: flex-end; justify-content: center;
    overflow: hidden; line-height: 1; position: relative;
    margin-top: -10px; pointer-events: auto; cursor: default;
    transition: transform 0.15s;
  }
  .date-avatar:first-child { margin-top: 0; }
  .date-avatar:hover { transform: scale(1.2); z-index: 100 !important; }
  .date-avatar.anim-in, .date-avatar-count.anim-in {
    opacity: 0; transform: scale(0);
    animation: avatarPop 0.15s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
  }
  @keyframes avatarPop {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
  }
  .date-avatar-count {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: var(--text-tertiary); color: #fff;
    font-size: 10px; font-weight: 700; border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    margin-top: -10px; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  }

  /* ─── Popup ─── */
  .install-banner {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 16px 20px; z-index: 200;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    animation: slideUp 0.3s ease;
  }
  @keyframes slideUp {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
  }
  .install-banner.visible { display: block; }
  .install-banner-content {
    display: flex; align-items: center; gap: 14px; max-width: 500px; margin: 0 auto;
  }
  .install-banner-icon {
    width: 48px; height: 48px; border-radius: 12px; background: #F93838;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800; color: #fff; flex-shrink: 0;
  }
  .install-banner-text { flex: 1; }
  .install-banner-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
  .install-banner-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
  .install-banner-actions { display: flex; gap: 8px; margin-top: 10px; }
  .install-btn {
    padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600;
    font-family: inherit; cursor: pointer; border: none;
  }
  .install-btn.primary { background: #F93838; color: #fff; }
  .install-btn.primary:hover { background: #d62f2f; }
  .install-btn.secondary { background: transparent; color: var(--text-tertiary); border: 1px solid var(--border); }
  .popup-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.20); backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px); z-index: 100;
  }
  .popup-overlay.active { display: block; }
  .popup {
    display: none; position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(440px, 92vw); max-height: 88vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px; z-index: 101;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .popup.active { display: block; }
  .popup-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 20px;
  }
  .popup-zone {
    font-size: 11px; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
  }
  .popup-id {
    font-size: 30px; font-weight: 800; margin-top: 2px;
    color: var(--text); letter-spacing: -0.5px;
  }
  .popup-close {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text-secondary); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
  }
  .popup-close:hover { background: var(--border-light); }
  .popup-bookings-label {
    font-size: 10px; color: var(--text-tertiary); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
  }
  .popup-booking-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 4px;
  }
  .popup-booking-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
  }
  .popup-booking-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
  .popup-booking-name { font-size: 13px; color: var(--text-secondary); font-weight: 500; flex: 1; }
  .popup-booking-time { font-size: 12px; color: var(--text-tertiary); font-family: var(--sans); font-weight: 500; }

  /* Booking mode tabs */
  .booking-mode-tabs {
    display: flex; gap: 4px; margin-bottom: 16px;
    background: var(--bg); border-radius: var(--radius-sm); padding: 3px;
  }
  .booking-mode-tab {
    flex: 1; padding: 9px 12px; border-radius: var(--radius-xs);
    font-size: 12px; font-weight: 600; text-align: center;
    color: var(--text-tertiary); transition: all 0.15s;
  }
  .booking-mode-tab.active {
    background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  }
  .booking-mode-tab:not(.active):hover { color: var(--text-secondary); }

  /* Time selection area */
  .time-section { margin-bottom: 16px; }
  .time-section-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
  }
  .time-section-label {
    font-size: 10px; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
  }
  .time-display-inline {
    font-size: 16px; font-weight: 800; font-family: var(--sans);
    color: var(--text); letter-spacing: 0.5px;
  }

  .hour-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .hour-btn {
    padding: 10px 0; border-radius: var(--radius-xs);
    background: var(--bg); color: var(--text-tertiary);
    font-size: 13px; font-weight: 500; font-family: var(--sans);
    transition: all 0.12s; border: 1px solid transparent;
    position: relative;
  }
  .hour-btn:hover:not(.conflict) { background: var(--border-light); }
  .hour-btn.in-range {
    background: var(--blue-light); color: var(--blue);
    font-weight: 700; border-radius: 4px; border-color: var(--blue-mid);
  }
  .hour-btn.start {
    background: var(--blue); color: #fff; font-weight: 700;
    border-radius: var(--radius-xs) 4px 4px var(--radius-xs); border-color: var(--blue);
  }
  .hour-btn.end {
    background: var(--purple); color: #fff; font-weight: 700;
    border-radius: 4px var(--radius-xs) var(--radius-xs) 4px; border-color: var(--purple);
  }
  .hour-btn.start.end { border-radius: var(--radius-xs); }
  .hour-btn.end-marker {
    background: rgba(139,92,246,0.1); color: var(--purple); font-weight: 600;
    border: 1.5px dashed var(--purple); border-radius: 4px;
  }
  .hour-btn.conflict {
    background: var(--red-light); color: rgba(220,38,38,0.4);
    border-color: rgba(220,38,38,0.15); cursor: not-allowed;
  }
  .hour-btn.conflict::after {
    content: ''; position: absolute; top: 50%; left: 20%; right: 20%;
    height: 1.5px; background: rgba(220,38,38,0.3);
    transform: rotate(-12deg);
  }
  .hour-indicator {
    display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
    font-size: 12px; color: var(--text-tertiary); font-weight: 500;
  }
  .hour-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    animation: pulse 1.5s infinite;
  }
  .custom-time-toggle {
    display: block; width: 100%; padding: 10px;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 12px;
    cursor: pointer; transition: background 0.15s;
  }
  .custom-time-toggle:hover { background: var(--surface-hover); }
  .hour-grid-wrapper { margin-top: 8px; }

  /* Multi-day booking */
  .multi-day-section { margin-bottom: 16px; }
  .multi-day-row {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px; border-radius: var(--radius);
    background: var(--bg); border: 1px solid var(--border-light);
  }
  .multi-day-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; flex-shrink: 0; }
  .multi-day-input {
    flex: 1; font-family: var(--sans); font-size: 14px; font-weight: 600;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 8px 12px; background: var(--surface); color: var(--text);
    outline: none; text-align: center;
  }
  .multi-day-input:focus { border-color: #F93838; box-shadow: 0 0 0 3px rgba(249,56,56,0.1); }
  .multi-day-info {
    margin-top: 8px; font-size: 11px; color: var(--text-tertiary);
    font-weight: 500; text-align: center;
  }

  .confirm-btn {
    margin-top: 14px; padding: 15px 20px; border-radius: var(--radius);
    background: #F93838;
    color: #fff; font-size: 15px; font-weight: 700; width: 100%;
    letter-spacing: 0.3px; box-shadow: 0 6px 24px rgba(249,56,56,0.30);
    transition: box-shadow 0.2s, transform 0.15s;
  }
  .confirm-btn:hover { box-shadow: 0 8px 32px rgba(249,56,56,0.40); }
  .confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .cancel-btn {
    padding: 14px 20px; border-radius: var(--radius);
    border: 2px solid rgba(220,38,38,0.25); background: var(--red-light);
    color: var(--red); font-size: 15px; font-weight: 700; width: 100%;
  }
  .own-booking-info {
    padding: 18px; border-radius: var(--radius);
    background: var(--blue-light); border: 1px solid var(--blue-mid); margin-bottom: 16px;
  }
  .own-booking-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 600; }
  .own-booking-time { font-size: 17px; font-weight: 800; font-family: var(--sans); color: var(--blue); }
  .own-booking-dates { font-size: 12px; color: var(--blue); font-weight: 500; margin-top: 4px; }

  .toast {
    display: none; position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    padding: 10px 20px; border-radius: var(--radius); color: var(--text);
    font-size: 13px; font-weight: 600; z-index: 200; white-space: nowrap;
    box-shadow: var(--shadow-lg); animation: slideDown 0.3s ease;
  }
  .toast.active { display: block; }
  .toast.success { background: var(--green-light); border: 1px solid var(--green-border); color: var(--green); }
  .toast.error { background: var(--red-light); border: 1px solid rgba(220,38,38,0.3); color: var(--red); }
  .toast.info { background: var(--blue-light); border: 1px solid var(--blue-mid); color: var(--blue); }


  /* Feedback badge */
  .feedback-badge {
    position: absolute; top: -2px; right: -2px; width: 16px; height: 16px;
    background: var(--red); color: white; border-radius: 50%;
    font-size: 9px; font-weight: 700; display: none;
    align-items: center; justify-content: center; z-index: 5;
    border: 2px solid var(--surface);
  }
  .feedback-badge.active { display: flex; }
  .feedback-list { max-height: 55vh; overflow-y: auto; }
  .feedback-item {
    padding: 12px; border-radius: var(--radius-xs); margin-bottom: 8px;
    background: var(--bg); border: 1px solid var(--border-light);
  }
  .feedback-item.unread { border-left: 3px solid var(--blue); }
  .feedback-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
  }
  .feedback-author { font-size: 12px; font-weight: 600; color: var(--text); }
  .feedback-time { font-size: 10px; color: var(--text-tertiary); }
  .feedback-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; white-space: pre-wrap; }
  .feedback-resolve-btn {
    margin-top: 6px; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border);
    background: var(--surface); font-size: 11px; color: var(--text-secondary);
    cursor: pointer; font-family: inherit;
  }
  .feedback-resolve-btn:hover { background: var(--bg); }

  /* Legend */
  .map-legend {
    position: absolute; top: 8px; left: 8px;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 20px; padding: 4px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08); z-index: 5;
    display: flex; flex-direction: row; gap: 8px; align-items: center;
  }
  .legend-item {
    display: flex; align-items: center; gap: 4px;
    font-size: 9px; font-weight: 500; color: var(--text-tertiary);
  }
  .legend-dot {
    width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
  }

  /* Mobile info bubble */
  .mobile-info-bubble {
    position: absolute; z-index: 50;
    background: #1A1A1A; color: #fff; border-radius: 10px;
    padding: 10px 14px; min-width: 160px; max-width: 220px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    pointer-events: auto; font-family: var(--sans);
    animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .mobile-info-bubble::after {
    content: ''; position: absolute; left: 50%; bottom: -6px;
    transform: translateX(-50%);
    border-left: 7px solid transparent; border-right: 7px solid transparent;
    border-top: 7px solid #1A1A1A;
  }
  .mobile-info-bubble.arrow-top::after {
    bottom: auto; top: -6px;
    border-top: none; border-bottom: 7px solid #1A1A1A;
  }
  .mobile-info-line {
    display: flex; align-items: center; gap: 8px; padding: 3px 0;
  }
  .mobile-info-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }
  .mobile-info-name { font-size: 13px; font-weight: 600; flex: 1; }
  .mobile-info-time { font-size: 11px; font-family: var(--sans); opacity: 0.6; }

  /* Conflict warning */
  .conflict-warning {
    padding: 12px 14px; border-radius: var(--radius-sm);
    background: #FEF3C7; border: 1px solid #FDE68A;
    font-size: 12px; color: #92400E; font-weight: 500;
    margin-bottom: 12px; line-height: 1.5;
  }
  .conflict-warning strong { font-weight: 700; }

  /* Meeting room styles */
  .room-popup {
    display: none; position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 92vw); max-height: 88vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px; z-index: 101;
    box-shadow: var(--shadow-lg);
    animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .room-popup.active { display: block; }
  .room-header {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  }
  .room-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
  }
  .room-title { font-size: 22px; font-weight: 800; color: var(--text); }
  .room-subtitle { font-size: 12px; color: var(--text-tertiary); font-weight: 500; margin-top: 2px; }
  .room-close {
    margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text-secondary); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
  }
  .room-close:hover { background: var(--border-light); }

  /* Room schedule display */
  .room-schedule-container { margin-bottom: 20px; }
  .room-schedule-loading, .room-schedule-error, .room-schedule-empty {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 13px; text-align: center;
  }
  .room-schedule-loading { 
    background: var(--bg); color: var(--text-tertiary);
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .room-schedule-error { background: rgba(220,38,38,0.08); color: rgba(220,38,38,0.8); }
  .room-schedule-empty { background: rgba(22,163,74,0.08); color: rgba(22,163,74,0.8); }
  .room-schedule-label {
    font-size: 10px; color: var(--text-tertiary); margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
  }
  .room-schedule-timeline {
    position: relative; height: 28px; background: var(--bg);
    border-radius: 6px; margin-bottom: 10px; overflow: hidden;
    border: 1px solid var(--border-light);
  }
  .room-schedule-block {
    position: absolute; top: 3px; bottom: 12px;
    border-radius: 4px; border: 1px solid;
  }
  .room-schedule-marker {
    position: absolute; bottom: 1px; font-size: 7px;
    color: var(--text-tertiary); transform: translateX(-50%); opacity: 0.6;
  }
  .room-schedule-list { display: flex; flex-direction: column; gap: 6px; }
  .room-schedule-item {
    font-size: 13px; color: var(--text-secondary);
    padding: 8px 12px; background: var(--bg); border-radius: 8px;
    display: flex; align-items: center; gap: 12px;
  }
  .room-schedule-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background-size: cover; background-position: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
  .room-schedule-avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }
  .room-schedule-info { flex: 1; }
  .room-schedule-name { font-weight: 500; color: var(--text); }
  .room-schedule-time { font-weight: 600; color: var(--text); font-size: 12px; }

  .room-time-section { margin-bottom: 20px; }
  .room-time-label {
    font-size: 10px; color: var(--text-tertiary); margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
  }
  .room-time-grid {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  }
  .room-time-select {
    padding: 14px 16px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--bg);
    font-family: 'Outfit', 'Century Gothic', sans-serif; 
    font-size: 15px; font-weight: 600;
    color: var(--text); cursor: pointer; text-align: center;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%236B6560' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }
  .room-time-select option {
    font-family: 'Outfit', 'Century Gothic', sans-serif; 
    font-weight: 500;
  }
  .room-time-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,56,56,0.1);
    outline: none;
  }
  .room-time-arrow {
    font-size: 18px; color: var(--text-tertiary); font-weight: 500;
  }
  .room-time-display {
    text-align: center; padding: 12px;
    background: var(--primary-light); border-radius: var(--radius-sm);
    border: 1px solid var(--primary-mid); margin-top: 12px;
  }
  .room-time-display-text {
    font-size: 18px; font-weight: 800; font-family: var(--sans); color: var(--primary);
  }
  .room-time-display-duration {
    font-size: 12px; color: var(--text-secondary); margin-top: 4px; font-weight: 500;
  }

  .room-book-btn {
    margin-top: 16px; padding: 16px 20px; border-radius: var(--radius);
    background: #F93838;
    color: #fff; font-size: 15px; font-weight: 700; width: 100%;
    letter-spacing: 0.3px; box-shadow: 0 6px 24px rgba(249,56,56,0.30);
    transition: box-shadow 0.2s, transform 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
  }
  .room-book-btn:hover { box-shadow: 0 8px 32px rgba(249,56,56,0.40); }
  .room-book-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .room-book-btn svg { flex-shrink: 0; }

  .room-status {
    margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; text-align: center; display: none;
  }
  .room-status.loading {
    display: block; background: var(--blue-light); color: var(--blue);
    border: 1px solid var(--blue-mid);
  }
  .room-status.success {
    display: block; background: var(--green-light); color: var(--green);
    border: 1px solid var(--green-border);
  }
  .room-status.error {
    display: block; background: var(--red-light); color: var(--red);
    border: 1px solid rgba(220,38,38,0.3);
  }

  .room-hitarea {
    pointer-events: all; cursor: pointer;
    fill: transparent;
    transition: fill 0.15s;
    user-select: none; -webkit-user-select: none;
    stroke: none;
  }
  .room-hitarea:hover {
    fill: rgba(255,255,255,0.20);
  }

  /* Parking spot styles */
  .parking-hitarea {
    pointer-events: all; cursor: pointer;
    fill: rgba(36,37,40,0.10);
    transition: fill 0.15s;
    user-select: none; -webkit-user-select: none;
    mix-blend-mode: multiply;
    stroke: none;
  }
  .parking-hitarea:hover {
    fill: rgba(36,37,40,0.20);
  }
  .parking-hitarea.own {
    fill: rgba(37,99,235,0.25);
    mix-blend-mode: normal;
  }
  .parking-hitarea.booked {
    fill: rgba(220,38,38,0.18);
  }

  /* Brown/Orange room hitarea */
  .brown-room-hitarea {
    pointer-events: all; cursor: pointer;
    fill: transparent;
    transition: fill 0.15s;
    user-select: none; -webkit-user-select: none;
    stroke: none;
  }
  .brown-room-hitarea:hover {
    fill: rgba(255,255,255,0.20);
  }
  .brown-room-hitarea.unavailable {
    fill: rgba(36,37,40,0.05);
    cursor: not-allowed;
  }
  .brown-room-hitarea.booked {
    fill: rgba(220,38,38,0.12);
  }
  .brown-room-hitarea.own {
    fill: rgba(37,99,235,0.20);
  }

  @keyframes slideDown { from { opacity:0; transform: translateX(-50%) translateY(-10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
  @keyframes popIn { from { opacity:0; transform: translate(-50%,-50%) scale(0.92); } to { opacity:1; transform: translate(-50%,-50%) scale(1); } }
  @keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

  @media (max-width: 768px) {
    .header { padding: 10px 14px; gap: 8px; }
    .header-left { flex-shrink: 0; min-width: 0; }
    .header-left h1 { font-size: 15px; }
    .header-right { flex-shrink: 1; min-width: 0; gap: 6px; }
    .badge { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
    .header-sub { display: none; }
    .date-bar-label { padding: 4px 14px 0; }
    .date-strip { padding: 4px 0 8px; }
    .date-strip-inner { padding: 0 10px; }
    .toast { top: 56px; }
    .zoom-controls { bottom: 12px; right: 12px; }
    .map-legend { top: 6px; left: 6px; padding: 3px 8px; gap: 6px; }
    .legend-item { font-size: 8px; gap: 3px; }
    .legend-dot { width: 6px; height: 6px; }
  }
  /* ══════════ RESOURCE CALENDAR OVERLAY ══════════ */
  .cal-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 5000; background: var(--bg); flex-direction: column;
  }
  .cal-overlay.active { display: flex; }
  .cal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
  }
  .cal-header-left { display: flex; align-items: center; gap: 10px; }
  .cal-header h2 { font-size: 16px; font-weight: 700; margin: 0; }
  .cal-header-icon { font-size: 20px; display: flex; align-items: center; color: var(--text); }
  .cal-back-btn, .cal-admin-btn {
    background: none; border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--text);
    font-weight: 500; font-family: var(--sans);
  }
  .cal-back-btn:active, .cal-admin-btn:active { background: var(--border); }
  .cal-year-nav {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .cal-year-nav button {
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    width: 32px; height: 32px; cursor: pointer; font-size: 11px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
  }
  .cal-year-display { font-size: 16px; font-weight: 700; min-width: 48px; text-align: center; }
  .cal-today-btn {
    margin-left: auto; background: var(--text); color: #fff; border: none;
    padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: var(--sans);
  }
  .cal-legend {
    display: flex; gap: 10px; padding: 6px 16px; font-size: 11px;
    color: var(--text-secondary); background: var(--surface); border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .cal-legend-item { display: flex; align-items: center; gap: 4px; }
  .cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
  .cal-body {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 12px; display: flex; flex-direction: column; gap: 12px;
    max-width: 900px; margin: 0 auto; width: 100%;
  }
  .cal-month {
    background: var(--surface); border-radius: 10px; overflow: hidden;
    border: 1px solid var(--border);
  }
  .cal-month-header {
    background: #334155; color: #f1f5f9; padding: 10px 14px;
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  }
  #calOverlay td.selected { box-shadow: inset 0 0 0 2px var(--blue) !important; background: rgba(37,99,235,0.08) !important; }
  #calOverlay td.selecting { box-shadow: inset 0 0 0 1px var(--blue) !important; background: rgba(37,99,235,0.04) !important; }
  .cal-day-num { font-weight: 600; font-size: 11px; line-height: 1; padding: 1px; color: #242528; }
  .cal-cell-bookings { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px; overflow: hidden; }
  .cal-bk-chip {
    display: inline-flex; align-items: center; gap: 0; border-radius: 3px; overflow: hidden;
    font-size: 10px; font-weight: 600; color: #fff; line-height: 1; position: relative;
    max-width: 100%;
  }
  .cal-bk-chip-user {
    padding: 2.5px 4px; background: var(--user-color, #666);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cal-bk-chip-item {
    padding: 2.5px 4px; background: var(--chip-color, #999);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cal-bk-del {
    position: absolute; right: -2px; top: -2px;
    background: #dc2626; color: #fff; border: none; width: 12px; height: 12px;
    border-radius: 50%; font-size: 8px; cursor: pointer; display: none; line-height: 1;
    align-items: center; justify-content: center; padding: 0;
  }
  .cal-bk-chip:hover .cal-bk-del { display: flex; }

  /* Calendar booking modal */
  .cal-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 6000; justify-content: center; align-items: flex-end;
  }
  .cal-modal.active { display: flex; }
  .cal-modal-content {
    background: var(--surface); border-radius: 16px 16px 0 0; width: 100%;
    max-width: 480px; max-height: 80vh; max-height: 80dvh; overflow-y: auto;
    animation: slideUp 0.25s cubic-bezier(0.16,1,0.3,1);
  }
  .cal-modal-handle { width: 32px; height: 4px; background: var(--border); border-radius: 2px; margin: 10px auto 0; }
  .cal-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
  }
  .cal-modal-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
  .cal-modal-body { padding: 16px 18px; }
  .cal-form-group { margin-bottom: 14px; }
  .cal-form-group label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
  .cal-form-group select, .cal-form-group textarea {
    width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: var(--sans); color: var(--text);
  }
  .cal-form-group textarea { resize: vertical; min-height: 50px; }
  .cal-dates-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
  .cal-date-tag {
    background: rgba(37,99,235,0.08); color: var(--blue); border-radius: 4px;
    padding: 2px 6px; font-size: 12px; font-weight: 600;
  }
  .cal-existing { margin-top: 12px; }
  .cal-existing h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--text-secondary); }
  .cal-existing-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
  }
  .cal-form-buttons { display: flex; gap: 10px; margin-top: 16px; }
  .cal-form-buttons button {
    flex: 1; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: var(--sans); border: none;
  }
  .cal-btn-cancel { background: var(--bg); color: var(--text); border: 1px solid var(--border) !important; }
  .cal-btn-save { background: var(--blue); color: #fff; }

  /* Calendar admin panel */
  .cal-admin {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 7000; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
    justify-content: center; align-items: flex-end;
  }
  .cal-admin.active { display: flex; }
  .cal-admin-content {
    background: var(--surface); border-radius: 16px 16px 0 0; width: 100%;
    max-width: 500px; max-height: 85vh; display: flex; flex-direction: column;
    animation: slideUp 0.25s cubic-bezier(0.16,1,0.3,1);
  }
  .cal-admin-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
  }
  .cal-admin-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
  .cal-admin-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
  .cal-admin-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }
  .cal-admin-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .cal-admin-name { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-admin-status {
    padding: 2px 8px; border-radius: 100px; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.03em; flex-shrink: 0;
  }
  .cal-admin-status.on { background: rgba(22,163,74,0.1); color: #16a34a; }
  .cal-admin-status.off { background: rgba(220,38,38,0.1); color: #dc2626; }
  .cal-admin-actions { display: flex; gap: 4px; flex-shrink: 0; }
  .cal-admin-actions button {
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    width: 28px; height: 28px; cursor: pointer; font-size: 12px; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
  }
  .cal-admin-actions button:hover { border-color: var(--text-tertiary); color: var(--text); }
  .cal-admin-add {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px; margin: 12px 0; border: 1px dashed var(--border); border-radius: 8px;
    cursor: pointer; font-size: 13px; color: var(--text-secondary); background: none;
    width: 100%; font-family: var(--sans);
  }
  .cal-admin-add:hover { border-color: var(--text-tertiary); color: var(--text); }
  .cal-admin-form { padding: 12px 0; }
  .cal-admin-form .cal-form-group input[type="text"], .cal-admin-form .cal-form-group textarea {
    width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: var(--sans); color: var(--text);
  }
  .cal-admin-form .color-row { display: flex; gap: 10px; align-items: flex-end; }
  .cal-admin-form .color-row .cal-form-group:first-child { flex: 1; }
  .cal-admin-form input[type="color"] {
    width: 44px; height: 40px; padding: 2px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  }

  /* Floor plan calendar icons */
  .cal-floor-icon {
    cursor: pointer;
    pointer-events: all !important;
  }
  .cal-floor-icon * { pointer-events: all !important; }

  /* Mobile: hide user name in chip, show only colored dot + item */
  @media (max-width: 767px) {
    .cal-bk-chip-user {
      max-width: 0; padding: 0; overflow: hidden;
    }
    .cal-bk-chip { border-left: 3px solid var(--user-color, #666); }
  }

  @media (min-width: 768px) {
    .cal-modal-content, .cal-admin-content { border-radius: 16px; max-height: 80vh; }
    .cal-modal.active, .cal-admin.active { align-items: center; }
  }

