/* ============================================
   AulaClichn Design System v2.0
   ============================================ */

/* --- Variables --- */
:root {
    --ac-primary: #4f46e5;
    --ac-primary-light: #6366f1;
    --ac-primary-dark: #3730a3;
    --ac-primary-50: #eef2ff;
    --ac-secondary: #0ea5e9;
    --ac-success: #10b981;
    --ac-warning: #f59e0b;
    --ac-danger: #ef4444;
    --ac-info: #06b6d4;

    --ac-sidebar-bg: #0f172a;
    --ac-sidebar-hover: rgba(255, 255, 255, 0.06);
    --ac-sidebar-active: rgba(79, 70, 229, 0.3);
    --ac-sidebar-text: #94a3b8;
    --ac-sidebar-text-active: #ffffff;
    --ac-sidebar-width: 270px;

    --ac-body-bg: #f1f5f9;
    --ac-card-bg: #ffffff;
    --ac-border: #e2e8f0;
    --ac-border-light: #f1f5f9;
    --ac-text: #1e293b;
    --ac-text-muted: #64748b;
    --ac-text-light: #94a3b8;

    --ac-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ac-radius: 10px;
    --ac-radius-sm: 6px;
    --ac-radius-lg: 16px;
    --ac-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --ac-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --ac-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --ac-transition: all 0.2s ease;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--ac-font);
    background: var(--ac-body-bg);
    color: var(--ac-text);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Sidebar --- */
.ac-sidebar {
    width: var(--ac-sidebar-width);
    height: 100vh;
    background: var(--ac-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.ac-sidebar::-webkit-scrollbar { width: 4px; }
.ac-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.ac-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.ac-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.ac-sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--ac-primary), var(--ac-secondary));
    border-radius: var(--ac-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ac-sidebar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

.ac-sidebar-brand-sub {
    color: var(--ac-text-light);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ac-sidebar-nav {
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.ac-sidebar-nav::-webkit-scrollbar { width: 4px; }
.ac-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.ac-sidebar-section {
    color: var(--ac-text-light);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 20px 24px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    position: relative;
}

.ac-sidebar-section:hover {
    color: rgba(255, 255, 255, 0.9);
}

.ac-sidebar-section-arrow {
    font-size: 0.6rem;
    transition: transform 0.25s ease;
}

.ac-sidebar-section[aria-expanded="false"] .ac-sidebar-section-arrow {
    transform: rotate(-90deg);
}

.ac-sidebar-group {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}

.ac-sidebar-group.collapsed {
    max-height: 0;
    opacity: 0;
}

.ac-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    margin: 2px 12px;
    color: var(--ac-sidebar-text);
    text-decoration: none;
    border-radius: var(--ac-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--ac-transition);
    position: relative;
}

.ac-sidebar-link:hover {
    color: var(--ac-sidebar-text-active);
    background: var(--ac-sidebar-hover);
}

.ac-sidebar-link.active {
    color: var(--ac-sidebar-text-active);
    background: var(--ac-sidebar-active);
}

.ac-sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--ac-primary-light);
    border-radius: 0 3px 3px 0;
}

.ac-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ac-sidebar-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
}

/* --- Sidebar Footer & Collapse --- */
.ac-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 12px;
    flex-shrink: 0;
}

.ac-sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 8px;
    background: none;
    border: none;
    color: var(--ac-sidebar-text);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--ac-radius-sm);
    cursor: pointer;
    transition: var(--ac-transition);
    white-space: nowrap;
}

.ac-sidebar-collapse-btn:hover {
    color: var(--ac-sidebar-text-active);
    background: var(--ac-sidebar-hover);
}

