/**
 * MicroAdmin - Globale Stylesheet
 * Gedeelde opmaak voor het hele platform.
 */

/* === CSS VARIABLES (DARK = DEFAULT) === */
:root {
    --primary-color: #60a5fa;
    --primary-dark: #3b82f6;
    --accent-color: #fbbf24;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --error-color: #f87171;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --info-color: #60a5fa;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --radius: 0.5rem;
}

/* === LIGHT MODE OVERRIDE === */
html[data-theme="light"] {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --error-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

/* === RESET & BASIS === */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* === LAYOUT === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
}

/* === NAVBAR === */
.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.navbar-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    margin: 3px 0;
    border-radius: 2px;
}

.navbar-menu {
    display: flex;
    align-items: center;
}

/* === NAV SECTIONS === */
.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    align-items: center;
}

.navbar-nav-left {
    flex: 1;
}

.navbar-nav-right {
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border-color);
}

/* === NAV ITEMS === */
.nav-item {
    position: relative;
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--bg-color);
}

.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
    position: relative;
    white-space: nowrap;
    font-size: 0.95rem;
}
.nav-link:hover {
    background: var(--bg-color);
    text-decoration: none;
}

/* === NAV DROPDOWN === */
.nav-dropdown {
    position: relative;
}

/* Onzichtbare brug tussen toggle en menu -- vangt muis op zodat hover niet breekt */
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 10px;
    z-index: 1001;
}

.nav-dropdown-toggle {
    cursor: default;
}

.nav-dropdown-toggle::after {
    content: '\25BC';
    font-size: 0.6rem;
    margin-left: 0.15rem;
    opacity: 0.6;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    z-index: 1001;
    list-style: none;
    margin: 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    color: var(--text-color);
    font-size: 0.9rem;
    transition: background 0.15s;
}
.nav-dropdown-item:hover {
    background: var(--bg-color);
    text-decoration: none;
}
.nav-dropdown-item.active {
    color: var(--primary-color);
    font-weight: 600;
    background: var(--bg-color);
}

/* === NAV BADGE === */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent-color);
    color: #0f172a;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 0.25rem;
}

/* === NAV DIVIDER === */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(96 165 250 / 0.2);
}
html[data-theme="light"] .form-input:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] .form-textarea:focus {
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover {
    text-decoration: none;
}
.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--error-color);
    color: #fff;
    border-color: var(--error-color);
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-color);
}

/* === CARDS === */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* === FLASH MESSAGES === */
.flash {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}
.flash-success {
    background: #064e3b;
    border-color: var(--success-color);
    color: #bbf7d0;
}
html[data-theme="light"] .flash-success {
    background: #f0fdf4;
    color: #166534;
}
.flash-error {
    background: #450a0a;
    border-color: var(--error-color);
    color: #fecaca;
}
html[data-theme="light"] .flash-error {
    background: #fef2f2;
    color: #991b1b;
}
.flash-warning {
    background: #451a03;
    border-color: var(--warning-color);
    color: #fde68a;
}
html[data-theme="light"] .flash-warning {
    background: #fffbeb;
    color: #92400e;
}
.flash-info {
    background: #172554;
    border-color: var(--info-color);
    color: #bfdbfe;
}
html[data-theme="light"] .flash-info {
    background: #eff6ff;
    color: #1e40af;
}

/* === LOGIN / REGISTER PAGE === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === TABLES === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}
.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--text-muted);
}
.data-table tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr:hover td {
    background: var(--bg-color);
}

/* === FOOTER === */
.site-footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.site-footer .version {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

/* === PRINT STYLES === */
@media print {
    .navbar,
    .site-footer,
    .btn,
    form,
    .flash,
    .auth-links,
    .navbar-toggle {
        display: none !important;
    }
    .main-content {
        padding: 0;
        max-width: 100%;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        background: #fff;
        color: #000;
    }
    .data-table {
        box-shadow: none;
        background: #fff;
        color: #000;
    }
    .data-table th {
        background: #f5f5f5;
        color: #000;
    }
    body {
        background: #fff;
        color: #000;
    }
    a {
        color: #000;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }
    .navbar-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--surface-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        padding: 0.5rem;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }
    .navbar-menu.active {
        display: block;
    }
    .navbar-nav {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }
    .navbar-nav-right {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    .nav-item.active .nav-link::after {
        left: 0.75rem;
        right: 0.75rem;
    }
    .nav-dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        background: transparent;
    }
    .nav-dropdown-toggle::after {
        content: '';
    }
    .nav-divider {
        display: none;
    }
    .main-content {
        padding: 1rem;
    }
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .card {
        padding: 1rem;
    }
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}
.badge-blue {
    background: #1e3a5f;
    color: #93c5fd;
}
html[data-theme="light"] .badge-blue {
    background: #dbeafe;
    color: #1e40af;
}
.badge-green {
    background: #064e3b;
    color: #86efac;
}
html[data-theme="light"] .badge-green {
    background: #dcfce7;
    color: #166534;
}
.badge-red {
    background: #450a0a;
    color: #fca5a5;
}
html[data-theme="light"] .badge-red {
    background: #fee2e2;
    color: #991b1b;
}
.badge-yellow {
    background: #451a03;
    color: #fcd34d;
}
html[data-theme="light"] .badge-yellow {
    background: #fef3c7;
    color: #92400e;
}
.badge-purple {
    background: #4c1d6b;
    color: #d8b4fe;
}
html[data-theme="light"] .badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
}

