/* ======================================
   DronesMatrix — Bootstrap 5.3 Variable Overrides
   Brand colors (Tailwind Slate gray scale, #3B8CF4 primary),
   app layout tokens, and dark-mode surface flips.
   ====================================== */

:root {
    /* Override Bootstrap primary → brand blue */
    --bs-primary: #3B8CF4;
    --bs-primary-rgb: 59, 140, 244;

    /* Override Bootstrap gray scale → Tailwind Slate */
    --bs-gray-50:  #f8fafc;
    --bs-gray-100: #edf1f5;
    --bs-gray-200: #e2e8f0;
    --bs-gray-300: #cbd5e1;
    --bs-gray-400: #94a3b8;
    --bs-gray-500: #64748b;
    --bs-gray-600: #475569;
    --bs-gray-700: #334155;
    --bs-gray-800: #1e293b;
    --bs-gray-900: #171a1f;

    /* Override Bootstrap body/text/border */
    --bs-body-color: #171a1f;
    --bs-body-color-rgb: 23, 26, 31;
    --bs-body-bg: #ffffff;
    --bs-body-bg-rgb: 255, 255, 255;
    --bs-secondary-color: #64748b;
    --bs-secondary-color-rgb: 100, 116, 139;
    --bs-tertiary-color: #334155;
    --bs-tertiary-color-rgb: 51, 65, 85;
    --bs-tertiary-bg: #ffffff;
    --bs-tertiary-bg-rgb: 255, 255, 255;
    --bs-border-color: #e2e8f0;
    --bs-emphasis-color: #171a1f;

    /* Font family */
    --bs-body-font-family: 'Manrope', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* App layout dimensions (JS toggles these) */
    --dm-sidebar-width: 250px;
    --dm-sidebar-collapsed-width: 68px;
    --dm-right-toolbar-width: 56px;

    /* App surfaces (need dark mode flip, no Bootstrap equivalent) */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e2e8f0;
    --card-bg: #ffffff;
}

[data-bs-theme="dark"] {
    /* Invert Slate gray scale */
    --bs-gray-50:  #0b1120;
    --bs-gray-100: #0f172a;
    --bs-gray-200: #1e293b;
    --bs-gray-300: #334155;
    --bs-gray-400: #475569;
    --bs-gray-500: #64748b;
    --bs-gray-600: #94a3b8;
    --bs-gray-700: #cbd5e1;
    --bs-gray-800: #e2e8f0;
    --bs-gray-900: #f1f5f9;

    /* Override Bootstrap dark body/text/border */
    --bs-body-color: #f1f5f9;
    --bs-body-color-rgb: 241, 245, 249;
    --bs-body-bg: #0b1120;
    --bs-body-bg-rgb: 11, 17, 32;
    --bs-secondary-color: #94a3b8;
    --bs-secondary-color-rgb: 148, 163, 184;
    --bs-tertiary-color: #cbd5e1;
    --bs-tertiary-color-rgb: 203, 213, 225;
    --bs-tertiary-bg: #1e293b;
    --bs-tertiary-bg-rgb: 30, 41, 59;
    --bs-border-color: #334155;
    --bs-emphasis-color: #f1f5f9;

    /* App surfaces */
    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --card-bg: #1e293b;
}

/* ======================================
   Section 2: Base Reset & Typography
   ====================================== */
html {
    font-size: 16px;
    position: relative;
    min-height: 100%;
    scroll-behavior: smooth;
    font-optical-sizing: auto;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--bs-body-font-family);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.6;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { color: var(--bs-body-color); font-weight: 700; }
p, .lead { color: var(--bs-tertiary-color); font-weight: 500; }

a { color: var(--bs-primary); text-decoration: none; }
a:hover { color: #2B7DE9; }

::selection {
    background: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--bs-gray-900);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bs-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bs-gray-400); }

/* ======================================
   Section 3: App Layout (Sidebar + Content, no top header)
   ====================================== */
.dm-app {
    display: flex;
    min-height: 100vh;
}

/* ======================================
   Bootstrap 5 Tooltip Overrides
   ====================================== */
.tooltip {
    --bs-tooltip-bg: var(--bs-gray-800);
    --bs-tooltip-color: #fff;
    --bs-tooltip-border-radius: 6px;
    --bs-tooltip-padding-x: 10px;
    --bs-tooltip-padding-y: 5px;
    --bs-tooltip-font-size: 0.8125rem;
    font-family: inherit;
}

.tooltip-inner {
    font-weight: 500;
    letter-spacing: 0.01em;
    max-width: 220px;
}

[data-bs-theme="dark"] .tooltip {
    --bs-tooltip-bg: var(--bs-gray-100);
    --bs-tooltip-color: var(--bs-gray-900);
}

/* ======================================
   Section 4: Header / Navbar (sticky top bar)
   ====================================== */
.dm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--bs-gray-200);
    position: sticky;
    top: 0;
    z-index: 1030;
    height: 56px;
    min-height: 56px;
}

.dm-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dm-header-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--bs-body-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.dm-header-toggle:hover {
    background: var(--bs-gray-100);
    color: var(--bs-body-color);
}

.dm-header-divider {
    width: 1px;
    height: 24px;
    background: var(--bs-gray-200);
}

.dm-header-welcome {
    font-size: 0.875rem;
    color: var(--bs-tertiary-color);
    white-space: nowrap;
}

.dm-header-welcome strong {
    color: var(--bs-body-color);
    font-weight: 600;
}

.dm-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Clerk UserButton mount target */
#clerk-user-button {
    display: flex;
    align-items: center;
    min-width: 32px;
    min-height: 32px;
}

.dm-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Page-specific toolbar elements (search, view toggles, etc.) */
.dm-toolbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    padding: 8px 16px;
    flex: 0 1 400px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dm-toolbar-search:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
    background: #fff;
}

.dm-toolbar-search i {
    color: var(--bs-gray-400);
    font-size: 1rem;
    flex-shrink: 0;
}

.dm-toolbar-search input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--bs-gray-800);
    font-size: 0.9375rem;
    width: 100%;
    font-family: var(--bs-body-font-family);
}

.dm-toolbar-search input::placeholder {
    color: var(--bs-gray-400);
}

/* View Toggle Buttons (grid / list) — used by Projects page */
.dm-view-toggles {
    display: flex;
    align-items: center;
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.dm-view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--bs-tertiary-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.1rem;
}

.dm-view-btn:hover {
    color: var(--bs-body-color);
}

.dm-view-btn.active {
    background: #fff;
    color: var(--bs-gray-800);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Auth Buttons */
.dm-auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tool Button (theme toggle, etc.) */
.dm-tool-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--bs-tertiary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.dm-tool-btn:hover {
    background: var(--bs-gray-100);
    color: var(--bs-body-color);
}

.dm-tool-btn.active {
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
}


/* ======================================
   Section 5: Left Sidebar (full height)
   ====================================== */
.dm-sidebar {
    width: var(--dm-sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease,
                transform 0.2s ease;
    overflow: hidden;
    z-index: 1040;
}

/* Sidebar Logo */
.dm-sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    text-decoration: none;
    overflow: hidden;
    background: #0f172a;
    border-radius: 0;
}

.dm-sidebar-logo:hover {
    text-decoration: none;
}

.dm-logo-img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    transition: max-width 0.2s ease;
}

/* Dark theme: sidebar is already dark, logo shows naturally */
[data-bs-theme="dark"] .dm-sidebar-logo {
    background: transparent;
}

/* Collapsed: shrink logo */
.sidebar-collapsed .dm-sidebar-logo {
    padding: 14px 6px;
}

.sidebar-collapsed .dm-logo-img {
    max-width: 44px;
}

/* Sidebar Navigation */
.dm-sidebar-nav {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.dm-nav-section {
    margin-bottom: 8px;
}

.dm-nav-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #2B7DE9;
    padding: 16px 14px 10px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Storage Widget */
.dm-sidebar-storage {
    padding: 12px 16px 14px;
    border-top: 1px solid var(--sidebar-border);
    white-space: nowrap;
    overflow: hidden;
}

.dm-storage-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.dm-storage-header i {
    font-size: 1rem;
    color: var(--bs-tertiary-color);
}

.dm-storage-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dm-storage-pct {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-left: auto;
}

.dm-storage-bar {
    width: 100%;
    height: 5px;
    background: var(--bs-gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.dm-storage-fill {
    height: 100%;
    background: var(--bs-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.dm-storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--bs-tertiary-color);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}


.dm-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dm-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    color: var(--bs-body-color);
    text-decoration: none;
    border-radius: 8px;
    white-space: nowrap;
    position: relative;
    margin-bottom: 4px;
    transition: color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

/* Gooey blob background — scales up smoothly behind the item */
.dm-nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: transparent;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.2s ease,
                background 0.2s ease;
    z-index: -1;
}

.dm-nav-item:hover {
    color: var(--bs-body-color);
    text-decoration: none;
}

.dm-nav-item:hover::before {
    background: var(--bs-gray-100);
    transform: scale(1);
    opacity: 1;
}

/* Icon lift on hover */
.dm-nav-item:hover i {
    transform: scale(1.08);
}

/* Active state */
.dm-nav-item.active {
    color: var(--bs-primary);
    font-weight: 600;
}

.dm-nav-item.active::before {
    background: rgba(var(--bs-primary-rgb), 0.08);
    transform: scale(1);
    opacity: 1;
}

.dm-nav-item i {
    font-size: 1.3rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: var(--bs-body-color);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dm-nav-item.active i {
    color: var(--bs-primary);
}

.dm-nav-item span {
    font-size: 1rem;
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* User profile — pinned to sidebar bottom */
.dm-sidebar-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--sidebar-border);
    white-space: nowrap;
    overflow: hidden;
}

.dm-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.dm-user-avatar-sm {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bs-primary), #2B7DE9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dm-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.2s ease;
    min-width: 0;
}

.dm-user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bs-body-color);
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dm-user-role {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-tertiary-color);
    text-transform: capitalize;
    line-height: 1.3;
}


