/* Custom styles complementing Tailwind CSS for CARA Dashboard */

/* Hide Electron window controls in web */
.window-controls { display: none !important; }

/* ========================================
   Transparent Window — Rounded Corners
======================================== */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #f6f6f8;
}

/* Allow the main content area to scroll when projects overflow the viewport */
.dashboard-shell {
    overflow-y: auto;
}

/* Scale up on large screens so content doesn't feel tiny */
@media (min-width: 1600px) {
    #app-shell { zoom: 1.1; }
}
@media (min-width: 1920px) {
    #app-shell { zoom: 1.2; }
}
@media (min-width: 2400px) {
    #app-shell { zoom: 1.3; }
}

#window-frame {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background: #f6f6f8;
}

#app-shell {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f6f6f8;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Frameless Window
======================================== */
#global-nav {
    -webkit-app-region: drag;
    transition: box-shadow 0.2s;
}

#global-nav.nav-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#global-nav input,
#global-nav button,
#global-nav a,
#global-nav .window-controls {
    -webkit-app-region: no-drag;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-control-btn {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: opacity 120ms;
}

.window-control-icon {
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    font-family: -apple-system, system-ui, sans-serif;
    opacity: 0;
    transition: opacity 120ms;
    color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.window-controls:hover .window-control-icon {
    opacity: 1;
}

.window-control-close {
    background: #ff5f57;
}

.window-control-minimize {
    background: #ffbd2e;
}

.window-control-maximize {
    background: #28c840;
}

.window-control-close:hover {
    background: #ff3b30;
}

.window-control-minimize:hover {
    background: #f0a000;
}

.window-control-maximize:hover {
    background: #1aab29;
}

/* Unfocused state — muted grey circles */
.window-controls.unfocused .window-control-btn {
    background: #d4d4d4;
}

.window-controls.unfocused .window-control-icon {
    opacity: 0;
}

body {
    font-family: 'Inter', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', sans-serif;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Custom row hover transition */
.project-row {
    transition: all 0.2s ease-in-out;
}

.project-row:hover {
    transform: translateY(-1px);
    background-color: rgba(243, 244, 246, 0.8); /* Cool Gray 100 */
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.action-btn-row {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-row:hover .action-btn-row {
    opacity: 1;
}

/* Modal Styles - Maintaining compatibility with existing modal logic */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 1rem;
    width: min(90vw, 600px);
    max-width: 600px;
    max-height: min(90vh, calc(100dvh - 2rem));
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    contain: layout paint style;
    display: flex;
    flex-direction: column;
    margin: auto;
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-sm {
    max-width: 500px;
}

.modal-header-error {
    background: var(--color-error, #dc2626);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-header-error h2,
.modal-header-error .modal-close {
    color: white;
}

.modal-close {
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #f3f4f6;
}

.modal-content {
    padding: 1.25rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    scrollbar-gutter: stable;
}

.auth-modal {
    max-width: 460px;
}

.auth-modal-subtitle {
    margin: 0 0 0.875rem 0;
    color: var(--color-text-secondary, #4b5563);
    font-size: 0.875rem;
}

.auth-modal-error {
    margin: 0 0 0.875rem 0;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.auth-password-requirements {
    margin: -0.25rem 0 0;
    color: var(--color-text-secondary, #64748b);
    font-size: 0.75rem;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background-color: white;
    font-size: 0.875rem;
    transition:
        border-color 0.2s,
        ring 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.required {
    color: #ef4444;
}

#new-project-description {
    resize: none;
    overflow: hidden;
    min-height: 96px;
    max-height: 120px;
}

#new-project-modal .new-project-modal {
    width: min(94vw, 920px);
    max-width: 920px;
    max-height: min(92vh, calc(100dvh - 1rem));
}

#new-project-modal .modal-header {
    padding: 1rem 1.25rem;
    flex: 0 0 auto;
}

#new-project-modal .modal-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

#new-project-modal-react {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#new-project-modal .new-project-form-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem 0.85rem;
    scrollbar-gutter: stable;
}

#new-project-modal .form-group {
    margin-bottom: 0.8rem;
}

#new-project-modal .new-project-form-body > .form-group:first-child {
    margin-bottom: 0.9rem;
}

#new-project-modal .form-group label {
    margin-bottom: 0.3rem;
    font-size: 0.86rem;
}

#new-project-modal .form-control {
    min-height: 38px;
    padding: 0.45rem 0.65rem;
}

#new-project-modal #project-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 0.9rem;
}

#new-project-modal .new-project-field-title,
#new-project-modal .new-project-field-description {
    grid-column: 1 / -1;
}

#new-project-modal .new-project-field-description {
    margin-bottom: 0;
}

#new-project-modal #new-project-description {
    min-height: 66px;
    max-height: 86px;
}

#new-project-modal .field-toggle {
    margin-top: 0.45rem;
}

#new-project-modal .modal-actions {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.06);
}

#new-project-modal .metadata-review-note {
    margin: 0 0 0.8rem;
    padding: 0.7rem 0.85rem;
}

#new-project-modal .metadata-review-note p {
    line-height: 1.32;
}

#new-project-modal #new-project-pdf-info {
    margin-top: 0.55rem !important;
}

#new-project-modal #new-project-pdf-info > div {
    gap: 0.55rem;
    padding: 0.65rem 0.75rem !important;
}

#new-project-modal #new-project-pdf-info > div > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

#new-project-modal #new-project-pdf-name {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

#new-project-modal #new-project-pdf-info .btn {
    flex: 0 0 auto;
}

.field-toggle {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition:
        background-color 0.2s,
        color 0.2s,
        border-color 0.2s;
}

.field-toggle:hover {
    background: #f1f5f9;
    color: #1f2937;
    border-color: #cbd5e1;
}

.field-toggle i {
    font-size: 11px;
}

.description-popout-backdrop {
    z-index: 1200;
    background: rgba(15, 23, 42, 0.5);
}

.description-popout-modal {
    width: min(920px, calc(100vw - 48px));
    max-width: 920px;
    max-height: min(86vh, 780px);
    display: flex;
    flex-direction: column;
}