/* === LABEL TAGS === */
.label-tag {
    display: inline-block;
    padding: 0.1rem 0.375rem;
    border-radius: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    margin-right: 0.25rem;
}

/* === AVATARS === */
.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.avatar-sm {
    width: 40px;
    height: 40px;
}
.avatar-lg {
    width: 120px;
    height: 120px;
}
.avatar-fallback {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}
.avatar-fallback-sm {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}
.avatar-fallback-lg {
    width: 120px;
    height: 120px;
    font-size: 2rem;
}

/* === FAVORITE BUTTON === */
.fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.fav-btn:hover {
    text-decoration: none;
    background: var(--bg-color);
}
.fav-btn.active {
    background: var(--warning-color);
    color: #0f172a;
    border-color: var(--warning-color);
}

/* === DETAIL GRID === */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.detail-label {
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.detail-value {
    margin: 0;
    font-weight: 600;
}

/* === FILE INPUT === */
.file-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.file-input-wrapper input[type="file"] {
    padding: 0.5rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

/* === LABEL SELECTOR === */
.label-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.label-option {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
    background: var(--surface-color);
    color: var(--text-color);
    transition: border-color 0.2s;
}
.label-option:hover {
    border-color: var(--primary-color);
}
.label-option input[type="checkbox"] {
    margin: 0;
}
.label-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* === SMALL BUTTON === */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* === CHECKBOX GROUP === */
.checkbox-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

/* === SEARCH BAR === */
.search-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.search-bar .form-group {
    margin-bottom: 0;
}
.search-bar .form-group:first-child {
    flex: 1;
    min-width: 200px;
}

/* === BULK ACTIONS === */
.bulk-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* === FORM GRID === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.form-grid-full {
    grid-column: 1 / -1;
}

/* === TIMELINE FEED === */
.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.timeline-item {
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.timeline-action {
    font-weight: 600;
    font-size: 0.9rem;
}
.timeline-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.timeline-details {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === GRID UTILITIES === */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
.grid-2-asymmetric {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* === LIST UTILITIES === */
.list-plain {
    list-style: none;
    padding: 0;
    margin: 0;
}
.list-item-split {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.list-item-split-sm {
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === MODAL SCROLL AREA === */
.modal-scroll {
    max-height: 350px;
    overflow-y: auto;
}
.modal-scroll-sm {
    max-height: 300px;
    overflow-y: auto;
}

/* === UTILITY HELPERS === */
.cursor-pointer { cursor: pointer; }
.hidden { display: none !important; }
.d-inline { display: inline; }

/* === STEP BADGES (import wizard) === */
.step-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
}
.step-active {
    background: var(--primary-color);
    color: #fff;
}
.step-inactive {
    background: var(--bg-color);
    color: var(--text-color);
}
.section-divider {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}
.card-title-sm { font-size: 1rem; }
.btn-compact {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
}

/* === STAT CARDS (dashboard counters) === */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}
.stat-value-accent {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
}
.stat-label {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* === MODAL === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}
.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease;
    margin: 0 auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
    flex-shrink: 0;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}
.modal-close:hover {
    color: var(--text-color);
    background: var(--bg-color);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

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

/* Large modal */
.modal-lg .modal {
    max-width: 720px;
}

/* Full-width modal (inline in page) */
.modal-inline {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

/* === CARD EDIT MODE === */
.card-edit-mode {
    border-left: 4px solid var(--accent-color);
}

/* === LAYOUT UTILITIES === */
.flex-row {
    display: flex;
    gap: 1rem;
}
.flex-row-wrap {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.align-center {
    align-items: center;
}
.align-end {
    align-items: flex-end;
}
.justify-between {
    justify-content: space-between;
}
.gap-sm {
    gap: 0.5rem;
}
.gap-md {
    gap: 1rem;
}
.gap-lg {
    gap: 2rem;
}

/* === SPACING UTILITIES === */
.mb-4 { margin-bottom: 1.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-6 { margin-top: 2rem; }

/* === SIZE UTILITIES === */
.w-full { width: 100%; }
.whitespace-nowrap { white-space: nowrap; }

/* === TEXT UTILITIES === */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* === COMPONENT UTILITIES === */
.form-inline { display: inline; }
.notes-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.metadata-value {
    margin: 0 0 1rem;
    font-weight: 600;
}
.dup-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: var(--radius);
}
.dup-group-title {
    margin: 0 0 0.5rem;
    font-weight: 600;
}
.birthday-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.birthday-item {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.birthday-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.color-input {
    width: 50px;
    height: 40px;
    border: none;
    cursor: pointer;
}
.label-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
}
.mb-0 { margin-bottom: 0; }

/* === FOCUS RING === */
.focus-ring:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* === VISUALLY HIDDEN (a11y) === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === TENANT TAKEOVER BANNER === */
.takeover-banner {
    background: var(--warning-color);
    color: #0f172a;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.takeover-banner form {
    margin: 0;
}
.takeover-banner .btn {
    background: #0f172a;
    color: #fbbf24;
    border-color: #0f172a;
}
.takeover-banner .btn:hover {
    background: #1e293b;
    border-color: #1e293b;
}

/* === FORM VALIDATION === */
.is-invalid {
    border-color: var(--error-color) !important;
}
.is-invalid:focus {
    box-shadow: 0 0 0 3px rgb(248 113 113 / 0.2) !important;
}
html[data-theme="light"] .is-invalid:focus {
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.15) !important;
}

/* === INPUT GROUP (password + generate button) === */
.input-group {
    display: flex;
    gap: 0;
}
.input-group .form-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1;
}
.input-group .btn-addon {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    padding: 0.625rem 0.875rem;
    white-space: nowrap;
}

/* === MULTI SELECT TABLE (modal) === */
.multi-select-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.multi-select-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}
.multi-select-table tbody td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}
.multi-select-table tbody tr.selectable {
    cursor: pointer;
}
.multi-select-table tbody tr.selectable:hover {
    background: var(--bg-color);
}
.multi-select-table tbody tr.selected {
    background: rgb(59 130 246 / 0.25);
}
.multi-select-table tbody tr.selected td:first-child {
    border-left: 4px solid var(--primary-color);
}
.multi-select-table tbody tr.selected:hover {
    background: rgb(59 130 246 / 0.35);
}
.multi-select-table .checkbox-cell {
    width: 2rem;
    text-align: center;
}

/* === MODAL SEARCH === */
.modal-search {
    position: sticky;
    top: 0;
    background: var(--surface-color);
    padding-bottom: 0.75rem;
    z-index: 2;
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === UTILITY === */
.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }

/* === THEMING PAGES === */
.theme-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.theme-left-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.theme-right-col {
    position: sticky;
    top: 1rem;
    align-self: start;
}
.theme-preview-card {
    padding: 0;
    overflow: hidden;
}
.theme-preview-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.theme-preview-body {
    min-height: 350px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    border-radius: 0 0 8px 8px;
}
.theme-preview-navbar {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    transition: all 0.2s ease;
}
.theme-preview-navbar-brand {
    font-weight: bold;
    font-size: 1.1rem;
}
.theme-preview-nav-item {
    padding: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 0.85rem;
}
.theme-preview-surface {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}
.theme-preview-title {
    margin: 0 0 1rem 0;
    transition: all 0.2s ease;
}
.theme-preview-text {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.theme-preview-btn {
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.theme-preview-table {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}
.theme-preview-table-row {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.theme-preview-table-row:last-child {
    border-bottom: none;
}
.theme-preview-table-name {
    font-weight: 500;
    transition: all 0.2s ease;
}
.theme-preview-badge {
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}
.theme-color-picker {
    width: 50px;
    height: 40px;
    border: none;
    cursor: pointer;
    border-radius: 6px;
}
.theme-color-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.theme-color-row .form-input {
    flex: 1;
}
.theme-save-btn {
    width: 100%;
}
/* App preview phone mockup */
.app-preview-phone {
    width: 260px;
    height: 420px;
    border-radius: 24px;
    border: 4px solid var(--surface-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}
.app-preview-header {
    padding: 0.75rem;
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.app-preview-content {
    flex: 1;
    padding: 0.75rem;
    overflow-y: auto;
}
.app-preview-search {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}
.app-preview-card {
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}
.app-preview-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    transition: all 0.2s ease;
}
.app-preview-name {
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.app-preview-sub {
    font-size: 0.75rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}
.app-preview-fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}
.app-preview-bottomnav {
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}
.app-preview-nav-item {
    font-size: 0.7rem;
    text-align: center;
    transition: all 0.2s ease;
}
.app-preview-center {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
}