/* ======================================
   Section 6: Sidebar Collapsed State
   ====================================== */
.sidebar-collapsed .dm-sidebar {
    width: var(--dm-sidebar-collapsed-width);
}

/* Nav: hide labels and text */
.sidebar-collapsed .dm-nav-label,
.sidebar-collapsed .dm-nav-item span {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .dm-nav-item {
    justify-content: center;
    padding: 10px;
}

.sidebar-collapsed .dm-nav-item:hover {
    transform: none;
}

.sidebar-collapsed .dm-main {
    margin-left: var(--dm-sidebar-collapsed-width);
    max-width: calc(100vw - var(--dm-sidebar-collapsed-width));
}

/* Storage: hide everything except just the icon */
.sidebar-collapsed .dm-sidebar-storage {
    padding: 10px 8px;
    text-align: center;
}

.sidebar-collapsed .dm-storage-title,
.sidebar-collapsed .dm-storage-pct,
.sidebar-collapsed .dm-storage-bar,
.sidebar-collapsed .dm-storage-info {
    display: none;
}

.sidebar-collapsed .dm-storage-header {
    justify-content: center;
    margin-bottom: 0;
}

/* Bottom: hide user info and sign-out */
.sidebar-collapsed .dm-sidebar-bottom {
    justify-content: center;
    padding: 12px 8px;
}

.sidebar-collapsed .dm-sidebar-bottom .dm-user-info {
    opacity: 0;
    pointer-events: none;
    width: 0;
    min-width: 0;
    overflow: hidden;
}

/* Collapsed tooltips */
.sidebar-collapsed .dm-nav-item {
    position: relative;
}

.sidebar-collapsed .dm-nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    background: var(--card-bg);
    color: var(--bs-gray-800);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--sidebar-border);
}

.sidebar-collapsed .dm-nav-item:hover::after {
    opacity: 1;
}

.sidebar-collapsed .dm-user-avatar-sm {
    position: relative;
}

.sidebar-collapsed .dm-user-avatar-sm::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    color: var(--bs-gray-800);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--sidebar-border);
}

.sidebar-collapsed .dm-user-avatar-sm:hover::after {
    opacity: 1;
}

/* ======================================
   Section 6b: Dark Theme
   ====================================== */
/* Dark mode variable overrides are in the :root block at the top of this file */

/* Sidebar dark overrides */
[data-bs-theme="dark"] .dm-nav-item {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .dm-nav-item:hover {
    color: #f1f5f9;
}

[data-bs-theme="dark"] .dm-nav-item:hover::before {
    background: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .dm-nav-item.active {
    color: #4da6ff;
}

[data-bs-theme="dark"] .dm-nav-item.active::before {
    background: rgba(var(--bs-primary-rgb), 0.15);
}

[data-bs-theme="dark"] .dm-nav-label {
    color: #4da6ff;
}

[data-bs-theme="dark"] .dm-user-name {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dm-user-role {
    color: #64748b;
}

[data-bs-theme="dark"] .dm-storage-title,
[data-bs-theme="dark"] .dm-storage-header i {
    color: #94a3b8;
}

[data-bs-theme="dark"] .dm-storage-pct {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dm-storage-bar {
    background: #334155;
}

[data-bs-theme="dark"] .dm-storage-info {
    color: #64748b;
}

/* Header / Navbar dark overrides */
[data-bs-theme="dark"] .dm-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .dm-header-toggle {
    color: #94a3b8;
}

[data-bs-theme="dark"] .dm-header-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dm-header-divider {
    background: #334155;
}

[data-bs-theme="dark"] .dm-header-welcome {
    color: #94a3b8;
}

[data-bs-theme="dark"] .dm-header-welcome strong {
    color: #e2e8f0;
}

/* Toolbar search dark overrides */
[data-bs-theme="dark"] .dm-toolbar-search {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
}

[data-bs-theme="dark"] .dm-toolbar-search:focus-within {
    background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .dm-toolbar-search input {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dm-view-toggles {
    background: rgba(255, 255, 255, 0.05);
    border-color: #334155;
}

[data-bs-theme="dark"] .dm-view-btn.active {
    background: #334155;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .dm-tool-btn {
    color: #94a3b8;
}

[data-bs-theme="dark"] .dm-tool-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}


/* ======================================
   Section 7: Main Content Area
   ====================================== */
.dm-main {
    flex: 1;
    margin-left: var(--dm-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    max-width: calc(100vw - var(--dm-sidebar-width));
    transition: margin-left 0.2s ease,
                max-width 0.2s ease,
                margin-right 0.2s ease;
}

/* When right toolbar is present */
.dm-app.has-right-toolbar .dm-main {
    margin-right: var(--dm-right-toolbar-width);
}

/* Content area */
.dm-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
    background: var(--bs-body-bg);
    color: var(--bs-gray-900);
}

.dm-content h1,
.dm-content h2,
.dm-content h3,
.dm-content h4,
.dm-content h5,
.dm-content h6 {
    color: var(--bs-body-color);
}

.dm-content p {
    color: var(--bs-tertiary-color);
}

/* ======================================
   Section 8: Right Toolbar
   ====================================== */
.dm-right-toolbar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--dm-right-toolbar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    z-index: 1020;
    gap: 6px;
}

.dm-tool-divider {
    width: 28px;
    height: 1px;
    background: var(--sidebar-border);
    margin: 6px 0;
}

.dm-tool-spacer {
    flex: 1;
}

/* ======================================
   Section 9: Footer
   ====================================== */
.dm-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--bs-gray-200);
    color: var(--bs-tertiary-color);
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bs-body-bg);
}

.dm-footer a { color: var(--bs-body-color); }
.dm-footer a:hover { color: var(--bs-primary); }

/* ======================================
   Section 10: Bootstrap Component Overrides (Light Content Area)
   ====================================== */

/* Forms */
.form-control,
.form-select {
    background-color: #fff;
    border: 1px solid var(--bs-gray-200);
    color: var(--bs-gray-900);
}

.form-select {
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center / 16px 16px;
    padding-right: 2.25rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--bs-primary);
    color: var(--bs-gray-900);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

.form-select:focus {
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233B8CF4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.75rem center / 16px 16px;
}

.form-control::placeholder { color: var(--bs-gray-400); }
.form-label { color: var(--bs-body-color); font-weight: 600; }

.input-group-text {
    background: var(--bs-body-bg);
    border-color: var(--bs-gray-200);
    color: var(--bs-gray-600);
}

/* Buttons — keep Bootstrap 5.3 defaults */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

/* Bootstrap Button Color Overrides */
.btn-primary {
    background-color: #3B8CF4;
    border-color: #3B8CF4;
    color: #fff;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:first-child:active {
    background-color: #2B7DE9;
    border-color: #2B7DE9;
    color: #fff;
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(59, 140, 244, 0.3);
}

.btn-outline-primary {
    color: #3B8CF4;
    border-color: #3B8CF4;
}

.btn-outline-primary:hover,
.btn-outline-primary:active {
    background-color: #3B8CF4;
    border-color: #3B8CF4;
    color: #fff;
}

.btn-outline-secondary {
    color: #1e293b;
    border-color: #cbd5e1;
}

.btn-outline-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

/* Override Bootstrap primary utilities */
.text-primary {
    color: var(--bs-primary) !important;
}

.bg-primary {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
}

/* Bootstrap Pagination Override */
.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.page-link {
    color: var(--bs-primary);
}

.page-link:hover {
    color: #2B7DE9;
}

/* Links inside content area */
.dm-content a:not(.dm-nav-item):not(.dm-header-link):not(.btn) {
    color: var(--bs-primary);
}

.dm-content a:not(.dm-nav-item):not(.dm-header-link):not(.btn):hover {
    color: #2B7DE9;
}

/* ── Page Loader — centered full-content spinner ── */
.dm-page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 16px;
}

.dm-page-loader .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
    color: var(--bs-primary);
}

.dm-page-loader-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    letter-spacing: 0.01em;
}

/* ── Modals — unified design system ──────────────── */
.modal {
    --bs-modal-bg: var(--card-bg);
    --bs-modal-color: var(--bs-gray-900);
    --bs-modal-border-color: transparent;
    --bs-body-bg: var(--card-bg);
    --bs-body-color: var(--bs-gray-900);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--bs-gray-100);
    padding: 24px 24px 16px;
    background: var(--bs-gray-50);
}

.modal-title {
    color: var(--bs-body-color);
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.3;
}

.modal-title i {
    color: var(--bs-secondary-color);
    font-size: 1.1em;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    border-top: 1px solid var(--bs-gray-100);
    padding: 16px 24px 24px;
    gap: 12px;
    background: var(--bs-gray-50);
}

.btn-close {
    filter: none;
    opacity: 0.4;
    transition: opacity 0.15s;
}

.btn-close:hover {
    opacity: 0.8;
}

/* Modal form controls */
.modal .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 6px;
}

.modal .form-control,
.modal .form-select {
    background-color: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: var(--bs-gray-900);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.12);
}

.modal .form-control::placeholder {
    color: var(--bs-secondary-color);
    font-weight: 400;
}

