/**
 * Plotted Development – two-column layout: collapsible sidebar + main (top bar, search, Recents, Folders).
 * Colors follow project theme (theme.css).
 */
.dashboard-page {
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
}

/* ---- Sidebar ---- */
.dashboard-sidebar {
    width: 240px;
    min-width: 240px;
    height: 100vh;
    position: relative;
    background: var(--color-surface-strong);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease;
    flex-shrink: 0;
    z-index: 30;
}

.dashboard-sidebar.sidebar-collapsed {
    width: 72px;
    min-width: 72px;
    overflow: visible;
}

.sidebar-collapsed .sidebar-nav {
    overflow: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-collapsed .sidebar-nav::-webkit-scrollbar {
    display: none;
}

.dashboard-sidebar.sidebar-collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* Tooltips on hover when collapsed */
.sidebar-collapsed .sidebar-link {
    position: relative;
}

.sidebar-collapsed .sidebar-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-surface-strong, #1e293b);
    color: var(--color-text, #fff);
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    visibility: hidden;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    border: 1px solid var(--color-border);
}

.sidebar-collapsed .sidebar-link[data-tooltip]:hover::after {
    visibility: visible;
}

.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: var(--bg-elev-1);
}

.sidebar-toggle-icon {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    transition: transform 0.2s;
}

.sidebar-collapsed .sidebar-toggle {
    right: 8px;
}

.sidebar-collapsed .sidebar-toggle-icon {
    transform: scaleX(-1);
}

.sidebar-upload-wrap {
    padding: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    margin-top: 44px;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-right: 0.5rem;
}

.sidebar-link:hover {
    color: var(--color-text);
    background: var(--bg-elev-1);
}

.sidebar-link.active {
    color: var(--color-text);
    background: var(--color-surface);
    border-left: 3px solid var(--color-primary, #3b82f6);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-weight: 600;
}

.sidebar-sub-link {
    padding-left: 2.25rem;
    font-size: 0.83rem;
    color: var(--color-muted);
}

.sidebar-sub-link .sidebar-icon svg {
    width: 17px;
    height: 17px;
}

.sidebar-sub-link.active {
    font-weight: 600;
}

.sidebar-link--coming-soon {
    color: var(--color-muted);
    opacity: 0.72;
}

.sidebar-link--coming-soon:hover {
    color: var(--color-muted);
    background: transparent;
}

.sidebar-link--coming-soon.active {
    border-left: none;
    background: transparent;
    font-weight: 500;
}

.sidebar-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sidebar-icon svg {
    width: 20px;
    height: 20px;
}

.sidebar-text {
    white-space: nowrap;
    transition: opacity 0.2s;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.sidebar-icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon-btn:hover {
    color: var(--color-text);
    background: var(--bg-elev-1);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-text);
    color: var(--color-bg-elevated);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* User menu in footer */
.sidebar-user-menu-wrap {
    position: relative;
    width: 100%;
}

.sidebar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.sidebar-user-btn:hover {
    background: var(--bg-elev-1);
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar-user-name {
    display: none;
}

.sidebar-user-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 0.35rem 0;
    z-index: 1000;
}

.sidebar-user-dropdown.visible {
    display: block;
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.12s;
    white-space: nowrap;
}

.sidebar-dropdown-item:hover {
    background: var(--bg-elev-1);
}

.sidebar-dropdown-item--danger {
    color: var(--color-danger, #e74c3c);
}

.sidebar-dropdown-item--danger:hover {
    background: rgba(231, 76, 60, 0.08);
}

.sidebar-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.3rem 0;
}

/* ---- Main wrap ---- */
.dashboard-main-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.dashboard-page--booting .dashboard-topbar,
.dashboard-page--booting .dashboard-content {
    visibility: hidden;
}

.dashboard-boot-loader {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 100vh;
    padding: 2rem;
    background: var(--color-bg);
    color: var(--color-text);
    text-align: center;
}

.dashboard-page--booting .dashboard-boot-loader {
    display: flex;
}

.dashboard-boot-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-text);
    border-radius: 50%;
    animation: dashboardBootSpin 0.7s linear infinite;
}

.dashboard-boot-title {
    font-size: 0.92rem;
    font-weight: 700;
}