.ac-sidebar-collapse-btn i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Collapsed sidebar (desktop only) */
@media (min-width: 992px) {
    .ac-sidebar {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .ac-sidebar.collapsed {
        width: 72px;
    }

    .ac-sidebar.collapsed .ac-sidebar-brand > div:last-child,
    .ac-sidebar.collapsed .ac-sidebar-section span,
    .ac-sidebar.collapsed .ac-sidebar-section-arrow,
    .ac-sidebar.collapsed .ac-sidebar-collapse-text,
    .ac-sidebar.collapsed .ac-sidebar-text,
    .ac-sidebar.collapsed .ac-sidebar-link .badge {
        opacity: 0;
        width: 0;
        overflow: hidden;
        white-space: nowrap;
        transition: opacity 0.15s ease;
    }

    .ac-sidebar.collapsed .ac-sidebar-header {
        padding: 24px 16px;
        display: flex;
        justify-content: center;
    }

    .ac-sidebar.collapsed .ac-sidebar-brand {
        gap: 0;
    }

    .ac-sidebar.collapsed .ac-sidebar-section {
        padding: 12px 16px 4px;
        justify-content: center;
        pointer-events: none;
    }

    .ac-sidebar.collapsed .ac-sidebar-section::after {
        content: '';
        display: block;
        width: 24px;
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        position: absolute;
        bottom: 0;
    }

    .ac-sidebar.collapsed .ac-sidebar-link {
        padding: 10px 0;
        margin: 2px 8px;
        justify-content: center;
        gap: 0;
        position: relative;
    }

    .ac-sidebar.collapsed .ac-sidebar-link.active::before {
        left: -8px;
    }

    .ac-sidebar.collapsed .ac-sidebar-collapse-btn {
        justify-content: center;
        gap: 0;
    }

    .ac-sidebar.collapsed .ac-sidebar-collapse-btn i {
        transform: rotate(180deg);
    }

    .ac-sidebar.collapsed .ac-sidebar-group {
        max-height: 800px !important;
        opacity: 1 !important;
    }

    /* Tooltip on hover for collapsed links */
    .ac-sidebar.collapsed .ac-sidebar-link::after {
        content: attr(data-title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: #1e293b;
        color: #fff;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.8rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        margin-left: 8px;
        z-index: 1050;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .ac-sidebar.collapsed .ac-sidebar-link:hover::after {
        opacity: 1;
    }

    /* Hover expand */
    .ac-sidebar.collapsed:hover {
        width: var(--ac-sidebar-width);
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.3);
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-brand > div:last-child,
    .ac-sidebar.collapsed:hover .ac-sidebar-section span,
    .ac-sidebar.collapsed:hover .ac-sidebar-section-arrow,
    .ac-sidebar.collapsed:hover .ac-sidebar-collapse-text,
    .ac-sidebar.collapsed:hover .ac-sidebar-text,
    .ac-sidebar.collapsed:hover .ac-sidebar-link .badge {
        opacity: 1;
        width: auto;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-header {
        padding: 24px 20px;
        justify-content: flex-start;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-brand {
        gap: 12px;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-section {
        padding: 20px 24px 8px;
        justify-content: space-between;
        pointer-events: auto;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-section::after {
        display: none;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-link {
        padding: 10px 20px;
        margin: 2px 12px;
        justify-content: flex-start;
        gap: 12px;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-link.active::before {
        left: -12px;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-link::after {
        display: none;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-collapse-btn {
        justify-content: flex-start;
        gap: 12px;
    }

    .ac-sidebar.collapsed:hover .ac-sidebar-group.collapsed {
        max-height: 0 !important;
        opacity: 0 !important;
    }

    /* Main content adjustment */
    .ac-main {
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.sidebar-collapsed .ac-main {
        margin-left: 72px;
    }
}

/* --- Main Content --- */
.ac-main {
    margin-left: var(--ac-sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Top Bar --- */
.ac-topbar {
    background: var(--ac-card-bg);
    border-bottom: 1px solid var(--ac-border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ac-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ac-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ac-topbar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ac-text);
}

.ac-breadcrumb {
    font-size: 0.8rem;
    color: var(--ac-text-muted);
}

/* --- Content Area --- */
.ac-content {
    padding: 24px;
}

/* --- Cards --- */
.ac-card {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow);
    padding: 20px;
}

.ac-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ac-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    margin: -20px -20px 20px -20px;
}

.ac-card-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Form Section Card --- */
.ac-form-section {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.ac-form-section-header {
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--ac-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-form-section-header i {
    font-size: 1rem;
    color: var(--ac-primary);
    width: 20px;
    text-align: center;
}

.ac-form-section-header h6 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ac-text);
}

.ac-form-section-body {
    padding: 20px;
}

/* --- Stat Cards --- */
.ac-stat-card {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 20px;
    box-shadow: var(--ac-shadow);
    transition: var(--ac-transition);
}

.ac-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ac-shadow-lg);
}

.ac-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--ac-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.ac-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.ac-stat-label {
    font-size: 0.8rem;
    color: var(--ac-text-muted);
    font-weight: 500;
}

/* --- Tables --- */
.ac-table-wrapper {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow);
    overflow: hidden;
}

.ac-table {
    width: 100%;
    margin: 0;
}

.ac-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--ac-border);
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ac-text-muted);
    white-space: nowrap;
}

.ac-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ac-border-light);
    font-size: 0.875rem;
    vertical-align: middle;
}

.ac-table tbody tr:hover {
    background: #f8fafc;
}

.ac-table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Badges --- */
.ac-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ac-badge-success { background: #ecfdf5; color: #065f46; }
.ac-badge-danger { background: #fef2f2; color: #991b1b; }
.ac-badge-warning { background: #fffbeb; color: #92400e; }
.ac-badge-info { background: #eff6ff; color: #1e40af; }
.ac-badge-primary { background: #eef2ff; color: #3730a3; }
.ac-badge-secondary { background: #f1f5f9; color: #475569; }

/* --- Buttons --- */
.ac-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--ac-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--ac-transition);
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}

.ac-btn:hover { transform: translateY(-1px); box-shadow: var(--ac-shadow-md); }

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

.ac-btn-success { background: var(--ac-success); color: #fff; }
.ac-btn-success:hover { background: #059669; color: #fff; }

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

.ac-btn-secondary { background: #fff; color: var(--ac-text); border: 1px solid var(--ac-border); }
.ac-btn-secondary:hover { background: #f8fafc; color: var(--ac-text); }

.ac-btn-sm { padding: 5px 10px; font-size: 0.78rem; }

.ac-btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ac-radius-sm);
    border: 1px solid var(--ac-border);
    background: #fff;
    color: var(--ac-text-muted);
    transition: var(--ac-transition);
    cursor: pointer;
    font-size: 0.9rem;
}

.ac-btn-icon:hover { background: #f8fafc; color: var(--ac-text); border-color: #cbd5e1; }
.ac-btn-icon.text-danger:hover { background: #fef2f2; color: var(--ac-danger); border-color: #fecaca; }
.ac-btn-icon.text-success:hover { background: #ecfdf5; color: var(--ac-success); border-color: #a7f3d0; }
.ac-btn-icon.text-warning:hover { background: #fffbeb; color: var(--ac-warning); border-color: #fde68a; }
.ac-btn-icon.text-primary:hover { background: #eef2ff; color: var(--ac-primary); border-color: #c7d2fe; }

/* --- Forms --- */
.ac-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ac-text);
    margin-bottom: 6px;
}

.ac-form-label .text-danger { font-size: 0.9em; }

.ac-form-control {
    display: block;
    width: 100%;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    padding: 9px 14px;
    font-size: 0.875rem;
    transition: var(--ac-transition);
    color: var(--ac-text);
    background: #fff;
    font-family: var(--ac-font);
}

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

.ac-form-control::placeholder {
    color: var(--ac-text-light);
}

.ac-form-control.is-invalid {
    border-color: var(--ac-danger);
}

.ac-form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

textarea.ac-form-control {
    resize: vertical;
    min-height: 80px;
}

select.ac-form-control {
    appearance: auto;
}

.ac-form-hint {
    font-size: 0.75rem;
    color: var(--ac-text-light);
    margin-top: 4px;
}

/* --- Form Checkbox / Check Card --- */
.ac-check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    cursor: pointer;
    transition: var(--ac-transition);
    background: #fff;
}

.ac-check-card:hover {
    border-color: var(--ac-primary-light);
    background: var(--ac-primary-50);
}

.ac-check-card.active,
.ac-check-card:has(input:checked) {
    border-color: var(--ac-primary);
    background: var(--ac-primary-50);
}

.ac-check-card .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.ac-check-card-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ac-text);
    line-height: 1.3;
}

.ac-check-card-desc {
    font-size: 0.75rem;
    color: var(--ac-text-muted);
}

/* Toggle switch */
.ac-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.ac-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ac-toggle-track {
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 11px;
    position: relative;
    transition: var(--ac-transition);
    flex-shrink: 0;
}

.ac-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: var(--ac-transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ac-toggle input:checked + .ac-toggle-track {
    background: var(--ac-primary);
}

.ac-toggle input:checked + .ac-toggle-track::after {
    transform: translateX(18px);
}

.ac-toggle-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ac-text);
}

/* --- Form Footer --- */
.ac-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    margin-top: 4px;
}

/* --- Page Header --- */
.ac-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.ac-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0;
    line-height: 1.3;
}

.ac-page-subtitle {
    font-size: 0.85rem;
    color: var(--ac-text-muted);
    margin: 2px 0 0;
}

/* --- Module Cards --- */
.ac-module-card {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 24px;
    text-align: center;
    transition: var(--ac-transition);
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--ac-text);
}

.ac-module-card:hover {
    border-color: var(--ac-primary-light);
    transform: translateY(-3px);
    box-shadow: var(--ac-shadow-lg);
    color: var(--ac-text);
}

.ac-module-card i {
    font-size: 2.2rem;
    color: var(--ac-primary);
    margin-bottom: 12px;
    display: block;
}

.ac-module-card h6 {
    font-weight: 600;
    margin-bottom: 4px;
}

.ac-module-card small {
    color: var(--ac-text-muted);
    font-size: 0.78rem;
}

/* --- Alerts --- */
.ac-alert {
    border-radius: var(--ac-radius);
    border: none;
    padding: 14px 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ac-alert-success { background: #ecfdf5; color: #065f46; border-left: 4px solid var(--ac-success); }
.ac-alert-danger { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--ac-danger); }
.ac-alert-warning { background: #fffbeb; color: #92400e; border-left: 4px solid var(--ac-warning); }
.ac-alert-info { background: #eff6ff; color: #1e40af; border-left: 4px solid var(--ac-info); }

/* --- User Avatar --- */
.ac-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ac-primary), var(--ac-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* --- Profile Chip --- */
.ac-profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 2px solid var(--ac-border);
    border-radius: var(--ac-radius);
    cursor: pointer;
    transition: var(--ac-transition);
    background: #fff;
    min-width: 160px;
}

.ac-profile-chip:hover {
    border-color: var(--ac-text-light);
}

.ac-profile-chip.selected {
    border-color: var(--profile-color, var(--ac-primary));
    background: color-mix(in srgb, var(--profile-color, var(--ac-primary)) 8%, white);
}

.ac-profile-chip .form-check-input { margin: 0; flex-shrink: 0; }
.ac-profile-chip i { font-size: 1.1rem; flex-shrink: 0; }
.ac-profile-chip span { font-size: 0.875rem; font-weight: 500; }

/* --- Filter Bar --- */
.ac-filter-bar {
    background: var(--ac-card-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: var(--ac-shadow);
}

.ac-filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ac-text-muted);
    margin-right: 4px;
}

.ac-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--ac-border);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ac-transition);
    background: #fff;
    color: var(--ac-text-muted);
}

.ac-filter-btn:hover { border-color: var(--ac-text-light); color: var(--ac-text); }
.ac-filter-btn.active { background: var(--ac-primary); border-color: var(--ac-primary); color: #fff; }

/* --- Empty State --- */
.ac-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--ac-text-muted);
}

.ac-empty-state i { font-size: 3rem; display: block; margin-bottom: 12px; opacity: 0.4; }
.ac-empty-state p { font-size: 0.9rem; margin: 0; }

/* --- Permission Grid --- */
.ac-perm-group {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
    transition: var(--ac-transition);
}

.ac-perm-group:hover { border-color: var(--ac-primary-light); }

.ac-perm-group-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--ac-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ac-perm-group-header label { font-weight: 600; font-size: 0.85rem; cursor: pointer; }

.ac-perm-group-body {
    padding: 10px 14px;
}

.ac-perm-group-body .form-check { padding-top: 4px; padding-bottom: 4px; }
.ac-perm-group-body .form-check-label { font-size: 0.82rem; color: var(--ac-text-muted); }

/* --- Dropdown menu override --- */
.dropdown-menu {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow-lg);
    padding: 8px;
}

.dropdown-item { border-radius: var(--ac-radius-sm); padding: 8px 12px; font-size: 0.85rem; }
.dropdown-item:hover { background: #f1f5f9; }

/* --- DataTables override --- */
.dataTables_wrapper { padding: 16px 20px; }

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_filter label {
    font-size: 0.82rem;
    color: var(--ac-text-muted);
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--ac-border) !important;
    border-radius: var(--ac-radius-sm) !important;
    padding: 7px 14px !important;
    font-size: 0.85rem !important;
    transition: var(--ac-transition);
    margin-left: 6px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--ac-primary-light) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
    outline: none !important;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 12px;
}

.dataTables_wrapper .dataTables_length label {
    font-size: 0.82rem;
    color: var(--ac-text-muted);
    font-weight: 500;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--ac-border) !important;
    border-radius: var(--ac-radius-sm) !important;
    padding: 5px 10px !important;
    font-size: 0.82rem !important;
    margin: 0 4px !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.8rem;
    color: var(--ac-text-muted);
    padding-top: 12px !important;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 12px !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px !important;
    border-radius: var(--ac-radius-sm) !important;
    border: 1px solid var(--ac-border) !important;
    background: #fff !important;
    color: var(--ac-text) !important;
    font-size: 0.82rem !important;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--ac-primary) !important;
    border-color: var(--ac-primary) !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: var(--ac-text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: #f8fafc !important;
    border-color: var(--ac-border) !important;
    color: var(--ac-text-light) !important;
    cursor: default;
    opacity: 0.6;
}