/* Danger zone in modals */
.modal .danger-zone {
    border: 1px solid var(--bs-gray-200);
    border-radius: 12px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.03);
}

.modal .danger-zone-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 10px;
}


/* Upload drop zone */
.dm-upload-zone {
    border: 2px dashed var(--sidebar-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--bs-gray-400);
    margin-bottom: 20px;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.dm-upload-zone:hover {
    border-color: var(--bs-primary);
}

.dm-upload-zone i {
    font-size: 3rem;
    color: var(--sidebar-border);
    display: block;
    margin-bottom: 8px;
}

.dm-upload-zone p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--bs-gray-500);
}

/* Alerts */
.alert-danger {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.alert-success {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}

.alert-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.alert-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

/* Tables */
.table {
    color: var(--bs-gray-900);
    border-color: var(--bs-gray-200);
}

.table > thead { color: var(--bs-body-color); font-weight: 600; }
.table-striped > tbody > tr:nth-of-type(odd) { background: rgba(245, 246, 250, 0.5); }
.table-hover > tbody > tr:hover { background: var(--bs-body-bg); }

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--bs-gray-200);
    color: var(--bs-gray-900);
}

.card-header {
    background: var(--bs-body-bg);
    border-bottom-color: var(--bs-gray-200);
}

.card-footer {
    background: var(--bs-body-bg);
    border-top-color: var(--bs-gray-200);
}

/* Text utilities */
.text-muted { color: var(--bs-tertiary-color) !important; }
.text-danger { color: #ef4444 !important; }
.text-success { color: #22c55e !important; }
.text-warning { color: #f59e0b !important; }
.text-info { color: var(--bs-primary) !important; }

/* Dropdown */
.dropdown-menu {
    background: var(--card-bg);
    border-color: var(--bs-gray-200);
}

.dropdown-item { color: var(--bs-body-color); }

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--bs-body-bg);
    color: var(--bs-gray-900);
}

.dropdown-divider { border-top-color: var(--bs-gray-200); }

/* Progress bar */
.progress {
    background: var(--bs-gray-200);
}

.progress-bar {
    background: var(--bs-primary);
}

/* ======================================
   Section 11: DM Component Utilities
   ====================================== */
.dm-card {
    background: var(--card-bg);
    border: 1px solid var(--bs-gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dm-card:hover {
    border-color: var(--bs-gray-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

/* ======================================
   Section 12: Dashboard / Project Cards
   ====================================== */

/* Dashboard Summary Stat Cards */
.dm-stat-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.dm-stat-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    min-height: 120px;
}
.dm-stat-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.dm-stat-card-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dm-stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.dm-stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dm-stat-card-icon i {
    font-size: 1.5rem;
    color: #fff;
}

/* Color Variants — uses Bootstrap variable overrides */
.dm-stat-card--success { background: #16a34a; }
.dm-stat-card--primary { background: var(--bs-primary); }
.dm-stat-card--info    { background: #0891b2; }
.dm-stat-card--warning { background: #d97706; }

.dm-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.dm-page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--bs-body-color);
}


/* ======================================
   Shared Page Header (used by all inner pages)
   ====================================== */
.dm-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dm-page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--bs-body-color);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 4px;
}

.dm-page-subtitle {
    color: var(--bs-secondary-color);
    font-size: 0.9375rem;
    font-weight: 400;
    margin: 0;
}

/* Shared action button layout helper (icon + text alignment) */
.dm-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
}

.dm-btn-action i {
    font-size: 1.1rem;
}

/* ── Projects Page Header ───── */
.dm-proj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dm-proj-header-left {
    flex-shrink: 0;
}

.dm-proj-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Search input — pill shape, subtle bg */
.dm-proj-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(var(--bs-primary-rgb), 0.03);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.08);
    border-radius: 9999px;
    padding: 0 16px;
    height: 40px;
    min-width: 256px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dm-proj-search:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 1px var(--bs-primary);
}

.dm-proj-search i {
    color: var(--bs-secondary-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.dm-proj-search input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 0.875rem;
    font-family: var(--bs-body-font-family);
    font-weight: 400;
    width: 100%;
}

.dm-proj-search input::placeholder {
    color: var(--bs-secondary-color);
}

/* Grid/List toggle group */
.dm-proj-view-toggles {
    display: flex;
    align-items: center;
    background: rgba(var(--bs-primary-rgb), 0.04);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.08);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    height: 40px;
}

.dm-proj-view-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1rem;
    padding: 0 10px;
}

.dm-proj-view-btn:hover {
    color: var(--bs-tertiary-color);
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.dm-proj-view-btn.active {
    background: var(--card-bg);
    color: var(--bs-body-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Project Cards Grid ───────────────── */
.dm-projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    padding-bottom: 2.5rem;
}

@media (min-width: 768px) {
    .dm-projects-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .dm-projects-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1400px) {
    .dm-projects-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Base Card ───────────────── */
.dm-project-card {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.4);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    height: 280px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dm-project-card:hover {
    border-color: rgba(226, 232, 240, 0.8);
    box-shadow: 0 20px 40px rgba(var(--bs-primary-rgb), 0.05);
}

/* ── "New Workspace" card ───── */
.dm-project-card--new {
    border: 2px dashed rgba(226, 232, 240, 0.4);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    box-shadow: none;
}

.dm-project-card--new:hover {
    border-color: rgba(var(--bs-primary-rgb), 0.5);
    background: rgba(var(--bs-primary-rgb), 0.02);
}

.dm-project-new-inner {
    text-align: center;
    padding: 2rem;
}

.dm-project-new-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bs-gray-100);
    color: var(--bs-tertiary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dm-project-card--new:hover .dm-project-new-icon {
    background: var(--bs-primary);
    color: #fff;
    transform: scale(1.1);
}

.dm-project-new-title {
    font-weight: 600;
    color: var(--bs-secondary-color);
    font-size: 1.125rem;
    margin: 0 0 8px;
    transition: color 0.3s;
}

.dm-project-card--new:hover .dm-project-new-title {
    color: var(--bs-body-color);
}

.dm-project-new-desc {
    color: var(--bs-secondary-color);
    opacity: 0.7;
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
    padding: 0 1.5rem;
}

/* ── Top bar: status + member count ── */
.dm-project-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
}

.dm-project-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 6px;
    border: 1px solid var(--bs-gray-200);
    background: var(--card-bg);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

.dm-project-members {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    background: var(--card-bg);
    border: 1px solid var(--bs-gray-200);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

.dm-project-members i {
    font-size: 0.75rem;
    color: var(--bs-primary);
}

/* ── Card Image Area ───────── */
.dm-project-card-img {
    position: relative;
    height: 120px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bs-gray-100);
}

.dm-project-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover overlay with "Open Viewer" */
.dm-project-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(1px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.dm-project-card:hover .dm-project-hover-overlay {
    opacity: 1;
}

.dm-project-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border: 1px solid var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.9);
    color: #fff;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(var(--bs-primary-rgb), 0.2);
    transition: all 0.2s ease;
}

.dm-project-open-btn:hover {
    background: var(--bs-primary);
    transform: scale(1.05);
}

/* ── Card Body ─────────────── */
.dm-project-card-body {
    padding: 16px 16px 8px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dm-project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dm-project-card-body h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--bs-body-color);
    line-height: 1.3;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.dm-project-card-body p {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    font-weight: 400;
    margin: 4px 0 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 3-dot menu */
.dm-card-menu {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-top: -4px;
    margin-right: -8px;
    flex-shrink: 0;
}

.dm-card-menu:hover {
    color: var(--bs-body-color);
}

/* ── Footer: date + storage ── */
.dm-project-footer {
    padding: 0 16px 14px;
    margin-top: auto;
    border-top: 1px solid var(--bs-gray-100);
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.dm-project-footer-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
}

.dm-project-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
}

.dm-project-meta i {
    font-size: 0.875rem;
}

/* ── List view ─────────────── */
.dm-projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dm-projects-list .dm-project-card {
    flex-direction: row;
    align-items: center;
    height: auto;
}

.dm-projects-list .dm-project-card--new {
    min-height: auto;
    height: auto;
    padding: 1.5rem;
}

.dm-projects-list .dm-project-card-img {
    width: 120px;
    height: 80px;
    flex-shrink: 0;
    margin: 12px;
}

.dm-projects-list .dm-project-card-body {
    padding: 12px 14px;
}

.dm-projects-list .dm-project-card-body p {
    -webkit-line-clamp: 1;
}

.dm-projects-list .dm-project-footer {
    border-top: none;
    padding: 0 14px 0 0;
}

.dm-projects-list .dm-project-hover-overlay {
    display: none;
}

/* ── Flatpickr overrides ────────────────────────────── */
.flatpickr-input[readonly] {
    background-color: var(--bs-body-bg);
    cursor: pointer;
}
input.flatpickr-input.form-control + input.form-control.input {
    background-color: var(--bs-body-bg);
    cursor: pointer;
}

/* Context Menu */
.dm-context-menu {
    position: fixed;
    z-index: 1060;
    background: var(--card-bg);
    border: 1px solid var(--bs-gray-200);
    border-radius: 6px;
    padding: 3px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.92);
    transform-origin: top right;
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
    pointer-events: none;
}

.dm-context-menu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.dm-context-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--bs-gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s ease;
    white-space: nowrap;
}

.dm-context-item i {
    font-size: 0.9375rem;
    color: var(--bs-gray-500);
}

.dm-context-item:hover {
    background: var(--bs-gray-100);
    color: var(--bs-emphasis-color);
}

.dm-context-item:hover i {
    color: var(--bs-gray-700);
}

