/* Family Safe Vault design system. Presentation only; existing DOM contracts remain intact. */
:root {
    --bg: #FFFFFF;
    --bg-soft: #F5F7FB;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --text: #0F172A;
    --text-muted: #475569;
    --primary: #1D4ED8;
    --primary-hover: #1E40AF;
    --accent: #0F766E;
    --warning: #B45309;
    --danger: #B91C1C;
    --success: #15803D;
    --dark-bg: #0B1220;
    --dark-text: #E2E8F0;

    /* Compatibility aliases: keep all existing component and script variable names. */
    --bg-main: var(--bg-soft);
    --bg-surface: var(--surface);
    --bg-surface-dark: var(--bg-soft);
    --bg-secondary: var(--bg-soft);
    --bg-glass: var(--surface);
    --bg-color: var(--bg);
    --text-color: var(--text);
    --text-primary: var(--text);
    --text-secondary: var(--text-muted);
    --text-light: var(--text-muted);
    --primary-color: var(--primary);
    --text-warning: var(--warning);
    --border-color: var(--border);
    --border-color-glow: color-mix(in srgb, var(--primary) 35%, transparent);
    --primary-glow: color-mix(in srgb, var(--primary) 10%, transparent);
    --success-glow: color-mix(in srgb, var(--success) 8%, transparent);
    --warning-glow: color-mix(in srgb, var(--warning) 8%, transparent);
    --danger-glow: color-mix(in srgb, var(--danger) 8%, transparent);
    --sidebar-width: 260px;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --transition-speed: 150ms;
    --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Existing component geometry retained below. */



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

body {
    background-color: var(--bg-main);
    background-image: none;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism base helper */
.glass {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 color-mix(in srgb, var(--text) 8%, transparent);
}

.glass-dark {
    background: var(--bg-surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow var(--transition-speed) ease,
                border-color var(--transition-speed) ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: 0 12px 40px 0 color-mix(in srgb, var(--text) 8%, transparent);
}

/* Buttons */
.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    gap: 8px;
    justify-content: center;
    padding: 10px 20px;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background: var(--surface);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--text) 8%, transparent);
    color: var(--text);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px color-mix(in srgb, var(--text) 8%, transparent);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--bg-soft);
    border-color: var(--text-secondary);
}

.btn-danger-hover:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-glow);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: color var(--transition-speed) ease;
}
.btn-close:hover {
    color: var(--danger);
}

/* Form Styles */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    color: var(--text-secondary);
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input, 
.form-group textarea {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    padding: 12px 14px;
    transition: all var(--transition-speed) ease;
    width: 100%;
}
.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    outline: none;
}

/* Universal Light Blue Styling for all Drop Down Pick Lists (Select & Options) */
select, 
.form-group select, 
.vault-item-modal .modal-body select, 
.q-select,
select:focus, 
.form-group select:focus, 
.vault-item-modal .modal-body select:focus {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    color: var(--primary) !important;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)) !important;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 14px;
    transition: all var(--transition-speed) ease;
    width: 100%;
    outline: none;
}

select:focus,
.form-group select:focus,
.vault-item-modal .modal-body select:focus {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 8%, transparent) !important;
}

select option,
select optgroup,
.q-select option,
.form-group select option,
.vault-item-modal .modal-body select option {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    color: var(--primary) !important;
    font-weight: 500;
}

select option:checked,
select option:hover,
select option:focus {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    color: var(--primary) !important;
}

select:disabled, 
select[disabled],
.form-group select:disabled, 
.vault-item-modal .modal-body select:disabled {
    background: var(--surface) !important;
    background-color: var(--surface) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
    cursor: not-allowed !important;
    opacity: 0.95 !important;
}

.form-row {
    display: flex;
    gap: 15px;
}
.flex-1 {
    flex: 1;
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}
.password-input-wrapper input {
    padding-right: 48px;
}
.toggle-password {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    height: 100%;
    position: absolute;
    right: 0;
    top: 0;
    transition: color var(--transition-speed) ease;
    width: 44px;
}
.toggle-password:hover {
    color: var(--text-primary);
}

.btn-inside {
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    height: 38px;
    padding: 0 12px;
    position: absolute;
    right: 5px;
    top: 5px;
    transition: all var(--transition-speed) ease;
}
.btn-inside:hover {
    background: var(--primary);
}

/* Helpers */
.hidden {
    display: none !important;
}

/* TOAST NOTIFICATIONS */
.toast {
    align-items: center;
    border-left: 4px solid var(--primary);
    bottom: 24px;
    display: flex;
    gap: 12px;
    max-width: 380px;
    padding: 16px 20px;
    position: fixed;
    right: 24px;
    transition: transform 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 150ms ease;
    z-index: 10000000;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 40px color-mix(in srgb, var(--text) 8%, transparent);
    border: 1px solid var(--border-color);
}
.toast.hidden {
    opacity: 0;
    transform: translateY(100px);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger { border-left-color: var(--danger); }

/* AUTHENTICATION VIEW */
.auth-container {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    max-width: 440px;
    padding: 40px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.logo-icon {
    background: var(--surface);
    border-radius: 50%;
    box-shadow: 0 0 30px color-mix(in srgb, var(--text) 8%, transparent);
    color: var(--text);
    display: inline-block;
    font-size: 2.2rem;
    height: 70px;
    line-height: 70px;
    margin-bottom: 16px;
    text-align: center;
    width: 70px;
}
.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}
.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 24px;
    text-align: center;
}
.auth-footer a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
.auth-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.security-warning {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    padding: 14px;
}
.security-warning i {
    color: var(--warning);
    font-size: 1.2rem;
    margin-top: 2px;
}
.security-warning p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Password strength in register */
.password-strength-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.strength-bar {
    background: var(--border-color);
    border-radius: 2px;
    height: 4px;
    position: relative;
    transition: all var(--transition-speed) ease;
    width: 60%;
}
.strength-bar::after {
    content: '';
    border-radius: 2px;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    transition: all var(--transition-speed) ease;
    width: 0;
}
.strength-bar.weak::after { background: var(--danger); width: 33%; }
.strength-bar.medium::after { background: var(--warning); width: 66%; }
.strength-bar.strong::after { background: var(--success); width: 100%; }

.strength-text {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
}

/* APP LAYOUT */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    border-radius: 0;
    border-bottom: none;
    border-left: none;
    border-top: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    left: 0;
    position: fixed;
    top: 0;
    width: var(--sidebar-width);
    z-index: 100;
}

.sidebar-brand {
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    min-height: 180px;
    padding: 16px 12px;
}
.brand-logo {
    max-height: 180px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px var(--text));
    transition: transform 150ms ease;
}
.brand-logo:hover {
    transform: scale(1.03);
}
.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-nav ul {
    list-style: none;
}
.nav-item {
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
    transition: all var(--transition-speed) ease;
    position: relative;
}
.nav-item a {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.95rem;
    font-weight: 500;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
}
.nav-item i {
    font-size: 1.1rem;
    width: 20px;
}
.nav-item:hover, .nav-item.active {
    background: var(--bg-soft);
}
.nav-item:hover a, .nav-item.active a {
    color: var(--text-primary);
}
.nav-item.active::before {
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    content: '';
    height: 60%;
    left: 0;
    position: absolute;
    top: 20%;
    width: 4px;
}

/* Dynamic Expandable Vertical Navigational Menu Bar */
.sidebar-folder-tree {
    list-style: none !important;
    padding: 2px 0 6px 8px !important;
    margin: 0 0 6px 12px !important;
    border-left: 2px solid var(--border);
    transition: all 150ms ease;
}
.sidebar-folder-item {
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    padding: 7px 10px;
    margin: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.86rem;
    transition: all var(--transition-speed) ease;
}
.sidebar-folder-item:hover {
    background: var(--bg-soft);
    color: var(--text);
    transform: translateX(3px);
}
.sidebar-folder-item.active {
    background: var(--bg-soft);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 2px 6px color-mix(in srgb, var(--text) 8%, transparent);
}
.sidebar-sub-item {
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    padding: 5px 10px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: all var(--transition-speed) ease;
}
.sidebar-sub-item:hover {
    background: var(--bg-soft);
    color: var(--text-secondary);
}
.sidebar-sub-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    font-weight: 600;
}
.cat-expander-icon {
    margin-left: auto;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: all 150ms ease;
}
.cat-expander-icon:hover {
    background: var(--bg-soft);
    transform: scale(1.05);
}

.badge {
    background: var(--primary);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
}
.badge-warning { background: var(--warning); color: var(--text); }
#audit-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-footer {
    align-items: center;
    border-top: 1px solid var(--border-color);
    display: flex;
    height: 80px;
    justify-content: space-between;
    padding: 0 24px;
}
.user-profile {
    align-items: center;
    display: flex;
    gap: 12px;
}
.user-avatar {
    align-items: center;
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
    display: flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.user-details {
    display: flex;
    flex-direction: column;
}
.user-details .username {
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-details .status {
    align-items: center;
    color: var(--success);
    display: flex;
    font-size: 0.75rem;
    gap: 4px;
}
.status-dot {
    font-size: 0.4rem;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color var(--transition-speed) ease;
}
.btn-logout:hover {
    color: var(--danger);
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 20px;
}
.top-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-soft);
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    overflow-x: auto;
}
.top-nav-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 150ms ease;
    white-space: nowrap;
}
.top-nav-link:not(.active):hover {
    color: var(--text);
    background: var(--bg-soft);
}
.top-nav-link.active,
.top-nav-link.active:hover,
.top-nav-link.active:focus {
    color: var(--text);
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary-glow);
    font-weight: 600;
}