.description-popout-kicker {
    margin: 0 0 4px;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.description-popout-content {
    padding: 1.25rem;
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.85rem;
}

.description-popout-helper {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.description-popout-textarea {
    min-height: 420px;
    max-height: none;
    flex: 1;
    resize: vertical;
    overflow: auto;
    font-size: 0.95rem;
    line-height: 1.55;
}

.description-popout-actions {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 720px) {
    .description-popout-modal {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .description-popout-textarea {
        min-height: 320px;
    }

    #new-project-modal .new-project-modal {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }

    #new-project-modal #project-fields {
        grid-template-columns: 1fr;
    }

    #new-project-modal .new-project-form-body {
        padding: 0.85rem 1rem 0.75rem;
    }

    #new-project-modal .modal-actions {
        padding: 0.75rem 1rem;
    }

    #new-project-modal #new-project-pdf-info > div {
        align-items: flex-start !important;
        flex-wrap: wrap;
    }
}

.metadata-loading-spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 3px solid #dbe3ef;
    border-top-color: var(--color-primary, #164772);
    border-radius: 999px;
    display: block;
    animation: metadata-spinner-rotate 0.85s linear infinite;
}

@keyframes metadata-spinner-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.metadata-review-note {
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(37, 99, 235, 0.24);
    border-radius: 10px;
    background: rgba(239, 246, 255, 0.86);
    color: #1e3a8a;
}

.metadata-review-note i {
    margin-top: 2px;
    color: #2563eb;
}

.metadata-review-note strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
}

.metadata-review-note p {
    margin: 2px 0 0;
    color: #1d4ed8;
    font-size: 0.8rem;
    line-height: 1.4;
}

.draft-upload-modal .modal-content {
    text-align: center;
}

.draft-upload-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.draft-upload-progress {
    width: 100%;
    max-width: 320px;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.draft-upload-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #164772, #0f3358);
    transition: width 0.2s ease;
}

.draft-upload-percent {
    margin: -0.25rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.draft-upload-status {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.draft-upload-detail {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #475569;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #164772;
    color: white;
}

.btn-primary:hover {
    background-color: #0f3358;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.25rem;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Avatar Group */
.avatar-group {
    display: flex;
    overflow: hidden;
}

.avatar-group > * + * {
    margin-left: -0.5rem;
}

.avatar {
    display: inline-block;
    height: 1.75rem;
    width: 1.75rem;
    border-radius: 9999px;
    box-shadow: 0 0 0 2px white;
}

.project-row-avatar {
    border: 2px solid #ffffff;
    box-shadow: none;
}

/* ============================================
   Dashboard Entry Refresh (stitch-inspired)
   ============================================ */
html[data-theme='light'] body {
    background: #f5f7fb;
    color: #111827;
}

#global-nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e5eaf2 !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

#global-nav .size-8 {
    background: #164772;
    border-radius: 10px;
}

#global-nav .dashboard-brand-sub {
    background: #f3f6fb;
    border: 1px solid #dbe3ef;
    color: #718096;
    display: inline-flex;
    align-items: center;
    align-self: center;
    height: 18px;
    line-height: 1;
}

#global-nav .size-8 i {
    transform: translateY(0);
    line-height: 1;
}

#global-nav #nav-search-input {
    background: #f4f6fa;
    border: 1px solid transparent;
    color: #111827;
}

#global-nav #nav-search-input::placeholder {
    color: #9aa4b2;
}

#global-nav #nav-search-input:focus {
    background: #ffffff;
    border-color: #d9e2ef;
    box-shadow: 0 0 0 2px rgba(22, 71, 114, 0.08);
}

#toolbar-react h1 {
    color: #164772;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
}

#toolbar-react button {
    transition: all 0.18s ease;
}

#toolbar-react .bg-primary\/10 {
    background: rgba(22, 71, 114, 0.1) !important;
    border-color: rgba(22, 71, 114, 0.2) !important;
}

#toolbar-react .bg-primary {
    background: #164772 !important;
}

#toolbar-react .bg-primary:hover {
    background: #0f3358 !important;
}

/* Grid mode: no container */
#projects-container[data-view-mode='grid'] {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

/* List mode: white container like reference */
#projects-container[data-view-mode='list'] {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.dashboard-shell {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: clamp(2.5rem, 6vh, 5rem);
    padding-bottom: 1rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
#projects-thead-react {
    background: #f7f9fc !important;
    border-bottom: 1px solid #e5eaf2 !important;
    color: #6b7280 !important;
}

#projects-thead-react > div {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

#projects-thead-react .dashboard-th-sortable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #6b7280;
    user-select: none;
}

#projects-thead-react .dashboard-th-sortable:hover,
#projects-thead-react .dashboard-th-sortable.is-active {
    color: #164772;
}

#projects-thead-react .dashboard-th-arrow {
    font-size: 10px;
    opacity: 0.65;
}

.project-row {
    min-height: 72px;
    border-left: 3px solid transparent;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}

.project-row:hover {
    transform: translateY(-1px);
    background-color: #f8fbff;
    border-left-color: var(--project-accent, #164772);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--project-accent, #164772) 22%, transparent);
    z-index: 2;
}

.project-row:hover h3 {
    color: #0f3358;
}

.project-row h3 {
    color: #111827;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.project-row .rounded-md.bg-gray-100 {
    background: #f3f5f9 !important;
    border-color: #e5eaf2 !important;
    color: #4b5563 !important;
}

.dashboard-agency {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b5563;
    line-height: 1.2;
}

/* New Project PDF upload affordance */
.upload-zone {
    border: 1.5px dashed #c7d3e5;
    background: #f8fbff;
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.upload-zone:hover {
    border-color: #9fb3d1;
    background: #f3f8ff;
}

.upload-zone.dragging {
    border-color: #164772;
    background: #eef3ff;
    box-shadow: inset 0 0 0 1px rgba(22, 71, 114, 0.12);
}

.upload-zone .upload-icon {
    font-size: 22px;
    color: #ef4444;
}

.upload-zone-btn {
    margin-top: 10px;
    border: 1px solid #d5deec;
    background: #ffffff;
    color: #374151;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.upload-zone-btn:hover {
    background: #f6f9ff;
    border-color: #c2cfe3;
}

.project-row .inline-flex.rounded-full {
    font-weight: 600;
}

.project-row-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--project-status-dot, #94a3b8);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--project-status-dot, #94a3b8) 14%, transparent);
    flex: 0 0 auto;
}

.action-btn-row {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.project-row:hover .action-btn-row {
    opacity: 1;
}

/* Grid mode: footer blends into page */
#projects-container[data-view-mode='grid'] #dashboard-footer {
    background: transparent !important;
    border-top: none !important;
    color: #7b8798 !important;
    padding: 12px 0 !important;
}

/* List mode: footer inside container */
#projects-container[data-view-mode='list'] #dashboard-footer {
    background: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    color: #7b8798 !important;
    padding: 12px 24px !important;
}