.dm-context-item.dm-context-danger {
    color: #EF4444;
}

.dm-context-item.dm-context-danger i {
    color: #EF4444;
}

.dm-context-item.dm-context-danger:hover {
    background: #FEF2F2;
}

.dm-context-divider {
    height: 1px;
    background: var(--bs-gray-200);
    margin: 2px 4px;
}

/* ======================================
   Section 13: (Reserved - all styles are hardcoded, no theme switching needed)
   ====================================== */

/* ======================================
   Section 14: Page-Specific Overrides
   ====================================== */

/* Map page: flush content, no footer */
.dm-app[data-page="map"] .dm-content {
    padding: 0;
    overflow: hidden;
}

.dm-app[data-page="map"] .dm-footer {
    display: none;
}

/* ======================================
   Section 15: Mobile Overlay
   ====================================== */
.dm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1045;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ======================================
   Section 16: Responsive Breakpoints
   ====================================== */

/* Tablet */
@media (max-width: 991.98px) {
    .dm-proj-header {
        flex-direction: column;
        gap: 16px;
    }

    .dm-proj-header-right {
        flex-wrap: wrap;
    }

    .dm-proj-search {
        min-width: 180px;
        flex: 1;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .dm-sidebar {
        transform: translateX(-100%);
        width: var(--dm-sidebar-width);
    }

    .dm-app.sidebar-mobile-open .dm-sidebar {
        transform: translateX(0);
    }

    .dm-app.sidebar-mobile-open .dm-overlay {
        display: block;
        opacity: 1;
    }

    .dm-main {
        margin-left: 0;
        max-width: 100vw;
    }

    .sidebar-collapsed .dm-main {
        margin-left: 0;
        max-width: 100vw;
    }

    .dm-content {
        padding: 16px;
    }

    /* Compact header on mobile */
    .dm-header {
        padding: 0 16px;
        height: 50px;
        min-height: 50px;
    }

    .dm-header-welcome {
        display: none;
    }

    .dm-header-divider {
        display: none;
    }

    .dm-toolbar-search {
        flex: 1;
        min-width: 0;
    }

    .dm-proj-header {
        flex-direction: column;
        gap: 12px;
    }

    .dm-proj-header-right {
        flex-wrap: wrap;
        width: 100%;
    }

    .dm-proj-search {
        flex: 1;
        min-width: 0;
    }

    .dm-project-card--new {
        min-height: 200px;
        height: auto;
    }

    .dm-project-card {
        height: auto;
        min-height: 280px;
    }

    /* Right toolbar becomes bottom bar on mobile */
    .dm-right-toolbar {
        position: fixed;
        top: auto;
        right: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 52px;
        flex-direction: row;
        justify-content: center;
        border-left: none;
        border-top: 1px solid var(--sidebar-border);
        padding: 0 8px;
        gap: 4px;
        overflow-x: auto;
    }

    .dm-app.has-right-toolbar .dm-main {
        margin-right: 0;
        padding-bottom: 52px;
    }

    .dm-tool-divider {
        width: 1px;
        height: 24px;
        margin: 0 4px;
    }

    .dm-tool-spacer {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .dm-auth-buttons .btn {
        font-size: 0.8125rem;
        padding: 5px 12px;
    }
}

/* DataTables light theme */
.dataTables_wrapper {
    color: var(--bs-gray-900);
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--bs-gray-600);
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: #fff;
    border: 1px solid var(--bs-gray-200);
    color: var(--bs-gray-900);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.page-item.active .page-link,
table.dataTable + .dataTables_wrapper .page-item.active .page-link {
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--bs-gray-600) !important;
}

/* ======================================
   Section 17: SweetAlert2 Theme (Light + colorful accents)
   ====================================== */

/* Confirmation dialogs — clean white, rounded, matching site modals */
.dm-swal-popup {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    font-family: inherit !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12) !important;
}

.dm-swal-title {
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    color: #1e293b !important;
}

.dm-swal-actions {
    gap: 12px;
}

/* Toast notifications — rich colored backgrounds with vibrant icons */
.dm-swal-toast {
    border-radius: 12px !important;
    font-family: var(--bs-body-font-family) !important;
    font-size: 0.9rem !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18) !important;
    min-width: 320px !important;
    max-width: 450px !important;
    border: none !important;
    padding: 0.85rem 1rem !important;
}