/* 3D ICON SYSTEM */
.nav-3d-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text) !important;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent);
    transition: transform 150ms ease, box-shadow 150ms ease;
    flex-shrink: 0;
    margin-right: 6px;
}
.nav-item:hover .nav-3d-icon,
.top-nav-link:hover .nav-3d-icon {
    transform: scale(1.12) translateY(-1px);
    box-shadow: 0 5px 12px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent);
}

.icon-3d-passwords { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-documents { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-reminders { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-contacts  { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-medical   { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-photos    { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-library   { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-audit     { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-settings  { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-admin     { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }
.icon-3d-folders   { background: var(--surface); box-shadow: 0 4px 10px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 1px color-mix(in srgb, var(--text) 8%, transparent); }

/* UNIFIED CARD ACTION ICONS */
.card-actions-unified {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.btn-action-icon {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.18s ease;
}
.btn-action-icon:hover {
    color: var(--text);
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px var(--primary-glow);
}
.btn-action-icon.btn-action-delete:hover {
    background: var(--danger) !important;
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border)) !important;
    box-shadow: 0 3px 8px color-mix(in srgb, var(--text) 8%, transparent) !important;
}
.search-wrapper {
    max-width: 400px;
    position: relative;
    width: 100%;
}
.search-wrapper input {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    padding: 10px 14px 10px 40px;
    width: 100%;
    transition: all var(--transition-speed) ease;
}
.search-wrapper input:focus {
    background: var(--bg-soft);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    outline: none;
}
.search-icon {
    color: var(--text-muted);
    left: 15px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

/* View Headings */
.view-header {
    margin-bottom: 30px;
}
.view-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.view-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* DASHBOARD SUMMARY */
.dashboard-summary {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 30px;
}
.stat-card {
    align-items: center;
    display: flex;
    gap: 20px;
    padding: 24px;
}
.stat-icon {
    align-items: center;
    border-radius: var(--border-radius-sm);
    display: flex;
    height: 48px;
    justify-content: center;
    width: 48px;
    font-size: 1.3rem;
}
.bg-primary-glow { background: var(--primary-glow); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.bg-warning-glow { background: var(--warning-glow); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.bg-danger-glow { background: var(--danger-glow); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); }
.bg-success-glow { background: var(--success-glow); color: var(--success); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }

.stat-info h3 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Category Filter pills */
.filter-bar {
    align-items: center;
    display: flex;
    gap: 15px;
    margin-bottom: 24px;
}
.filter-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}
.pill {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 16px;
    transition: all var(--transition-speed) ease;
}
.pill:not(.active):hover {
    background: var(--bg-soft);
    color: var(--text-primary);
}
.pill.active,
.pill.active:hover,
.pill.active:focus {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--text) 8%, transparent);
}

/* Credentials Grid */
.credentials-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.credential-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.card-header {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title-block {
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.card-url {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-url:hover {
    color: var(--primary);
    text-decoration: underline;
}

.card-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    padding: 2px 6px;
}
.cat-Secure-Passwords { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.cat-Social { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cat-Important-Documents { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.cat-Work { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); }
.cat-Milestones-Reminders { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.cat-Important-Contacts { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.cat-Family-Medical-Info { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.cat-Photo-Video { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.cat-Other { background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }

.card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.body-row {
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
}
.body-row-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.body-row-val {
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.body-row-val.masked {
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
}
.row-actions {
    display: flex;
    gap: 4px;
}
.btn-card-action {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    height: 28px;
    transition: color var(--transition-speed) ease;
    width: 28px;
}
.btn-card-action:hover {
    color: var(--text-primary);
}

.card-footer {
    align-items: center;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
}
.card-timestamp {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.card-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-danger {
    color: var(--text-muted);
}
.btn-icon-danger:hover {
    color: var(--danger);
}
.btn-icon-primary:hover {
    color: var(--primary);
}

/* Empty/Placeholder States */
.empty-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.empty-icon {
    color: var(--text-muted);
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
}
.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
}

/* PASSWORD GENERATOR VIEW */
.generator-container {
    max-width: 600px;
    padding: 30px;
    width: 100%;
}
.generator-display {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 8px 8px 8px 18px;
}
.generator-display input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 1.25rem;
    outline: none;
    width: 80%;
}
.generator-actions {
    display: flex;
    gap: 6px;
}
.btn-gen-action {
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    height: 44px;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    width: 44px;
}
.btn-gen-action:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--text-primary);
}

.strength-meter-container {
    margin-bottom: 24px;
}
.meter-bar-wrapper {
    background: var(--border-color);
    border-radius: 3px;
    height: 6px;
    margin-bottom: 8px;
    width: 100%;
}
.gen-strength-bar {
    border-radius: 3px;
    height: 100%;
    transition: all var(--transition-speed) ease;
    width: 0;
}
#gen-strength-bar.weak { background: var(--danger); width: 25%; }
#gen-strength-bar.fair { background: var(--warning); width: 50%; }
#gen-strength-bar.good { background: var(--primary); width: 75%; }
#gen-strength-bar.strong { background: var(--success); width: 100%; }

.meter-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.option-row {
    margin-bottom: 20px;
}
.option-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Custom styled Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-soft);
    border-radius: 3px;
    outline: none;
    margin: 10px 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px color-mix(in srgb, var(--text) 8%, transparent);
    transition: all 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Option Grid Checkboxes */
.option-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: var(--text-secondary);
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 1px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
}
.checkbox-container:hover input ~ .checkmark {
    background-color: var(--bg-soft);
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--border);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* SECURITY AUDIT VIEW */
.audit-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr 2fr;
}
.audit-score-card {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 30px;
    text-align: center;
}
.radial-progress-wrapper {
    margin: 30px 0;
    position: relative;
    width: 160px;
    height: 160px;
}
.radial-progress {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.radial-progress circle {
    fill: none;
    stroke-width: 8;
}
.radial-progress circle.bg {
    stroke: var(--text);
}
.radial-progress circle.progress {
    stroke: var(--success);
    stroke-linecap: round;
    transition: stroke-dashoffset 150ms ease-in-out;
}
.radial-text {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}
.radial-text span {
    font-size: 2.2rem;
    font-weight: 700;
}
.radial-text small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-summary-note {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.audit-issues-card {
    padding: 30px;
}
.audit-issues-card h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
}
.audit-lists {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.audit-section h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.audit-item-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.audit-item-list li {
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
}
.audit-item-info {
    display: flex;
    flex-direction: column;
}
.audit-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.audit-item-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.empty-list-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    border: 1px dashed var(--border-color) !important;
    background: transparent !important;
    justify-content: center !important;
    padding: 15px !important;
}

/* SETTINGS VIEW */
.settings-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.settings-grid .card {
    padding: 30px;
}
.settings-grid h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-grid p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 24px;
}
.icon-accent {
    color: var(--primary);
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.export-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.settings-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}
.import-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.file-upload-label {
    margin-bottom: 0;
    width: 100%;
}
.file-name-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    word-break: break-all;
}

/* MODALS */
.modal {
    align-items: center;
    background: var(--bg-soft);
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: opacity var(--transition-speed) ease;
}
.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    max-width: 500px;
    padding: 30px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* ── FLOATING DRAGGABLE CREDENTIAL MODAL ─────────────────────────────── */
#credential-modal {
    /* Keep the backdrop but allow mouse events on modal panel only */
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-soft);
    backdrop-filter: blur(3px);
}

#credential-modal .modal-content {
    max-width: 800px;
    width: 94%;
    /* Floating window positioned near top-center on open; JS dragging takes over */
    margin-top: 36px;
    padding: 0;
    max-height: 92vh;
    overflow: hidden;   /* Panel itself never scrolls — inner body does */
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow: 0 24px 80px color-mix(in srgb, var(--text) 8%, transparent), 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
    /* Draggable — JS will set position: fixed + left/top */
    position: relative;
    user-select: none;
    transition: box-shadow 150ms ease;
}

#credential-modal .modal-content.is-dragging {
    box-shadow: 0 36px 100px color-mix(in srgb, var(--text) 8%, transparent), 0 0 0 2px color-mix(in srgb, var(--text) 8%, transparent);
    cursor: grabbing;
}

/* ── Sticky drag handle / header ── */
#credential-modal .modal-header {
    margin-bottom: 0;
    padding: 16px 24px 14px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#credential-modal .modal-header::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 4px;
    border-radius: 4px;
    background: var(--bg-soft);
    margin-right: 6px;
    flex-shrink: 0;
}

#credential-modal .modal-header:active {
    cursor: grabbing;
}

/* ── Scrollable form body ── */
#credential-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 24px 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

#credential-modal-body::-webkit-scrollbar {
    width: 6px;
}
#credential-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
#credential-modal-body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border-radius: 6px;
}
#credential-modal-body::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

/* ── Sticky footer with action buttons ── */
#credential-modal-footer {
    flex-shrink: 0;
    padding: 12px 24px 16px;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    border-radius: 0 0 16px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Form field sizing ── */
#credential-modal .form-group {
    margin-bottom: 10px;
}
#credential-modal label {
    font-size: 0.84rem;
    margin-bottom: 4px;
}
#credential-modal input,
#credential-modal select,
#credential-modal textarea {
    padding: 7px 12px;
    font-size: 0.88rem;
    height: 36px;
}
#credential-modal textarea {
    height: auto;
}