.dashboard-boot-subtitle {
    font-size: 0.78rem;
    color: var(--color-muted);
}

@keyframes dashboardBootSpin {
    to { transform: rotate(360deg); }
}

/* ---- Top bar ---- */
.dashboard-topbar {
    flex-shrink: 0;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.dashboard-topbar-title {
    flex-shrink: 0;
}

.dashboard-org-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin: 0 0 0.15rem 0;
}

.dashboard-org-subtitle {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0;
}

/* ---- Main content ---- */
.dashboard-content {
    flex: 1;
    overflow: hidden;
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Search bar */
.dashboard-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0 1rem;
    flex-shrink: 0;
    min-width: 200px;
    box-shadow: 0 1px 3px rgba(22, 35, 56, 0.04);
}

.dashboard-search-icon {
    flex-shrink: 0;
    color: var(--color-muted);
    display: flex;
}

.dashboard-search-icon svg {
    width: 20px;
    height: 20px;
}

.dashboard-search-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    outline: none;
}

.dashboard-search-input::placeholder {
    color: var(--color-muted);
}

.dashboard-search-filter-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-search-filter-btn:hover {
    color: var(--color-text);
    background: var(--bg-elev-1);
}

/* Filters (inline with search) */
.dashboard-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.dashboard-filter-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.8rem;
    cursor: pointer;
    max-width: 220px;
}

.dashboard-filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-sm);
}

/* Section titles */
.dashboard-section {
    margin-bottom: 1.75rem;
}

.dashboard-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
}

/* Topbar recents: small thumbnails in header */
.topbar-recents {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.topbar-recents-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.topbar-recents-track {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-recent-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    max-width: 150px;
}

.topbar-recent-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.topbar-recent-thumb {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    object-fit: cover;
    background: var(--color-bg);
    flex-shrink: 0;
}
.topbar-recent-thumb.lazy-hidden {
    opacity: 0;
    transition: opacity 0.25s ease;
}
.topbar-recent-thumb.lazy-loaded {
    opacity: 1;
}

.topbar-recent-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}

.recents-empty {
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* Two-column layout: Folders (left) | Projects (right), both scrollable */
.dashboard-two-col {
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: 1.5rem;
    align-items: stretch;
    min-height: 0;
    flex: 1;
}

.dashboard-folders-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.dashboard-folders-col .dashboard-section-title {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.dashboard-folders-scroll {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-elevated);
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    transform: translateZ(0);
}

.dashboard-folders-scroll::-webkit-scrollbar {
    width: 8px;
}

.dashboard-folders-scroll::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: 4px;
}

.dashboard-folders-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.dashboard-projects-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.dashboard-projects-col .dashboard-section-title {
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.dashboard-projects-scroll {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    transform: translateZ(0);
}

.dashboard-projects-scroll::-webkit-scrollbar {
    width: 8px;
}

.dashboard-projects-scroll::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: 4px;
}

.dashboard-projects-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.workspace-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    transition: opacity 0.18s ease-out;
}

/* Folder cards – compact card structure */
.folder-card {
    position: relative;
    width: 100%;
    text-align: left;
    border-radius: var(--radius);
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--color-border);
}

.folder-card--system {
    background: var(--color-surface);
}

.folder-card--owned {
    background: var(--color-bg-elevated);
}

.folder-card:hover {
    border-color: var(--border-strong);
}

.folder-card--system:hover {
    background: var(--color-accent-hover);
}

.folder-card--owned:hover {
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.folder-card.active {
    border-color: rgba(22, 35, 56, 0.28);
    box-shadow: 0 0 0 2px rgba(22, 35, 56, 0.10);
}

.folder-card--system:not(.active) {
    background: transparent;
    border-color: transparent;
}

.folder-card--system.active {
    background: var(--color-accent-hover);
}

.folder-card--owned.active {
    background: var(--color-surface);
    box-shadow: 0 0 0 2px rgba(22, 35, 56, 0.10);
}

.folder-card.drop-target {
    border-color: var(--color-success);
    background: rgba(34, 197, 94, 0.08);
}

.folder-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.folder-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
}

.folder-card-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-muted);
}

.folder-card-subtitle {
    font-size: 0.7rem;
    color: var(--color-muted);
    margin: 0.2rem 0 0 0;
    line-height: 1.2;
}

.folder-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--color-border);
}