.dm-swal-toast .swal2-title {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

/* Make toast icons smaller + vibrant */
.dm-swal-toast .swal2-icon {
    width: 1.6rem !important;
    height: 1.6rem !important;
    margin: 0 0.6rem 0 0 !important;
    border-width: 2px !important;
}
.dm-swal-toast .swal2-icon .swal2-icon-content { font-size: 0.9rem !important; }

/* Close button styling */
.dm-swal-toast .swal2-close {
    font-size: 1.1rem !important;
    color: inherit !important;
    opacity: 0.5 !important;
}
.dm-swal-toast .swal2-close:hover { opacity: 1 !important; }

/* Timer progress bar — match the accent color */
.dm-swal-toast .swal2-timer-progress-bar { border-radius: 0 0 12px 12px !important; }

/* Success toast — deeper green */
.dm-swal-toast.swal2-icon-success {
    background: linear-gradient(135deg, #dcfce7 0%, #badbcc 100%) !important;
    border-left: 5px solid #16a34a !important;
}
.dm-swal-toast.swal2-icon-success .swal2-title { color: #14532d !important; }
.dm-swal-toast.swal2-icon-success .swal2-timer-progress-bar { background: #16a34a !important; }

/* Error toast — deeper red */
.dm-swal-toast.swal2-icon-error {
    background: linear-gradient(135deg, #fee2e2 0%, #f1c0c5 100%) !important;
    border-left: 5px solid #dc2626 !important;
}
.dm-swal-toast.swal2-icon-error .swal2-title { color: #7f1d1d !important; }
.dm-swal-toast.swal2-icon-error .swal2-timer-progress-bar { background: #dc2626 !important; }

/* Warning toast — deeper amber */
.dm-swal-toast.swal2-icon-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #ffe9a0 100%) !important;
    border-left: 5px solid #d97706 !important;
}
.dm-swal-toast.swal2-icon-warning .swal2-title { color: #713f12 !important; }
.dm-swal-toast.swal2-icon-warning .swal2-timer-progress-bar { background: #d97706 !important; }

/* Info toast — deeper blue */
.dm-swal-toast.swal2-icon-info {
    background: linear-gradient(135deg, #cffafe 0%, #a8e8f8 100%) !important;
    border-left: 5px solid #0891b2 !important;
}
.dm-swal-toast.swal2-icon-info .swal2-title { color: #164e63 !important; }
.dm-swal-toast.swal2-icon-info .swal2-timer-progress-bar { background: #0891b2 !important; }

/* Confirmation popup description text */
.dm-swal-popup .swal2-html-container {
    color: #64748b !important;
}

.dm-swal-popup .swal2-html-container strong {
    color: #1e293b !important;
}

/* ======================================
   Section 18: Organization Page
   ====================================== */

/* Content state */
.org-content {
    display: none;
}

.org-content.show {
    display: block;
}

/* Bootstrap 5 nav-tabs — themed overrides */
.nav-tabs {
    border-bottom: 2px solid var(--bs-gray-100);
    gap: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;
    color: var(--bs-body-color);
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.75rem 1.25rem;
    transition: color 0.15s ease, border-color 0.15s ease;
    background: none;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    color: var(--bs-body-color);
    border-bottom-color: var(--bs-gray-300);
    isolation: auto;
}

.nav-tabs .nav-link.active {
    color: var(--bs-primary);
    font-weight: 600;
    border-bottom-color: var(--bs-primary);
    background: none;
}

/* ── General Tab: Profile Card ─────────── */
.org-profile-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.org-profile-header {
    position: relative;
    padding-bottom: 85px;
}

.org-profile-gradient {
    height: 120px;
    background: linear-gradient(135deg, var(--bs-primary) 0%, #6366f1 100%);
    border-radius: 16px 16px 0 0;
}

.org-profile-logo {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 130px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 4px solid var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.org-profile-initial {
    color: var(--bs-primary);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.org-profile-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(12px - 4px);
}

/* Logo edit overlay — shown on profile logo in edit mode */
.org-logo-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    border-radius: calc(12px - 4px);
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.org-logo-edit-overlay:hover {
    background: rgba(0, 0, 0, 0.5);
}

.org-profile-logo.editable {
    cursor: pointer;
}

/* File text shown below logo in edit mode */
.org-logo-file-text {
    font-size: 0.8125rem;
    color: var(--bs-gray-500);
    margin-bottom: 4px;
}

.org-profile-body {
    padding: 12px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
}

.org-profile-name {
    font-weight: 800;
    color: var(--bs-body-color);
    margin-bottom: 0;
    font-size: 1.125rem;
}

.org-profile-id {
    font-size: 0.8125rem;
    color: var(--bs-tertiary-color);
    font-weight: 500;
    margin-top: 2px;
}

.org-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ── General Tab: Form Card ────────────── */
.org-form-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--bs-gray-100);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.org-form-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--bs-gray-200);
}

/* Equal height cards in General tab only */
#pane-general .org-form-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.org-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.org-form-header h5 {
    font-weight: 800;
    color: var(--bs-body-color);
    margin-bottom: 0;
    font-size: 1.125rem;
}

.org-form-body {
    padding: 1.25rem;
    flex: 1;
}

/* Form labels — dark and bold */
.org-form-body .form-label {
    color: var(--bs-body-color);
    font-weight: 700;
}

/* Logo upload (General tab) */
.org-logo-upload {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--bs-gray-300);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    background: var(--bs-gray-50);
}

.org-logo-upload:hover {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.org-logo-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.org-logo-placeholder {
    text-align: center;
    color: var(--bs-gray-400);
}

.org-logo-placeholder i {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 2px;
}

.org-logo-placeholder span {
    font-size: 0.8125rem;
}

.org-logo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 0.65rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.org-logo-upload:hover .org-logo-remove {
    display: flex;
}


/* Org form inputs */
.org-form-body .form-control,
.org-form-body .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--bs-border-color);
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.org-form-body .form-control:focus,
.org-form-body .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

/* Readonly fields — subtle gray fill like the reference design */
.org-form-body .form-control[readonly] {
    background: var(--bs-gray-50);
    border-color: var(--bs-gray-200);
    cursor: default;
    color: var(--bs-body-color);
    font-weight: 500;
}

.org-form-body .form-control[readonly]:focus {
    border-color: var(--bs-gray-200);
    box-shadow: none;
}

/* ── Connected Accounts Tab ────────────── */
.social-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: 1px solid var(--bs-gray-200);
    border-radius: 12px;
    background: var(--card-bg);
    transition: box-shadow 0.2s ease;
}

.social-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.social-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.social-row-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--bs-gray-100);
    color: var(--bs-gray-400);
}

.social-row-icon.connected {
    color: #fff;
}

.social-row-icon.linkedin-bg  { color: #0A66C2; }
.social-row-icon.facebook-bg  { color: #1877F2; }
.social-row-icon.instagram-bg { color: #E4405F; }
.social-row-icon.xtwitter-bg  { color: #000000; }

.social-row-icon.linkedin-bg.connected  { background: #0A66C2; color: #fff; }
.social-row-icon.facebook-bg.connected  { background: #1877F2; color: #fff; }
.social-row-icon.instagram-bg.connected { background: #E4405F; color: #fff; }
.social-row-icon.xtwitter-bg.connected  { background: #000000; color: #fff; }

.social-row-name {
    font-weight: 600;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
}

.social-row-url {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    display: block;
}

.social-row-url:hover {
    text-decoration: underline;
    color: var(--bs-primary);
}

.social-row-status {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}

.social-row-btn {
    white-space: nowrap;
}

/* ── Plans & Billing Tab ───────────────── */
.plan-current-badge {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.plan-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1.5px solid var(--bs-border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: all 0.2s ease;
}

.plan-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.plan-card--active {
    border: 2px dashed var(--bs-primary);
    box-shadow: none;
    padding-top: 2.25rem;
    overflow: visible;
}

.plan-card-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 20px;
    border-radius: 9999px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), 0.3);
}

.plan-card-header {
    margin-bottom: 1rem;
}

.plan-card-name {
    font-weight: 800;
    color: var(--bs-body-color);
    margin-bottom: 4px;
}

.plan-card-name--active {
    color: var(--bs-primary);
}

.plan-card-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--bs-body-color);
    line-height: 1.2;
}

.plan-card-price span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-tertiary-color);
}

.plan-card-desc {
    font-size: 0.875rem;
    color: var(--bs-tertiary-color);
    margin-bottom: 0;
    margin-top: 6px;
}

.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex: 1;
}

.plan-card-features li {
    padding: 5px 0;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-card-features li i {
    color: var(--bs-tertiary-color);
    font-size: 1rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.plan-card-features--active li i {
    color: var(--bs-primary);
}

/* "Pricing TBD" smaller text instead of dollar amount */
.plan-card-price--tbd {
    font-size: 1.75rem;
}

/* Excluded feature (red X) */
.plan-feature-excluded {
    color: #ef4444 !important;
}

.plan-feature-excluded i {
    color: #ef4444 !important;
}

/* Dark card — Enterprise / Custom */
.plan-card--dark {
    background: #0f172a;
    border-color: #1e293b;
    color: #f1f5f9;
}

.plan-card--dark:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.plan-card--dark .plan-card-name {
    color: var(--bs-primary);
}

.plan-card--dark .plan-card-price {
    color: #f1f5f9;
}

.plan-card--dark .plan-card-desc {
    color: #94a3b8;
}

.plan-card--dark .plan-card-features li {
    color: #cbd5e1;
}

.plan-card--dark .plan-card-features li i {
    color: var(--bs-primary);
}

.plan-card-btn {
    width: 100%;
}

/* ── Storage Tab ──────────────────────────── */
.storage-plan-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.storage-progress-track {
    width: 100%;
    height: 10px;
    background: var(--bs-gray-100);
    border-radius: 9999px;
    overflow: hidden;
}

.storage-progress-bar {
    height: 100%;
    background: var(--bs-primary);
    border-radius: 9999px;
    transition: width 0.6s ease;
}

/* Expandable project item wrapper */
.storage-project-item {
    border-bottom: 1px solid var(--bs-border-color);
}

.storage-project-item:last-child {
    border-bottom: none;
}

/* Storage by project rows */
.storage-project-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.storage-project-row:hover {
    background-color: var(--bs-gray-50);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Chevron icon for expand/collapse */
.storage-project-chevron {
    font-size: 1.15rem;
    color: var(--bs-gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.storage-project-item.expanded .storage-project-chevron {
    transform: rotate(90deg);
    color: var(--bs-primary);
}

.storage-project-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.storage-project-name {
    font-weight: 700;
    color: var(--bs-body-color);
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storage-project-meta {
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
    margin-top: 2px;
}

.storage-project-row:hover .storage-project-name {
    color: var(--bs-primary);
}

/* Expandable detail panel */
.storage-project-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    background: var(--bs-gray-50);
    padding: 0 1.25rem 0 3.25rem;
}

.storage-project-detail.open {
    max-height: 200px;
    padding: 0.75rem 1.25rem 1rem 3.25rem;
}

/* ── macOS-style segmented storage detail ──────────────── */

/* Segmented bar — uploaded vs processed (project-level) */
.sd-segmented-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bs-gray-200);
    margin-bottom: 0.75rem;
}

.sd-segment {
    height: 100%;
    min-width: 0;
    transition: width 0.3s ease;
}

.sd-segment--uploaded {
    background: var(--bs-primary);
    border-radius: 6px 0 0 6px;
}

.sd-segment--processed {
    background: #16a34a;
}

/* When uploaded is 0 and processed is first, round left */
.sd-segment--uploaded:first-child {
    border-radius: 6px 0 0 6px;
}

/* Legend — colored dots + label + size + time */
.sd-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sd-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.sd-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sd-legend-dot--uploaded {
    background: var(--bs-primary);
}

.sd-legend-dot--processed {
    background: #16a34a;
}

.sd-legend-dot--free {
    background: var(--bs-gray-200);
}

.sd-legend-label {
    color: var(--bs-body-color);
    font-weight: 500;
    min-width: 110px;
}

.sd-legend-size {
    font-weight: 600;
    color: var(--bs-body-color);
    min-width: 60px;
}

.sd-legend-time {
    color: var(--bs-secondary-color);
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.sd-legend-time i {
    font-size: 0.875rem;
}

.storage-project-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid;
    white-space: nowrap;
}

.storage-project-status.status-active {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(22, 163, 74, 0.05);
}

.storage-project-status.status-archived {
    color: var(--bs-gray-500);
    border-color: var(--bs-gray-200);
    background: var(--bs-gray-50);
}

.storage-project-status.status-processing {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.3);
    background: rgba(217, 119, 6, 0.05);
}

.storage-project-status.status-completed {
    color: var(--bs-primary);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    background: rgba(var(--bs-primary-rgb), 0.05);
}

.storage-project-bar {
    width: 100px;
    height: 6px;
    background: var(--bs-gray-100);
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
}

.storage-project-bar-fill {
    height: 100%;
    background: var(--bs-primary);
    border-radius: 9999px;
}

.storage-project-size {
    font-weight: 600;
    color: var(--bs-body-color);
    font-size: 0.875rem;
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* ── Team Members Tab ──────────────────── */
.member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background 0.2s ease;
}

.member-row:hover {
    background: var(--bs-gray-50);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.member-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.member-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.member-name {
    font-weight: 700;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
}

.member-email {
    font-size: 0.8125rem;
    color: var(--bs-tertiary-color);
    font-weight: 500;
}

.member-you-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 9999px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-size: 0.6875rem;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

.member-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-role-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid var(--bs-border-color);
    background: var(--card-bg);
    color: var(--bs-tertiary-color);
}

.member-role-badge.role-admin {
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.04);
}

.member-more-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--bs-tertiary-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.member-more-btn:hover {
    background: var(--bs-gray-100);
    color: var(--bs-gray-700);
}

/* ── Social brand colors (shared) ──────── */
.linkedin-color { color: #0A66C2; }
.facebook-color { color: #1877F2; }
.instagram-color { color: #E4405F; }
.twitter-color { color: #000000; }

/* ======================================
   Section 19: Users Page
   ====================================== */
.action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-gray-200);
    background: var(--card-bg);
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.action-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-icon.view:hover { color: var(--bs-primary); border-color: var(--bs-primary); background: rgba(var(--bs-primary-rgb), 0.06); }
.action-icon.edit:hover { color: #8B5CF6; border-color: #8B5CF6; background: rgba(139, 92, 246, 0.06); }
.action-icon.members:hover { color: #0891b2; border-color: #0891b2; background: rgba(8, 145, 178, 0.06); }
.action-icon.download:hover { color: #059669; border-color: #059669; background: rgba(5, 150, 105, 0.06); }

/* Action icon color variants — replace inline styles */
.action-icon-danger  { color: #ef4444; border-color: #fecaca; }
.action-icon-primary { color: var(--bs-primary); border-color: #bfdbfe; }
.action-icon-danger:hover  { background: #fef2f2; }
.action-icon-primary:hover { background: rgba(var(--bs-primary-rgb), 0.06); }

.detail-card {
    background: var(--bs-gray-50);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid var(--bs-gray-100);
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--bs-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 500;
    color: var(--bs-emphasis-color);
    margin-bottom: 0;
}

/* ── Dataset Details: back arrow ─────────────────────── */
.ds-back-arrow {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-gray-200);
    background: var(--card-bg);
    color: var(--bs-secondary-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ds-back-arrow:hover {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.06);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Upload Dataset modal: drop zone ─────────────────── */
.ds-upload-zone {
    border: 2px dashed var(--bs-primary);
    border-radius: 12px;
    padding: 24px 16px 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(var(--bs-primary-rgb), 0.02);
    transition: background 0.2s, border-color 0.2s;
}
.ds-upload-zone:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
}
.ds-upload-zone.dragover {
    background: rgba(var(--bs-primary-rgb), 0.08);
    border-color: var(--bs-primary);
}
.ds-ext-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.social-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bs-gray-100);
    color: var(--bs-gray-600);
    border: 1px solid var(--bs-gray-200);
}

.social-badge.google  { background: rgba(234, 67, 53, 0.08); color: #EA4335; border-color: rgba(234, 67, 53, 0.2); }
.social-badge.github  { background: rgba(36, 41, 46, 0.08); color: #24292e; border-color: rgba(36, 41, 46, 0.2); }
.social-badge.facebook { background: rgba(24, 119, 242, 0.08); color: #1877F2; border-color: rgba(24, 119, 242, 0.2); }
.social-badge.apple   { background: rgba(0, 0, 0, 0.06); color: #000; border-color: rgba(0, 0, 0, 0.15); }

.danger-zone {
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 1rem;
    background: #fef2f2;
}

.danger-zone-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* Invite modal — photo upload circle */
.dm-invite-photo-upload {
    width: 100px;
    height: 100px;
    border: 2px dashed var(--bs-gray-300);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.dm-invite-photo-upload:hover {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.04);
}
.dm-invite-photo-upload i {
    font-size: 32px;
    color: var(--bs-gray-400);
}
.dm-invite-photo-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-gray-200);
    cursor: pointer;
}

/* Project permission rows in invite modal */
.project-permission-row {
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-100);
    transition: background 0.2s ease;
}
.project-permission-row:hover {
    background: var(--bs-gray-100) !important;
}
.project-permission-row .remove-project-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.project-permission-row .remove-project-btn:hover {
    background: #fef2f2;
}

/* Tom Select overrides for modal context */
.modal .ts-wrapper .ts-control {
    background-color: var(--bs-gray-50);
    border-color: var(--bs-gray-200);
    color: var(--bs-gray-900);
}
.modal .ts-wrapper .ts-dropdown {
    background-color: #fff;
    border-color: var(--bs-gray-200);
    color: var(--bs-gray-900);
}

/* ─────────────────────────────────────────────────────────
   Section 19b: Users Page — Redesigned
   ───────────────────────────────────────────────────────── */

/* Invite User button */
/* .dm-btn-invite removed — now uses shared .dm-btn-action */

.dm-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--bs-gray-100);
    color: var(--bs-secondary-color);
    margin-left: 6px;
}

.nav-tabs .nav-link.active .dm-tab-count {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.dm-tab-count--warn {
    background: #fef3c7;
    color: #d97706;
}

/* Panel wrapper */
.dm-users-panel {
    border: 1px solid var(--bs-gray-100);
    border-radius: 16px;
    background: var(--card-bg);
    overflow: hidden;
}

/* Search & filter toolbar */
.dm-users-toolbar {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-gray-100);
}

.dm-users-search {
    position: relative;
}

.dm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-gray-400);
    font-size: 1.1rem;
    pointer-events: none;
}

.dm-search-input {
    padding-left: 40px !important;
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    height: 42px;
    background: var(--card-bg);
}

.dm-search-input::placeholder {
    color: var(--bs-gray-400);
}

.dm-search-input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

.dm-filter-select {
    width: auto;
    min-width: 140px;
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    height: 42px;
    color: var(--bs-body-color);
    font-weight: 500;
}

.dm-filter-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

/* Table — clean rows */
.dm-users-table {
    margin-bottom: 0;
}

.dm-users-table thead th {
    background: transparent !important;
    border-top: none !important;
    border-bottom: 1px solid var(--bs-gray-100) !important;
    border-right: none;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    text-transform: capitalize;
}

/* Clean rows */
.dm-users-table tbody tr.dm-user-row {
    background: var(--card-bg);
    transition: background-color 0.15s ease;
}

.dm-users-table tbody tr.dm-user-row:hover {
    background: var(--bs-gray-50);
}

.dm-users-table tbody tr.dm-user-row td {
    border: none !important;
    border-bottom: 1px solid var(--bs-gray-100) !important;
    padding: 1rem;
    vertical-align: middle;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--bs-body-color);
}

/* Avatar */
.dm-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.dm-user-avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

/* User cell text */
.dm-user-name {
    font-weight: 600;
    color: var(--bs-body-color);
    font-size: 0.9375rem;
    line-height: 1.3;
}

.dm-user-email {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    line-height: 1.3;
}

/* Role badge — colored by type */
.dm-role-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid;
}

.dm-role-badge--admin {
    color: var(--bs-primary);
    border-color: rgba(var(--bs-primary-rgb), 0.3);
    background: rgba(var(--bs-primary-rgb), 0.06);
}

.dm-role-badge--user {
    color: var(--bs-gray-600);
    border-color: var(--bs-gray-200);
    background: var(--bs-gray-50);
}

/* Status badge — pill style */
.dm-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid;
}

.dm-status-badge--active {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(22, 163, 74, 0.06);
}

.dm-status-badge--inactive {
    color: var(--bs-gray-500);
    border-color: var(--bs-gray-200);
    background: var(--bs-gray-50);
}
.dm-status-badge--pending {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.3);
    background: rgba(217, 119, 6, 0.06);
}

/* Storage Usage cell */
.dm-storage-cell {
    min-width: 120px;
}

.dm-storage-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
    margin-bottom: 4px;
}

.dm-storage-total {
    color: var(--bs-secondary-color);
    margin-left: 8px;
}

.dm-storage-track {
    width: 100%;
    height: 5px;
    background: var(--bs-gray-100);
    border-radius: 9999px;
    overflow: hidden;
}

.dm-storage-track .dm-storage-bar {
    height: 100%;
    background: var(--bs-primary);
    border-radius: 9999px;
    min-width: 2px;
    transition: width 0.4s ease;
}

/* Last Active */
.dm-last-active {
    font-size: 0.875rem;
    color: var(--bs-body-color);
    font-weight: 500;
}

/* DataTable controls within panel */
.dm-users-panel .dataTables_length,
.dm-users-panel .dataTables_filter {
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.dm-users-panel .dataTables_filter input {
    border: 1px solid var(--bs-gray-200);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.875rem;
    color: var(--bs-gray-700);
    margin-left: 6px;
}

.dm-users-panel .dataTables_filter input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
    outline: none;
}

/* Bottom bar */
.dm-users-dt-bottom {
    font-size: 0.875rem;
    color: var(--bs-gray-500);
    padding: 0 1rem 0.75rem;
}

.dm-users-dt-bottom .dataTables_length select {
    margin: 0 6px;
    padding: 4px 24px 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--bs-gray-200);
    background-color: #fff;
    color: var(--bs-gray-700);
    font-size: 0.875rem;
    min-width: 60px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px;
}

/* Override DataTable stripe shadow for card rows */
.dm-users-table.table > tbody > tr > * {
    box-shadow: none !important;
}

/* Responsive toolbar */
@media (max-width: 768px) {
    .dm-users-toolbar { flex-wrap: wrap; }
    .dm-users-toolbar .dm-users-search {
        max-width: 100% !important;
        flex-basis: 100%;
    }
    .dm-filter-select {
        min-width: 100px;
        flex: 1;
    }

    /* Tabs responsive */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }
    .org-form-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .member-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .member-meta {
        margin-left: 50px;
    }
}

/* ─────────────────────────────────────────────────────────
   Section 20: Project Member Rows
   ───────────────────────────────────────────────────────── */
.dm-member-row {
    transition: background 0.2s ease;
    border-radius: 10px;
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-100);
}
.dm-member-row:hover {
    background: var(--bs-gray-100) !important;
}
.dm-member-row .dm-remove-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}
.dm-member-row:hover .dm-remove-btn {
    opacity: 1;
}
.dm-member-row .dm-perm-select {
    border-color: var(--bs-gray-200);
    background-color: #fff;
    transition: border-color 0.2s ease;
}
.dm-member-row .dm-perm-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

/* Members datatable header — separators & color */
#tblMembers thead th {
    border-right: 1px solid var(--bs-gray-200);
    color: var(--bs-gray-500);
    font-weight: 500;
    transition: color 0.2s ease;
}
#tblMembers thead th:last-child {
    border-right: none;
}
#tblMembers thead th:hover {
    color: var(--bs-gray-700);
}