.modal-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Notes Modal Detail Row */
.detail-row {
    margin-bottom: 15px;
    font-size: 0.95rem;
}
.detail-row strong {
    color: var(--text-secondary);
    display: inline-block;
    width: 100px;
}
.notes-display-box {
    margin-top: 8px;
    padding: 15px;
    min-height: 100px;
    max-height: 250px;
    overflow-y: auto;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Document spreadsheet table styles */
.doc-table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}
.doc-table th {
    background: var(--primary);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.doc-table td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 12px 16px;
    transition: color 0.15s ease;
    word-break: break-word;
}
.doc-table tr:hover td {
    background: var(--bg-soft);
    color: var(--text-primary);
}


/* Animation classes */
@keyframes pop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.animate-pop {
    animation: pop 150ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Responsive styles */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
        position: static;
        width: 100%;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        margin-left: 0;
        padding: 20px;
        width: 100%;
    }
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .audit-grid {
        grid-template-columns: 1fr;
    }
}

/* Multi-Factor Authentication Styles */
.mfa-info-box {
    text-align: center;
    padding: 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
}
.mfa-info-box i {
    font-size: 2.2rem;
    color: var(--primary);
    text-shadow: 0 0 15px color-mix(in srgb, var(--text) 8%, transparent);
    margin-bottom: 4px;
}
.mfa-info-box p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.key-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    width: 100%;
    margin-top: 4px;
    box-shadow: inset 0 2px 4px color-mix(in srgb, var(--text) 8%, transparent);
}
.mfa-key-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px color-mix(in srgb, var(--text) 8%, transparent);
}
.btn-copy-key {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-speed) ease;
}
.btn-copy-key:hover {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.mfa-code-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    width: 100%;
}
#mfa-code, #mfa-setup-code {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1.6rem !important;
    letter-spacing: 0.6rem !important;
    font-weight: 700;
    padding: 12px;
    text-align: center;
    width: 100%;
    outline: none;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
#mfa-code:focus, #mfa-setup-code:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}
#mfa-code::placeholder, #mfa-setup-code::placeholder {
    letter-spacing: 0.6rem;
    color: var(--text-muted);
}

/* Floating MODAL style for View Excel Document */
#document-modal {
    background: transparent !important;
    pointer-events: none; /* Let clicks pass through outside the modal */
    align-items: flex-start;
    justify-content: flex-start;
    display: flex !important; /* Always display flex when active */
}
#document-modal.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}
#document-modal .modal-content {
    pointer-events: auto; /* Handle clicks inside the modal */
    position: fixed;
    top: 100px;
    right: 30px;
    width: 520px;
    max-width: calc(100vw - 60px);
    max-height: calc(100vh - 150px);
    margin: 0;
    box-shadow: 0 15px 50px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
}
#document-modal .modal-header {
    cursor: move; /* Draggable cursor */
    user-select: none;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
#document-modal .document-modal-body {
    flex: 1;
    overflow-y: auto;
}
#document-modal .modal-actions {
    margin-top: 15px !important;
}

.ref-spreadsheet-link:hover {
    color: var(--success) !important;
    text-shadow: 0 0 8px color-mix(in srgb, var(--text) 8%, transparent);
}

/* Security Questions Selectors */
.q-select {
    background: var(--surface) !important;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)) !important;
    border-radius: var(--border-radius-sm);
    color: var(--primary) !important;
    padding: 8px 12px;
    width: 100%;
    outline: none;
    font-family: var(--font-sans);
    margin-top: 5px;
    font-weight: 500;
}
.q-select option {
    background: var(--surface) !important;
    color: var(--primary) !important;
}

/* Key Mapping Cards */
.keymapping-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-soft);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.keymapping-card .card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

/* Admin Dashboard Elements */
.badge-admin {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-role-admin {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}
.badge-role-user {
    background: var(--bg-soft);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.badge-status-active {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
}
.badge-status-suspended {
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    color: var(--danger);
}
.badge-status-locked {
    background: color-mix(in srgb, var(--warning) 8%, var(--surface));
    color: var(--warning);
}
.badge-status-disabled {
    background: var(--bg-soft);
    color: var(--text-muted);
}

/* ============================================================
   VAULT ITEM ATTACHMENTS — DROPZONE & FILE LIST
   ============================================================ */

.attachment-dropzone {
    border: 2px dashed color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    transition: border-color 150ms, background 150ms;
    cursor: pointer;
    overflow: hidden;
}
.attachment-dropzone:hover,
.attachment-dropzone.drag-over {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.attachment-dropzone.drag-over {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);
}
.dropzone-inner {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.attachment-file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.attachment-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    transition: background 0.15s;
}
.attachment-chip:hover { background: var(--bg-soft); }
.attachment-chip-icon {
    font-size: 1.2rem;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}
.att-icon-pdf   { color: var(--danger); }
.att-icon-doc   { color: var(--primary); }
.att-icon-image { color: var(--accent); }
.att-icon-audio { color: var(--warning); }
.att-icon-video { color: var(--primary); }
.att-icon-other { color: var(--text-muted); }
.attachment-chip-info { flex: 1; min-width: 0; }
.attachment-chip-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    display: block;
}
.attachment-chip-meta { color: var(--text-muted); font-size: 0.72rem; }
.attachment-chip-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-att-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: color 0.15s, background 0.15s;
}
.btn-att-action:hover            { background: var(--bg-soft); color: var(--text); }
.btn-att-action.btn-att-preview:hover { color: var(--primary); }
.btn-att-action.btn-att-delete:hover  { color: var(--danger); }

/* ============================================================
   FLOATING PREVIEW WINDOWS
   ============================================================ */

#floating-preview-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 99999;
    overflow: visible;
}
.floating-preview-window {
    position: fixed;
    top: 85px;
    left: 85px;
    width: 680px;
    height: 520px;
    min-width: 320px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: 0 24px 70px color-mix(in srgb, var(--text) 8%, transparent), 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    pointer-events: all;
    resize: both;
    overflow: hidden;
    z-index: 999999;
    opacity: 1;
}
.floating-preview-window.minimized { height: 44px !important; resize: none; overflow: hidden; }
.floating-preview-window.minimized .preview-window-body { display: none; }
.preview-window-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 44px;
    min-height: 44px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    cursor: move;
    user-select: none;
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}
.preview-window-file-icon { font-size: 1rem; flex-shrink: 0; }
.preview-window-title {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.preview-window-controls { display: flex; gap: 6px; flex-shrink: 0; }
.preview-win-btn {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s, color 0.15s;
}
.preview-win-btn:hover         { background: var(--bg-soft); color: var(--text); }
.preview-win-btn.close-btn:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.preview-win-btn.min-btn:hover { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); }
.preview-window-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.preview-window-body iframe,
.preview-window-body video { width: 100%; height: 100%; border: none; background: var(--surface); }
.preview-window-body img {
    width: 100%; height: 100%; object-fit: contain;
    background: var(--bg-soft); padding: 8px; box-sizing: border-box;
}
.preview-window-body audio {
    width: 100%; height: auto;
    margin: auto; padding: 20px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    display: block;
}
.preview-window-docx-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
    background: var(--bg-soft);
}
.preview-window-docx-content h1,
.preview-window-docx-content h2,
.preview-window-docx-content h3 { color: var(--primary); margin-bottom: 8px; }
.preview-window-unsupported {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 10px;
    padding: 30px;
    text-align: center;
}
.preview-window-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 10px;
    font-size: 0.9rem;
}
.floating-preview-window:focus-within,
.floating-preview-window:active { z-index: 8200; }

/* =========================================================================
   MILESTONES & REMINDERS STYLES
   ========================================================================= */
.milestones-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--text) 8%, transparent), inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.milestones-summary-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: var(--surface);
}
.summary-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 18px;
}
.summary-stat-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.summary-stat-box:hover {
    background: var(--bg-soft);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--text) 8%, transparent);
}
.summary-stat-box.active-filter {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    box-shadow: 0 0 15px color-mix(in srgb, var(--text) 8%, transparent);
}
.summary-stat-num {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}
.summary-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.next-reminder-box {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}
.next-reminder-info h4 {
    margin: 0 0 6px 0;
    color: var(--text-light);
    font-size: 1.05rem;
    font-weight: 700;
}
.next-reminder-info p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Reminder Item Cards */
.reminder-card-custom {
    position: relative;
    overflow: hidden;
    border-top: 3px solid transparent;
}
.reminder-card-custom[data-status="Due Soon"] { border-top-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.reminder-card-custom[data-status="Due Today"] { border-top-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.reminder-card-custom[data-status="Past Due"] { border-top-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.reminder-card-custom[data-status="Completed"] { border-top-color: color-mix(in srgb, var(--accent) 35%, var(--border)); opacity: 0.85; }
.reminder-card-custom[data-status="Cancelled"] { border-top-color: var(--border); opacity: 0.65; }
.reminder-card-custom[data-status="Upcoming"] { border-top-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-badge.upcoming { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.status-badge.duesoon { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.status-badge.duetoday { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); animation: pulseGlow 150ms infinite; }
.status-badge.pastdue { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); animation: pulseGlow 150ms infinite; }
.status-badge.completed { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.status-badge.cancelled { background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border); }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 8%, transparent); }
    70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--text) 8%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 8%, transparent); }
}

.priority-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.priority-tag.low { background: var(--bg-soft); color: var(--text-muted); }
.priority-tag.normal { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); }
.priority-tag.high { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.priority-tag.critical { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); font-weight: 800; }