.folder-card-btn {
    padding: 0.3rem 0.62rem;
    font-size: 0.69rem;
    font-weight: 700;
    /* The card sits on --color-surface (#e8e8e3 beige) and these buttons used the
       same token with an 8%-alpha border, so they vanished into the card. White
       fill + solid dark border is the only combination that reads on beige. */
    color: #162338;
    background: #ffffff;
    border: 1px solid rgba(22, 35, 56, 0.42);
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(22, 35, 56, 0.08);
    font-family: var(--font-body);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.folder-card-btn:hover {
    background: #162338;
    border-color: #162338;
    color: #ffffff;
}

.folder-card-btn:focus-visible {
    outline: 2px solid #162338;
    outline-offset: 2px;
}

.folder-card-btn--danger {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.35);
    background: #fff5f4;
}

.folder-card-btn--danger:hover {
    background: #b42318;
    border-color: #b42318;
    color: #ffffff;
}

.folder-card-skeleton {
    height: 72px;
    border-radius: var(--radius);
    background: var(--color-surface);
    background-image: linear-gradient(90deg, var(--color-surface) 0%, var(--color-bg-elevated) 50%, var(--color-surface) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

/* Upload modal */
.upload-modal {
    max-width: 680px !important;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.upload-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.upload-modal-body {
    padding-top: 1rem;
}

.upload-modal .upload-zone {
    margin: 0;
}

/* Hero Section */
.hero {
    text-align: left;
    margin-bottom: 2.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.hero-title span {
    color: var(--color-text);
}

.hero-subtitle {
    font-size: 0.95rem;
    color: var(--color-muted);
    max-width: 520px;
    line-height: 1.6;
}

/* Upload Section */
.upload-section {
    margin-bottom: 2.6rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text);
}

/* Upload Zone */
.upload-zone {
    background: var(--color-bg-card);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--border-strong);
    background: var(--color-surface);
}

.upload-zone.dragover {
    border-color: var(--border-strong);
    background: var(--color-surface);
}

.upload-zone.uploading {
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.upload-input {
    display: none;
}

/* Upload Form (appears after file selection) */
.upload-form {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.upload-form.visible {
    display: block;
}

.upload-preview {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.preview-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}

.preview-info {
    text-align: left;
    flex: 1;
}

.preview-filename {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.preview-size {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-strong);
    box-shadow: 0 0 0 3px rgba(22, 35, 56, 0.06);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Buttons use components/buttons.css */

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Progress Bar */
.upload-progress {
    display: none;
    margin-top: 1rem;
}

.upload-progress.visible {
    display: block;
}

.progress-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-text);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* Multi-file upload form */
.multi-upload-form {
    display: none;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.multi-upload-form.visible {
    display: block;
}

.multi-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 2px;
}

.multi-file-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.7rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.multi-thumb {
    width: 72px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: var(--color-bg);
}

.multi-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.multi-name-input {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.82rem !important;
}

.multi-file-meta {
    font-size: 0.7rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-file-360-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--color-muted);
    cursor: pointer;
}

.multi-file-remove {
    background: none;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.multi-file-remove:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.08);
}

/* Projects Grid – compact horizontal cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 0.45rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.project-card.owner-draggable {
    cursor: grab;
}

.project-card.owner-draggable.is-dragging {
    opacity: 0.48;
    transform: scale(0.99);
}

.project-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.project-image {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--color-bg);
    flex-shrink: 0;
}
.project-image.loading-placeholder {
    background-image: linear-gradient(90deg, var(--color-bg) 0%, rgba(255,255,255,0.03) 50%, var(--color-bg) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.project-image.lazy-hidden {
    opacity: 0;
    transition: opacity 0.25s ease;
}
.project-image.lazy-loaded {
    opacity: 1;
}
.projects-container-transition {
    transition: opacity 0.18s ease-out;
}

.project-content {
    flex: 1;
    min-width: 0;
    padding: 0.1rem 0;
}

.project-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.project-main-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.1rem 0.35rem;
    margin-left: 0.3rem;
    border-radius: 3px;
    background: #2563eb;
    color: #fff;
    border: none;
    vertical-align: middle;
}

.project-card.is-main-panorama {
    border: 1.5px solid #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.68rem;
    color: var(--color-muted);
    margin-top: 0.1rem;
}

.project-plots {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--color-text);
    font-weight: 600;
}

.project-date {
    opacity: 0.7;
}

/* Config icon + dropdown menu */
.project-config-wrap {
    position: relative;
    flex-shrink: 0;
}

.project-config-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.project-config-btn:hover,
.project-config-btn.active {
    background: var(--color-surface);
    color: var(--color-text);
}

.project-config-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 150px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(22, 35, 56, 0.12);
    z-index: 100;
    padding: 0.25rem 0;
    animation: configMenuIn 0.12s ease-out;
}

@keyframes configMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-config-menu.visible {
    display: block;
}

.project-config-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.85rem;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--color-text);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}