#dashboard-footer button {
    border: 1px solid #dbe3ef !important;
    background: #ffffff !important;
    color: #4b5563 !important;
}

#dashboard-footer button:hover:not(:disabled) {
    background: #f6f8fc !important;
    border-color: #cdd8e8 !important;
}

/* Card View */
.project-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    align-content: start;
    /* Strip horizontal padding from the p-6 class so cards align with toolbar */
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    padding: 18px 16px;
    border: 1px solid #e5eaf2;
    border-left: 3px solid color-mix(in srgb, var(--project-accent, #e5eaf2) 58%, #ffffff);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    cursor: default;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.project-card.project-card--openable {
    cursor: pointer;
}

.project-card.project-card--openable:focus-visible {
    outline: 2px solid rgba(22, 71, 114, 0.35);
    outline-offset: 2px;
}

.project-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--project-accent, #164772) 48%, #e5eaf2);
    box-shadow:
        0 10px 26px rgba(15, 23, 42, 0.08),
        0 0 0 1px color-mix(in srgb, var(--project-accent, #164772) 20%, transparent);
}

.project-card:hover .project-card-title {
    color: #0f3358;
}

.project-card--skeleton {
    box-shadow: none;
    cursor: default;
}

.project-card--skeleton:hover {
    transform: none;
    border-color: #e5eaf2;
    box-shadow: none;
}

.project-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.project-card-sch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    color: #164772;
    background: rgba(22, 71, 114, 0.06);
    border: 1px solid rgba(22, 71, 114, 0.12);
    height: 20px;
    padding: 0 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

.project-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
    margin: 2px 0 0 0;
}

.project-card-subtitle {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: #64748b;
}

.project-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.project-card-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #dbe3ef;
    color: #64748b;
    background: #fff;
}

.project-card-open:hover {
    color: #164772;
    border-color: #bfccdf;
    background: #f8fbff;
}

.project-card-open--danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff;
}

.project-card-open--danger:hover {
    color: #991b1b;
    border-color: #fca5a5;
    background: #fef2f2;
}

.project-card-open--label {
    width: auto;
    height: 32px;
    border-radius: 9px;
    padding: 0 10px;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.project-card-team {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 0;
}

.project-card-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid #fff;
    margin-left: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.project-card-avatar:first-child {
    margin-left: 0;
}

.project-card-avatar--overflow {
    background: #eef2f7;
    color: #475569;
}

.project-card-progress-track {
    margin-top: 4px;
    width: 100%;
    height: 4px;
    background: #e5eaf2;
    border-radius: 999px;
    overflow: hidden;
}

.project-card-progress-fill {
    height: 100%;
    border-radius: 999px;
}

/* Project Detail Modal */
.project-detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    justify-content: flex-end;
    background: rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(2px);
    /* Ensure modal interactions remain clickable even over frameless drag regions. */
    -webkit-app-region: no-drag;
}

.project-detail-panel {
    width: min(92vw, 560px);
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #e5eaf2;
    box-shadow: -12px 0 36px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    -webkit-app-region: no-drag;
}

.project-detail-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    -webkit-app-region: no-drag;
}

.project-detail-title {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 23px;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
}

.project-detail-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.project-detail-subtitle {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.project-detail-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #e5eaf2;
    color: #64748b;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-app-region: no-drag;
}

.project-detail-close * {
    -webkit-app-region: no-drag;
}

.project-detail-close:hover {
    color: #111827;
    background: #f8fafc;
}

.project-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.project-detail-block {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e5eaf2;
    background: #fbfdff;
}

.project-detail-label {
    margin: 0 0 8px 0;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.project-detail-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.project-detail-label-row .project-detail-label {
    margin: 0;
}

.project-detail-note {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #64748b;
}

.project-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.project-detail-cell {
    min-height: 44px;
}

.project-detail-cell--full {
    grid-column: 1 / -1;
}

.project-detail-value {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.project-detail-value--multiline {
    white-space: pre-wrap;
    line-height: 1.5;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.project-detail-value--multiline.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-detail-description-scroll {
    display: block;
    max-height: min(42vh, 320px);
    overflow-y: auto;
    padding-right: 6px;
}

.project-detail-expand-btn {
    border: 0;
    padding: 0;
    background: none;
    color: #164772;
    font-size: 12px;
    font-weight: 700;
}

.project-detail-expand-btn:hover {
    text-decoration: underline;
}

.project-detail-input {
    font-size: 14px;
    font-weight: 500;
}

.project-detail-textarea {
    resize: vertical;
    min-height: 116px;
}

.project-detail-progress-track {
    margin-top: 10px;
    width: 100%;
    height: 5px;
    background: #e8eef7;
    border-radius: 999px;
    overflow: hidden;
}

.project-detail-progress-fill {
    height: 100%;
    border-radius: 999px;
}

.project-detail-team {
    display: flex;
    align-items: center;
}

.project-detail-team-avatar {
    width: 28px;
    height: 28px;
    margin-left: -8px;
    border-radius: 999px;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.project-detail-team-avatar:first-child {
    margin-left: 0;
}

.project-detail-team-avatar--overflow {
    background: #eef2f7;
    color: #475569;
}

.project-detail-footer {
    border-top: 1px solid #eef2f7;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
}

.project-row-name-link {
    border: 0;
    padding: 0;
    margin: 0;
    background: none;
    display: block;
    max-width: 100%;
    color: #111827;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-row-name-link:hover {
    color: #164772;
    text-decoration: underline;
}

.project-row-details-link {
    border: 0;
    padding: 0;
    background: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.project-row-details-link:hover {
    color: #164772;
    text-decoration: underline;
}

.dashboard-header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    box-shadow: none;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease;
}

.dashboard-header-icon-btn:hover,
.dashboard-header-icon-btn:focus-visible,
.dashboard-header-icon-btn.dashboard-theme-btn[aria-pressed='true'] {
    background: transparent;
    border-color: transparent;
    color: #164772;
}

.project-row-name-link:focus-visible,
.project-row-details-link:focus-visible,
.project-card-open:focus-visible,
.action-btn-row button:focus-visible,
.project-detail-expand-btn:focus-visible,
#header-controls-react button:focus-visible,
#dashboard-footer button:focus-visible,
.btn:focus-visible {
    outline: 2px solid rgba(22, 71, 114, 0.45);
    outline-offset: 2px;
    border-radius: 8px;
}

/* Content zoom — scale up to fill window */
.dashboard-shell {
    zoom: 1.12;
}

/* Card hover — left border accent */
.project-card {
    border-left: 3px solid transparent;
}
.project-card:hover {
    border-left-color: #164772;
}

/* Ghost "Create New Project" card */
.project-card--ghost {
    background: transparent;
    border: 2px dashed #d1d9e6;
    box-shadow: none;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-left-width: 2px;
}
.project-card--ghost,
.project-card--ghost:hover {
    border-left: 2px dashed;
}
.project-card--ghost:hover {
    border-color: #164772;
    background: rgba(22, 71, 114, 0.03);
    transform: none;
    box-shadow: none;
}
.project-card--ghost-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
}
.project-card--ghost:hover .project-card--ghost-inner {
    color: #164772;
}
.project-card--ghost-inner .material-symbols-outlined {
    font-size: 32px;
    background: #f1f5f9;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.project-card--ghost:hover .project-card--ghost-inner .material-symbols-outlined {
    background: rgba(22, 71, 114, 0.08);
}
.project-card--ghost-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
}
.project-card--ghost-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Progress bar flush to card bottom edge */
.project-card-progress-track {
    margin-top: auto;
    margin-bottom: -16px;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    border-radius: 0 0 14px 11px;
    height: 5px;
}
.project-card-progress-fill {
    border-radius: 0 0 14px 11px;
}

/* Access admin modal */
.access-admin-modal {
    max-width: 980px;
}

.access-admin-layout {
    display: grid;
    gap: 16px;
}

.access-admin-create-org {
    padding: 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    background: #ffffff;
}

.access-admin-create-org-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.access-admin-create-org-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-text-secondary, #64748b);
}

.access-admin-create-org-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.2fr 1fr 1.2fr auto;
    align-items: end;
}