.reminder-actions-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.btn-reminder-action {
    flex: 1;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
}
.btn-mark-complete {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.btn-mark-complete:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); transform: scale(1.02); }

.btn-cancel-rem {
    background: var(--bg-soft);
    color: var(--text);
    border-color: var(--border);
}
.btn-cancel-rem:hover { background: var(--bg-soft); }

.btn-reopen {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.btn-reopen:hover { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }

/* Multi-select notification chips in form */
.notif-chip {
    display: inline-block;
    cursor: pointer;
}
.notif-chip input {
    display: none;
}
.notif-chip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: all 150ms ease;
}
.notif-chip input:checked + span {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border-color: var(--primary);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 0 10px color-mix(in srgb, var(--text) 8%, transparent);
}
.notif-chip:hover span {
    border-color: var(--border);
}

/* AI Voice Assistant Animations & States */
@keyframes ai-pulse-mic {
    0% { transform: scale(1); box-shadow: 0 0 10px color-mix(in srgb, var(--text) 8%, transparent), 0 0 20px color-mix(in srgb, var(--text) 8%, transparent); }
    50% { transform: scale(1.15); box-shadow: 0 0 20px color-mix(in srgb, var(--text) 8%, transparent), 0 0 35px color-mix(in srgb, var(--text) 8%, transparent); }
    100% { transform: scale(1); box-shadow: 0 0 10px color-mix(in srgb, var(--text) 8%, transparent), 0 0 20px color-mix(in srgb, var(--text) 8%, transparent); }
}

.ai-mic-active {
    background: var(--surface);
    animation: ai-pulse-mic 150ms infinite ease-in-out !important;
    border: 2px solid var(--border) !important;
}

.ai-mic-idle:hover {
    transform: scale(1.08);
    box-shadow: 0 0 22px color-mix(in srgb, var(--text) 8%, transparent) !important;
}

/* =====================================================
   REMINDER LIST VIEW — "All Milestones & Reminders"
   ===================================================== */
.reminder-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reminder-list-row {
    display: grid;
    grid-template-columns: 38px 1fr 100px 120px 160px 130px 120px 110px 130px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    cursor: default;
}

.reminder-list-row:hover {
    background: var(--bg-soft);
}