.project-config-menu-item:hover {
    background: var(--color-surface);
}

.project-config-menu-item.danger {
    color: var(--color-danger);
}

.project-config-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-text);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton placeholders */
.skeleton-card-compact {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.skeleton-thumb-compact {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--color-bg);
    background-image: linear-gradient(90deg, var(--color-bg) 0%, rgba(255,255,255,0.04) 50%, var(--color-bg) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.skeleton-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}
.skeleton-image {
    width: 100%;
    height: 180px;
    background: var(--color-bg);
    background-image: linear-gradient(90deg, var(--color-bg) 0%, rgba(255,255,255,0.04) 50%, var(--color-bg) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.skeleton-content { padding: 0.5rem 0; flex: 1; min-width: 0; }
.skeleton-line {
    height: 0.75rem;
    border-radius: 4px;
    background: var(--color-border);
    margin-bottom: 0.5rem;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-workspace-item {
    height: 4rem;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    background-image: linear-gradient(90deg, var(--color-surface) 0%, var(--color-bg-elevated) 50%, var(--color-surface) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Delete Confirmation Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 1rem;
}

.modal-backdrop.visible {
    display: flex;
}

.modal {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--color-border);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.modal-text {
    color: var(--color-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.msg.error {
    font-size: 0.85rem;
    color: var(--color-danger);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.share-link-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.share-link-input {
    font-size: 0.82rem;
}

.share-link-copy-btn {
    white-space: nowrap;
    min-width: 76px;
}

.share-endpoint-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-endpoint-prefix {
    font-size: 0.78rem;
    color: var(--color-muted);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.62rem 0.7rem;
    white-space: nowrap;
}

.share-check-btn {
    white-space: nowrap;
}

.workspace-share-status {
    margin-bottom: 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    color: var(--color-text);
}

.workspace-share-status.ok {
    border-color: rgba(34, 197, 94, 0.35);
    color: var(--color-success);
}

.workspace-share-status.warn {
    border-color: rgba(245, 158, 11, 0.35);
    color: #b7791f;
}

/* Compact, well-designed form for Create/Edit Project (smaller + traditional form style) */
#create-workspace-modal .ws-compact-form .form-group {
    margin: 0;
}
#create-workspace-modal .ws-compact-form .form-label {
    display: block;
    margin: 0 0 0.2rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
}
#create-workspace-modal .ws-compact-form .form-input,
#create-workspace-modal .ws-compact-form textarea.form-input {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.28rem 0.5rem;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
}
#create-workspace-modal .ws-compact-form .form-input:focus,
#create-workspace-modal .ws-compact-form textarea.form-input:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.07);
    outline: none;
}
#create-workspace-modal .ws-compact-form textarea.form-input {
    min-height: 52px;
}
#create-workspace-modal .ws-compact-form .form-group:last-child {
    margin-bottom: 0.1rem;
}
#create-workspace-modal .ws-compact-form > div[style*="grid-template-columns"] {
    gap: 0.5rem;
}

/* Smaller project create/edit modal */
#create-workspace-modal .modal {
    padding: 1.1rem 1.35rem 1rem !important;
}
#create-workspace-modal .modal-title {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}
#create-workspace-modal .modal-text {
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow);
}

.toast.success {
    border-color: var(--color-success);
}