.access-admin-create-org-error {
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
}

.access-admin-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    background: var(--color-bg-tertiary, #f9fafb);
}

.access-admin-org {
    font-size: 13px;
    color: var(--color-text-secondary, #4b5563);
}

.access-admin-org strong {
    color: var(--color-text-primary, #111827);
}

.access-admin-invite-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    align-items: end;
}

.access-admin-members {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}

.access-admin-table-wrap {
    overflow-x: auto;
}

.access-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.access-admin-table th,
.access-admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}

.access-admin-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 11px;
}

.access-admin-user-name {
    font-weight: 600;
    color: #0f172a;
}

.access-admin-user-email {
    color: #64748b;
    font-size: 12px;
}

.access-admin-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 9999px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.access-admin-status-active {
    background: #dcfce7;
    color: #166534;
}

.access-admin-status-invited {
    background: #dbeafe;
    color: #0f3358;
}

.access-admin-status-suspended {
    background: #fef3c7;
    color: #92400e;
}

.access-admin-status-removed {
    background: #fee2e2;
    color: #b91c1c;
}

.access-admin-role {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.access-admin-actions {
    display: inline-flex;
    gap: 8px;
}

.access-admin-actions .btn {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.access-admin-empty {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

@media (max-width: 920px) {
    .access-admin-create-org-grid {
        grid-template-columns: 1fr;
    }

    .access-admin-invite-grid {
        grid-template-columns: 1fr;
    }

    .access-admin-actions {
        flex-wrap: wrap;
    }
}

/* ── Admin Activity Panel ── */

.admin-activity-row td {
    padding: 0 !important;
}

.admin-activity-cell {
    border-top: none !important;
}

.admin-activity-panel {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
}

.admin-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.admin-activity-count {
    color: #94a3b8;
    font-size: 12px;
}

.admin-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.admin-activity-table th {
    text-align: left;
    padding: 4px 8px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e2e8f0;
}

.admin-activity-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.admin-activity-table tr:last-child td {
    border-bottom: none;
}

.btn-active {
    background: var(--color-primary, #80b3a7) !important;
    color: #fff !important;
    border-color: var(--color-primary, #80b3a7) !important;
}

/* ========================================
   Audit Log Viewer
======================================== */

.audit-log-modal {
    max-width: 1100px;
}

.audit-viewer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.audit-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.audit-viewer-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #164772;
    display: flex;
    align-items: center;
    gap: 6px;
}

.audit-viewer-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audit-auto-refresh {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* Summary Cards */
.audit-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.audit-summary-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.audit-summary-icon {
    font-size: 20px;
    color: #164772;
}

.audit-summary-info {
    display: flex;
    flex-direction: column;
}

.audit-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.audit-summary-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* Filter Bar */
.audit-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.audit-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.audit-filter-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.audit-filter-input {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    color: #111827;
    min-width: 120px;
    transition: border-color 0.15s;
}

.audit-filter-input:focus {
    outline: none;
    border-color: #164772;
    box-shadow: 0 0 0 2px rgba(22, 71, 114, 0.1);
}

.audit-filter-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

/* Buttons */
.audit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition:
        background-color 0.15s,
        color 0.15s;
}

.audit-btn-primary {
    background: #164772;
    color: white;
}

.audit-btn-primary:hover {
    background: #232e4a;
}

.audit-btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.audit-btn-secondary:hover {
    background: #f3f4f6;
}

.audit-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.audit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table */
.audit-table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.audit-table thead {
    background: #f3f4f6;
}

.audit-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.audit-th-expand {
    width: 36px;
}

.audit-row {
    cursor: pointer;
    transition: background-color 0.12s;
}

.audit-row:hover {
    background: #f9fafb;
}

.audit-row-expanded {
    background: #f0f4f8;
}

.audit-cell {
    padding: 10px 12px;
    border-top: 1px solid #f3f4f6;
    vertical-align: middle;
}

.audit-cell-timestamp {
    white-space: nowrap;
    color: #374151;
    font-size: 12px;
    min-width: 150px;
}

.audit-cell-actor {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
}

.audit-cell-target {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6b7280;
}

.audit-cell-expand {
    text-align: center;
    color: #9ca3af;
}

/* Badges */
.audit-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.audit-badge-auth {
    background: #dbeafe;
    color: #1e40af;
}

.audit-badge-membership {
    background: #fef3c7;
    color: #92400e;
}

.audit-badge-project {
    background: #d1fae5;
    color: #065f46;
}

.audit-badge-response {
    background: #ede9fe;
    color: #5b21b6;
}

.audit-badge-config {
    background: #e5e7eb;
    color: #374151;
}

.audit-badge-default {
    background: #f3f4f6;
    color: #6b7280;
}

.audit-outcome {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.audit-outcome-success {
    background: #d1fae5;
    color: #065f46;
}

.audit-outcome-failure {
    background: #fee2e2;
    color: #991b1b;
}

/* Detail Row */
.audit-row-detail {
    background: #f8fafc;
}

.audit-cell-detail {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
}

.audit-details-empty {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.audit-details-content {
    font-size: 12px;
}

.audit-details-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-details-key {
    padding: 3px 12px 3px 0;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    vertical-align: top;
}

.audit-details-value {
    padding: 3px 0;
    color: #374151;
    word-break: break-all;
}

/* Loading & Empty */
.audit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

.audit-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* Pagination */
.audit-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
}

.audit-pagination-info {
    font-size: 12px;
    color: #6b7280;
}

.audit-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-pagination-page {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

@media (max-width: 768px) {
    .audit-summary-cards {
        grid-template-columns: 1fr;
    }

    .audit-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .audit-filter-actions {
        margin-left: 0;
    }

    .audit-cell-actor,
    .audit-cell-target {
        display: none;
    }
}

/* ============================================
   Additional Dashboard Color Schemes
   ============================================ */
html[data-theme='coastal'] {
    color-scheme: light;
    --dashboard-bg: #f4fafb;
    --dashboard-surface: #ffffff;
    --dashboard-surface-raised: #e8f3f5;
    --dashboard-surface-muted: rgba(14, 116, 144, 0.08);
    --dashboard-border: rgba(16, 42, 53, 0.1);
    --dashboard-border-strong: rgba(16, 42, 53, 0.18);
    --dashboard-text: #102a35;
    --dashboard-muted: #48606a;
    --dashboard-tertiary: #748993;
    --dashboard-primary: #0e7490;
    --dashboard-primary-strong: #155e75;
    --dashboard-primary-rgb: 14, 116, 144;
    --dashboard-hover: rgba(14, 116, 144, 0.07);
    --dashboard-shadow: rgba(16, 42, 53, 0.1);
    --dashboard-nav: #0b1f33;
    --dashboard-nav-border: rgba(103, 232, 249, 0.14);
    --dashboard-nav-text: #d8e9ee;
    --dashboard-nav-accent: #67e8f9;
}

html[data-theme='forest'] {
    color-scheme: light;
    --dashboard-bg: #f6faf5;
    --dashboard-surface: #ffffff;
    --dashboard-surface-raised: #eaf3e8;
    --dashboard-surface-muted: rgba(47, 111, 78, 0.08);
    --dashboard-border: rgba(23, 38, 25, 0.1);
    --dashboard-border-strong: rgba(23, 38, 25, 0.18);
    --dashboard-text: #172619;
    --dashboard-muted: #506052;
    --dashboard-tertiary: #7b897c;
    --dashboard-primary: #4d7c3b;
    --dashboard-primary-strong: #365a2a;
    --dashboard-primary-rgb: 77, 124, 59;
    --dashboard-hover: rgba(77, 124, 59, 0.07);
    --dashboard-shadow: rgba(23, 38, 25, 0.1);
    --dashboard-nav: #13251c;
    --dashboard-nav-border: rgba(183, 217, 130, 0.14);
    --dashboard-nav-text: #dce9df;
    --dashboard-nav-accent: #b7d982;
}

html[data-theme='terra'] {
    color-scheme: light;
    --dashboard-bg: #fbf6f2;
    --dashboard-surface: #ffffff;
    --dashboard-surface-raised: #f3e8df;
    --dashboard-surface-muted: rgba(180, 83, 42, 0.08);
    --dashboard-border: rgba(45, 31, 23, 0.1);
    --dashboard-border-strong: rgba(45, 31, 23, 0.18);
    --dashboard-text: #2d1f17;
    --dashboard-muted: #66564c;
    --dashboard-tertiary: #8d7d72;
    --dashboard-primary: #b4532a;
    --dashboard-primary-strong: #8f3f1f;
    --dashboard-primary-rgb: 180, 83, 42;
    --dashboard-hover: rgba(180, 83, 42, 0.07);
    --dashboard-shadow: rgba(45, 31, 23, 0.1);
    --dashboard-nav: #252b35;
    --dashboard-nav-border: rgba(242, 170, 127, 0.14);
    --dashboard-nav-text: #f0ded2;
    --dashboard-nav-accent: #f2aa7f;
}

html[data-theme='plum'] {
    color-scheme: light;
    --dashboard-bg: #f8f5fb;
    --dashboard-surface: #ffffff;
    --dashboard-surface-raised: #efe7f4;
    --dashboard-surface-muted: rgba(124, 63, 140, 0.08);
    --dashboard-border: rgba(38, 21, 45, 0.1);
    --dashboard-border-strong: rgba(38, 21, 45, 0.18);
    --dashboard-text: #26152d;
    --dashboard-muted: #5f5266;
    --dashboard-tertiary: #897b90;
    --dashboard-primary: #7c3f8c;
    --dashboard-primary-strong: #633070;
    --dashboard-primary-rgb: 124, 63, 140;
    --dashboard-hover: rgba(124, 63, 140, 0.07);
    --dashboard-shadow: rgba(38, 21, 45, 0.1);
    --dashboard-nav: #1f2537;
    --dashboard-nav-border: rgba(211, 155, 224, 0.14);
    --dashboard-nav-text: #e9ddec;
    --dashboard-nav-accent: #d39be0;
}

html[data-theme='graphite'] {
    color-scheme: light;
    --dashboard-bg: #f6f7f8;
    --dashboard-surface: #ffffff;
    --dashboard-surface-raised: #eceff2;
    --dashboard-surface-muted: rgba(71, 85, 105, 0.08);
    --dashboard-border: rgba(24, 33, 43, 0.1);
    --dashboard-border-strong: rgba(24, 33, 43, 0.18);
    --dashboard-text: #18212b;
    --dashboard-muted: #586473;
    --dashboard-tertiary: #818b98;
    --dashboard-primary: #2563eb;
    --dashboard-primary-strong: #1d4ed8;
    --dashboard-primary-rgb: 37, 99, 235;
    --dashboard-hover: rgba(37, 99, 235, 0.07);
    --dashboard-shadow: rgba(24, 33, 43, 0.1);
    --dashboard-nav: #20242b;
    --dashboard-nav-border: rgba(147, 197, 253, 0.14);
    --dashboard-nav-text: #dce3ea;
    --dashboard-nav-accent: #93c5fd;
}

html[data-theme='solar'] {
    color-scheme: light;
    --dashboard-bg: #fffaf0;
    --dashboard-surface: #fffdf7;
    --dashboard-surface-raised: #f7edcc;
    --dashboard-surface-muted: rgba(202, 138, 4, 0.09);
    --dashboard-border: rgba(43, 36, 20, 0.1);
    --dashboard-border-strong: rgba(43, 36, 20, 0.18);
    --dashboard-text: #2b2414;
    --dashboard-muted: #665d47;
    --dashboard-tertiary: #8d846e;
    --dashboard-primary: #ca8a04;
    --dashboard-primary-strong: #9a6700;
    --dashboard-primary-rgb: 202, 138, 4;
    --dashboard-hover: rgba(202, 138, 4, 0.07);
    --dashboard-shadow: rgba(43, 36, 20, 0.1);
    --dashboard-nav: #1f2a37;
    --dashboard-nav-border: rgba(250, 204, 21, 0.14);
    --dashboard-nav-text: #f2e9cf;
    --dashboard-nav-accent: #facc15;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar']),
html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(body, #window-frame, #app-shell, #app-shell.bg-background-light, .dashboard-shell) {
    background: var(--dashboard-bg) !important;
    color: var(--dashboard-text) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    #global-nav {
    background: var(--dashboard-nav) !important;
    border-bottom-color: var(--dashboard-nav-border) !important;
    box-shadow: none !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    #global-nav .text-primary {
    color: var(--dashboard-nav-text) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    #global-nav .dashboard-brand-sub {
    background: rgba(var(--dashboard-primary-rgb), 0.14) !important;
    border-color: rgba(var(--dashboard-primary-rgb), 0.24) !important;
    color: var(--dashboard-nav-accent) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(#global-nav #nav-search-input, .search-box input, .filter-select, .form-control, input, select, textarea) {
    background: var(--dashboard-surface) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-text) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(#global-nav #nav-search-input:focus, .search-box input:focus, .form-control:focus) {
    border-color: rgba(var(--dashboard-primary-rgb), 0.4) !important;
    box-shadow: 0 0 0 3px rgba(var(--dashboard-primary-rgb), 0.14) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(
        .text-primary,
        #toolbar-react h1,
        .dashboard-header-icon-btn:hover,
        .dashboard-header-icon-btn:focus-visible,
        .dashboard-header-icon-btn.dashboard-theme-btn[aria-pressed='true']
    ) {
    color: var(--dashboard-primary-strong) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(.text-text-main, .text-gray-900, .project-row h3, .project-card-title, .project-detail-title, h1, h2, h3, h4) {
    color: var(--dashboard-text) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(
        .text-text-muted,
        .text-gray-400,
        .text-gray-500,
        .text-gray-600,
        .dashboard-agency,
        .project-count,
        .project-card-meta,
        .project-detail-meta,
        .project-detail-description,
        .empty-state p,
        #dashboard-footer
    ) {
    color: var(--dashboard-muted) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(#projects-container[data-view-mode='list'], .project-card, .modal, .project-detail-panel, .access-admin-modal, .audit-log-modal) {
    background: var(--dashboard-surface) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-text) !important;
    box-shadow: 0 16px 36px var(--dashboard-shadow) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(
        #projects-thead-react,
        #projects-container[data-view-mode='list'] #dashboard-footer,
        .modal-header,
        .modal-footer,
        .project-detail-header,
        .audit-table-header,
        .audit-row-detail,
        #toolbar-react .bg-gray-100,
        .bg-gray-100
    ) {
    background: var(--dashboard-surface-raised) !important;
    border-color: var(--dashboard-border) !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(#toolbar-react .bg-primary, .btn-primary, button.bg-primary) {
    background: var(--dashboard-primary) !important;
    color: #ffffff !important;
}

html:is([data-theme='coastal'], [data-theme='forest'], [data-theme='terra'], [data-theme='plum'], [data-theme='graphite'], [data-theme='solar'])
    :is(#toolbar-react .bg-primary:hover, .btn-primary:hover, button.bg-primary:hover) {
    background: var(--dashboard-primary-strong) !important;
}

/* ============================================
   Command Theme
   ============================================ */
html[data-theme='command'] {
    color-scheme: light;
    --dashboard-bg: #fbfaf6;
    --dashboard-surface: #ffffff;
    --dashboard-surface-raised: #eff2f6;
    --dashboard-surface-muted: #f4f0e6;
    --dashboard-border: #d8dfe6;
    --dashboard-border-strong: #c6d0da;
    --dashboard-text: #0b1a31;
    --dashboard-muted: #545f6c;
    --dashboard-tertiary: #7a8592;
    --dashboard-primary: #d7a03d;
    --dashboard-primary-strong: #966800;
    --dashboard-hover: #f4f0e6;
    --dashboard-shadow: rgba(11, 26, 49, 0.1);
}

html[data-theme='command'],
html[data-theme='command'] body,
html[data-theme='command'] #window-frame,
html[data-theme='command'] #app-shell,
html[data-theme='command'] #app-shell.bg-background-light,
html[data-theme='command'] .dashboard-shell {
    background: var(--dashboard-bg) !important;
    color: var(--dashboard-text) !important;
}

html[data-theme='command'] #global-nav {
    background: #061428 !important;
    border-bottom-color: #212e42 !important;
    box-shadow: none !important;
}

html[data-theme='command'] #global-nav .text-primary {
    color: #fff9ee !important;
}

html[data-theme='command'] #global-nav .dashboard-brand-sub {
    background: rgba(215, 160, 61, 0.14) !important;
    border-color: rgba(215, 160, 61, 0.24) !important;
    color: #f0c96f !important;
}

html[data-theme='command'] #global-nav #nav-search-input,
html[data-theme='command'] .search-box input,
html[data-theme='command'] .filter-select,
html[data-theme='command'] .form-control,
html[data-theme='command'] input,
html[data-theme='command'] select,
html[data-theme='command'] textarea {
    background: var(--dashboard-surface) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-text) !important;
}

html[data-theme='command'] #global-nav #nav-search-input:focus,
html[data-theme='command'] .search-box input:focus,
html[data-theme='command'] .form-control:focus {
    border-color: rgba(215, 160, 61, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(215, 160, 61, 0.14) !important;
}

html[data-theme='command'] .text-primary,
html[data-theme='command'] #toolbar-react h1,
html[data-theme='command'] .dashboard-header-icon-btn:hover,
html[data-theme='command'] .dashboard-header-icon-btn:focus-visible,
html[data-theme='command'] .dashboard-header-icon-btn.dashboard-theme-btn[aria-pressed='true'] {
    color: var(--dashboard-primary-strong) !important;
}

html[data-theme='command'] .text-text-main,
html[data-theme='command'] .text-gray-900,
html[data-theme='command'] .project-row h3,
html[data-theme='command'] .project-card-title,
html[data-theme='command'] .project-detail-title,
html[data-theme='command'] h1,
html[data-theme='command'] h2,
html[data-theme='command'] h3,
html[data-theme='command'] h4 {
    color: var(--dashboard-text) !important;
}

html[data-theme='command'] .text-text-muted,
html[data-theme='command'] .text-gray-400,
html[data-theme='command'] .text-gray-500,
html[data-theme='command'] .text-gray-600,
html[data-theme='command'] .dashboard-agency,
html[data-theme='command'] .project-count,
html[data-theme='command'] .project-card-meta,
html[data-theme='command'] .project-detail-meta,
html[data-theme='command'] .project-detail-description,
html[data-theme='command'] .empty-state p,
html[data-theme='command'] #dashboard-footer {
    color: var(--dashboard-muted) !important;
}

html[data-theme='command'] #projects-container[data-view-mode='list'],
html[data-theme='command'] .project-card,
html[data-theme='command'] .modal,
html[data-theme='command'] .project-detail-panel,
html[data-theme='command'] .access-admin-modal,
html[data-theme='command'] .audit-log-modal {
    background: var(--dashboard-surface) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-text) !important;
    box-shadow: 0 16px 36px var(--dashboard-shadow) !important;
}

html[data-theme='command'] #projects-thead-react,
html[data-theme='command'] #projects-container[data-view-mode='list'] #dashboard-footer,
html[data-theme='command'] .modal-header,
html[data-theme='command'] .modal-footer,
html[data-theme='command'] .project-detail-header,
html[data-theme='command'] .audit-table-header,
html[data-theme='command'] .audit-row-detail,
html[data-theme='command'] #toolbar-react .bg-gray-100,
html[data-theme='command'] .bg-gray-100 {
    background: var(--dashboard-surface-raised) !important;
    border-color: var(--dashboard-border) !important;
}

html[data-theme='command'] #toolbar-react .bg-primary,
html[data-theme='command'] .btn-primary,
html[data-theme='command'] button.bg-primary {
    background: #d7a03d !important;
    color: #0b1a31 !important;
}

html[data-theme='command'] #toolbar-react .bg-primary:hover,
html[data-theme='command'] .btn-primary:hover,
html[data-theme='command'] button.bg-primary:hover {
    background: #c58b1e !important;
}

/* ============================================
   Dark Mode
   ============================================ */
html[data-theme='dark'] {
    color-scheme: dark;
    --dashboard-bg: #1d2125;
    --dashboard-surface: #22272b;
    --dashboard-surface-raised: #2c333a;
    --dashboard-surface-muted: #38414a;
    --dashboard-border: #3c4146;
    --dashboard-border-strong: #454f59;
    --dashboard-text: #dee4ea;
    --dashboard-muted: #b6c2cf;
    --dashboard-tertiary: #8590a2;
    --dashboard-primary: #579dff;
    --dashboard-primary-strong: #85b8ff;
    --dashboard-hover: #2c333a;
    --dashboard-shadow: rgba(0, 0, 0, 0.32);
}

html[data-theme='dark'],
html[data-theme='dark'] body,
html[data-theme='dark'] #window-frame,
html[data-theme='dark'] #app-shell {
    background: var(--dashboard-bg) !important;
    color: var(--dashboard-text) !important;
}

html[data-theme='dark'] #app-shell.bg-background-light,
html[data-theme='dark'] .dashboard-shell {
    background: var(--dashboard-bg) !important;
}

html[data-theme='dark'] #global-nav {
    background: var(--dashboard-surface) !important;
    border-bottom-color: var(--dashboard-border) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

html[data-theme='dark'] #global-nav .dashboard-brand-sub {
    background: var(--dashboard-surface-muted) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] .text-primary,
html[data-theme='dark'] #toolbar-react h1 {
    color: var(--dashboard-primary) !important;
}

html[data-theme='dark'] .text-text-main,
html[data-theme='dark'] .text-gray-900,
html[data-theme='dark'] .project-row h3,
html[data-theme='dark'] .project-card-title,
html[data-theme='dark'] .project-detail-title,
html[data-theme='dark'] .modal h2,
html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4 {
    color: var(--dashboard-text) !important;
}

html[data-theme='dark'] .text-text-muted,
html[data-theme='dark'] .text-gray-400,
html[data-theme='dark'] .text-gray-500,
html[data-theme='dark'] .text-gray-600,
html[data-theme='dark'] .dashboard-agency,
html[data-theme='dark'] .project-count,
html[data-theme='dark'] .project-card-meta,
html[data-theme='dark'] .project-detail-meta,
html[data-theme='dark'] .project-detail-description,
html[data-theme='dark'] .empty-state p,
html[data-theme='dark'] #dashboard-footer {
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] #global-nav #nav-search-input,
html[data-theme='dark'] .search-box input,
html[data-theme='dark'] .filter-select,
html[data-theme='dark'] .form-control,
html[data-theme='dark'] input,
html[data-theme='dark'] select,
html[data-theme='dark'] textarea {
    background: #1d2125 !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-text) !important;
}

html[data-theme='dark'] #global-nav #nav-search-input::placeholder,
html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder {
    color: #8590a2 !important;
}

html[data-theme='dark'] #global-nav #nav-search-input:focus,
html[data-theme='dark'] .search-box input:focus,
html[data-theme='dark'] .form-control:focus {
    background: var(--dashboard-surface) !important;
    border-color: rgba(87, 157, 255, 0.38) !important;
    box-shadow: 0 0 0 3px rgba(87, 157, 255, 0.14) !important;
}

html[data-theme='dark'] #header-controls-react button,
html[data-theme='dark'] .header-btn,
html[data-theme='dark'] .btn,
html[data-theme='dark'] #dashboard-footer button {
    background: var(--dashboard-surface-muted) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] #header-controls-react button:hover,
html[data-theme='dark'] .header-btn:hover,
html[data-theme='dark'] #dashboard-footer button:hover:not(:disabled),
html[data-theme='dark'] .btn:hover {
    background: var(--dashboard-hover) !important;
    border-color: rgba(87, 157, 255, 0.36) !important;
    color: var(--dashboard-text) !important;
}

html[data-theme='dark'] #header-controls-react .dashboard-header-icon-btn,
html[data-theme='dark'] .dashboard-header-icon-btn,
html[data-theme='dark'] .dashboard-header-icon-btn.dashboard-theme-btn[aria-pressed='true'] {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--dashboard-muted) !important;
    box-shadow: none !important;
}

html[data-theme='dark'] #header-controls-react .dashboard-header-icon-btn:hover,
html[data-theme='dark'] #header-controls-react .dashboard-header-icon-btn:focus-visible,
html[data-theme='dark'] #header-controls-react .dashboard-header-icon-btn.dashboard-theme-btn[aria-pressed='true'],
html[data-theme='dark'] .dashboard-header-icon-btn:hover,
html[data-theme='dark'] .dashboard-header-icon-btn:focus-visible,
html[data-theme='dark'] .dashboard-header-icon-btn.dashboard-theme-btn[aria-pressed='true'] {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--dashboard-primary) !important;
}

html[data-theme='dark'] #toolbar-react .bg-primary,
html[data-theme='dark'] .btn-primary,
html[data-theme='dark'] button.bg-primary {
    background: #0c66e4 !important;
    color: #ffffff !important;
}

html[data-theme='dark'] #toolbar-react .bg-primary:hover,
html[data-theme='dark'] .btn-primary:hover,
html[data-theme='dark'] button.bg-primary:hover {
    background: #0055cc !important;
}

html[data-theme='dark'] #toolbar-react .bg-primary\/10 {
    background: rgba(87, 157, 255, 0.12) !important;
    border-color: rgba(87, 157, 255, 0.28) !important;
}