.reminder-list-row.list-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.reminder-list-row .rl-icon { text-align: center; }
.reminder-list-row .rl-title { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-list-row .rl-title small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.reminder-list-row .rl-due   { font-size: 0.83rem; color: var(--text-secondary); }

.reminder-list-row .rl-priority { font-size: 0.8rem; }
.reminder-list-row .rl-folder { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-list-row .rl-actions { display: flex; gap: 4px; justify-content: flex-end; }
.reminder-list-row .rl-actions button { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }

/* Faded completed/cancelled rows */
.reminder-list-row[data-status="Completed"] { opacity: 0.65; }
.reminder-list-row[data-status="Cancelled"]  { opacity: 0.45; }
/* Left accent bar by status */
.reminder-list-row[data-status="Due Soon"]   { border-left: 3px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.reminder-list-row[data-status="Due Today"]  { border-left: 3px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }
.reminder-list-row[data-status="Past Due"]   { border-left: 3px solid color-mix(in srgb, var(--danger) 35%, var(--border)); }
.reminder-list-row[data-status="Completed"]  { border-left: 3px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.reminder-list-row[data-status="Cancelled"]  { border-left: 3px solid var(--border); }
.reminder-list-row[data-status="Upcoming"]   { border-left: 3px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.reminder-list-row.list-header               { border-left: 3px solid transparent; }

@media (max-width: 1024px) {
    .reminder-list-row {
        grid-template-columns: 32px 1fr 120px 110px 90px 120px;
    }
    .reminder-list-row .rl-folder { display: none; }
}
@media (max-width: 768px) {
    .reminder-list-row {
        grid-template-columns: 28px 1fr 100px 90px;
    }
    .reminder-list-row .rl-priority,
    .reminder-list-row .rl-folder { display: none; }
}

/* =====================================================
   DOCUMENT LIST VIEW — "All Important Documents"
   ===================================================== */
.document-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.document-list-row {
    display: grid;
    grid-template-columns: 38px 1fr 120px 140px 100px 100px 140px 140px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    cursor: default;
    border-left: 3px solid transparent;
}

.document-list-row:hover {
    background: var(--bg-soft);
}

.document-list-row.list-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.document-list-row .dl-icon { text-align: center; }
.document-list-row .dl-title { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list-row .dl-title small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.document-list-row .dl-owner { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list-row .dl-shared { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list-row .dl-type { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; font-weight: 600; }
.document-list-row .dl-size { font-size: 0.8rem; color: var(--text-secondary); }
.document-list-row .dl-folder { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-list-row .dl-actions { display: flex; gap: 4px; justify-content: flex-end; }
.document-list-row .dl-actions button { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }

@media (max-width: 1024px) {
    .document-list-row {
        grid-template-columns: 32px 1fr 100px 120px 90px 120px 140px;
    }
    .document-list-row .dl-size { display: none; }
}
@media (max-width: 768px) {
    .document-list-row {
        grid-template-columns: 28px 1fr 100px 120px 80px 110px;
    }
    .document-list-row .dl-folder { display: none; }
}

/* =====================================================
   PASSWORD LIST VIEW — "All Secure Passwords"
   ===================================================== */
.password-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.password-list-row {
    display: grid;
    grid-template-columns: 38px 1fr 100px 120px 180px 140px 140px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    cursor: default;
    border-left: 3px solid transparent;
}

.password-list-row:hover {
    background: var(--bg-soft);
}

.password-list-row.list-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.password-list-row .pl-icon { text-align: center; }
.password-list-row .pl-title { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.password-list-row .pl-title small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.password-list-row .pl-user { font-size: 0.8rem; color: var(--text-secondary); font-family: Consolas, Monaco, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.password-list-row .pl-folder { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.password-list-row .pl-actions { display: flex; gap: 4px; justify-content: flex-end; }
.password-list-row .pl-actions button { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }

@media (max-width: 1024px) {
    .password-list-row {
        grid-template-columns: 32px 1fr 140px 140px;
    }
    .password-list-row .pl-folder { display: none; }
}
@media (max-width: 768px) {
    .password-list-row {
        grid-template-columns: 28px 1fr 120px;
    }
    .password-list-row .pl-user { display: none; }
}

/* =====================================================
   MEDIA LIST VIEW — "All Photo & Video"
   ===================================================== */
.media-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.media-list-row {
    display: grid;
    grid-template-columns: 48px 1fr 120px 140px 100px 100px 140px 140px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    cursor: default;
    border-left: 3px solid transparent;
}

.media-list-row:hover {
    background: var(--bg-soft);
}

.media-list-row.list-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.media-list-row .ml-icon { 
    text-align: center; 
    width: 48px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-soft);
    overflow: hidden;
}
.media-list-row .ml-icon img, .media-list-row .ml-icon video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.media-list-row .ml-title { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-list-row .ml-title small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.media-list-row .ml-owner { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-list-row .ml-shared { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-list-row .ml-type { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; font-weight: 600; }
.media-list-row .ml-size { font-size: 0.8rem; color: var(--text-secondary); }
.media-list-row .ml-folder { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-list-row .ml-actions { display: flex; gap: 4px; justify-content: flex-end; }
.media-list-row .ml-actions button { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }

@media (max-width: 1024px) {
    .media-list-row {
        grid-template-columns: 40px 1fr 100px 120px 90px 120px 140px;
    }
    .media-list-row .ml-size { display: none; }
}
@media (max-width: 768px) {
    .media-list-row {
        grid-template-columns: 36px 1fr 100px 120px 80px 110px;
    }
    .media-list-row .ml-folder { display: none; }
}

/* Nav count badge */
.nav-count-badge {
    background: var(--bg-soft);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

/* =====================================================
   CONTACT LIST VIEW — "All Important Contacts"
   ===================================================== */
.contact-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-list-row {
    display: grid;
    grid-template-columns: 44px 1.4fr 100px 120px 140px 180px 160px 140px 130px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    cursor: default;
    border-left: 3px solid transparent;
}

.contact-list-row:hover { background: var(--bg-soft); }
.contact-list-row.is-emergency  { border-left: 3px solid color-mix(in srgb, var(--danger) 35%, var(--border)); }
.contact-list-row.is-favorite   { border-left: 3px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }

.contact-list-row.list-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-left: 3px solid transparent;
}

.contact-list-row .cl-icon   { text-align: center; }
.contact-list-row .cl-name   { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-list-row .cl-name small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.contact-list-row .cl-type   { font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-list-row .cl-phone  { font-size: 0.82rem; font-family: Consolas, Monaco, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-list-row .cl-email  { font-size: 0.80rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-list-row .cl-folder { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-list-row .cl-actions { display: flex; gap: 4px; justify-content: flex-end; }
.contact-list-row .cl-actions button { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }

@media (max-width: 1200px) {
    .contact-list-row { grid-template-columns: 38px 1.2fr 120px 160px 140px 110px; }
    .contact-list-row .cl-email { display: none; }
}
@media (max-width: 900px) {
    .contact-list-row { grid-template-columns: 36px 1fr 100px 130px 110px; }
    .contact-list-row .cl-folder { display: none; }
}
@media (max-width: 680px) {
    .contact-list-row { grid-template-columns: 32px 1fr 90px 110px; }
    .contact-list-row .cl-type { display: none; }
}

/* =====================================================
   FAMILY & MEDICAL LIST VIEW — "All Family & Medical Info"
   ===================================================== */
.family-medical-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.family-medical-list-row {
    display: grid;
    grid-template-columns: 44px 1fr 100px 120px 80px 120px 100px 110px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    cursor: default;
    border-left: 3px solid transparent;
}

.family-medical-list-row:hover { background: var(--bg-soft); }
.family-medical-list-row.has-critical-alert { border-left: 3px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }

.family-medical-list-row.list-header {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-left: 3px solid transparent;
}

.family-medical-list-row .fml-icon   { text-align: center; }
.family-medical-list-row .fml-name   { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-medical-list-row .fml-name small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.family-medical-list-row .fml-dob    { font-size: 0.8rem; color: var(--text-secondary); }
.family-medical-list-row .fml-blood  { font-size: 0.82rem; font-weight: 700; text-align: center; }
.family-medical-list-row .fml-physician { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-medical-list-row .fml-folder { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-medical-list-row .fml-actions { display: flex; gap: 4px; justify-content: flex-end; }
.family-medical-list-row .fml-actions button { padding: 4px 8px; font-size: 0.75rem; border-radius: 6px; }

@media (max-width: 1200px) {
    .family-medical-list-row { grid-template-columns: 38px 1.2fr 90px 110px 160px 110px; }
    .family-medical-list-row .fml-physician { display: none; }
}
@media (max-width: 900px) {
    .family-medical-list-row { grid-template-columns: 36px 1fr 80px 100px 110px 110px; }
    .family-medical-list-row .fml-folder { display: none; }
}
@media (max-width: 680px) {
    .family-medical-list-row { grid-template-columns: 32px 1fr 75px 100px 100px; }
    .family-medical-list-row .fml-blood { display: none; }
}

/* Owner and Shared columns styling for all lists */
.rl-owner, .pl-owner, .cl-owner, .fml-owner { 
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
    font-size: 0.78rem; color: var(--text-secondary); align-self: center; font-weight: 500;
}
.rl-shared, .pl-shared, .cl-shared, .fml-shared { 
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
    font-size: 0.78rem; color: var(--primary); align-self: center; font-weight: 500; opacity: 0.9;
}

/* ==========================================
   PRINT / PDF EXPORT STYLES
   ========================================== */
.print-only { display: none; }

@media print {
    body * { visibility: hidden; }
    
    body {
        background: var(--surface) !important;
        color: var(--text) !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #print-canvas, #print-canvas * {
        visibility: visible;
    }
    
    #print-canvas {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 20px;
        background: var(--surface);
        display: block !important;
        color: var(--text);
        font-family: Arial, sans-serif;
    }

    #print-canvas h1 { font-size: 24px; border-bottom: 2px solid var(--border); padding-bottom: 10px; margin-bottom: 20px; color: var(--text); }
    #print-canvas h2 { font-size: 18px; color: var(--text); margin-top: 20px; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
    #print-canvas p { margin: 5px 0; font-size: 14px; color: var(--text); line-height: 1.5; }
    #print-canvas .print-row { display: flex; margin-bottom: 10px; }
    #print-canvas .print-label { font-weight: bold; width: 150px; color: var(--text-muted); }
    #print-canvas .print-value { flex: 1; }
    #print-canvas .print-block { margin-bottom: 20px; padding: 15px; border: 1px solid var(--border); border-radius: 8px; }
    
    @page { margin: 0.5cm; }
}
.vault-tree-button { display: block; width: 100%; text-align: left; margin: 3px 0; font-size: .8rem; border-color: var(--border-color); color: var(--text-primary); }
.vault-scope-badge { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; margin-bottom: 12px; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); background: var(--bg-surface); }
.vault-scope-badge .vault-tree-button { width: auto; margin-left: auto; }


/* Plan and quota views use the existing palette in both themes. */
.plan-card-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
.plan-catalog-card { padding:20px; position:relative; border:1px solid var(--border-color); background:var(--bg-surface); color:var(--text-primary); display:flex; flex-direction:column; gap:12px; min-width:0; }
.plan-catalog-card small { color:var(--text-muted); }
.plan-card-grid select { background:var(--bg-surface-dark) !important; color:var(--text-primary) !important; border:1px solid var(--border-color); }
.plan-card-grid select option { background:var(--bg-main) !important; color:var(--text-primary) !important; }
.plan-catalog-card ul { padding-left:20px; }
.plan-highlighted { border-color:var(--primary); }
.plan-popular { align-self:flex-start; }
.plan-quota-alert { padding:12px; border:1px solid var(--warning); color:var(--text-primary); border-radius:var(--border-radius-sm); }
.plan-admin-form { display:grid; gap:14px; padding:24px; color:var(--text-primary); }
.plan-admin-form label { display:grid; gap:6px; }
.plan-admin-form input,.plan-admin-form textarea { background:var(--bg-surface) !important; color:var(--text-primary) !important; border:1px solid var(--border-color); }
@media (max-width:1100px) { .plan-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px) { .plan-card-grid { grid-template-columns:minmax(0,1fr); } }

/* =============================================================
   REGISTRATION VIEW & TRIAL PLAN SELECTION (PREMIUM DARK UI)
   ============================================================= */

/* Wide Registration Container & Card */
.auth-container.register-mode {
    align-items: flex-start;
    padding: 30px 20px;
    min-height: 100vh;
}

.auth-card.auth-card-wide {
    max-width: 1060px;
    width: 100%;
    padding: 36px 44px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1px solid var(--border);
    box-shadow: 0 25px 60px -15px color-mix(in srgb, var(--text) 8%, transparent), 0 0 40px color-mix(in srgb, var(--text) 8%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    transition: max-width 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Step Banners */
.register-step-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 18px;
}

.step-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 9999px;
    padding: 3px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-main-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.step-sub-title {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Signup Notice */
.signup-trial-notice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.signup-trial-notice::before {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.signup-trial-alert {
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

/* Plan Card Grid & Cards */
#signup-trial-plans .plan-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

#signup-trial-plans .plan-catalog-card {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--text) 8%, transparent);
}

#signup-trial-plans .plan-catalog-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    box-shadow: 0 12px 24px color-mix(in srgb, var(--text) 8%, transparent), 0 0 15px color-mix(in srgb, var(--text) 8%, transparent);
}

/* Radio Indicator inside Plan Card */
.plan-radio-indicator {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    transition: all 150ms ease;
    background: var(--bg-soft);
}

/* Selected Plan Card State */
#signup-trial-plans .plan-catalog-card.selected {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border)) !important;
    background: var(--surface);
    box-shadow: 0 0 28px color-mix(in srgb, var(--text) 8%, transparent), 0 16px 32px color-mix(in srgb, var(--text) 8%, transparent) !important;
    transform: translateY(-2px);
}

#signup-trial-plans .plan-catalog-card.selected .plan-radio-indicator {
    background: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    color: var(--primary);
    box-shadow: 0 0 10px color-mix(in srgb, var(--text) 8%, transparent);
}

#signup-trial-plans .plan-catalog-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    padding-right: 28px;
    letter-spacing: -0.3px;
}

#signup-trial-plans .plan-catalog-card .plan-popular {
    position: absolute;
    top: -10px;
    left: 16px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 9999px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--text) 8%, transparent);
}

#signup-trial-plans .plan-catalog-card > p:first-of-type {
    display: inline-block;
    align-self: flex-start;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 3px 10px;
    border-radius: 6px;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}

#signup-trial-plans .plan-catalog-card strong {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    display: block;
}

#signup-trial-plans .plan-catalog-card small {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: block;
    margin-top: -6px;
}

#signup-trial-plans .plan-catalog-card ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 0.82rem;
    color: var(--text);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

#signup-trial-plans .plan-catalog-card ul li {
    position: relative;
    padding-left: 20px;
    line-height: 1.35;
}

#signup-trial-plans .plan-catalog-card ul li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--accent);
    position: absolute;
    left: 0;
    font-size: 0.75rem;
    top: 2px;
}

#signup-trial-plans .plan-catalog-card .btn {
    margin-top: auto;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 150ms ease;
}

#signup-trial-plans .plan-catalog-card.selected .btn {
    background: var(--surface);
    border-color: transparent;
    color: var(--text);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 8%, transparent);
}

/* 2-Column Register Form Grid */
.register-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    #signup-trial-plans .plan-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 680px) {
    .auth-card.auth-card-wide {
        padding: 24px 18px;
    }
    #signup-trial-plans .plan-card-grid {
        grid-template-columns: 1fr !important;
    }
    .register-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .register-step-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Documents Drag-and-Drop and Overlay Styles */
.empty-dropzone {
    transition: all 150ms ease-in-out;
}
.empty-dropzone:hover,
.empty-dropzone:focus-visible {
    border-color: var(--primary-hover) !important;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface)) !important;
    box-shadow: 0 0 20px color-mix(in srgb, var(--text) 8%, transparent);
    transform: translateY(-2px);
}
.empty-dropzone:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
.drag-overlay {
    animation: fadeInOverlay 150ms ease-out;
}
@keyframes fadeInOverlay {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Customize Categories & Folders Styles */
.customize-tab-btn {
    padding: 7px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 150ms ease;
}
.customize-tab-btn.active {
    background: var(--primary);
    color: var(--text);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--text) 8%, transparent);
}

.customize-category-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.customize-category-card:hover {
    border-color: var(--border);
    background: var(--bg-soft);
}
.customize-category-card.is-hidden {
    opacity: 0.65;
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

.customize-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 12px;
}
.customize-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}
.customize-folder-list {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 8px 12px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.customize-folder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: background 0.15s ease, border-color 0.15s ease;
    margin-bottom: 2px;
}
.customize-folder-row:hover {
    background: var(--bg-soft);
    border-color: var(--border);
}
.customize-folder-row.is-hidden {
    opacity: 0.6;
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.customize-folder-row.is-inherited-hidden {
    opacity: 0.55;
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.customize-folder-subbranch {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Customize Category Nav Pills */
.customize-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 2px 2px 8px 2px;
    margin-bottom: 12px;
}
.customize-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 150ms ease;
    user-select: none;
}
.customize-cat-pill:hover {
    background: var(--bg-soft);
    color: var(--text-primary);
    border-color: var(--border);
}
.customize-cat-pill.active {
    background: var(--primary);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--text) 8%, transparent);
    font-weight: 600;
}
.customize-cat-pill .pill-badge {
    background: var(--bg-soft);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
}
.customize-cat-pill.active .pill-badge {
    background: var(--bg-soft);
    color: var(--text);
}

/* iOS-style toggle switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
    margin: 0;
}
.toggle-slider {
    position: relative;
    width: 38px;
    height: 20px;
    background-color: var(--bg-soft);
    border-radius: 20px;
    transition: background-color 150ms ease;
    display: inline-block;
    flex-shrink: 0;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--surface);
    border-radius: 50%;
    transition: transform 150ms ease;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* Hidden Manager List Rows */
.hidden-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    gap: 12px;
    transition: all 0.15s ease;
}
.hidden-item-row:hover {
    background: var(--bg-soft);
    border-color: var(--border);
}
.hidden-item-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
}
.badge-category {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}
.badge-folder {
    background: color-mix(in srgb, var(--warning) 8%, var(--surface));
    color: var(--warning);
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
}

/* ── Storage Allocation Table & Column Alignment ── */
.storage-allocation-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 16px;
    font-size: 0.88rem;
    color: var(--text-primary);
    table-layout: auto;
}