/* ─────────────────────────────────────────────────────────
   Section 21: Project Detail Page
   ───────────────────────────────────────────────────────── */

/* Breadcrumb */
.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
}
.breadcrumb-item a:hover {
    color: #2B7DE9;
    text-decoration: underline;
}
.breadcrumb-item.active {
    color: var(--bs-gray-500);
}

/* Tab styling for project detail tabs — inherits pill-outline from .nav-tabs */

/* Stat cards hover in overview */
#overview-panel .detail-card {
    transition: box-shadow 0.2s ease;
}
#overview-panel .detail-card:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Edit field button in detail cards */
.edit-field-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
    text-decoration: none !important;
}
.detail-card:hover .edit-field-btn,
#overviewName:hover ~ .edit-field-btn,
.edit-field-btn.edit-name-btn {
    opacity: 1;
}
.edit-field-btn:hover {
    color: var(--bs-primary) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   §23 — Project Hub (Home page)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Project Hub page */

/* ── Header right controls ──────────────────────────── */
.ph-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Search */
.ph-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    padding: 0 16px;
    height: 44px;
    width: 240px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ph-search-wrap:focus-within {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.ph-search-icon {
    color: #9CA3AF;
    font-size: 15px;
    flex-shrink: 0;
}
.ph-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13.5px;
    color: #374151;
    width: 100%;
}
.ph-search-input::placeholder { color: #B0B7C3; }

/* View toggle */
.ph-view-toggle {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    height: 44px;
}
.ph-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0 13px;
    cursor: pointer;
    color: #9CA3AF;
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.ph-view-btn:hover  { background: #F3F4F6; color: #374151; }
.ph-view-btn.active { background: #EFF2FF; color: var(--bs-primary); }


/* ── Grid ───────────────────────────────────────────── */
.ph-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 1100px) { .ph-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .ph-grid { grid-template-columns: 1fr; } }

/* ── Card ───────────────────────────────────────────── */
.ph-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
}
.ph-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* Hero area */
.ph-card-hero {
    position: relative;
    height: 160px;
    background: #EBF0F9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ph-illustration {
    width: 64%;
    max-width: 200px;
    display: block;
}

/* Hero top row (status + visibility left, count right) */
.ph-hero-left {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

/* Status badge */
.ph-status-badge {
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.ph-s-active     { background: #DBEAFE; color: #1D4ED8; }
.ph-s-completed  { background: #D1FAE5; color: #059669; }
.ph-s-processing { background: #FEF3C7; color: #D97706; }
.ph-s-archived   { background: #F3F4F6; color: #6B7280; }

/* Visibility badge (Public / Private) */
.ph-vis-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1px solid;
    background: #fff;
}
.ph-vis-badge i { font-size: 12px; }
.ph-vis-public {
    color: #059669;
    border-color: #A7F3D0;
}
.ph-vis-private {
    color: #6B7280;
    border-color: #D1D5DB;
}

/* Count badge (top-right of hero) */
.ph-count-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bs-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    z-index: 1;
}
.ph-count-badge i { font-size: 13px; }

/* Card body */
.ph-card-body { padding: 15px 16px 16px; }

/* Title row */
.ph-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}
.ph-card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Three-dot menu */
.ph-menu-wrap {
    position: relative;
    flex-shrink: 0;
}
.ph-menu-btn {
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    line-height: 1;
}
.ph-card:hover .ph-menu-btn,
.ph-dropdown.open ~ .ph-menu-btn,
.ph-menu-wrap:hover .ph-menu-btn { opacity: 1; }
.ph-menu-btn:hover { background: #F3F4F6; color: #374151; }

/* Dropdown */
.ph-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
}
.ph-dropdown.open { display: block; }
.ph-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}
.ph-dd-item:hover { background: #F9FAFB; color: var(--bs-primary); }
.ph-dd-item i { font-size: 15px; }

/* Description */
.ph-card-desc {
    font-size: 12.5px;
    color: #6B7280;
    line-height: 1.55;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta footer */
.ph-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #F3F4F6;
    padding-top: 10px;
    font-size: 12px;
    color: #9CA3AF;
}
.ph-meta-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ph-meta-left span {
    display: flex;
    align-items: center;
    gap: 5px;
}
.ph-card-meta i { font-size: 13px; }

/* Data type badge (footer right) */
.ph-type-badge {
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid;
    white-space: nowrap;
}
.ph-t-lidar          { color: #2563EB; border-color: #BFDBFE; background: #EFF6FF; }
.ph-t-photogrammetry { color: #DC2626; border-color: #FECACA; background: #FEF2F2; }
.ph-t-pointcloud     { color: #7C3AED; border-color: #DDD6FE; background: #F5F3FF; }
.ph-t-elevation      { color: #059669; border-color: #A7F3D0; background: #ECFDF5; }
.ph-t-thermal        { color: #D97706; border-color: #FDE68A; background: #FFFBEB; }

/* Inline visibility badge: hidden in grid view, shown in list view */
.ph-vis-inline { display: none; }

/* ── List view ───────────────────────────────────────── */
.ph-grid.ph-list { grid-template-columns: 1fr; gap: 12px; }
.ph-grid.ph-list .ph-card { display: flex; flex-direction: row; }
.ph-grid.ph-list .ph-card-hero {
    width: 160px;
    height: auto;
    min-height: 120px;
    flex-shrink: 0;
    border-radius: 0;
}
/* Hide hero visibility badge in list view, show inline one instead */
.ph-grid.ph-list .ph-hero-left .ph-vis-badge { display: none; }
.ph-grid.ph-list .ph-vis-inline { display: inline-flex; flex-shrink: 0; margin-left: auto; }
/* Card body: flex column so meta sticks to bottom */
.ph-grid.ph-list .ph-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
}
.ph-grid.ph-list .ph-card-title-row {
    justify-content: flex-start;
}
.ph-grid.ph-list .ph-card-desc {
    margin-bottom: 0;
}
.ph-grid.ph-list .ph-card-meta {
    margin-top: auto;
}
/* Align type badge right edge with visibility badge above */
.ph-grid.ph-list .ph-type-badge {
    margin-left: auto;
}

/* ── Empty state ─────────────────────────────────────── */
.ph-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 20px;
    color: #9CA3AF;
    font-size: 14px;
}
.ph-empty i { font-size: 20px; }

/* ── Mobile header wrap ──────────────────────────────── */
@media (max-width: 768px) {
    .ph-header-right { width: 100%; flex-wrap: wrap; }
    .ph-search-wrap { flex: 1; min-width: 160px; }
    .ph-header-right .dm-btn-action { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   §24 — Projects Table View
   ═══════════════════════════════════════════════════════════════════════════ */

/* Page wrapper — white bg, consistent with sidebar */
.pj-page {
    background: #ffffff;
    min-height: 100%;
    margin: -24px -32px -24px -32px;
    padding: 32px 36px;
    box-sizing: border-box;
}
.pj-page .container-fluid { padding: 0 !important; }


/* ── Search input width override for Projects page ── */
.pj-page .dm-proj-search { max-width: 280px; }

/* ── Table wrapper ────────────────────────────────── */
.pj-table-wrap {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #F0F2F5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* ── Table ────────────────────────────────────────── */
.pj-table {
    width: 100%;
    border-collapse: collapse;
}

/* Header row */
.pj-table thead tr {
    border-bottom: 1px solid #F0F2F5;
}
.pj-table thead th {
    padding: 13px 18px;
    font-size: 11px;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    background: #fff;
}
.pj-th-actions { text-align: right; }

/* Body rows */
.pj-table tbody tr {
    border-bottom: 1px solid #F9FAFB;
    transition: background 0.15s;
    cursor: default;
}
.pj-table tbody tr:last-child { border-bottom: none; }
.pj-table tbody tr:hover      { background: #FAFBFD; }

/* Cells */
.pj-table td {
    padding: 15px 18px;
    vertical-align: middle;
}

/* PROJECT cell */
.pj-proj-name {
    font-size: 14.5px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}
.pj-proj-desc {
    font-size: 12px;
    color: #9CA3AF;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* PROJECT link (blue clickable name) */
.pj-proj-link {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--bs-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 300px;
    transition: color 0.15s;
}
.pj-proj-link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Generic text cell */
.pj-col-text {
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

/* Processing state */
.pj-processing {
    font-size: 13px;
    color: #9CA3AF;
    font-style: italic;
}

/* ── Member avatar group ──────────────────────────── */
.pj-avatar-group {
    display: flex;
    align-items: center;
    /* Stack avatars left-to-right with later ones on top */
    direction: ltr;
}
/* Each avatar circle */
.pj-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    /* White ring is the ONLY separator — no outline, no box-shadow (both cause blur on white bg) */
    border: 2px solid #ffffff;
    margin-left: -7px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.pj-avatar:first-child { margin-left: 0; }
/* Each subsequent avatar stacks above the previous */
.pj-avatar:nth-child(2) { z-index: 2; }
.pj-avatar:nth-child(3) { z-index: 3; }
/* +N overflow badge — same size and border as avatars for visual consistency */
.pj-avatar-more {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    margin-left: -7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #4B5563;
    background: #E5E7EB;
    flex-shrink: 0;
    z-index: 4;
    position: relative;
}
.pj-no-members {
    color: #D1D5DB;
    font-size: 14px;
}

/* ── Action buttons ───────────────────────────────── */
.pj-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: flex-end;
}
.pj-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #C4CAD4;
    font-size: 15px;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
}
.pj-action-btn:hover              { background: #F3F4F6; color: #374151; }
.pj-action-btn.pj-action-delete   { color: #FDA4A4; }
.pj-action-btn.pj-action-delete:hover { background: #FEE2E2; color: #DC2626; }
/* Disabled state — mock rows: all icons visible but dimmed, non-interactive */
.pj-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1100px) {
    .pj-proj-name, .pj-proj-desc { max-width: 220px; }
}
@media (max-width: 900px) {
    /* Table scrolls horizontally on medium screens */
    .pj-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pj-table { min-width: 700px; }
    .pj-proj-name, .pj-proj-desc { max-width: 160px; }
    /* Hide less critical columns on tablet */
    .pj-table thead th:nth-child(3),
    .pj-table tbody td:nth-child(3) { display: none; } /* SIZE */
}
@media (max-width: 768px) {
    .pj-page { padding: 20px 16px; margin: -16px; }
    .pj-page .container-fluid { padding: 0 !important; }
    .pj-page .dm-proj-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pj-page .dm-proj-header-right { width: 100%; flex-wrap: wrap; gap: 8px; }
    .pj-page .dm-proj-search { flex: 1; min-width: 140px; max-width: 100%; }
    /* Hide DATA TYPE on mobile */
    .pj-table thead th:nth-child(2),
    .pj-table tbody td:nth-child(2) { display: none; }
    /* Hide PROCESSED DATA on mobile */
    .pj-table thead th:nth-child(4),
    .pj-table tbody td:nth-child(4) { display: none; }
}

/* ═══════════════════════════════════════════════════════
   Section 22 · Unified DataTable Card System (dm-dt-*)
   Reusable card + table + pagination pattern for all
   DataTable pages.
   ═══════════════════════════════════════════════════════ */

/* ── Card Container ─────────────────────────────────── */
.dm-dt-card {
    background: var(--card-bg);
    border: 1px solid var(--bs-gray-200);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* ── Card Header ────────────────────────────────────── */
.dm-dt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--bs-gray-100);
}
.dm-dt-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.dm-dt-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.dm-dt-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ── Toolbar (search + filters) ─────────────────────── */
.dm-dt-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--bs-gray-100);
}
.dm-dt-search {
    position: relative;
    flex: 1;
    max-width: 340px;
}
.dm-dt-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-gray-400);
    font-size: 1.1rem;
    pointer-events: none;
}
.dm-dt-search-input {
    width: 100%;
    padding: 8px 14px 8px 40px;
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--bs-body-color);
    background: var(--card-bg);
    height: 40px;
    font-family: var(--bs-body-font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dm-dt-search-input::placeholder { color: var(--bs-gray-400); }
.dm-dt-search-input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}
.dm-dt-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--bs-body-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    height: 40px;
    transition: all 0.15s;
}
.dm-dt-filter-btn:hover {
    border-color: var(--bs-gray-300);
    background: var(--bs-gray-50);
}

/* ── Toolbar title + right group ──────────────────────── */
.dm-dt-toolbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bs-emphasis-color);
    margin: 0;
    white-space: nowrap;
}
.dm-dt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ── Bulk delete button ──────────────────────────────── */
.dm-dt-bulk-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid #FECACA;
    border-radius: 9999px;
    background: #FEE2E2;
    color: #DC2626;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.dm-dt-bulk-delete:hover {
    background: #FECACA;
    border-color: #FCA5A5;
}
.dm-dt-bulk-delete i {
    font-size: 1rem;
}

/* ── Custom checkbox ─────────────────────────────────── */
.dm-dt-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--bs-gray-300);
    cursor: pointer;
    accent-color: var(--bs-primary);
}

/* ── Filter dropdown (icon + select) ─────────────────── */
.dm-dt-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.dm-dt-filter-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-gray-400);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}
.dm-dt-filter-select {
    padding: 8px 32px 8px 34px;
    border: 1px solid var(--bs-gray-200);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--bs-body-color);
    font-size: 0.875rem;
    font-weight: 500;
    height: 40px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    transition: border-color 0.15s;
}
.dm-dt-filter-select:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

