:root {
    /* Primary palette - Modern indigo */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --primary-lighter: #eef2ff;
    --primary-dark: #3730a3;

    /* Accent colors */
    --accent-emerald: #10b981;
    --accent-emerald-light: #d1fae5;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fef3c7;
    --accent-rose: #f43f5e;
    --accent-rose-light: #ffe4e6;
    --accent-sky: #0ea5e9;
    --accent-sky-light: #e0f2fe;
    --accent-violet: #8b5cf6;
    --accent-violet-light: #ede9fe;

    /* Neutrals */
    --text-color: #1e293b;
    --text-secondary: #475569;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --white: #ffffff;

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --bg-active: #eef2ff;

    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f8fafc;
    --sidebar-active: #eef2ff;
    --sidebar-border: #e2e8f0;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 76px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE RESET & GLOBAL STYLES ===== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== SHARED FORM STYLES ===== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--white);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-input::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-input,
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.error-message {
    color: var(--error-color);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

/* ===== SHARED BUTTON STYLES ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-lg);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #312e81 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

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

.btn-danger {
    background: none;
    color: var(--error-color);
    border-color: transparent;
    padding: 0.375rem 0.75rem;
}

.btn-danger:hover {
    background-color: var(--accent-rose-light);
    color: #dc2626;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-link:hover {
    background-color: var(--primary-lighter);
    color: var(--primary-hover);
}

.btn-link.text-danger {
    color: var(--error-color);
}

.btn-link.text-danger:hover {
    background-color: var(--accent-rose-light);
    color: #dc2626;
}

.btn .icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== SHARED CARD STYLES ===== */

.content-card,
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* ===== SHARED TABLE STYLES ===== */

.table-container,
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table,
.table,
.users-table,
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.table thead th,
.users-table th,
.activity-table .table-header th {
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    background-color: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.data-table td,
.table td,
.users-table td,
.activity-table .table-row td {
    padding: 0.875rem 1.25rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    vertical-align: middle;
}

.data-table tbody tr:hover,
.table tbody tr:hover,
.users-table tr:hover {
    background-color: var(--bg-hover);
}

.data-table tbody tr:last-child td,
.table tbody tr:last-child td,
.users-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== SHARED MODAL STYLES ===== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal.hidden {
    display: none;
    opacity: 0;
    visibility: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn var(--transition-slow) ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.modal-close,
.close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 1.25rem;
    line-height: 1;
}

.modal-close:hover,
.close-button:hover {
    background-color: var(--bg-hover);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-hover);
}

/* ===== SHARED ALERT STYLES ===== */

.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: var(--accent-emerald-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background-color: var(--accent-amber-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-danger {
    background-color: var(--accent-rose-light);
    color: #9f1239;
    border: 1px solid #fecdd3;
}

/* ===== SHARED BADGE STYLES ===== */

.badge,
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.role-badge {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.role-badges {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-actief,
.status-badge.open,
.status-open {
    background-color: var(--accent-emerald-light);
    color: #065f46;
}

.status-inactief,
.status-badge.in_progress,
.status-in_progress {
    background-color: var(--accent-sky-light);
    color: #0369a1;
}

.status-geblokkeerd,
.status-badge.closed,
.status-closed {
    background-color: #f1f5f9;
    color: var(--text-light);
}

.status-waiting_for_input {
    background-color: var(--accent-amber-light);
    color: #92400e;
}

.status-resolved {
    background-color: var(--accent-emerald-light);
    color: #065f46;
}

/* Priority badges */
.priority-low {
    background-color: var(--accent-emerald-light);
    color: #065f46;
}

.priority-medium {
    background-color: var(--accent-sky-light);
    color: #0369a1;
}

.priority-high {
    background-color: var(--accent-amber-light);
    color: #92400e;
}

.priority-urgent {
    background-color: var(--accent-rose-light);
    color: #9f1239;
}

/* ===== SHARED SEARCH/FILTER STYLES ===== */

.search-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.search-box {
    position: relative;
    max-width: 380px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background-color: var(--white);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 1.125rem;
    height: 1.125rem;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.5rem 2.25rem 0.5rem 0.875rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    background-color: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* ===== SHARED PAGE STYLES ===== */

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

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

/* ===== FORM GRID ===== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full-width {
        grid-column: span 1;
    }
}

/* ===== PROFILE PHOTO ===== */

.profile-photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
}

.profile-photo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.profile-photo:hover {
    transform: scale(1.1);
}

/* ===== UTILITY CLASSES ===== */

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.inline-form { display: inline; }
.hidden-row { display: none; }
.form-help { font-size: 0.8125rem; color: var(--text-light); margin-top: 0.375rem; line-height: 1.5; }

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.align-items-end { align-items: flex-end !important; }
.w-100 { width: 100% !important; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem !important; }

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .button-group {
        width: 100%;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }

    .row {
        flex-direction: column;
    }

    .col-md-2, .col-md-3, .col-md-4 {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
}

/* ===== SCROLLBAR STYLING ===== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