.toast.error {
    border-color: var(--color-danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        box-shadow: 4px 0 20px rgba(22, 35, 56, 0.08);
    }

    .dashboard-sidebar.sidebar-collapsed {
        width: 56px;
        min-width: 56px;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .dashboard-topbar {
        padding: 1rem 1.25rem;
    }

    .dashboard-org-name {
        font-size: 1.25rem;
    }

    .topbar-recents {
        display: none;
    }

    .dashboard-two-col {
        grid-template-columns: 1fr;
    }

    .dashboard-folders-scroll {
        max-height: 280px;
    }

    .dashboard-projects-scroll {
        max-height: none;
    }

    .upload-preview {
        flex-direction: column;
        text-align: center;
    }

    .preview-info {
        text-align: center;
    }

    .form-row {
        flex-direction: column;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────────────────────
   Dashboard modals (Create/Edit Project, Rename, Delete)
   The shared button styles make .btn, .btn-primary and .btn-secondary
   all render as the same beige chip, so the confirming action was
   indistinguishable from Cancel and the cards read as flat beige.
   These overrides are scoped to dashboard modals only.
   ───────────────────────────────────────────────────────────── */
.modal-backdrop .modal {
    background: #ffffff;
    border: 1px solid rgba(22, 35, 56, 0.14);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.modal-backdrop .modal-title {
    color: #162338;
    letter-spacing: -0.01em;
}

.modal-backdrop .modal-text {
    color: #4a5568;
}

.modal-backdrop .form-label {
    color: #334155;
}

.modal-backdrop .form-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #162338;
}

.modal-backdrop .form-input::placeholder {
    color: #94a3b8;
}

.modal-backdrop .form-input:focus {
    border-color: #162338;
    box-shadow: 0 0 0 3px rgba(22, 35, 56, 0.10);
}

.modal-backdrop .modal-actions {
    gap: 0.6rem;
    align-items: center;
}

.modal-backdrop .modal-actions .btn {
    min-width: 96px;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.84rem;
    padding: 0.55rem 1rem;
}

.modal-backdrop .btn-primary {
    background: #162338;
    color: #ffffff;
    border: 1px solid #162338;
}

.modal-backdrop .btn-primary:hover {
    background: #0f172a;
    border-color: #0f172a;
}

.modal-backdrop .btn-secondary {
    background: #ffffff;
    color: #162338;
    border: 1px solid rgba(22, 35, 56, 0.32);
}

.modal-backdrop .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #162338;
}

.modal-backdrop .btn-danger {
    background: #b42318;
    color: #ffffff;
    border: 1px solid #b42318;
}

.modal-backdrop .btn-danger:hover {
    background: #91180f;
    border-color: #91180f;
}

.modal-backdrop .btn:focus-visible {
    outline: 2px solid #162338;
    outline-offset: 2px;
}

/* Create/Edit Project: readable optional-details disclosure + pinned footer */
#create-workspace-modal .modal {
    padding: 1.25rem 1.4rem 0 !important;
    display: flex;
    flex-direction: column;
}

#create-workspace-modal .modal-title {
    font-size: 1.12rem;
    margin-bottom: 0.3rem;
}

#create-workspace-modal .modal-text {
    font-size: 0.82rem;
    margin-bottom: 0.9rem;
}

#create-workspace-modal .upload-details-section {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0 0.7rem;
}

#create-workspace-modal .upload-details-section > summary {
    color: #162338 !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    padding: 0.55rem 0 !important;
    list-style: none;
}

#create-workspace-modal .upload-details-section > summary::marker,
#create-workspace-modal .upload-details-section > summary::-webkit-details-marker {
    display: none;
}

#create-workspace-modal .upload-details-section > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.4rem;
    color: #64748b;
    transition: transform 0.15s ease;
}

#create-workspace-modal .upload-details-section[open] > summary::before {
    transform: rotate(90deg);
}

#create-workspace-modal .upload-details-section .ws-compact-form {
    padding-bottom: 0.7rem;
}

#create-workspace-modal .ws-compact-form .form-input,
#create-workspace-modal .ws-compact-form textarea.form-input,
#create-workspace-modal .ws-compact-form select.form-input {
    background: #ffffff;
    border-color: #cbd5e1;
    height: auto;
    padding: 0.34rem 0.5rem;
}

#create-workspace-modal .modal-actions {
    position: sticky;
    bottom: 0;
    margin: 0.9rem -1.4rem 0 !important;
    padding: 0.7rem 1.4rem !important;
    background: #ffffff;
    border-top: 1px solid #e2e8f0 !important;
}