html[data-theme='dark'] #toolbar-react .bg-gray-100,
html[data-theme='dark'] .bg-gray-100 {
    background: var(--dashboard-surface-muted) !important;
}

html[data-theme='dark'] #toolbar-react .bg-white,
html[data-theme='dark'] .bg-white {
    background: var(--dashboard-surface-raised) !important;
}

html[data-theme='dark'] #projects-container[data-view-mode='list'],
html[data-theme='dark'] .project-card,
html[data-theme='dark'] .modal,
html[data-theme='dark'] .project-detail-panel,
html[data-theme='dark'] .access-admin-modal,
html[data-theme='dark'] .audit-log-modal {
    background: var(--dashboard-surface) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-text) !important;
    box-shadow: 0 16px 36px var(--dashboard-shadow) !important;
}

html[data-theme='dark'] #projects-thead-react,
html[data-theme='dark'] #projects-container[data-view-mode='list'] #dashboard-footer,
html[data-theme='dark'] .modal-header,
html[data-theme='dark'] .modal-footer,
html[data-theme='dark'] .project-detail-header,
html[data-theme='dark'] .audit-table-header,
html[data-theme='dark'] .audit-row-detail {
    background: var(--dashboard-surface-raised) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] #projects-thead-react .dashboard-th-sortable {
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] #projects-thead-react .dashboard-th-sortable:hover,
html[data-theme='dark'] #projects-thead-react .dashboard-th-sortable.is-active {
    color: var(--dashboard-primary) !important;
}