.storage-allocation-table thead {
    background: var(--bg-soft);
    border-bottom: 2px solid var(--border-color);
}

.storage-allocation-table th {
    text-align: left !important;
    padding: 12px 14px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    color: var(--text-secondary) !important;
    white-space: nowrap;
    vertical-align: middle !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.storage-allocation-table td {
    text-align: left !important;
    padding: 12px 14px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary);
    font-size: 0.88rem;
    white-space: nowrap;
}

.storage-allocation-table tbody tr:hover td {
    background: var(--bg-soft);
}

.storage-allocation-table .badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: capitalize;
}

.storage-allocation-table .badge-primary {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
}

.storage-allocation-table .badge-secondary {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
}

.storage-allocation-table .badge-warning {
    background: color-mix(in srgb, var(--warning) 8%, var(--surface));
    color: var(--warning);
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
}

.storage-allocation-table td progress {
    display: block;
    width: 120px;
    max-width: 100%;
    height: 6px;
    margin-top: 5px;
    border-radius: 3px;
    overflow: hidden;
    background-color: var(--bg-soft);
}

.storage-allocation-table td progress::-webkit-progress-bar {
    background-color: var(--bg-soft);
    border-radius: 3px;
}

.storage-allocation-table td progress::-webkit-progress-value {
    background-color: var(--primary);
    border-radius: 3px;
}

.storage-allocation-table td progress::-moz-progress-bar {
    background-color: var(--primary);
    border-radius: 3px;
}

/* ==========================================================================
   PUBLIC MARKETING SITE & LEGAL PAGES STYLES
   ========================================================================== */

.public-landing-container {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Landing Top Navigation Bar */
.marketing-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.marketing-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.marketing-nav-brand img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 8px var(--text));
}

.marketing-nav-brand span {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--surface);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.marketing-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.marketing-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 150ms ease;
    padding: 6px 10px;
    border-radius: 6px;
}

.marketing-nav-link:hover, .marketing-nav-link.active {
    color: var(--text);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.marketing-nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

@media (max-width: 900px) {
    .marketing-nav-links {
        display: none;
    }
    .marketing-navbar {
        padding: 12px 18px;
    }
}

/* Hero Section */
.marketing-hero-section {
    padding: 40px 32px 70px 32px;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
    min-height: calc(100vh - 75px);
}

@media (max-width: 1024px) {
    .marketing-hero-section {
        grid-template-columns: 1fr;
        padding: 30px 20px 60px 20px;
        min-height: auto;
    }
    .hero-content {
        text-align: center;
    }
    .hero-cta-group {
        justify-content: center;
    }
    .hero-trust-badges {
        justify-content: center;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0 0 20px 0;
}

.hero-title .gradient-text {
    background: var(--surface);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-tagline {
    font-size: 1.18rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    max-width: 620px;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.btn-hero-primary {
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px color-mix(in srgb, var(--text) 8%, transparent);
    transition: all 150ms ease;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -4px color-mix(in srgb, var(--text) 8%, transparent);
}

.btn-hero-secondary {
    padding: 14px 26px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
}

.hero-trust-badges {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 10px;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.trust-badge i {
    color: var(--accent);
}

/* Auth Card integration in Hero */
.hero-auth-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hero-auth-slot .auth-container {
    min-height: auto;
    padding: 0;
    width: 100%;
}

.hero-auth-slot .auth-card {
    max-width: 480px;
    box-shadow: 0 20px 40px color-mix(in srgb, var(--text) 8%, transparent), 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent);
}

.hero-auth-slot .auth-container.register-mode .auth-card {
    max-width: 780px;
}

/* Marketing Sections */
.marketing-section {
    padding: 90px 28px;
    max-width: 1320px;
    margin: 0 auto;
}

.marketing-section-dark {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 56px auto;
}

.section-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.section-title {
    font-size: clamp(2rem, 3.2vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 0 0 16px 0;
}

.section-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Vault Organization Section */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.category-showcase-card {
    padding: 28px;
    border-radius: 16px;
    transition: all 150ms ease;
    display: flex;
    flex-direction: column;
}

.category-showcase-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px color-mix(in srgb, var(--text) 8%, transparent);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.category-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 18px;
}

.cat-passwords { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); }
.cat-documents { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); }
.cat-media     { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); }
.cat-reminders { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); }
.cat-contacts  { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); }
.cat-medical   { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); }

.category-showcase-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px 0;
}

.category-showcase-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.55;
}

.folder-preview-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-right: 6px;
    margin-bottom: 6px;
}

/* Vault Scope & Family Pool Architecture */
.vault-architecture-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 24px;
}

@media (max-width: 900px) {
    .vault-architecture-grid {
        grid-template-columns: 1fr;
    }
}

.arch-card {
    padding: 32px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.arch-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.arch-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.arch-personal .arch-icon {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
}

.arch-shared .arch-icon {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
}

.arch-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.arch-features-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.arch-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.arch-features-list li i {
    color: var(--accent);
    margin-top: 3px;
}

/* Security Section */
.security-quote-card {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto 50px auto;
    box-shadow: 0 20px 40px color-mix(in srgb, var(--text) 8%, transparent);
    position: relative;
}

.security-quote-card .quote-icon {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.security-quote-card blockquote {
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text);
    margin: 0 0 16px 0;
    font-style: italic;
    letter-spacing: -0.01em;
}

.security-quote-card .quote-source {
    font-size: 0.92rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.security-pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.security-pillar-card {
    padding: 28px;
    border-radius: 14px;
}

.security-pillar-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 14px 0 8px 0;
}

.security-pillar-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* Pricing Section */
.pricing-cycle-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.toggle-pill-btn {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.toggle-pill-btn.active {
    background: var(--primary);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 8%, transparent);
}

.toggle-discount-tag {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.marketing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    align-items: stretch;
}

.pricing-card {
    border-radius: 18px;
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 150ms ease;
}

.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px color-mix(in srgb, var(--text) 8%, transparent);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}

.pricing-card.popular-card {
    border: 2px solid var(--primary);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--text) 8%, transparent);
}

.popular-ribbon {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    color: var(--text);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--text) 8%, transparent);
    white-space: nowrap;
}

.pricing-card-header {
    margin-bottom: 20px;
}

.plan-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.pill-solo { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); }
.pill-family { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
.pill-invited { background: color-mix(in srgb, var(--warning) 8%, var(--surface)); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); }

.plan-card-name {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 6px 0;
}

.plan-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}

