    .material-symbols-outlined {
      font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    }
    body { font-family: 'Inter', sans-serif; background: #faf8ff; color: #131b2e; }
    h1, h2, h3, .font-headline { font-family: 'Space Grotesk', sans-serif; }

    /* Layout */
    .app { display: flex; min-height: 100vh; }
    .sidebar {
      width: 260px; background: #f2f3ff; padding: 24px 16px;
      position: fixed; height: 100vh; overflow-y: auto; z-index: 50;
      box-shadow: 4px 0 24px rgba(15,23,42,0.04);
    }
    .sidebar-logo { padding: 0 8px 24px; margin-bottom: 8px; }
    .sidebar-logo h1 { font-size: 20px; font-weight: 900; font-family: 'Space Grotesk', sans-serif; color: #5416c9; text-transform: uppercase; letter-spacing: -0.02em; }
    .sidebar-logo h1 span { color: #6c3ce1; }
    .sidebar-nav { padding: 0; display: flex; flex-direction: column; gap: 4px; }
    .nav-item {
      display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: rgba(19,27,46,0.6);
      text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer;
      border-radius: 12px; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.04em;
    }
    .nav-item:hover { background: #faf8ff; color: #131b2e; transform: translateX(2px); }
    .nav-item.active { background: #dae2fd; color: #5416c9; box-shadow: 0 1px 3px rgba(15,23,42,0.06); }
    .nav-item .material-symbols-outlined { font-size: 20px; }
    .main { margin-left: 260px; flex: 1; }
    .topbar {
      background: #faf8ff; padding: 16px 28px;
      display: flex; justify-content: space-between; align-items: center;
      position: sticky; top: 0; z-index: 40;
    }
    .topbar h2 { font-size: 22px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; color: #131b2e; }
    .content { padding: 28px; }

    /* Login */
    .login-overlay {
      position: fixed; inset: 0; background: linear-gradient(135deg, #131b2e 0%, #283044 50%, #5416c9 100%);
      display: flex; align-items: center; justify-content: center; z-index: 1000;
    }
    .login-card {
      background: rgba(250,248,255,0.07); backdrop-filter: blur(24px);
      border-radius: 24px; padding: 48px; width: 420px;
      border: 1px solid rgba(203,195,215,0.15); box-shadow: 0 32px 64px rgba(0,0,0,0.3);
    }
    .login-card h2 { color: #faf8ff; margin-bottom: 8px; font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 700; }
    .login-card p { color: rgba(250,248,255,0.6); margin-bottom: 28px; font-size: 14px; }
    .form-group { margin-bottom: 18px; }
    .form-group label { display: block; color: rgba(250,248,255,0.5); font-size: 12px; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
    .form-group input {
      width: 100%; padding: 12px 16px; background: rgba(250,248,255,0.08); border: 1px solid rgba(203,195,215,0.2);
      border-radius: 12px; color: #faf8ff; font-size: 14px; outline: none; transition: border-color 0.2s;
    }
    .form-group input::placeholder { color: rgba(250,248,255,0.3); }
    .form-group input:focus { border-color: #6c3ce1; box-shadow: 0 0 0 3px rgba(108,60,225,0.15); }

    /* Form groups inside cards (e.g. profile page) — light-mode overrides */
    .card .form-group label { color: #7a7486; }
    .card .form-group input, .card .form-group select, .card .form-group textarea {
      background: #faf8ff; border: 1px solid #eaedff; color: #131b2e;
    }
    .card .form-group input::placeholder, .card .form-group textarea::placeholder { color: #9e98a7; }
    .card .form-group input:focus, .card .form-group select:focus, .card .form-group textarea:focus {
      border-color: #6c3ce1; box-shadow: 0 0 0 3px rgba(108,60,225,0.1); background: white;
    }

    .btn-primary {
      width: 100%; padding: 14px; background: linear-gradient(135deg, #5416c9, #6c3ce1);
      color: white; border: none; border-radius: 12px; font-weight: 700; cursor: pointer;
      font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em;
      transition: all 0.2s; box-shadow: 0 4px 16px rgba(84,22,201,0.3);
    }
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(84,22,201,0.4); }
    .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

    /* Stats grid */
    .stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 28px; }
    .stat-card {
      background: white; border-radius: 16px; padding: 20px;
      box-shadow: 0 1px 4px rgba(15,23,42,0.06);
      border-left: 4px solid #5416c9; transition: all 0.2s;
    }
    .stat-card .label { font-size: 10px; color: #7a7486; margin-bottom: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
    .stat-card .value { font-size: 32px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
    .stat-card .value.purple { color: #5416c9; }
    .stat-card .value.green { color: #006c4b; }
    .stat-card .value.orange { color: #f59e0b; }
    .stat-card .value.blue { color: #3b82f6; }

    /* Cards */
    .card {
      background: white; border-radius: 16px; margin-bottom: 24px;
      box-shadow: 0 1px 4px rgba(15,23,42,0.06); overflow: hidden;
    }
    .card-header {
      display: flex; justify-content: space-between; align-items: center;
      padding: 18px 24px; background: #f2f3ff;
    }
    .card-header h3 { font-size: 16px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: #131b2e; }

    /* Project detail */
    .proj-back-btn {
      display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
      color: #5416c9; font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 16px;
      font-family: inherit;
    }
    .proj-back-btn:hover { text-decoration: underline; }
    .proj-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
    .proj-detail-header h3 { font-size: 22px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; color: #131b2e; margin: 0; }
    .proj-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
    .proj-tab {
      padding: 10px 20px; border-radius: 12px; border: 1px solid #eaedff; background: white;
      font-size: 13px; font-weight: 600; color: #494455; cursor: pointer; transition: all 0.2s;
      font-family: inherit;
    }
    .proj-tab:hover { background: #f2f3ff; color: #5416c9; }
    .proj-tab.active { background: #5416c9; color: white; border-color: #5416c9; }
    .proj-tab-content { display: none; }
    .proj-tab-content.active { display: block; }
    tr.proj-row { cursor: pointer; }
    tr.proj-row:hover td { background: #f2f3ff; }
    .ms-amount-input {
      width: 120px; padding: 8px 12px; border: 1px solid #eaedff; border-radius: 10px;
      font-size: 14px; outline: none; background: #faf8ff; color: #131b2e; font-family: inherit;
    }
    .ms-amount-input:focus { border-color: #6c3ce1; box-shadow: 0 0 0 3px rgba(108,60,225,0.1); }

    /* Tables */
    table { width: 100%; border-collapse: collapse; }
    th {
      text-align: left; padding: 12px 24px; font-size: 10px; color: #7a7486;
      text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
      background: #f2f3ff;
    }
    td { padding: 14px 24px; font-size: 14px; border-bottom: 1px solid #eaedff; }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: #faf8ff; }

    /* Pagination */
    .pagination { display:flex; align-items:center; justify-content:center; gap:12px; padding:16px; font-size:13px; color:#7a7486; }
    .pagination button { padding:6px 14px; border-radius:8px; border:1px solid #eaedff; background:white; color:#5416c9; cursor:pointer; font-weight:600; font-size:12px; }
    .pagination button:disabled { opacity:0.4; cursor:default; }

    /* Badges */
    .badge {
      display: inline-block; padding: 4px 12px; border-radius: 20px;
      font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    }
    .badge-active { background: #dcfce7; color: #166534; }
    .badge-sold { background: #e2e7ff; color: #5416c9; }
    .badge-available { background: #f0fdf4; color: #15803d; }
    .badge-reserved { background: #fef3c7; color: #92400e; }
    .badge-pending, .badge-pending-approval { background: #fff7ed; color: #9a3412; }
    .badge-priced { background: #eaedff; color: #5416c9; }
    .badge-approved { background: #dcfce7; color: #166534; }
    .badge-rejected { background: #ffdad6; color: #ba1a1a; }
    .badge-submitted { background: #fef3c7; color: #92400e; }
    .badge-completed { background: #e2e7ff; color: #5416c9; }

    /* Buttons */
    .btn-sm {
      padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 700;
      border: none; cursor: pointer; transition: all 0.2s; letter-spacing: 0.02em;
    }
    .btn-sm:hover { opacity: 0.85; transform: translateY(-1px); }
    .btn-approve { background: #006c4b; color: white; }
    .btn-reject { background: #ba1a1a; color: white; margin-left: 6px; }
    .btn-outline {
      padding: 8px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
      border: none; background: #eaedff; cursor: pointer; color: #5416c9;
      transition: all 0.2s;
    }
    .btn-outline:hover { background: #dae2fd; }
    .btn-create {
      padding: 10px 20px; border-radius: 12px; font-size: 13px; font-weight: 700;
      border: none; background: linear-gradient(135deg, #5416c9, #6c3ce1);
      color: white; cursor: pointer; transition: all 0.2s;
      box-shadow: 0 2px 8px rgba(84,22,201,0.25); text-transform: uppercase; letter-spacing: 0.04em;
    }
    .btn-create:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(84,22,201,0.3); }

    /* Progress bar */
    .progress-bar { height: 8px; background: #eaedff; border-radius: 8px; overflow: hidden; }
    .progress-fill { height: 100%; background: linear-gradient(90deg, #5416c9, #6c3ce1); border-radius: 8px; transition: width 0.5s ease; }
    .progress-clickable { cursor: pointer; border-radius: 8px; padding: 4px 8px; margin: -4px -8px; transition: background 0.15s; }
    .progress-clickable:hover { background: #eaedff; }

    /* Phase breakdown modal */
    .phase-breakdown-list { display: flex; flex-direction: column; gap: 12px; }
    .phase-breakdown-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #faf8ff; border-radius: 12px; border: 1px solid #eaedff; }
    .phase-breakdown-row .phase-info { flex: 1; min-width: 0; }
    .phase-breakdown-row .phase-info .phase-label { font-size: 14px; font-weight: 600; color: #131b2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .phase-breakdown-row .phase-info .phase-meta { font-size: 12px; color: #7a7486; margin-top: 2px; }
    .phase-breakdown-row .phase-bar { flex: 0 0 120px; }
    .phase-breakdown-row .phase-pct { flex: 0 0 44px; text-align: right; font-size: 13px; font-weight: 700; color: #5416c9; }

    /* Site updates */
    .site-updates-section { margin-top: 28px; }
    .site-updates-section h4 { font-size: 16px; font-weight: 700; color: #131b2e; margin-bottom: 14px; font-family: 'Space Grotesk', sans-serif; }
    .site-update-card { background: #faf8ff; border: 1px solid #eaedff; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
    .site-update-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
    .site-update-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #5416c9, #6c3ce1); color: white; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
    .site-update-meta { flex: 1; min-width: 0; }
    .site-update-name { font-size: 14px; font-weight: 600; color: #131b2e; }
    .site-update-date { font-size: 12px; color: #7a7486; }
    .site-update-notes { font-size: 14px; color: #494455; line-height: 1.5; margin-bottom: 10px; }
    .site-update-photos { display: flex; gap: 8px; flex-wrap: wrap; }
    .site-update-photos img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid #eaedff; transition: transform 0.15s, box-shadow 0.15s; }
    .site-update-photos img:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
    .site-update-empty { text-align: center; color: #7a7486; font-size: 13px; padding: 16px 0; }
    .photo-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 200; display: flex; align-items: center; justify-content: center; cursor: pointer; }
    .photo-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
    .photo-lightbox-caption { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); color: white; font-size: 14px; background: rgba(0,0,0,0.6); padding: 8px 16px; border-radius: 8px; }

    /* Internal phases */
    .int-phase-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #faf8ff; border: 1px solid #eaedff; border-radius: 10px; margin-bottom: 8px; }
    .int-phase-item .int-phase-name { flex: 1; font-size: 14px; font-weight: 600; color: #131b2e; }
    .int-phase-item .int-phase-delete { background: none; border: none; color: #ba1a1a; cursor: pointer; font-size: 18px; font-weight: 700; padding: 0 4px; line-height: 1; }
    .int-phase-item .int-phase-delete:hover { color: #93000a; }
    #internal-phase-name { font-family: 'Inter', sans-serif; }
    .int-phase-progress { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
    .int-phase-progress .progress-bar { flex: 1; }
    .int-phase-progress .int-pct { font-size: 12px; font-weight: 700; color: #5416c9; min-width: 36px; text-align: right; }
    .int-phase-status { font-size: 11px; margin-top: 2px; }

    /* Offline banner */
    .offline-banner {
      display: flex; align-items: center; justify-content: center; gap: 8px;
      padding: 8px 16px; background: #ba1a1a; color: #ffffff;
      font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
    }

    /* Loading spinner */
    .view-loader {
      display: flex; align-items: center; justify-content: center; padding: 64px 0; gap: 12px;
      color: #7a7486; font-size: 14px;
    }
    .view-loader .spinner {
      width: 28px; height: 28px; border: 3px solid #eaedff; border-top-color: #5416c9;
      border-radius: 50%; animation: spin 0.7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Error state with retry */
    .view-error {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      padding: 48px 0; gap: 12px; color: #7a7486; font-size: 14px; text-align: center;
    }
    .view-error .material-symbols-outlined { font-size: 40px; color: #ba1a1a; }
    .btn-retry {
      margin-top: 8px; padding: 8px 20px; border-radius: 12px; border: 1px solid #dae2fd;
      background: white; color: #5416c9; font-weight: 600; cursor: pointer; font-size: 13px;
      transition: all 0.2s;
    }
    .btn-retry:hover { background: #eaedff; }

    /* Section views */
    .view { display: none; }
    .view.active { display: block; }

    /* Toast */
    .toast {
      position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
      border-radius: 16px; color: white; font-size: 14px; font-weight: 600;
      z-index: 2000; opacity: 0; transition: all 0.3s;
      box-shadow: 0 8px 32px rgba(0,0,0,0.15); backdrop-filter: blur(8px);
    }
    .toast.show { opacity: 1; transform: translateY(-4px); }
    .toast-success { background: #006c4b; }
    .toast-error { background: #ba1a1a; }
    .toast-warning { background: #e67700; }

    /* User button */
    .user-btn {
      display: flex; align-items: center; gap: 8px; padding: 8px 16px;
      border: none; border-radius: 12px; background: #eaedff;
      cursor: pointer; font-size: 13px; font-weight: 600; color: #5416c9;
      transition: all 0.2s;
    }
    .user-btn:hover { background: #dae2fd; }

    .hidden { display: none !important; }

    /* Modal */
    .modal-overlay {
      position: fixed; inset: 0; background: rgba(19,27,46,0.5); backdrop-filter: blur(4px); z-index: 100;
      display: flex; align-items: center; justify-content: center;
    }
    .modal {
      background: white; border-radius: 24px; padding: 32px; width: 100%; max-width: 520px;
      max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(15,23,42,0.15);
    }
    .modal h3 { font-size: 20px; margin-bottom: 20px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #131b2e; }
    .modal .form-group { margin-bottom: 14px; }
    .modal .form-group label { display: block; font-size: 12px; color: #7a7486; margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
    .modal .form-group input, .modal .form-group select, .modal .form-group textarea {
      width: 100%; padding: 12px 16px; border: 1px solid #eaedff; border-radius: 12px;
      font-size: 14px; outline: none; font-family: inherit; background: #faf8ff; color: #131b2e;
      transition: all 0.2s;
    }
    .modal .form-group input:focus, .modal .form-group select:focus, .modal .form-group textarea:focus {
      border-color: #6c3ce1; box-shadow: 0 0 0 3px rgba(108,60,225,0.1); background: white;
    }
    .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
    .btn-modal-cancel {
      padding: 12px 24px; border: none; border-radius: 12px;
      background: #eaedff; cursor: pointer; font-size: 14px; color: #494455; font-weight: 600;
      transition: all 0.2s;
    }
    .btn-modal-cancel:hover { background: #dae2fd; }
    .btn-modal-submit {
      padding: 12px 24px; border: none; border-radius: 12px; cursor: pointer;
      font-size: 14px; font-weight: 700; color: white;
      background: linear-gradient(135deg, #5416c9, #6c3ce1);
      box-shadow: 0 2px 8px rgba(84,22,201,0.25); transition: all 0.2s;
    }
    .btn-modal-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(84,22,201,0.3); }
    .btn-modal-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
    .btn-danger { background: #ba1a1a !important; box-shadow: 0 2px 8px rgba(186,26,26,0.25) !important; }
    .btn-sm.btn-edit { background: #5416c9; color: white; }
    .btn-sm.btn-delete { background: #ba1a1a; color: white; margin-left: 6px; }
    .btn-sm.btn-assign { background: #6c3ce1; color: white; margin-left: 6px; }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

    /* Side Panel */
    .side-panel-overlay {
      position: fixed; inset: 0; background: rgba(19,27,46,0.3); backdrop-filter: blur(2px); z-index: 150;
      opacity: 0; transition: opacity 0.3s; pointer-events: none;
    }
    .side-panel-overlay.open { opacity: 1; pointer-events: auto; }
    .side-panel {
      position: fixed; top: 0; right: -480px; width: 460px; height: 100vh;
      background: white; z-index: 151; transition: right 0.3s ease;
      display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(15,23,42,0.1);
      border-radius: 24px 0 0 24px;
    }
    .side-panel.open { right: 0; }
    .side-panel-header {
      padding: 24px 28px; background: #f2f3ff;
      display: flex; justify-content: space-between; align-items: center;
      border-radius: 24px 0 0 0;
    }
    .side-panel-header h3 { font-size: 18px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
    .side-panel-close {
      background: white; border: none; border-radius: 10px;
      width: 36px; height: 36px; font-size: 18px; cursor: pointer;
      display: flex; align-items: center; justify-content: center; color: #494455;
      box-shadow: 0 1px 4px rgba(15,23,42,0.06); transition: all 0.2s;
    }
    .side-panel-close:hover { background: #eaedff; color: #5416c9; }
    .side-panel-body { flex: 1; overflow-y: auto; padding: 24px 28px; }
    .side-panel-footer { padding: 20px 28px; background: #f2f3ff; }

    .phase-item {
      display: flex; align-items: center; gap: 10px; padding: 12px 14px;
      background: #faf8ff; border-radius: 12px; margin-bottom: 8px;
      transition: all 0.2s; box-shadow: 0 1px 3px rgba(15,23,42,0.04);
    }
    .phase-item:hover { background: #eaedff; }
    .phase-item .phase-drag { cursor: grab; color: #cbc3d7; font-size: 16px; user-select: none; }
    .phase-item .phase-name { flex: 1; font-size: 14px; font-weight: 600; color: #131b2e; }
    .phase-item .phase-default { font-size: 10px; color: #7a7486; background: #eaedff; padding: 3px 10px; border-radius: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
    .phase-item .phase-actions { display: flex; gap: 4px; }
    .phase-item .phase-btn {
      background: white; border: none; border-radius: 8px;
      width: 30px; height: 30px; font-size: 13px; cursor: pointer;
      display: flex; align-items: center; justify-content: center; color: #494455;
      box-shadow: 0 1px 3px rgba(15,23,42,0.06); transition: all 0.2s;
    }
    .phase-item .phase-btn:hover { background: #eaedff; color: #5416c9; }
    .phase-item .phase-btn.delete:hover { background: #ffdad6; color: #ba1a1a; }

    .add-phase-row { display: flex; gap: 8px; margin-top: 16px; }
    .add-phase-row input {
      flex: 1; padding: 10px 14px; border: 1px solid #eaedff; border-radius: 12px;
      font-size: 14px; outline: none; background: #faf8ff; transition: all 0.2s;
    }
    .add-phase-row input:focus { border-color: #6c3ce1; background: white; box-shadow: 0 0 0 3px rgba(108,60,225,0.1); }
    .add-phase-row button {
      padding: 10px 20px; border: none; border-radius: 12px;
      background: linear-gradient(135deg, #5416c9, #6c3ce1);
      color: white; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
      box-shadow: 0 2px 8px rgba(84,22,201,0.25); transition: all 0.2s;
    }
    .add-phase-row button:hover { transform: translateY(-1px); }

    /* Flash animation for modal buttons */
    @keyframes flash-btn {
      0%, 100% { box-shadow: none; }
      25% { box-shadow: 0 0 0 3px rgba(108,60,225,0.3); }
      50% { box-shadow: none; }
      75% { box-shadow: 0 0 0 3px rgba(108,60,225,0.3); }
    }
    .btn-flash { animation: flash-btn 0.8s ease; }

    /* Search */
    .search-bar {
      display: flex; align-items: center; gap: 8px; flex: 1; max-width: 400px; margin: 0 24px;
      position: relative;
    }
    .search-bar input {
      width: 100%; padding: 10px 16px 10px 40px; border: none; border-radius: 12px;
      font-size: 13px; outline: none; background: #eaedff; color: #131b2e;
      transition: all 0.2s;
    }
    .search-bar input::placeholder { color: #7a7486; }
    .search-bar input:focus { background: white; box-shadow: 0 0 0 3px rgba(108,60,225,0.1); }
    .search-bar .search-icon {
      position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
      color: #7a7486; font-size: 18px; pointer-events: none;
    }
    .search-results {
      position: absolute; top: 100%; left: 0; right: 0; background: white;
      border-radius: 16px; margin-top: 8px;
      max-height: 400px; overflow-y: auto; z-index: 50;
      box-shadow: 0 16px 48px rgba(15,23,42,0.12);
    }
    .search-results .sr-section { padding: 10px 16px; font-size: 10px; font-weight: 700; color: #7a7486; text-transform: uppercase; letter-spacing: 0.08em; background: #f2f3ff; }
    .search-results .sr-item { padding: 12px 16px; cursor: pointer; font-size: 13px; transition: background 0.15s; }
    .search-results .sr-item:hover { background: #f2f3ff; }
    .search-results .sr-empty { padding: 20px; text-align: center; color: #7a7486; font-size: 13px; }

    /* Notification bell */
    .notif-bell {
      position: relative; background: #eaedff; border: none; border-radius: 12px;
      padding: 8px; cursor: pointer; margin-right: 8px; color: #5416c9;
      transition: all 0.2s; display: flex; align-items: center; justify-content: center;
    }
    .notif-bell:hover { background: #dae2fd; }
    .notif-badge {
      position: absolute; top: -4px; right: -4px; background: #ba1a1a; color: white;
      border-radius: 50%; width: 18px; height: 18px; font-size: 10px; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
    }
    .notif-dropdown {
      position: absolute; top: 100%; right: 0; width: 340px; background: white;
      border-radius: 16px; margin-top: 8px;
      max-height: 400px; overflow-y: auto; z-index: 50;
      box-shadow: 0 16px 48px rgba(15,23,42,0.12);
    }
    .notif-item { padding: 14px 18px; font-size: 13px; transition: background 0.15s; }
    .notif-item:not(:last-child) { border-bottom: 1px solid #eaedff; }
    .notif-item.unread { background: #f2f3ff; }
    .notif-item:hover { background: #eaedff; }
    .notif-item .notif-title { font-weight: 700; margin-bottom: 2px; color: #131b2e; }
    .notif-item .notif-body { color: #494455; }
    .notif-item .notif-time { font-size: 11px; color: #7a7486; margin-top: 4px; }

    /* Export button */
    .btn-export {
      padding: 8px 16px; border-radius: 12px; font-size: 12px; font-weight: 700;
      border: none; background: #eaedff; cursor: pointer; color: #5416c9;
      transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.04em;
    }
    .btn-export:hover { background: #dae2fd; }
    .lang-btn {
      display: flex; align-items: center; gap: 6px; padding: 8px 14px;
      border: none; border-radius: 12px; background: #eaedff; cursor: pointer;
      font-size: 13px; color: #5416c9; font-weight: 600; transition: all 0.2s;
    }
    .lang-btn:hover { background: #dae2fd; }
    .login-lang { margin-top: 20px; text-align: center; }
    .login-lang button {
      background: rgba(250,248,255,0.1); border: 1px solid rgba(203,195,215,0.2);
      color: rgba(250,248,255,0.6); padding: 8px 18px; border-radius: 20px;
      font-size: 13px; cursor: pointer; transition: all 0.2s;
    }
    .login-lang button:hover { background: rgba(250,248,255,0.15); color: #faf8ff; }

    /* Clickable elements */
    td[onclick], td[style*="cursor:pointer"], [data-clickable] { cursor: pointer; }
    td[onclick] strong, td[style*="cursor:pointer"] strong { color: #5416c9; transition: color 0.15s; }
    td[onclick]:hover strong, td[style*="cursor:pointer"]:hover strong { color: #6c3ce1; text-decoration: underline; }
    .stat-card[onclick], .stat-card[style*="cursor:pointer"] { transition: all 0.2s; }
    .stat-card[onclick]:hover, .stat-card[style*="cursor:pointer"]:hover { box-shadow: 0 8px 24px rgba(15,23,42,0.1); transform: translateY(-2px); }

    /* Image upload */
    .image-upload-area {
      border: 2px dashed #cbc3d7; border-radius: 12px; padding: 20px; text-align: center;
      cursor: pointer; transition: all 0.2s; margin-top: 4px; background: #faf8ff;
    }
    .image-upload-area:hover { border-color: #6c3ce1; background: #f2f3ff; }
    .image-upload-area.has-files { border-color: #006c4b; background: #f0fdf4; }
    .image-preview-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
    .image-preview-grid img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }

    /* Mobile menu toggle */
    .menu-toggle {
      display: none; background: #eaedff; border: none; border-radius: 12px;
      padding: 10px; cursor: pointer; flex-shrink: 0; color: #5416c9;
      transition: all 0.2s;
    }
    .menu-toggle:hover { background: #dae2fd; }
    .sidebar-overlay {
      display: none; position: fixed; inset: 0; background: rgba(19,27,46,0.4);
      backdrop-filter: blur(2px); z-index: 49;
    }
    .sidebar-overlay.open { display: block; }

    /* Table scroll wrapper */
    .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* ── Tablet ── */
    @media (max-width: 1024px) {
      .stats-grid { grid-template-columns: repeat(3, 1fr); }
      .search-bar { max-width: 240px; }
      .side-panel { width: 380px; right: -400px; }
    }

    /* ── Mobile ── */
    @media (max-width: 768px) {
      html, body { overflow-x: hidden; }

      .sidebar {
        transform: translateX(-100%); transition: transform 0.3s ease;
        z-index: 50; width: 280px;
      }
      .sidebar.open { transform: translateX(0); }
      .main { margin-left: 0; max-width: 100vw; }

      .menu-toggle { display: flex; align-items: center; justify-content: center; }

      .topbar { padding: 12px 16px; gap: 8px; }
      .topbar h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
      .search-bar { display: none; }

      .content { padding: 16px; }

      .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
      .stat-card { padding: 16px; border-radius: 12px; }
      .stat-card .value { font-size: 24px; }

      /* ── Table -> Card layout ── */
      .card { overflow: visible; border-radius: 16px; }
      .table-scroll { overflow-x: visible; }
      table { min-width: 0 !important; width: 100%; }
      table thead { display: none; }
      table tbody { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
      table tbody tr {
        display: block; border-radius: 14px; padding: 16px;
        background: #f2f3ff; box-shadow: 0 1px 3px rgba(15,23,42,0.04);
      }
      table tbody tr.empty-row {
        text-align: center; background: transparent; box-shadow: none;
      }
      table tbody tr.empty-row td {
        display: block; padding: 12px 0; color: #7a7486;
      }
      table tbody tr.empty-row td::before { display: none; }
      table tbody td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 7px 0; border-bottom: 1px solid rgba(234,237,255,0.6); font-size: 13px;
        gap: 8px; flex-wrap: wrap;
      }
      table tbody td:last-child { border-bottom: none; }
      table tbody td::before {
        content: attr(data-label);
        font-weight: 700; font-size: 10px; color: #7a7486;
        text-transform: uppercase; letter-spacing: 0.05em;
        flex-shrink: 0; min-width: 90px;
      }
      table tbody td:first-child { font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid #dae2fd; }
      table tbody td .btn-sm { margin-left: 0; margin-top: 0; }
      table tbody td .progress-bar { width: 80px !important; flex-shrink: 0; }

      .modal { max-width: 100%; margin: 12px; border-radius: 20px; padding: 24px; }
      .form-row { grid-template-columns: 1fr; }

      .side-panel { width: 100%; right: -100%; border-radius: 0; }
      .side-panel.open { right: 0; }
      .side-panel-header { border-radius: 0; }

      .login-card { width: calc(100% - 32px); max-width: 420px; padding: 28px; border-radius: 20px; }

      .proj-tabs { gap: 4px; }
      .proj-tab { padding: 8px 14px; font-size: 12px; }
      .proj-detail-header h3 { font-size: 18px; }

      .notif-dropdown { width: 300px; right: -40px; }

      .card-header {
        flex-direction: column; align-items: stretch !important; gap: 10px;
        padding: 14px 16px;
      }
      .card-header h3 { font-size: 15px; }
      .card-header > div,
      .card-header div[style*="display:flex"] {
        width: 100% !important; flex-wrap: wrap !important; gap: 6px !important;
      }
      .card-header .btn-create,
      .card-header .btn-outline,
      .card-header .btn-export { font-size: 12px; padding: 8px 14px; }
      .card-header select { width: 100% !important; max-width: 100% !important; }

      .catalog-category > div:first-child {
        flex-direction: column !important; align-items: flex-start !important; gap: 8px !important;
      }
      .catalog-category > div:first-child > div:last-child {
        width: 100%; flex-wrap: wrap !important;
      }
      .catalog-category > div:first-child .btn-sm { font-size: 11px; }

      .catalog-options-grid {
        grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important;
      }

      .co-item-row, .co-price-item-row {
        flex-direction: column !important;
      }
      .co-item-row input, .co-price-item-row input {
        flex: unset !important; width: 100% !important;
      }

      #materials-review-content select,
      #co-content select {
        max-width: 100% !important;
      }
    }

    /* ── Small phones ── */
    @media (max-width: 480px) {
      .stats-grid { grid-template-columns: 1fr; }
      .topbar h2 { font-size: 15px; }
      .lang-btn { display: none; }
      .catalog-options-grid { grid-template-columns: 1fr !important; }
      .sv-detail-grid { grid-template-columns: 1fr !important; }
    }

    /* ── Dark Mode ── */
    @media (prefers-color-scheme: dark) {
      body { background: #121318; color: #e4e1e9; }

      /* Layout */
      .sidebar { background: #1b1b23; box-shadow: 4px 0 24px rgba(0,0,0,0.2); }
      .sidebar-logo h1 { color: #cebdff; }
      .sidebar-logo h1 span { color: #d3c4ff; }
      .nav-item { color: rgba(228,225,233,0.6); }
      .nav-item:hover { background: #201f2b; color: #e4e1e9; }
      .nav-item.active { background: #2b2a37; color: #cebdff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
      .topbar { background: #121318; }
      .topbar h2 { color: #e4e1e9; }

      /* Cards & Tables */
      .stat-card { background: #1b1b23; box-shadow: 0 1px 4px rgba(0,0,0,0.15); border-left-color: #cebdff; }
      .stat-card .label { color: #948f99; }
      .stat-card .value.purple { color: #cebdff; }
      .card { background: #1b1b23; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
      .card-header { background: #201f2b; }
      .card-header h3 { color: #e4e1e9; }
      th { color: #948f99; background: #201f2b; }
      td { border-bottom-color: #2b2a37; color: #e4e1e9; }

      /* Project detail dark */
      .proj-back-btn { color: #cebdff; }
      .proj-detail-header h3 { color: #e4e1e9; }
      .proj-tab { background: #1b1b23; border-color: #2b2a37; color: #cac4d0; }
      .proj-tab:hover { background: #2b2a37; color: #cebdff; }
      .proj-tab.active { background: #6c3ce1; color: white; border-color: #6c3ce1; }
      tr.proj-row:hover td { background: #201f2b; }
      tr:hover td { background: #201f2b; }
      .ms-amount-input { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
      .ms-amount-input:focus { border-color: #7c4dff; background: #2b2a37; }
      #ms-unit-select { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }

      /* Badges */
      .badge-active { background: #1a3a2a; color: #64f9bc; }
      .badge-sold { background: #2b2a37; color: #cebdff; }
      .badge-available { background: #1a3a2a; color: #64f9bc; }
      .badge-reserved { background: #3a2a1a; color: #ffb74d; }
      .badge-pending, .badge-pending-approval { background: #3a2510; color: #ffb74d; }
      .badge-priced { background: #2b2a37; color: #cebdff; }
      .badge-approved { background: #1a3a2a; color: #64f9bc; }
      .badge-rejected { background: #3a1a1a; color: #ffb4ab; }
      .badge-submitted { background: #3a2a1a; color: #ffb74d; }
      .badge-completed { background: #2b2a37; color: #cebdff; }

      /* Buttons */
      .btn-outline { background: #2b2a37; color: #cebdff; }
      .btn-outline:hover { background: #363542; }
      .user-btn { background: #2b2a37; color: #cebdff; }
      .user-btn:hover { background: #363542; }
      .btn-export { background: #2b2a37; color: #cebdff; }
      .btn-export:hover { background: #363542; }
      .lang-btn { background: #2b2a37; color: #cebdff; }
      .lang-btn:hover { background: #363542; }

      /* Modals */
      .modal-overlay { background: rgba(0,0,0,0.6); }
      .modal { background: #1b1b23; box-shadow: 0 24px 64px rgba(0,0,0,0.4); }
      .modal h3 { color: #e4e1e9; }
      .modal .form-group label { color: #948f99; }
      .modal .form-group input,
      .modal .form-group select,
      .modal .form-group textarea {
        background: #201f2b !important; border-color: #2b2a37 !important; color: #e4e1e9 !important;
      }
      .modal .form-group input:focus,
      .modal .form-group select:focus,
      .modal .form-group textarea:focus {
        border-color: #7c4dff !important; background: #2b2a37 !important; box-shadow: 0 0 0 3px rgba(124,77,255,0.15);
      }
      .modal .form-group input::placeholder,
      .modal .form-group textarea::placeholder {
        color: #6b6778;
      }
      .modal .form-group label {
        color: #948f99 !important;
      }
      .btn-modal-cancel { background: #2b2a37; color: #cac4d0; }
      .btn-modal-cancel:hover { background: #363542; }

      /* Card form groups (profile page etc.) */
      .card .form-group label { color: #948f99; }
      .card .form-group input, .card .form-group select, .card .form-group textarea {
        background: #201f2b; border-color: #2b2a37; color: #e4e1e9;
      }
      .card .form-group input:focus, .card .form-group select:focus, .card .form-group textarea:focus {
        border-color: #7c4dff; background: #2b2a37; box-shadow: 0 0 0 3px rgba(124,77,255,0.15);
      }
      .card .form-group input::placeholder, .card .form-group textarea::placeholder { color: #6b6778; }

      /* Side Panel */
      .side-panel { background: #1b1b23; box-shadow: -8px 0 32px rgba(0,0,0,0.3); }
      .side-panel-header { background: #201f2b; }
      .side-panel-header h3 { color: #e4e1e9; }
      .side-panel-close { background: #2b2a37; color: #cac4d0; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
      .side-panel-close:hover { background: #363542; color: #cebdff; }
      .side-panel-footer { background: #201f2b; }
      .phase-item { background: #201f2b; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
      .phase-item:hover { background: #2b2a37; }
      .phase-item .phase-name { color: #e4e1e9; }
      .phase-item .phase-default { color: #948f99; background: #2b2a37; }
      .phase-item .phase-btn { background: #2b2a37; color: #cac4d0; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
      .phase-item .phase-btn:hover { background: #363542; color: #cebdff; }
      .phase-item .phase-btn.delete:hover { background: #3a1a1a; color: #ffb4ab; }
      .add-phase-row input { border-color: #2b2a37; background: #201f2b; color: #e4e1e9; }
      .add-phase-row input:focus { border-color: #7c4dff; background: #2b2a37; }

      /* Progress */
      .progress-bar { background: #2b2a37; }
      .progress-clickable:hover { background: #2b2a37; }
      .phase-breakdown-row { background: #201f2b; border-color: #2b2a37; }
      .phase-breakdown-row .phase-info .phase-label { color: #e4e1e9; }
      .phase-breakdown-row .phase-info .phase-meta { color: #948f99; }
      .phase-breakdown-row .phase-pct { color: #cebdff; }
      #proj-phase-desc { color: #948f99; }
      .site-updates-section h4 { color: #e4e1e9; }
      .site-update-card { background: #201f2b; border-color: #2b2a37; }
      .site-update-name { color: #e4e1e9; }
      .site-update-date { color: #948f99; }
      .site-update-notes { color: #c4c0cb; }
      .site-update-photos img { border-color: #2b2a37; }
      .site-update-empty { color: #948f99; }
      .int-phase-item { background: #201f2b; border-color: #2b2a37; }
      .int-phase-item .int-phase-name { color: #e4e1e9; }
      .int-phase-item .int-phase-delete { color: #ffb4ab; }
      #internal-phase-name { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
      #internal-phases-desc { color: #948f99; }
      .int-phase-progress .int-pct { color: #cebdff; }

      /* Search */
      .search-bar input { background: #2b2a37; color: #e4e1e9; }
      .search-bar input::placeholder { color: #948f99; }
      .search-bar input:focus { background: #363542; box-shadow: 0 0 0 3px rgba(124,77,255,0.15); }
      .search-results { background: #1b1b23; box-shadow: 0 16px 48px rgba(0,0,0,0.3); }
      .search-results .sr-section { background: #201f2b; color: #948f99; }
      .search-results .sr-item { color: #e4e1e9; }
      .search-results .sr-item:hover { background: #201f2b; }

      /* Notifications */
      .notif-bell { background: #2b2a37; color: #cebdff; }
      .notif-bell:hover { background: #363542; }
      .notif-dropdown { background: #1b1b23; box-shadow: 0 16px 48px rgba(0,0,0,0.3); }
      .notif-item:not(:last-child) { border-bottom-color: #2b2a37; }
      .notif-item.unread { background: #201f2b; }
      .notif-item:hover { background: #2b2a37; }
      .notif-item .notif-title { color: #e4e1e9; }
      .notif-item .notif-body { color: #cac4d0; }
      .notif-item .notif-time { color: #948f99; }

      /* Image upload */
      .image-upload-area { border-color: #49454e; background: #201f2b; color: #cac4d0; }
      .image-upload-area:hover { border-color: #7c4dff; background: #2b2a37; }
      .image-upload-area.has-files { border-color: #64f9bc; background: #1a3a2a; }

      /* Menu toggle */
      .menu-toggle { background: #2b2a37; color: #cebdff; }
      .menu-toggle:hover { background: #363542; }

      /* Mobile table cards */
      @media (max-width: 768px) {
        table tbody tr { background: #201f2b; }
        table tbody td { border-bottom-color: rgba(43,42,55,0.6); }
        table tbody td::before { color: #948f99; }
        table tbody td:first-child { border-bottom-color: #363542; }
      }

      /* Clickable elements */
      td[onclick] strong, td[style*="cursor:pointer"] strong { color: #cebdff; }
      td[onclick]:hover strong, td[style*="cursor:pointer"]:hover strong { color: #d3c4ff; }

      /* Site Visits Calendar */
      .sv-week-label { color: #e4e1e9 !important; }
      .sv-filter-select { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
      .sv-cal-header { background: #201f2b !important; color: #cac4d0 !important; border-bottom-color: #2b2a37 !important; }
      .sv-cal-header.today-col { background: rgba(206,189,255,0.1) !important; }
      .sv-cal-corner { border-right-color: #2b2a37 !important; }
      .sv-today-num { color: #cebdff !important; }
      .sv-cal-time { color: #948f99 !important; border-right-color: #2b2a37 !important; }
      .sv-cal-cell { border-right-color: #2b2a37 !important; border-bottom-color: #2b2a37 !important; }
      .sv-cal-cell.today-col { background: rgba(206,189,255,0.04); }
      .sv-cal-cell:hover { background: rgba(206,189,255,0.08) !important; }
      .sv-cal-event.status-requested { background: rgba(206,189,255,0.18); color: #cebdff; border-left-color: #cebdff; }
      .sv-cal-event.status-amended_by_admin, .sv-cal-event.status-amended_by_buyer { background: rgba(255,183,77,0.18); color: #ffb74d; border-left-color: #ffb74d; }
      .sv-cal-event.status-confirmed { background: rgba(100,249,188,0.15); color: #64f9bc; border-left-color: #64f9bc; }
      .sv-cal-event.status-completed { background: rgba(147,197,253,0.15); color: #93c5fd; border-left-color: #93c5fd; }
      .sv-cal-event.status-cancelled { background: rgba(255,180,171,0.15); color: #ffb4ab; border-left-color: #ffb4ab; }
      .sv-nav-btn { color: #cac4d0; }

      /* Site visit badges */
      .badge-sv-requested { color: #cebdff; }
      .badge-sv-amended_by_admin, .badge-sv-amended_by_buyer { color: #ffb74d; }
      .badge-sv-confirmed { color: #64f9bc; }
      .badge-sv-cancelled { color: #ffb4ab; }
      .badge-sv-completed { color: #93c5fd; }

      /* Site visit history timeline */
      .sv-history-item { border-bottom-color: #2b2a37; }
      .sv-history-label { color: #948f99; }
      .sv-history-datetime { color: #cebdff; }
      .sv-history-notes { color: #cac4d0; }

      /* Detail modal */
      .sv-detail-label { color: #948f99 !important; }

      /* Loading spinner */
      .sv-cal-loading { color: #948f99; }
      .sv-cal-loading::before { border-color: #2b2a37; border-top-color: #cebdff; }
    }

    /* ── Manual Dark Mode (data-theme="dark") ── */
    html[data-theme="dark"] body { background: #121318; color: #e4e1e9; }
    html[data-theme="dark"] .sidebar { background: #1b1b23; box-shadow: 4px 0 24px rgba(0,0,0,0.2); }
    html[data-theme="dark"] .sidebar-logo h1 { color: #cebdff; }
    html[data-theme="dark"] .sidebar-logo h1 span { color: #d3c4ff; }
    html[data-theme="dark"] .nav-item { color: rgba(228,225,233,0.6); }
    html[data-theme="dark"] .nav-item:hover { background: #201f2b; color: #e4e1e9; }
    html[data-theme="dark"] .nav-item.active { background: #2b2a37; color: #cebdff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
    html[data-theme="dark"] .topbar { background: #121318; }
    html[data-theme="dark"] .topbar h2 { color: #e4e1e9; }
    html[data-theme="dark"] .stat-card { background: #1b1b23; box-shadow: 0 1px 4px rgba(0,0,0,0.15); border-left-color: #cebdff; }
    html[data-theme="dark"] .stat-card .label { color: #948f99; }
    html[data-theme="dark"] .stat-card .value.purple { color: #cebdff; }
    html[data-theme="dark"] .card { background: #1b1b23; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
    html[data-theme="dark"] .card-header { background: #201f2b; }
    html[data-theme="dark"] .card-header h3 { color: #e4e1e9; }
    html[data-theme="dark"] th { color: #948f99; background: #201f2b; }
    html[data-theme="dark"] td { border-bottom-color: #2b2a37; color: #e4e1e9; }
    html[data-theme="dark"] tr:hover td { background: #201f2b; }
    html[data-theme="dark"] .proj-back-btn { color: #cebdff; }
    html[data-theme="dark"] .proj-detail-header h3 { color: #e4e1e9; }
    html[data-theme="dark"] .proj-tab { background: #1b1b23; border-color: #2b2a37; color: #cac4d0; }
    html[data-theme="dark"] .proj-tab:hover { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .proj-tab.active { background: #6c3ce1; color: white; border-color: #6c3ce1; }
    html[data-theme="dark"] tr.proj-row:hover td { background: #201f2b; }
    html[data-theme="dark"] .ms-amount-input { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
    html[data-theme="dark"] .ms-amount-input:focus { border-color: #7c4dff; background: #2b2a37; }
    html[data-theme="dark"] #ms-unit-select { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
    html[data-theme="dark"] .badge-active { background: #1a3a2a; color: #64f9bc; }
    html[data-theme="dark"] .badge-sold { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .badge-available { background: #1a3a2a; color: #64f9bc; }
    html[data-theme="dark"] .badge-reserved { background: #3a2a1a; color: #ffb74d; }
    html[data-theme="dark"] .badge-pending, html[data-theme="dark"] .badge-pending-approval { background: #3a2510; color: #ffb74d; }
    html[data-theme="dark"] .badge-priced { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .badge-approved { background: #1a3a2a; color: #64f9bc; }
    html[data-theme="dark"] .badge-rejected { background: #3a1a1a; color: #ffb4ab; }
    html[data-theme="dark"] .badge-submitted { background: #3a2a1a; color: #ffb74d; }
    html[data-theme="dark"] .badge-completed { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .btn-outline { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .btn-outline:hover { background: #363542; }
    html[data-theme="dark"] .user-btn { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .user-btn:hover { background: #363542; }
    html[data-theme="dark"] .btn-export { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .btn-export:hover { background: #363542; }
    html[data-theme="dark"] .lang-btn { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .lang-btn:hover { background: #363542; }
    html[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); }
    html[data-theme="dark"] .modal { background: #1b1b23; box-shadow: 0 24px 64px rgba(0,0,0,0.4); }
    html[data-theme="dark"] .modal h3 { color: #e4e1e9; }
    html[data-theme="dark"] .modal .form-group label { color: #948f99 !important; }
    html[data-theme="dark"] .modal .form-group input,
    html[data-theme="dark"] .modal .form-group select,
    html[data-theme="dark"] .modal .form-group textarea {
      background: #201f2b !important; border-color: #2b2a37 !important; color: #e4e1e9 !important;
    }
    html[data-theme="dark"] .modal .form-group input:focus,
    html[data-theme="dark"] .modal .form-group select:focus,
    html[data-theme="dark"] .modal .form-group textarea:focus {
      border-color: #7c4dff !important; background: #2b2a37 !important; box-shadow: 0 0 0 3px rgba(124,77,255,0.15);
    }
    html[data-theme="dark"] .btn-modal-cancel { background: #2b2a37; color: #cac4d0; }
    html[data-theme="dark"] .btn-modal-cancel:hover { background: #363542; }
    html[data-theme="dark"] .card .form-group label { color: #948f99; }
    html[data-theme="dark"] .card .form-group input,
    html[data-theme="dark"] .card .form-group select,
    html[data-theme="dark"] .card .form-group textarea {
      background: #201f2b; border-color: #2b2a37; color: #e4e1e9;
    }
    html[data-theme="dark"] .card .form-group input:focus,
    html[data-theme="dark"] .card .form-group select:focus,
    html[data-theme="dark"] .card .form-group textarea:focus {
      border-color: #7c4dff; background: #2b2a37; box-shadow: 0 0 0 3px rgba(124,77,255,0.15);
    }
    html[data-theme="dark"] .card .form-group input::placeholder,
    html[data-theme="dark"] .card .form-group textarea::placeholder { color: #6b6778; }
    html[data-theme="dark"] .side-panel { background: #1b1b23; box-shadow: -8px 0 32px rgba(0,0,0,0.3); }
    html[data-theme="dark"] .side-panel-header { background: #201f2b; }
    html[data-theme="dark"] .side-panel-header h3 { color: #e4e1e9; }
    html[data-theme="dark"] .side-panel-close { background: #2b2a37; color: #cac4d0; }
    html[data-theme="dark"] .side-panel-close:hover { background: #363542; color: #cebdff; }
    html[data-theme="dark"] .side-panel-footer { background: #201f2b; }
    html[data-theme="dark"] .phase-item { background: #201f2b; }
    html[data-theme="dark"] .phase-item:hover { background: #2b2a37; }
    html[data-theme="dark"] .phase-item .phase-name { color: #e4e1e9; }
    html[data-theme="dark"] .add-phase-row input { border-color: #2b2a37; background: #201f2b; color: #e4e1e9; }
    html[data-theme="dark"] .phase-breakdown-row { background: #201f2b; border-color: #2b2a37; }
    html[data-theme="dark"] .phase-breakdown-row .phase-info .phase-label { color: #e4e1e9; }
    html[data-theme="dark"] .phase-breakdown-row .phase-info .phase-meta { color: #948f99; }
    html[data-theme="dark"] .phase-breakdown-row .phase-pct { color: #cebdff; }
    html[data-theme="dark"] #proj-phase-desc { color: #948f99; }
    html[data-theme="dark"] .site-updates-section h4 { color: #e4e1e9; }
    html[data-theme="dark"] .site-update-card { background: #201f2b; border-color: #2b2a37; }
    html[data-theme="dark"] .site-update-name { color: #e4e1e9; }
    html[data-theme="dark"] .site-update-date { color: #948f99; }
    html[data-theme="dark"] .site-update-notes { color: #c4c0cb; }
    html[data-theme="dark"] .site-update-photos img { border-color: #2b2a37; }
    html[data-theme="dark"] .site-update-empty { color: #948f99; }
    html[data-theme="dark"] .int-phase-item { background: #201f2b; border-color: #2b2a37; }
    html[data-theme="dark"] .int-phase-item .int-phase-name { color: #e4e1e9; }
    html[data-theme="dark"] .int-phase-item .int-phase-delete { color: #ffb4ab; }
    html[data-theme="dark"] #internal-phase-name { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
    html[data-theme="dark"] #internal-phases-desc { color: #948f99; }
    html[data-theme="dark"] .int-phase-progress .int-pct { color: #cebdff; }
    html[data-theme="dark"] .progress-bar { background: #2b2a37; }
    html[data-theme="dark"] .search-bar input { background: #2b2a37; color: #e4e1e9; }
    html[data-theme="dark"] .search-bar input:focus { background: #363542; }
    html[data-theme="dark"] .search-results { background: #1b1b23; }
    html[data-theme="dark"] .search-results .sr-item { color: #e4e1e9; }
    html[data-theme="dark"] .search-results .sr-item:hover { background: #201f2b; }
    html[data-theme="dark"] .notif-bell { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .notif-bell:hover { background: #363542; }
    html[data-theme="dark"] .notif-dropdown { background: #1b1b23; }
    html[data-theme="dark"] .notif-item.unread { background: #201f2b; }
    html[data-theme="dark"] .notif-item:hover { background: #2b2a37; }
    html[data-theme="dark"] .notif-item .notif-title { color: #e4e1e9; }
    html[data-theme="dark"] .notif-item .notif-body { color: #cac4d0; }
    html[data-theme="dark"] .image-upload-area { border-color: #49454e; background: #201f2b; color: #cac4d0; }
    html[data-theme="dark"] .image-upload-area:hover { border-color: #7c4dff; background: #2b2a37; }
    html[data-theme="dark"] .menu-toggle { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .pagination button { background: #2b2a37; color: #cebdff; border-color: #49454e; }
    html[data-theme="dark"] .pagination { color: #948f99; }
    html[data-theme="dark"] .theme-toggle { background: #2b2a37; color: #cebdff; }
    html[data-theme="dark"] .theme-toggle:hover { background: #363542; }
    @media (max-width: 768px) {
      html[data-theme="dark"] table tbody tr { background: #201f2b; }
      html[data-theme="dark"] table tbody td { border-bottom-color: rgba(43,42,55,0.6); }
    }
    html[data-theme="dark"] .sv-week-label { color: #e4e1e9 !important; }
    html[data-theme="dark"] .sv-filter-select { background: #201f2b; border-color: #2b2a37; color: #e4e1e9; }
    html[data-theme="dark"] .sv-cal-header { background: #201f2b !important; color: #cac4d0 !important; }
    html[data-theme="dark"] .sv-cal-cell { border-color: #2b2a37 !important; }
    html[data-theme="dark"] .sv-cal-cell:hover { background: rgba(206,189,255,0.08) !important; }
    html[data-theme="dark"] .sv-cal-time { color: #948f99 !important; }

    /* Theme toggle button */
    .theme-toggle {
      width: 36px; height: 36px; border-radius: 12px; border: 1px solid #eaedff;
      background: white; cursor: pointer; display: inline-flex; align-items: center;
      justify-content: center; font-size: 18px; transition: all 0.2s;
    }
    .theme-toggle:hover { background: #f5f3ff; }

    /* ── Site Visits Calendar ── */
    .sv-controls {
      display: flex; justify-content: space-between; align-items: center;
      padding: 16px 20px; flex-wrap: wrap; gap: 12px;
    }
    .sv-nav {
      display: flex; align-items: center; gap: 8px;
    }
    .sv-nav-btn {
      width: 36px; height: 36px; padding: 0;
      display: inline-flex; align-items: center; justify-content: center;
    }
    .sv-week-label {
      margin: 0; font-size: 16px; min-width: 180px; text-align: center;
      font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #131b2e;
    }
    .sv-filters { display: flex; gap: 8px; }
    .sv-filter-select {
      padding: 8px 14px; border: 1px solid #eaedff; border-radius: 12px;
      font-size: 13px; background: #faf8ff; outline: none; color: #131b2e;
    }
    .sv-calendar-card { overflow-x: hidden; }
    .sv-calendar-grid {
      display: grid;
      grid-template-columns: 64px repeat(7, 1fr);
    }
    .sv-cal-header {
      padding: 10px 6px; text-align: center;
      font-size: 11px; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.05em;
      color: #494455; background: #f2f3ff;
      border-bottom: 2px solid #eaedff;
    }
    .sv-cal-header.today-col { background: rgba(84,22,201,0.08); }
    .sv-cal-corner { border-right: 1px solid #eaedff; }
    .sv-today-num { color: #5416c9; }
    .sv-cal-time {
      padding: 4px 8px; font-size: 11px; color: #7a7486;
      text-align: right; border-right: 1px solid #eaedff;
      height: 52px; box-sizing: border-box; line-height: 52px;
    }
    .sv-cal-cell {
      border-right: 1px solid #f2f3ff; border-bottom: 1px solid #f2f3ff;
      height: 52px; position: relative; overflow: visible;
    }
    .sv-cal-cell.today-col { background: rgba(84,22,201,0.03); }
    .sv-cal-cell:hover { background: rgba(84,22,201,0.05); }
    .sv-cal-event {
      position: absolute; left: 2px; right: 2px;
      border-radius: 6px; padding: 3px 6px;
      font-size: 11px; font-weight: 600; cursor: pointer;
      overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
      z-index: 5; transition: transform 0.15s;
    }
    .sv-cal-event:hover { transform: scale(1.02); z-index: 10; }
    .sv-cal-event.status-requested {
      background: rgba(84,22,201,0.15); color: #5416c9; border-left: 3px solid #5416c9;
    }
    .sv-cal-event.status-amended_by_admin, .sv-cal-event.status-amended_by_buyer {
      background: rgba(245,158,11,0.15); color: #b45309; border-left: 3px solid #f59e0b;
    }
    .sv-cal-event.status-confirmed {
      background: rgba(0,108,75,0.15); color: #006c4b; border-left: 3px solid #006c4b;
    }
    .sv-cal-event.status-completed {
      background: rgba(59,130,246,0.15); color: #1d4ed8; border-left: 3px solid #3b82f6;
    }
    .sv-cal-event.status-cancelled {
      background: rgba(186,26,26,0.12); color: #ba1a1a; border-left: 3px solid #ba1a1a;
    }

    /* Site visit badge classes */
    .badge-sv-requested { background: rgba(84,22,201,0.12); color: #5416c9; }
    .badge-sv-amended_by_admin, .badge-sv-amended_by_buyer { background: rgba(245,158,11,0.15); color: #b45309; }
    .badge-sv-confirmed { background: rgba(0,108,75,0.15); color: #006c4b; }
    .badge-sv-cancelled { background: rgba(186,26,26,0.12); color: #ba1a1a; }
    .badge-sv-completed { background: rgba(59,130,246,0.15); color: #1d4ed8; }

    /* Site visit history timeline */
    .sv-history-item {
      display: flex; gap: 10px; padding: 6px 0;
      border-bottom: 1px solid #f2f3ff;
    }
    .sv-history-dot {
      width: 10px; height: 10px; border-radius: 50%;
      margin-top: 5px; flex-shrink: 0;
    }
    .sv-history-label { font-size: 12px; color: #7a7486; }
    .sv-history-datetime { font-size: 12px; color: #5416c9; margin-top: 2px; }
    .sv-history-notes { font-size: 12px; color: #494455; font-style: italic; margin-top: 2px; }

    /* Detail modal grid */
    .sv-detail-grid {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: 12px; margin-bottom: 12px;
    }
    .sv-detail-label { font-size: 12px; color: #7a7486; display: block; }

    /* Calendar loading */
    .sv-cal-loading {
      grid-column: 1 / -1; text-align: center; padding: 48px 16px;
      color: #7a7486; font-size: 13px;
    }
    .sv-cal-loading::before {
      content: ''; display: block; width: 28px; height: 28px;
      margin: 0 auto 10px; border: 3px solid #eaedff;
      border-top-color: #5416c9; border-radius: 50%;
      animation: sv-spin 0.7s linear infinite;
    }
    @keyframes sv-spin { to { transform: rotate(360deg); } }

    /* Pending table action buttons */
    .sv-actions { display: flex; gap: 6px; flex-wrap: wrap; }

    @media (max-width: 900px) {
      .sv-controls { flex-direction: column; align-items: stretch; }
      .sv-nav { justify-content: center; }
      .sv-filters { justify-content: center; }
      .sv-week-label { font-size: 14px; min-width: 140px; }
      .sv-calendar-grid { grid-template-columns: 38px repeat(7, 1fr); }
      .sv-cal-header { font-size: 9px; padding: 6px 2px; letter-spacing: 0; }
      .sv-cal-header span { font-size: 13px !important; }
      .sv-cal-time { font-size: 9px; padding: 2px 3px; height: 40px; line-height: 40px; }
      .sv-cal-cell { height: 40px; }
      .sv-cal-event { font-size: 8px; padding: 2px 3px; border-left-width: 2px !important; }
    }