html[data-theme='dark'] #projects-tbody,
html[data-theme='dark'] .project-row {
    background: var(--dashboard-surface) !important;
    border-bottom-color: var(--dashboard-border) !important;
    border-left-color: transparent !important;
    border-left-width: 0 !important;
}

html[data-theme='dark'] .project-row:hover,
html[data-theme='dark'] .project-card:hover {
    background: var(--dashboard-hover) !important;
    border-bottom-color: var(--dashboard-border) !important;
    border-left-color: color-mix(in srgb, var(--project-accent, var(--dashboard-primary)) 54%, var(--dashboard-border)) !important;
}

html[data-theme='dark'] .project-row:hover h3,
html[data-theme='dark'] .project-card:hover .project-card-title {
    color: var(--dashboard-primary) !important;
}

html[data-theme='dark'] .divide-gray-50 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--dashboard-border) !important;
}

html[data-theme='dark'] .border-gray-100,
html[data-theme='dark'] .border-gray-200,
html[data-theme='dark'] .border-gray-300,
html[data-theme='dark'] .border-b,
html[data-theme='dark'] .border-t {
    border-color: var(--dashboard-border) !important;
}

html[data-theme='dark'] .project-row {
    border-left-color: transparent !important;
    border-left-width: 0 !important;
}