/* ── Table ───────────────────────────────────────────── */
.dm-dt-table {
    width: 100% !important;
    margin-bottom: 0;
    border-collapse: collapse;
    table-layout: fixed;
}
.dm-dt-table thead th {
    background: var(--bs-gray-50) !important;
    border-top: none !important;
    border-bottom: 1px solid var(--bs-gray-200) !important;
    border-right: none;
    color: var(--bs-secondary-color);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 13px 24px;
    white-space: nowrap;
}
/* Sort cursor for DataTable columns */
.dm-dt-table thead th.sorting,
.dm-dt-table thead th.sorting_asc,
.dm-dt-table thead th.sorting_desc {
    cursor: pointer;
}
.dm-dt-table tbody tr {
    background: var(--card-bg);
    transition: background-color 0.15s ease;
}
.dm-dt-table tbody tr:hover {
    background: var(--bs-gray-50);
}
.dm-dt-table tbody td {
    border: none !important;
    border-bottom: 1px solid var(--bs-gray-100) !important;
    padding: 14px 24px;
    vertical-align: middle;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--bs-body-color);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dm-dt-table tbody tr:last-child td {
    border-bottom: none !important;
}
.dm-dt-table.table > tbody > tr > * {
    box-shadow: none !important;
}


/* ── Pagination Footer (3-column) ────────────────────── */
.dm-dt-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid var(--bs-gray-200);
    font-size: 13px;
    color: var(--bs-secondary-color);
    background: var(--bs-gray-50);
}