.pricing-card-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.price-currency {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.price-amount {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.price-period {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-annual-savings {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 22px;
    min-height: 20px;
}

.pricing-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.pricing-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.pricing-features-list li i {
    color: var(--primary);
    width: 16px;
    margin-top: 2px;
}

.pricing-features-list li strong {
    color: var(--text);
}

.pricing-trial-disclaimer {
    text-align: center;
    margin-top: 36px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

/* FAQ Accordion */
.faq-accordion-container {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border-radius: 12px;
    overflow: hidden;
    transition: all 150ms ease;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: none;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms ease;
}

.faq-question:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.faq-chevron {
    color: var(--primary);
    transition: transform 150ms ease;
    font-size: 0.95rem;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 150ms ease, padding 150ms ease;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    padding: 0 24px;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 16px 24px 22px 24px;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

/* Marketing Footer */
.marketing-footer {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border-top: 1px solid var(--border);
    padding: 60px 32px 36px 32px;
}

.footer-top {
    max-width: 1320px;
    margin: 0 auto 40px auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 900px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-top {
        grid-template-columns: 1fr;
    }
}

.footer-brand img {
    height: 38px;
    width: auto;
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 150ms ease;
}

.footer-col a:hover {
    color: var(--text);
}

.footer-bottom {
    max-width: 1320px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* In-App Legal Modal & Tabs */
.legal-modal-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    overflow-x: auto;
}

.legal-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 150ms ease;
}

.legal-tab-btn:hover {
    color: var(--text);
}

.legal-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.legal-tab-content {
    display: none;
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 0.92rem;
    line-height: 1.65;
}

.legal-tab-content.active {
    display: block;
}

/* Vault Warning Banners */
.vault-warning-banners-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.vault-warning-banner-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.92rem;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--text) 8%, transparent);
    animation: fadeIn 150ms ease;
}

.vault-warning-banner-item.banner-warning {
    background: color-mix(in srgb, var(--warning) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
    color: var(--warning);
}

.vault-warning-banner-item.banner-danger {
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
    color: var(--danger);
}

.banner-icon-slot {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.banner-text-slot {
    flex-grow: 1;
}

.banner-text-slot strong {
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
}

.banner-text-slot p {
    margin: 0;
    font-size: 0.88rem;
    opacity: 0.95;
    line-height: 1.4;
}

.banner-action-slot {
    flex-shrink: 0;
}




/* ========================================================================
   Approved light design system: shared presentation, no behavior overrides.
   Do not set display on .hidden, [hidden], gated sections or action controls.
   ======================================================================== */
html { color-scheme: light !important; scroll-padding-top: 100px; }
body { background: var(--bg-soft); color: var(--text); font: 400 17px/1.65 var(--font-sans); overflow-x: visible; }
h1,h2,h3,h4 { color: var(--text); font-weight: 750; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.25rem,4vw + 1rem,3.5rem); }
h2 { font-size: clamp(1.75rem,2vw + 1rem,2.5rem); }
h3 { font-size: 1.25rem; }
p { max-width: 70ch; margin-block: 0 1em; }
a { color: var(--primary); text-underline-offset: .2em; }
a:hover { color: var(--primary-hover); }
button,input,select,textarea { font: inherit; }
*,*::before,*::after { transition-duration: 150ms !important; }
:focus-visible { outline: 3px solid var(--primary) !important; outline-offset: 3px; }
.glass,.glass-dark,.card,.pricing-card,.arch-card,.category-explainer-card,.security-pillar-card {
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--border-radius); box-shadow: 0 2px 10px color-mix(in srgb,var(--text) 5%,transparent);
    backdrop-filter: none; -webkit-backdrop-filter: none;
}
.card,.pricing-card,.arch-card,.category-explainer-card,.security-pillar-card { padding: clamp(20px,3vw,32px); }
.hover-lift:hover,.pricing-card:hover,.category-explainer-card:hover,.security-pillar-card:hover { transform: none; box-shadow: 0 3px 12px color-mix(in srgb,var(--text) 8%,transparent); }
.btn,.btn-sm,.btn-action-icon,.btn-att-action,.btn-close,.toggle-password,.top-nav-link,.cat-expander-icon {
    min-height: 48px; min-width: 48px; border-radius: 12px; line-height: 1.35;
}
.btn { padding: 12px 20px; font-weight: 700; box-shadow: none; white-space: normal; }
.btn-primary,.btn-primary:hover,.pill.active,.pill.active:hover,.top-nav-link.active,.top-nav-link.active:hover {
    background: var(--primary); border-color: var(--primary); color: var(--bg); box-shadow: none;
}
.btn-primary:hover { background: var(--primary-hover); transform: none; }
.btn-outline,.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--text-muted); }
.btn-outline:hover,.btn-secondary:hover { background: var(--bg-soft); color: var(--primary-hover); border-color: var(--primary); }
.btn-close,.toggle-password { color: var(--text-muted); }
.btn-danger,#btn-add-emergency { background: var(--danger); color: var(--bg); border-color: var(--danger); }
.btn:disabled,button:disabled,.btn.disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=hidden]),select,textarea {
    min-height: 48px; max-width: 100%; border: 1px solid var(--text-muted) !important;
    background: var(--surface) !important; color: var(--text) !important; border-radius: 12px; padding: 12px 14px;
}
select option { background: var(--surface) !important; color: var(--text) !important; }
input::placeholder,textarea::placeholder { color: var(--text-muted); opacity: 1; }
input[type=checkbox],input[type=radio] { accent-color: var(--primary); width: 20px; height: 20px; flex-shrink: 0; }
.form-group { min-width: 0; margin-bottom: 20px; }
.form-group label { color: var(--text); font-size: .9rem; text-transform: none; letter-spacing: normal; font-weight: 650; }
.form-group input:focus,.form-group textarea:focus,select:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--primary-glow); }
.password-input-wrapper input { padding-right: 54px !important; }
.form-error,.error-message,.text-danger { color: var(--danger); }
.help-text,.form-help,small { color: var(--text-muted); }
.badge,.pill,.plan-type-pill,.section-pill { font-weight: 650; }
.section-pill { background: var(--bg-soft); color: var(--primary); border: 1px solid var(--border); }
.pill-solo { color: var(--primary); background: var(--primary-glow); }
.pill-family { color: var(--accent); background: var(--success-glow); }
.pill-invited { color: var(--warning); background: var(--warning-glow); }
.popular-ribbon,.plan-popular { background: var(--primary); color: var(--bg); box-shadow: none; }
.pricing-card.popular-card,.plan-catalog-card.plan-highlighted { border: 2px solid var(--primary); box-shadow: none; }
.pricing-card,.plan-catalog-card { height: 100%; min-width: 0; }
.pricing-features-list { margin-block: 24px; flex: 1; }
.pricing-features-list li { padding-block: 10px; line-height: 1.55; color: var(--text); }
.pricing-features-list li i { color: var(--accent); }
.pricing-card > .btn { margin-top: auto; width: 100%; }
.plan-card-name,.price-amount,.plan-catalog-card h3 { color: var(--text); }
.plan-catalog-card ul { padding-left: 1.2em; margin-bottom: 20px; }
.plan-catalog-card li { margin-bottom: .75em; }
.billing-toggle { background: var(--bg-soft); border: 1px solid var(--border); }
.billing-toggle-btn { min-height: 48px; padding: 12px 18px; color: var(--text-muted); }
.billing-toggle-btn.active { background: var(--primary); color: var(--bg); }
.public-landing-container { background: var(--bg); color: var(--text); overflow-x: visible; }
.marketing-navbar { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); box-shadow: none; flex-wrap: wrap; }
.marketing-nav-brand span,.marketing-nav-link { color: var(--text); }
.marketing-nav-brand span { background: none; -webkit-text-fill-color: currentColor; }
.marketing-nav-actions { flex-wrap: wrap; }
.marketing-nav-link { font-weight: 600; }
.marketing-nav-link:hover,.marketing-nav-link.active { background: var(--bg-soft); color: var(--primary); }
.marketing-hero-section { background: var(--dark-bg); color: var(--dark-text); max-width: none; padding: clamp(48px,8vw,96px) max(24px,calc((100vw - 1360px)/2)); }
.hero-content,.hero-auth-slot { min-width: 0; }
.hero-title { font-size: clamp(2.25rem,4vw + 1rem,3.5rem); color: var(--dark-text); }
.hero-title .text-gradient,.hero-title span { background: none; -webkit-text-fill-color: currentColor; color: inherit; }
.hero-tagline,.hero-description,.hero-content p,.trust-badge,.trust-badge span { color: var(--dark-text); }
.hero-content .btn-outline { background: transparent; color: var(--dark-text); border-color: var(--dark-text); }
.hero-content :focus-visible { outline-color: var(--dark-text) !important; }
.hero-content .btn-primary { color: var(--bg); }
.hero-eyebrow { background: transparent; color: var(--dark-text); border-color: var(--dark-text); }
.hero-trust-badges,.hero-cta-group { flex-wrap: wrap; }
.hero-auth-slot .auth-card { background: var(--surface); color: var(--text); }
.auth-header h1,.auth-header h2,.auth-header p { color: var(--text); }
.auth-footer a { color: var(--primary); text-decoration: underline; }
.marketing-section { padding: clamp(48px,8vw,96px) 24px; background: var(--bg); }
.marketing-section-dark { background: var(--bg-soft); }
.section-title { color: var(--text); font-size: clamp(1.75rem,2vw + 1rem,2.5rem); }
.section-subtitle,.section-header p { color: var(--text-muted); margin-inline: auto; }
.marketing-footer { background: var(--bg-soft); color: var(--text); border-top: 1px solid var(--border); }
.footer-col h3,.footer-col h4 { font-size: 1rem; color: var(--text); margin-bottom: 16px; }
.footer-col a,.footer-brand p,.footer-bottom { color: var(--text-muted); }
.footer-col a:hover { color: var(--primary); text-decoration: underline; }
.security-pillar-card h3 { font-size: 1.25rem; margin-block: 16px 12px; }
.security-quote-block,.faq-item,.faq-question,.faq-answer { background: var(--surface); color: var(--text); }
.faq-question { min-height: 48px; }
.sidebar.glass { background: var(--surface); box-shadow: none; border-right: 1px solid var(--border); }
.sidebar-brand { min-height: 150px; }
.brand-logo { max-height: 150px; filter: none; }
.sidebar-nav { min-height: 0; padding: 20px 12px; }
.sidebar-footer { background: var(--surface); border-top: 1px solid var(--border); }
.nav-item a { min-height: 48px; color: var(--text-muted); }
.nav-item.active,.nav-item:hover { background: var(--bg-soft); }
.nav-item.active > a { color: var(--primary); }
.nav-3d-icon { box-shadow: none !important; filter: none; }
.nav-item:hover .nav-3d-icon,.top-nav-link:hover .nav-3d-icon { transform: none; }
.main-content { min-width: 0; }
.top-bar { flex-wrap: wrap; align-items: center; }
/* Keep context controls inside their flex row instead of underneath navigation. */
.vault-header-context { display: flex; align-items: center; gap: 10px; flex: 1 1 600px; min-width: 0; max-width: 100%; flex-wrap: wrap; }
.vault-header-context .search-wrapper { flex: 1 1 180px; }
#vault-scope-switcher { min-width: 0; max-width: 100%; flex-wrap: wrap; }
#vault-current-context { overflow-wrap: anywhere; }
.top-bar > .top-nav-menu { min-width: 0; flex: 0 1 auto; }