/* --- Select2 override --- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--ac-border) !important;
    border-radius: var(--ac-radius-sm) !important;
    min-height: 40px !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--ac-primary-light) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.select2-dropdown {
    border: 1px solid var(--ac-border) !important;
    border-radius: var(--ac-radius-sm) !important;
    box-shadow: var(--ac-shadow-lg) !important;
}

.select2-results__option--highlighted { background: var(--ac-primary) !important; }

/* --- Bootstrap form-check override --- */
.form-check-input { border-color: #cbd5e1; cursor: pointer; }
.form-check-input:checked { background-color: var(--ac-primary); border-color: var(--ac-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); border-color: var(--ac-primary-light); }
.form-check-label { cursor: pointer; }

/* --- Bootstrap input-group fix --- */
.input-group-text {
    border-color: var(--ac-border);
    background: #f8fafc;
    font-size: 0.875rem;
    color: var(--ac-text-muted);
}

/* --- Color input --- */
input[type="color"].ac-form-control {
    width: 50px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

/* --- Login Page --- */
.ac-login-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ac-login-bg::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15), transparent 70%);
    top: -200px;
    right: -100px;
}

.ac-login-bg::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1), transparent 70%);
    bottom: -100px;
    left: -50px;
}

.ac-login-card {
    max-width: 440px;
    width: 100%;
    border-radius: var(--ac-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .ac-sidebar { transform: translateX(-100%); }
    .ac-sidebar.show { transform: translateX(0); }
    .ac-main { margin-left: 0; }
    .ac-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }
    .ac-sidebar-overlay.show { display: block; }
    .ac-content { padding: 16px; }
    .ac-page-header { flex-direction: column; align-items: flex-start; }
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ac-fade-in { animation: fadeIn 0.3s ease forwards; }

/* --- School theme variant (blue) --- */
.ac-sidebar.school-theme {
    background: linear-gradient(180deg, #0c4a6e 0%, #0e7490 100%);
}

.ac-sidebar.school-theme .ac-sidebar-link.active { background: rgba(255, 255, 255, 0.15); }
.ac-sidebar.school-theme .ac-sidebar-link.active::before { background: #22d3ee; }