/* Left: total records — "Total Projects: 300" */
.dm-dt-footer-total {
    font-weight: 500;
    white-space: nowrap;
    flex: 0 0 auto;
}
.dm-dt-footer-total strong {
    color: var(--bs-body-color);
    font-weight: 700;
}

/* Center: page numbers — < 1 [2] 3 4 5 > */
.dm-dt-footer-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.dm-dt-footer-pages .dataTables_paginate {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 4px;
}
/* All page buttons (numbers + prev/next arrows) */
.dm-dt-footer-pages .paginate_button {
    min-width: 30px;
    height: 30px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--bs-secondary-color) !important;
    border: 1px solid var(--bs-gray-200) !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 6px !important;
    transition: all 0.15s !important;
    line-height: 1 !important;
    cursor: pointer;
}
/* Prev / Next arrow buttons */
.dm-dt-footer-pages .paginate_button.previous,
.dm-dt-footer-pages .paginate_button.next {
    border: 1px solid transparent !important;
    background: transparent !important;
    font-size: 16px !important;
    color: var(--bs-secondary-color) !important;
    min-width: 28px;
}
.dm-dt-footer-pages .paginate_button.previous:hover:not(.disabled),
.dm-dt-footer-pages .paginate_button.next:hover:not(.disabled) {
    color: var(--bs-body-color) !important;
    background: var(--bs-gray-100) !important;
}
/* Hover on number buttons */
.dm-dt-footer-pages .paginate_button:hover:not(.disabled):not(.current):not(.previous):not(.next) {
    background: var(--bs-gray-100) !important;
    color: var(--bs-body-color) !important;
    border-color: var(--bs-gray-300) !important;
}
/* Active / current page */
.dm-dt-footer-pages .paginate_button.current,
.dm-dt-footer-pages .paginate_button.current:hover {
    background: var(--bs-primary) !important;
    color: #fff !important;
    border-color: var(--bs-primary) !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(var(--bs-primary-rgb), 0.3);
}
/* Disabled prev/next */
.dm-dt-footer-pages .paginate_button.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Right: rows per page — "Show per Page: [5 v]" */
.dm-dt-footer-length {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex: 0 0 auto;
    white-space: nowrap;
}
.dm-dt-footer-length label {
    margin: 0;
    font-weight: 500;
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.dm-dt-footer-length select {
    padding: 4px 28px 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--bs-gray-200);
    background-color: #fff;
    color: var(--bs-gray-700);
    font-size: 13px;
    min-width: 52px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .dm-dt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }
    .dm-dt-header-right {
        width: 100%;
    }
    .dm-dt-header-right .dm-btn-action {
        width: 100%;
        justify-content: center;
    }
    .dm-dt-toolbar {
        flex-wrap: wrap;
        padding: 12px 18px;
    }
    .dm-dt-search {
        max-width: 100%;
        flex-basis: 100%;
    }
    .dm-dt-toolbar-right {
        flex-wrap: wrap;
        width: 100%;
    }
    .dm-dt-filter-wrap {
        flex: 1;
    }
    .dm-dt-filter-select {
        width: 100%;
    }
    .dm-dt-table thead th,
    .dm-dt-table tbody td {
        padding-left: 16px;
        padding-right: 16px;
    }
    .dm-dt-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        padding: 14px 18px;
    }
    .dm-dt-footer-total,
    .dm-dt-footer-pages,
    .dm-dt-footer-length {
        justify-content: center;
        flex: unset;
    }
}

/* Hide less-critical columns on smaller screens (Projects) */
@media (max-width: 1100px) {
    .dm-dt-table .pj-proj-name,
    .dm-dt-table .pj-proj-desc { max-width: 220px; }
    .dm-dt-table .pj-proj-link { max-width: 220px; }
}
@media (max-width: 900px) {
    .dm-dt-card { overflow-x: auto; }
    .dm-dt-table .pj-proj-name,
    .dm-dt-table .pj-proj-desc { max-width: 160px; }
    .dm-dt-table .pj-proj-link { max-width: 160px; }
    /* Hide checkbox column + bulk delete on small screens */
    .dm-dt-table thead th:first-child,
    .dm-dt-table tbody td:first-child { display: none; }
    .dm-dt-bulk-delete { display: none !important; }
}

/* ── Dataset Library table: allow header wrapping ───── */
#tblDatasets thead th {
    white-space: normal;
    line-height: 1.4;
    vertical-align: middle;
}

/* ── Responsive: stat cards stack on mobile ─────────── */
@media (max-width: 768px) {
    #statCards { flex-direction: column; }
}