.top-nav-menu { flex-wrap: wrap; max-width: 100%; overflow-x: visible; background: var(--surface); backdrop-filter: none; }
.top-nav-link { white-space: normal; color: var(--text-muted); padding: 10px 12px; }
.top-nav-link.active { color: var(--bg); }
.search-wrapper { min-width: 0; max-width: 100%; }
.sidebar-folder-item,.sidebar-sub-item { min-height: 48px; }
.nav-count-badge { background: var(--bg-soft); color: var(--text); }
.settings-grid { grid-template-columns: minmax(0,1fr); gap: 24px; }
.settings-grid > .card { min-width: 0; padding: clamp(20px,3vw,32px); }
.settings-grid h3 { font-size: 1.25rem; }
.settings-grid p { font-size: 1rem; }
.settings-grid :is(a,button,span,p) { overflow-wrap: anywhere; }
.settings-grid small { font-size: .875rem; }
.theme-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,170px),1fr)); gap: 16px; }
.theme-option { background: var(--surface); color: var(--text); padding: 16px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; text-align: left; }
.theme-option.active { border: 2px solid var(--primary); }
.theme-option-check { color: var(--primary); }
.theme-option:not(.active) .theme-option-check { visibility: hidden; }
.theme-preview { display: flex; height: 76px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-soft); }
.theme-preview-side { width: 30%; padding: 8px; border-right: 1px solid var(--border); }
.theme-preview-main { flex: 1; padding: 8px; }
.theme-preview .bar { display: block; height: 4px; background: var(--border); margin-bottom: 6px; }
.theme-preview .bar.accent { background: var(--primary); }
.modal { background: color-mix(in srgb,var(--dark-bg) 40%,transparent); padding: 16px; }
.modal-content,.modal-content.glass,.floating-preview-window { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 12px 36px color-mix(in srgb,var(--text) 12%,transparent); backdrop-filter: none; }
.modal-content { max-width: min(900px,calc(100vw - 32px)); }
.modal-body { min-width: 0; }
.modal-header,.modal-actions,.modal-footer { flex-wrap: wrap; gap: 12px; }
.modal-actions .btn { flex-shrink: 0; }
.preview-window-titlebar,.preview-toolbar { background: var(--bg-soft); color: var(--text); }
.preview-window-body { background: var(--surface); color: var(--text); }
.legal-modal-tabs { flex-wrap: wrap; overflow-x: visible; padding-block: 12px; }
.legal-tab-btn { min-height: 48px; white-space: normal; color: var(--text-muted); }
.legal-tab-btn.active,.legal-tab-btn:hover { color: var(--primary); }
.legal-tab-content { overflow-wrap: anywhere; }
.doc-table,.table,.storage-allocation-table,table { border-collapse: collapse; color: var(--text); background: var(--surface); }
th { background: var(--bg-soft); color: var(--text); text-align: left; font-weight: 700; }
th,td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
td { font-size: .9rem; }
.doc-table th,.doc-table td { color: var(--text); }
.doc-table td:nth-child(n+8):nth-child(-n+15),.storage-allocation-table td:nth-child(n+4):nth-child(-n+6) { text-align: right; font-variant-numeric: tabular-nums; }
.table-container,.table-responsive,.doc-table-wrapper { max-width: 100%; overflow-x: auto; }
progress { accent-color: var(--primary); max-width: 100%; }
.plan-quota-alert { background: var(--warning-glow); color: var(--warning); border: 1px solid var(--warning); border-radius: 12px; padding: 16px; }
#document-dropzone,#media-dropzone,.empty-dropzone { background: var(--bg-soft) !important; border-color: var(--text-muted); }
/* Compatibility with static colors emitted by existing JavaScript templates.
 * These selectors affect presentation only, never visibility or stored colors. */
.main-content :is(h1,h2,h3,h4,p,span,div)[style*="color:#fff"],
.main-content :is(h1,h2,h3,h4,p,span,div)[style*="color: #fff"] { color: var(--text) !important; }
.main-content :is(div,section)[style*="background:rgba(0,0,0"],
.main-content :is(div,section)[style*="background: rgba(0,0,0"],
.main-content :is(div,section)[style*="background: rgba(0, 0, 0"] { background: var(--bg-soft) !important; }
@media(max-width:1100px) {
    .top-bar > div { flex-wrap: wrap; }
    .marketing-pricing-grid,.plan-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:768px) {
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    .sidebar { width: 100%; position: static; height: auto; }
    .sidebar-brand { min-height: auto; padding: 16px; }
    .sidebar-brand .brand-logo { max-height: 100px; }
    .sidebar-nav { padding: 12px; }
    .marketing-navbar,.marketing-nav-actions { gap: 12px; }
    .marketing-nav-links { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .marketing-navbar { position: static; }
    .marketing-hero-section { grid-template-columns: minmax(0,1fr); padding-inline: 20px; }
    .hero-content { text-align: left; }
    .hero-auth-slot,.auth-container,.auth-card { width: 100%; min-width: 0; max-width: 100%; }
    .top-bar > div,.action-buttons,.modal-header > div { max-width: 100%; flex-wrap: wrap; min-width: 0; }
    .legal-header-bar,.legal-header-actions,.legal-footer { flex-wrap: wrap; }
    .floating-preview-window { left: 16px !important; top: 16px !important; max-width: calc(100vw - 32px); min-width: 0; max-height: calc(100dvh - 32px); }
    .modal-content,.modal-content.glass { min-width: 0; max-width: calc(100vw - 32px) !important; }
    #view-folders > .folders-management-grid { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:600px) {
    .marketing-pricing-grid,.plan-card-grid,.register-grid,.register-row,.vault-architecture-grid { grid-template-columns: minmax(0,1fr) !important; }
    .main-content { padding: 16px; }
    .marketing-nav-brand { min-width: 0; }
    .marketing-nav-brand span { font-size: 1rem; }
    .marketing-navbar { padding: 16px; }
    .hero-title { font-size: clamp(2.25rem,9vw,3.5rem); }
    .hero-cta-group { justify-content: flex-start; }
    .hero-cta-group .btn { width: 100%; }
    .marketing-section { padding-inline: 16px; }
    .category-explainer-grid,.security-pillars-grid,.footer-top { grid-template-columns: minmax(0,1fr); }
    .auth-card,.register-card,.card,.pricing-card { padding: 20px; }
    .register-col { min-width: 0; }
    .top-bar .search-wrapper { width: 100%; }
    #vault-scope-switcher { flex-wrap: wrap; max-width: 100%; }
    .form-group[style*="min-width"] { min-width: 0 !important; }
    .modal-content { padding: 20px; }
    .modal-header { align-items: flex-start; }
}
@media(prefers-reduced-motion:reduce) {
    *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Final baseline corrections from isolated accessibility/reflow checks. */
*,*::before,*::after { transition-property: color,background-color,border-color,box-shadow,opacity !important; }
.animate-pop { animation: none; }
.toggle-pill-btn { min-height: 48px; padding: 12px 18px; color: var(--text-muted); }
.toggle-pill-btn.active { background: var(--primary); color: var(--bg); }
.pill-invited { color: var(--warning); background: var(--surface); }
#terms-status-badge { background: var(--success); color: var(--bg); }
.settings-grid h3 { flex-wrap: wrap; max-width: 100%; min-width: 0; }
.settings-grid div { min-width: 0; max-width: 100%; }
.settings-grid [style*="display:flex"],.settings-grid [style*="display: flex"] { flex-wrap: wrap; }
.settings-grid .btn { max-width: 100%; }
@media(max-width:600px) {
    .settings-grid [style*="gap"] { gap: 12px !important; }
    .settings-grid input,.settings-grid select { min-width: 0; }
}

/* Preserve icon glyph mappings; use the approved brand treatment for their tiles. */
.nav-3d-icon { background: var(--primary-glow); color: var(--primary); border: 1px solid var(--border); }
.top-nav-link.active .nav-3d-icon { background: var(--bg); color: var(--primary); }
.search-wrapper input { padding-left: 44px !important; }
.plan-quota-alert,.vault-warning-banner-item.banner-warning { background: var(--surface); color: var(--warning); }

.hero-title .gradient-text { background: none; background-clip: border-box; -webkit-background-clip: border-box; -webkit-text-fill-color: currentColor; color: var(--dark-text); }
