
    /* Read-only compliance/report surfaces; existing team/calendar rules preserved. */
    .report-scroll{max-width:100%;overflow-x:auto;margin:16px 0}
    .report-scroll table{min-width:780px}
    .compliance-personal{display:flex;align-items:center;gap:24px;margin:20px 0}
    .compliance-ring{position:relative;flex:0 0 140px;width:140px;height:140px}
    .compliance-ring svg{width:140px;height:140px;transform:rotate(-90deg)}
    .compliance-ring strong{position:absolute;inset:0;display:grid;place-items:center;font-size:26px;color:var(--primary)}
    @media(max-width:600px){.compliance-personal{flex-direction:column;align-items:flex-start}.compliance-personal p{overflow-wrap:anywhere}}
    :root{
      --primary: #1e3a5f;
      --primary-light: #2a4d73;
      --primary-dark: #152a45;
      --accent: #c75b39;
      --accent-light: #d97a5a;
      --bg: #f5f2ed;
      --surface: #ffffff;
      --text: #2d2d2d;
      --text-secondary: #5a5a5a;
      --text-muted: #8a8a8a;
      --border: #e0dcd6;
      --border-light: #eceae6;
      --success: #2d7d46;
      --warning: #c75b39;
      --danger: #b91c1c;
      --info: #3b6e9e;
      --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
      --shadow: 0 4px 12px rgba(0,0,0,0.08);
      --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
      --radius: 12px;
      --radius-sm: 8px;
      --radius-lg: 16px;
      --transition: all 0.2s ease;
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }

    html, body {
      height: 100%;
      font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
      background: var(--bg);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
    }

    /* Account: one column, with identity separated from the new password. */
    #account-form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; margin-top: 20px; }
    #account-form .account-field { display: flex; flex-direction: column; gap: 8px; }
    #account-form .account-new-group { margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--border); }
    #account-form input { width: 100%; min-height: 44px; }
    #account-form input.password-match { border: 2px solid var(--success); background: #f1faf3; }
    #account-form input.password-mismatch { border: 2px solid var(--danger); background: #fff5f5; }
    #account-match { min-height: 1.5em; font-size: 14px; font-weight: 600; }
    #account-match.password-match { color: var(--success); }
    #account-match.password-mismatch { color: var(--danger); }
    #account-status:empty { display: none; }

    /* Layout */
    .app-container { display: flex; height: 100vh; overflow: hidden; }
    .sidebar {
      width: 260px;
      background: var(--primary);
      color: #fff;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      transition: var(--transition);
    }
    .sidebar-brand {
      padding: 28px 24px 20px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .sidebar-brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
    .sidebar-brand p { font-size: 12px; opacity: 0.7; margin-top: 4px; }
    .sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
    .sidebar-nav button {
      width: 100%; text-align: left; background: none; border: none; color: rgba(255,255,255,0.85);
      padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer;
      display: flex; align-items: center; gap: 12px; transition: var(--transition);
    }
    .sidebar-nav button:hover { background: rgba(255,255,255,0.08); color: #fff; }
    .sidebar-nav button.active { background: rgba(255,255,255,0.12); color: #fff; font-weight: 600; }
    .sidebar-footer {
      padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1);
      font-size: 12px; opacity: 0.6;
    }
    .main-content { flex: 1; overflow-y: auto; position: relative; }

    /* Mobile bottom nav */
    .mobile-nav {
      display: none;
      position: fixed; bottom: 0; left: 0; right: 0;
      background: var(--surface); border-top: 1px solid var(--border);
      padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
      z-index: 100;
      justify-content: space-around;
    }
    .mobile-nav button {
      background: none; border: none; display: flex; flex-direction: column; align-items: center;
      gap: 2px; font-size: 11px; color: var(--text-muted); cursor: pointer; padding: 4px 8px;
    }
    .mobile-nav button.active { color: var(--primary); font-weight: 600; }
    .mobile-nav svg { width: 22px; height: 22px; }

    /* Screens */
    .screen { display: none; min-height: 100%; }
    .screen.active { display: block; }

    /* Login */
    .login-wrap {
      display: flex; min-height: 100vh; background: var(--bg);
    }
    .login-panel {
      flex: 1; max-width: 420px; padding: 48px 32px; display: flex; flex-direction: column; justify-content: center;
      background: var(--surface);
    }
    .login-hero {
      flex: 1.2; background: var(--primary); color: #fff; display: flex; flex-direction: column;
      justify-content: center; padding: 48px; position: relative; overflow: hidden;
    }
    .login-hero::before {
      content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%);
    }
    .login-hero h2 { font-size: 32px; font-weight: 700; margin-bottom: 16px; position: relative; }
    .login-hero p { font-size: 15px; opacity: 0.85; line-height: 1.6; position: relative; }
    .login-hero .policy-box {
      margin-top: 32px; padding: 20px; background: rgba(255,255,255,0.08);
      border-radius: var(--radius); border-left: 3px solid var(--accent);
    }
    .login-hero .policy-box h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
    .login-hero .policy-box ul { list-style: none; font-size: 13px; opacity: 0.8; }
    .login-hero .policy-box li { padding: 3px 0; }
    .login-hero .policy-box li::before { content: '•'; margin-right: 8px; color: var(--accent); }

    .form-group { margin-bottom: 20px; }
    .form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
    .form-group input, .form-group select {
      width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
      font-size: 15px; background: var(--surface); color: var(--text); transition: var(--transition);
    }
    .form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30,58,95,0.08); }

    .btn {
      display: inline-flex; align-items: center; justify-content: center; gap: 8px;
      padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
      border: none; cursor: pointer; transition: var(--transition);
    }
    .btn-block { width: 100%; }
    .btn-primary { background: var(--primary); color: #fff; }
    .btn-primary:hover { background: var(--primary-light); }
    .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
    .btn-accent { background: var(--accent); color: #fff; }
    .btn-accent:hover { background: var(--accent-light); }
    .btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
    .btn-ghost:hover { background: var(--bg); }
    .btn-sm { padding: 8px 14px; font-size: 13px; }

    /* Onboarding */
    .onboarding-wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px; }
    .onboarding-wrap h2 { font-size: 24px; margin-bottom: 8px; }
    .onboarding-wrap > p { color: var(--text-secondary); margin-bottom: 32px; }
    .location-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
    .location-card {
      background: var(--surface); border: 2px solid var(--border-light); border-radius: var(--radius);
      padding: 24px; cursor: pointer; transition: var(--transition); text-align: center;
    }
    .location-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
    .location-card.selected { border-color: var(--primary); background: rgba(30,58,95,0.03); }
    .location-card h4 { font-size: 16px; margin-bottom: 4px; }
    .location-card p { font-size: 13px; color: var(--text-muted); }

    /* Header */
    .page-header {
      position: sticky; top: 0; z-index: 20; background: rgba(245,242,237,0.92);
      backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 20px 28px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .page-header h2 { font-size: 20px; font-weight: 700; }
    .user-chip {
      display: flex; align-items: center; gap: 10px; background: var(--surface);
      padding: 6px 12px 6px 6px; border-radius: 100px; border: 1px solid var(--border); font-size: 13px;
    }
    .avatar {
      width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
      display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
    }

    /* Content padding */
    .content-body { padding: 24px 28px 100px; }

    /* Counters */
    .counter-bar {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px;
    }
    .counter-card {
      background: var(--surface); border-radius: var(--radius); padding: 20px;
      border: 1px solid var(--border-light); box-shadow: var(--shadow-sm);
    }
    .counter-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); margin-bottom: 6px; }
    .counter-card .value { font-size: 28px; font-weight: 700; }
    .counter-card .value.ok { color: var(--success); }
    .counter-card .value.warn { color: var(--warning); }
    .counter-card .value.danger { color: var(--danger); }
    .counter-card .max { font-size: 14px; color: var(--text-muted); font-weight: 500; }

    /* Banner */
    .status-banner {
      padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 24px;
      display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500;
    }
    .status-banner.success { background: rgba(45,125,70,0.08); color: var(--success); border: 1px solid rgba(45,125,70,0.15); }
    .status-banner.warn { background: rgba(199,91,57,0.08); color: var(--warning); border: 1px solid rgba(199,91,57,0.15); }
    .status-banner.danger { background: rgba(185,28,28,0.08); color: var(--danger); border: 1px solid rgba(185,28,28,0.15); }
    .status-banner.info { background: rgba(30,58,95,0.06); color: var(--primary); border: 1px solid rgba(30,58,95,0.12); }

    /* Day cards */
    .days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
    .day-card {
      background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light);
      padding: 20px; box-shadow: var(--shadow-sm); transition: var(--transition);
    }
    .day-card:hover { box-shadow: var(--shadow); }
    .day-card .day-header {
      display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
    }
    .day-card .day-name { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); }
    .day-card .day-date { font-size: 12px; color: var(--text-muted); }
    .day-card .badge {
      display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 600;
    }
    .badge-meeting { background: rgba(199,91,57,0.12); color: var(--accent); }
    .badge-vacation { background: rgba(30,58,95,0.08); color: var(--primary); }
    .badge-authorized { background: rgba(45,125,70,0.12); color: var(--success); }

    .mode-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
    .mode-toggle button {
      flex: 1; padding: 10px; border: 1.5px solid var(--border); background: var(--surface);
      border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-secondary);
      transition: var(--transition);
    }
    .mode-toggle button:hover { border-color: var(--primary); }
    .mode-toggle button.selected { border-color: var(--primary); background: rgba(30,58,95,0.06); color: var(--primary); }
    .mode-toggle button:disabled { opacity: 0.4; cursor: not-allowed; }

    .location-select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 10px; }
    .location-select:focus { outline: none; border-color: var(--primary); }

    .desk-btn {
      width: 100%; padding: 10px; border: 1.5px dashed var(--border); background: var(--bg);
      border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer;
      display: flex; align-items: center; justify-content: center; gap: 6px; transition: var(--transition);
    }
    .desk-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(30,58,95,0.04); }
    .desk-btn.assigned { border-style: solid; border-color: var(--success); color: var(--success); background: rgba(45,125,70,0.06); }

    .day-warning {
      margin-top: 10px; padding: 8px 12px; background: rgba(185,28,28,0.06); border-radius: var(--radius-sm);
      font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 6px;
    }
    .day-note {
      margin-top: 10px; padding: 8px 12px; background: rgba(199,91,57,0.06); border-radius: var(--radius-sm);
      font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 6px;
    }

    /* Modal */
    .modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 200;
      display: none; align-items: center; justify-content: center; padding: 20px;
    }
    .modal-overlay.open { display: flex; }
    .modal {
      background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 520px;
      max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
    }
    .modal-header {
      padding: 20px 24px; border-bottom: 1px solid var(--border-light);
      display: flex; align-items: center; justify-content: space-between;
    }
    .modal-header h3 { font-size: 17px; }
    .modal-close { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; line-height: 1; }
    .modal-body { padding: 20px 24px; }
    .modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 10px; }

    /* Desk grid */
    .desk-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
    .desk-item {
      border-radius: var(--radius-sm); border: 2px solid var(--border);
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
      font-size: 12px; text-align: center; padding: 12px 8px; transition: var(--transition); cursor: default;
      min-height: 90px;
    }
    .desk-item.free { background: rgba(45,125,70,0.06); border-color: rgba(45,125,70,0.3); color: var(--success); cursor: pointer; }
    .desk-item.free:hover { background: rgba(45,125,70,0.12); }
    .desk-item.occupied { background: rgba(185,28,28,0.06); border-color: rgba(185,28,28,0.2); color: var(--danger); }
    .desk-item.reserved { background: rgba(30,58,95,0.06); border-color: var(--primary); color: var(--primary); }
    .desk-item.mine { background: rgba(59,110,158,0.10); border-color: var(--info); color: var(--info); }
    .desk-item .desk-num { font-size: 16px; font-weight: 700; }
    .desk-item .desk-status { font-size: 11px; opacity: 0.9; }
    .desk-note { margin-top: 16px; font-size: 12px; color: var(--text-muted); padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }

    /* Team board */
    .team-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
    .stat-pill {
      background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px;
      border: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px;
    }
    .stat-pill .icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
    .stat-pill .icon.office { background: rgba(30,58,95,0.08); color: var(--primary); }
    .stat-pill .icon.home { background: rgba(199,91,57,0.08); color: var(--accent); }
    .stat-pill .icon.vacation { background: rgba(90,90,90,0.08); color: var(--text-secondary); }
    .stat-pill .icon.total { background: rgba(45,125,70,0.08); color: var(--success); }
    .stat-pill .num { font-size: 20px; font-weight: 700; }
    .stat-pill .lbl { font-size: 11px; color: var(--text-muted); }

    .team-list { display: flex; flex-direction: column; gap: 10px; }

    .team-floor-reference { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
    .floor-reference { margin: 0; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
    .floor-reference img { display: block; width: 100%; height: auto; }
    .floor-reference a { display: block; cursor: zoom-in; }
    .floor-reference figcaption { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
    @media (max-width: 1000px) { .team-floor-reference { grid-template-columns: 1fr; } .floor-reference { max-width: 364px; } }

    .interactive-floor { position:relative; width:100%; max-width:412px; margin:16px 0; }
    .interactive-floor img { display:block; width:100%; height:auto; }
    .floor-pin { position:absolute; transform:translate(-50%,-50%); width:10%; min-height:25px; padding:3px 0; border:2px solid white; border-radius:5px; font-size:10px; font-weight:800; cursor:pointer; box-shadow:0 1px 3px #0005; }
    .floor-pin:focus-visible { outline:3px solid #111; outline-offset:2px; }
    .floor-pin:hover, .floor-pin:focus-visible { z-index:20; }
    .floor-pin::after { content:attr(data-tooltip); position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); width:170px; padding:10px 12px; border-radius:6px; background:#152a45; color:#fff; font-size:12px; font-weight:500; line-height:1.45; text-align:left; white-space:normal; box-shadow:0 4px 14px #0003; pointer-events:none; visibility:hidden; opacity:0; }
    .floor-pin:hover::after, .floor-pin:focus-visible::after { visibility:visible; opacity:1; }
    .floor-pin[style*="left:12.5%"]::after, .floor-pin[style*="left:25%"]::after, .floor-pin[style*="left:28%"]::after { left:0; transform:none; }
    .floor-pin[style*="left:75%"]::after { left:auto; right:0; transform:none; }
    .floor-pin.available,.floor-legend .available { background:#d5f4df; color:#14532d; }
    .floor-pin.busy,.floor-legend .busy { background:#fee2e2; color:#991b1b; }
    .floor-pin.own,.floor-legend .own { background:#dbeafe; color:#1e40af; }
    .floor-pin.locked,.floor-legend .locked { background:#fef3c7; color:#854d0e; }
    .floor-legend { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; font-size:12px; }
    .floor-legend span { padding:5px 9px; border-radius:5px; }
    .floor-help { font-size:12px; color:var(--text-secondary); max-width:500px; }
    #team-map-day { display:block; margin:8px 0; padding:8px; }
.team-filter-bar select { min-width:160px; max-width:100%; }
@media(max-width:900px){ .team-filter-bar { gap:8px; } }

    #team-list .pattern-cell.muted-day { background:#e5e7eb; color:#6b7280; border-color:#d1d5db; }
    #team-list .pattern-cell.selected-day { outline:2px solid var(--primary); outline-offset:3px; }

    .team-days-header { position:sticky; z-index:19; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 18px; background:var(--bg); border-bottom:1px solid var(--border); }
    .team-days-header strong { font-size:12px; color:var(--text-secondary); }
    .team-days-buttons { display:flex; gap:4px; flex-shrink:0; }
    .team-day-button { width:28px; height:28px; border:0; border-radius:6px; background:#e5e7eb; color:#6b7280; font-weight:700; cursor:pointer; }
    .team-day-button.active { background:var(--primary); color:white; }

    .user-menu { position:relative; }
    .user-menu summary { cursor:pointer; list-style:none; }
    .user-menu summary::-webkit-details-marker { display:none; }
    .user-menu summary:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
    .user-menu-panel { position:absolute; top:calc(100% + 8px); right:0; width:220px; padding:8px; background:var(--surface); border:1px solid var(--border); border-radius:12px; box-shadow:0 8px 24px #0002; z-index:50; }
    .user-menu-title { padding:8px 10px; font-size:12px; color:var(--text-muted); }
    .user-menu-panel button { display:block; width:100%; text-align:left; padding:11px 10px; background:transparent; border:0; border-radius:6px; color:var(--text); cursor:pointer; font:inherit; font-size:13px; }
    .user-menu-panel button:hover,.user-menu-panel button:focus-visible { background:var(--bg); }

    /* Desk Layout */
    .desk-layout {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
      grid-template-rows: repeat(4, 90px);
      gap: 8px;
      max-width: 640px;
    }
    .desk-layout .layout-cell {
      background: var(--surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      font-size: 12px;
      position: relative;
      transition: var(--transition);
    }
    .desk-layout .layout-cell.occupied {
      border-color: var(--primary);
      background: rgba(30,58,95,0.06);
    }
    .desk-layout .layout-cell.free {
      border-style: dashed;
      border-color: var(--border);
      color: var(--text-muted);
    }
    .desk-layout .layout-cell.fixed {
      border-color: var(--accent);
      background: rgba(199,91,57,0.06);
    }
    .desk-layout .layout-cell .layout-num {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-secondary);
    }
    .desk-layout .layout-cell .layout-who {
      font-size: 13px;
      font-weight: 600;
      color: var(--primary);
    }
    .desk-layout .layout-cell .layout-dept {
      font-size: 10px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }
    .desk-layout .layout-cell .layout-label {
      position: absolute;
      top: 4px;
      right: 6px;
      font-size: 9px;
      color: var(--text-muted);
      background: var(--bg);
      padding: 1px 5px;
      border-radius: 100px;
    }
    /* Grid positioning */
    .layout-9  { grid-column: 1; grid-row: 1; }
    .layout-10 { grid-column: 1; grid-row: 2; }
    .layout-c  { grid-column: 1; grid-row: 3; }
    .layout-6  { grid-column: 2; grid-row: 4; }
    .layout-a  { grid-column: 3; grid-row: 4; }
    .layout-7  { grid-column: 4; grid-row: 4; }
    .layout-5  { grid-column: 2; grid-row: 1; }
    .layout-1  { grid-column: 2; grid-row: 2; }
    .layout-4  { grid-column: 2; grid-row: 3; }
    .layout-3  { grid-column: 3; grid-row: 1; }
    .layout-8  { grid-column: 3; grid-row: 2; }
    .layout-2  { grid-column: 3; grid-row: 3; }
    .layout-b  { grid-column: 4; grid-row: 4; }

    /* Spacer cells for visual structure */
    .layout-spacer {
      grid-column: 4 / 5;
      grid-row: 1 / 4;
      background: transparent;
      border: none;
    }
    .layout-hall {
      grid-column: 5 / 7;
      grid-row: 4;
      background: transparent;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      color: var(--text-muted);
    }

    @media (max-width: 640px) {
      .desk-layout {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: repeat(5, 80px);
        max-width: 100%;
      }
      .layout-9  { grid-column: 1; grid-row: 1; }
      .layout-5  { grid-column: 2; grid-row: 1; }
      .layout-3  { grid-column: 3; grid-row: 1; }
      .layout-10 { grid-column: 1; grid-row: 2; }
      .layout-1  { grid-column: 2; grid-row: 2; }
      .layout-8  { grid-column: 3; grid-row: 2; }
      .layout-c  { grid-column: 1; grid-row: 3; }
      .layout-4  { grid-column: 2; grid-row: 3; }
      .layout-2  { grid-column: 3; grid-row: 3; }
      .layout-6  { grid-column: 1; grid-row: 4; }
      .layout-a  { grid-column: 2; grid-row: 4; }
      .layout-7  { grid-column: 3; grid-row: 4; }
      .layout-b  { grid-column: 2; grid-row: 5; }
      .layout-spacer, .layout-hall { display: none; }
    }
    .team-row {
      background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border-light);
      padding: 14px 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: var(--transition);
    }
    .team-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
    .team-row .avatar { width: 40px; height: 40px; font-size: 14px; flex-shrink: 0; }
    .team-row .info { flex: 1; min-width: 0; }
    .team-row .name { font-size: 14px; font-weight: 600; }
    .team-row .meta { font-size: 12px; color: var(--text-muted); }
    .team-row .pattern { display: flex; gap: 4px; }
    .pattern-cell {
      width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 700; color: #fff;
    }
    .pattern-cell.o { background: var(--primary); }
    .pattern-cell.c { background: var(--accent); }
    .pattern-cell.v { background: var(--text-muted); }
    .pattern-cell.- { background: var(--border-light); color: var(--text-muted); }

    /* Compliance */
    .compliance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    .compliance-card {
      background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-light);
      padding: 24px; box-shadow: var(--shadow-sm);
    }
    .compliance-card h3 { font-size: 15px; margin-bottom: 16px; color: var(--text-secondary); }
    .circle-chart { width: 140px; height: 140px; margin: 0 auto 16px; position: relative; }
    .circle-chart svg { transform: rotate(-90deg); }
    .circle-chart .pct {
      position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
      font-size: 28px; font-weight: 700; color: var(--primary);
    }
    .progress-row { margin-bottom: 14px; }
    .progress-row .progress-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
    .progress-track { height: 8px; background: var(--border-light); border-radius: 100px; overflow: hidden; }
    .progress-fill { height: 100%; border-radius: 100px; transition: width 0.4s ease; }

    /* Calendar */
    .calendar-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
    .calendar-toolbar h3 { font-size: 18px; }
    .calendar-nav { display: flex; gap: 8px; }
    .calendar-nav button { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 16px; }
    .calendar-nav button:hover { background: var(--bg); }

    .calendar-table { width: 100%; border-collapse: separate; border-spacing: 4px; }
    .calendar-table th { font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 8px; text-align: center; font-weight: 600; }
    .calendar-table td { aspect-ratio: 1; text-align: center; vertical-align: middle; font-size: 13px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-light); position: relative; }
    .calendar-table td.other { color: var(--text-muted); background: transparent; border-color: transparent; }
    .calendar-table td.today { font-weight: 700; border-color: var(--primary); }
    .calendar-table td.has-office { background: rgba(30,58,95,0.10); border-color: rgba(30,58,95,0.25); color: var(--primary); font-weight: 600; }
    .calendar-table td.has-home { background: rgba(199,91,57,0.10); border-color: rgba(199,91,57,0.25); color: var(--accent); font-weight: 600; }
    .calendar-table td.has-vacation { background: rgba(90,90,90,0.08); border-color: rgba(90,90,90,0.2); color: var(--text-secondary); font-weight: 600; }
    .calendar-table td.has-holiday { background: rgba(59,110,158,0.10); border-color: rgba(59,110,158,0.25); color: var(--info); font-weight: 600; }
    .calendar-table td .vacation-marker {
      position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
      width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted);
    }

    .vacation-list { margin-top: 24px; }
    .vacation-list h4 { font-size: 14px; margin-bottom: 12px; }
    .vacation-item {
      display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
      background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border-light); margin-bottom: 8px;
    }
    .vacation-item .dates { font-size: 13px; }
    .vacation-item button { background: none; border: none; color: var(--danger); font-size: 12px; cursor: pointer; font-weight: 600; }

    /* Detail panel */
    .detail-panel {
      position: fixed; right: 0; top: 0; bottom: 0; width: 360px; background: var(--surface);
      border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 150;
      transform: translateX(100%); transition: transform 0.25s ease; padding: 24px; overflow-y: auto;
    }
    .detail-panel.open { transform: translateX(0); }
    .detail-panel .close { background: none; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; margin-bottom: 16px; }
    .detail-panel .name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
    .detail-panel .role { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
    .detail-day { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
    .detail-day .day { font-weight: 600; color: var(--text-secondary); }

    /* Responsive */
    @media (max-width: 900px) {
      .sidebar { display: none; }
      .mobile-nav { display: flex; }
      .content-body { padding: 16px 16px 100px; }
      .page-header { padding: 14px 16px; }
      .login-wrap { flex-direction: column; }
      .login-hero { display: none; }
      .compliance-grid { grid-template-columns: 1fr; }
      .counter-bar { grid-template-columns: 1fr; }
      .team-stats { grid-template-columns: repeat(2, 1fr); }
      .desk-grid { grid-template-columns: repeat(3, 1fr); }
      .detail-panel { width: 100%; }
    }

    @media (max-width: 640px) {
      .days-grid { grid-template-columns: 1fr; }
      .location-grid { grid-template-columns: 1fr; }
    }

    /* Utility */
    .hidden { display: none !important; }
    .mt-2 { margin-top: 8px; }
    .mt-3 { margin-top: 12px; }
    .mt-4 { margin-top: 16px; }
    .text-sm { font-size: 13px; }
    .text-muted { color: var(--text-muted); }
    .flex { display: flex; }
    .items-center { align-items: center; }
    .gap-2 { gap: 8px; }
    .gap-3 { gap: 12px; }
    .justify-between { justify-content: space-between; }
    .w-full { width: 100%; }
  /* Admin */
    .admin-link { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 12px; cursor: pointer; background: none; border: none; width: 100%; }
    .admin-link:hover { color: var(--primary); text-decoration: underline; }
    .admin-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
    .admin-tabs { display:flex; gap:6px; margin-bottom:24px; padding:8px 0; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:25; background:var(--bg); overflow-x:auto; }
    .admin-tabs button { flex-shrink:0; border:0; border-radius:8px; padding:12px 18px; font:inherit; font-size:14px; font-weight:600; background:transparent; color:var(--text-secondary); cursor:pointer; }
    .admin-tabs button[aria-selected="true"] { background:var(--primary); color:white; }
    .admin-tabs button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
    #admin-panel-screen [role="tabpanel"][hidden] { display:none; }
    .admin-section-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
    @media(max-width:640px) { .admin-wrap { padding:16px 12px; } .admin-tabs button { padding:10px 12px; font-size:13px; } }

    .admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
    .admin-header h2 { font-size: 22px; }
    .data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-light); }
    .data-table th, .data-table td { padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border-light); }
    .data-table th { background: var(--bg); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; font-size: 11px; letter-spacing: 0.4px; }
    .data-table tr:last-child td { border-bottom: none; }
    .data-table td { color: var(--text); }
    .tag { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-secondary); }
    .tag.primary { background: rgba(30,58,95,0.08); color: var(--primary); }
    .tag.accent { background: rgba(199,91,57,0.08); color: var(--accent); }
    .row-actions { display: flex; gap: 8px; }
    .row-actions button { background: none; border: none; font-size: 12px; cursor: pointer; font-weight: 600; color: var(--text-muted); }
    .row-actions button:hover { color: var(--primary); }
    .row-actions button.danger:hover { color: var(--danger); }
    .admin-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    @media (max-width: 640px) { .admin-form-grid { grid-template-columns: 1fr; } .data-table { display: block; overflow-x: auto; } }
  
/* Integrated server-first pilot: presentation retained from original. */
[hidden] { display:none!important; }
button:disabled { opacity:.5; cursor:not-allowed!important; }
button:focus-visible,input:focus-visible,select:focus-visible { outline:3px solid var(--accent);outline-offset:3px; }
.intro { margin:16px 0;line-height:1.6;color:var(--text-secondary); }
.toolbar,.actions { display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:20px 0; }
input,select { font:inherit; padding:10px;border:1px solid var(--border);border-radius:8px;background:white;color:var(--text); }
#approval-form input,#approval-form label { display:block;max-width:100%;margin:10px 0;width:100%; }
#approval-form { max-width:650px; }
#audit-list,#saved-plan,#calendar { margin:20px 0;overflow:auto; }
/* Team: original row/map presentation, scoped to this view. */
#team-list { margin:20px 0; overflow:visible; }
#view-team .team-days-header { top:var(--team-header-top,0px); padding-bottom:24px; }
#view-team .team-day-button { position:relative; }
#view-team .team-day-button small { position:absolute; top:30px; left:0; width:28px; font-size:9px; color:var(--text-secondary); }
#view-team .pattern { flex-shrink:0; }
#view-team .pattern-cell[class~="-"].selected-day { background:var(--border-light); color:var(--text-muted); }
#view-team .floor-pin.unknown { background:#e5e7eb; color:#6b7280; }
#view-team .team-row:focus-visible { outline:2px solid var(--primary); }
#conflict-panel { margin-bottom:24px;border:2px solid var(--accent); }
#conflict-comparison { display:grid;grid-template-columns:1fr 1fr;gap:16px;overflow:auto;margin:20px 0; }
dialog { border:0;border-radius:16px;max-width:720px;width:calc(100% - 32px);max-height:90vh;margin:auto;color:var(--text); }
dialog::backdrop { background:#152a4588; }
#floor-map .interactive-floor { margin:16px auto; }
#desk-grid { grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); }
.lease { display:block;margin:8px 0;font-weight:700;color:var(--accent); }
.small-note { font-size:12px;color:var(--text-secondary);margin:10px 0; }
#version { font-size:12px;color:var(--text-secondary); }
.data-table { width:100%; }
/* Area calendar */
.area-calendar-header { display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px; }
.area-calendar-header label { font-size:12px;color:var(--text-secondary);font-weight:600; }
.area-calendar-header select { min-width:160px; }
.area-calendar-scroll { overflow-x:auto; margin:0 -28px; padding:0 28px; }
.area-calendar-grid { display:grid; grid-template-columns:220px repeat(5,minmax(180px,1fr)); gap:8px; min-width:1120px; }
.area-calendar-grid .area-corner { position:sticky; left:0; z-index:11; background:var(--bg); padding:12px; font-size:12px; color:var(--text-secondary); font-weight:600; text-transform:uppercase; letter-spacing:0.4px; }
.area-day-header { background:var(--surface); border:1px solid var(--border-light); border-radius:var(--radius-sm); padding:10px; text-align:center; }
.area-day-number { font-size:12px; color:var(--text-muted); }
.area-day-name { font-size:13px; font-weight:700; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.3px; }
.area-day-meta { font-size:11px; color:var(--text-muted); margin-top:4px; }
.area-person-cell { position:sticky; left:0; z-index:10; background:var(--bg); display:flex; align-items:center; gap:10px; padding:10px 12px; border-bottom:1px solid var(--border); }
.area-person-name { font-size:13px; font-weight:600; }
.area-person-meta { font-size:11px; color:var(--text-muted); }
.area-day-card { border:1px solid var(--border-light); border-left-width:4px; border-radius:var(--radius-sm); padding:10px; min-height:64px; display:flex; flex-direction:column; justify-content:center; }
.area-day-card.has-office { background: rgba(30,58,95,0.10); border-color: rgba(30,58,95,0.25); color: var(--primary); }
.area-day-card.has-home { background: rgba(199,91,57,0.10); border-color: rgba(199,91,57,0.25); color: var(--accent); }
.area-day-card.has-vacation { background: rgba(90,90,90,0.08); border-color: rgba(90,90,90,0.2); color: var(--text-secondary); }
.area-day-card.has-holiday { background: rgba(59,110,158,0.10); border-color: rgba(59,110,158,0.25); color: var(--info); }
.area-card-label { font-size:12px; font-weight:600; }
.area-card-site { font-size:11px; color:var(--text-secondary); }
@media(max-width:900px) {
 .app-container { display:block;height:auto;overflow:visible; }
 .sidebar { display:flex!important;width:100%;transition:none; }
 .sidebar-brand {padding:16px 20px}.sidebar-footer{display:none}.sidebar-nav{display:flex;overflow:auto;padding:8px}.sidebar-nav button{width:auto;white-space:nowrap;font-size:12px;padding:10px}
 .page-header { position:relative;padding:16px;gap:10px;flex-wrap:wrap; }
 .content-body {padding:16px 16px 50px}.main-content{overflow:visible}
 .counter-bar{gap:8px}.counter-card{padding:12px}.counter-card .value{font-size:24px}
 #conflict-comparison{grid-template-columns:1fr}.login-panel{max-width:none;width:100%;padding:32px 24px}
}