html[data-theme='dark'] .project-row:hover {
    border-left-color: transparent !important;
    border-left-width: 0 !important;
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--project-accent, var(--dashboard-primary)) 54%, var(--dashboard-border)) !important;
}

html[data-theme='dark'] .project-row .rounded-md.bg-gray-100,
html[data-theme='dark'] .project-card .rounded-md.bg-gray-100,
html[data-theme='dark'] .avatar,
html[data-theme='dark'] .project-row-avatar.bg-gray-100,
html[data-theme='dark'] .upload-zone,
html[data-theme='dark'] .upload-zone-btn {
    background: var(--dashboard-surface-muted) !important;
    border-color: var(--dashboard-border) !important;
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] .project-row-avatar {
    border-color: var(--dashboard-surface) !important;
}

html[data-theme='dark'] .action-btn-row button,
html[data-theme='dark'] .project-row button,
html[data-theme='dark'] .project-card button {
    color: var(--dashboard-muted) !important;
}

html[data-theme='dark'] .action-btn-row button:hover,
html[data-theme='dark'] .project-row button:hover,
html[data-theme='dark'] .project-card button:hover {
    color: var(--dashboard-primary) !important;
}

html[data-theme='dark'] .modal-backdrop,
html[data-theme='dark'] .project-detail-backdrop {
    background: rgba(29, 33, 37, 0.72) !important;
}

html[data-theme='dark'] .metadata-loading-spinner,
html[data-theme='dark'] .loading-spinner {
    border-color: var(--dashboard-border) !important;
    border-top-color: var(--dashboard-primary) !important;
}

html[data-theme='dark'] .skeleton {
    background: linear-gradient(
        90deg,
        var(--dashboard-surface-muted) 25%,
        #454f59 50%,
        var(--dashboard-surface-muted) 75%
    ) !important;
    background-size: 200% 100% !important;
}
