/* ====================================================
   KBM Mandiri - Design System (main.css)
   SMKN 1 Cipeundeuy
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- CSS Variables (Token System) ---- */
:root {
    --primary-50: #E3F2FD;
    --primary-100: #BBDEFB;
    --primary-200: #90CAF9;
    --primary-300: #64B5F6;
    --primary-400: #42A5F5;
    --primary-500: #2196F3;
    --primary-600: #1E88E5;
    --primary-700: #1976D2;
    --primary-800: #1565C0;
    --primary-900: #0D47A1;

    --accent-light: #FFE0B2;
    --accent: #FF9800;
    --accent-dark: #F57C00;

    --success-light: #E8F5E9;
    --success: #4CAF50;
    --success-dark: #2E7D32;

    --warning-light: #FFF8E1;
    --warning: #FFC107;
    --warning-dark: #F9A825;

    --danger-light: #FFEBEE;
    --danger: #EF5350;
    --danger-dark: #C62828;

    --info-light: #E0F7FA;
    --info: #00BCD4;
    --info-dark: #00838F;

    --dark: #0F172A;
    --dark-2: #1E293B;
    --dark-3: #334155;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;

    --sidebar-width: 270px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --gradient-primary: linear-gradient(135deg, #1565C0, #42A5F5);
    --gradient-accent: linear-gradient(135deg, #FF9800, #FFB74D);
    --gradient-success: linear-gradient(135deg, #2E7D32, #66BB6A);
    --gradient-danger: linear-gradient(135deg, #C62828, #EF5350);
    --gradient-dark: linear-gradient(180deg, #0D47A1 0%, #1A1A2E 100%);
    --gradient-sidebar: linear-gradient(180deg, #0a1628, #0D47A1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover { color: var(--primary-800); }

img { max-width: 100%; height: auto; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dark);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }

.text-primary { color: var(--primary-600) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning-dark) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-light { color: var(--text-light) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-small { font-size: 0.8rem; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ---- Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 24px;
    margin-top: var(--topbar-height);
}

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h3 i {
    color: var(--primary-600);
    font-size: 1.1rem;
}
.card-body {
    padding: 24px;
}
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 0 4px 4px 0;
}
.stat-card.primary::before { background: var(--gradient-primary); }
.stat-card.success::before { background: var(--gradient-success); }
.stat-card.warning::before { background: var(--gradient-accent); }
.stat-card.danger::before { background: var(--gradient-danger); }
.stat-card.info::before { background: linear-gradient(135deg, var(--info-dark), var(--info)); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}
.stat-icon.primary { background: var(--gradient-primary); }
.stat-icon.success { background: var(--gradient-success); }
.stat-icon.warning { background: var(--gradient-accent); }
.stat-icon.danger { background: var(--gradient-danger); }
.stat-icon.info { background: linear-gradient(135deg, var(--info-dark), var(--info)); }

.stat-info h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn:active {
    transform: translateY(0);
}
.btn i { font-size: 0.9rem; }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}
.btn-primary:hover { color: white; box-shadow: 0 4px 15px rgba(21,101,192,0.4); }

.btn-success {
    background: var(--gradient-success);
    color: white;
}
.btn-success:hover { color: white; box-shadow: 0 4px 15px rgba(46,125,50,0.4); }

.btn-warning {
    background: var(--gradient-accent);
    color: white;
}
.btn-warning:hover { color: white; }

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}
.btn-danger:hover { color: white; box-shadow: 0 4px 15px rgba(198,40,40,0.4); }

.btn-info {
    background: linear-gradient(135deg, var(--info-dark), var(--info));
    color: white;
}
.btn-info:hover { color: white; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--text);
}
.btn-outline:hover {
    border-color: var(--primary-500);
    color: var(--primary-600);
    background: var(--primary-50);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--primary-600);
    box-shadow: none;
    transform: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}
.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}
.btn-block {
    width: 100%;
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}
.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}
.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}
.form-control::placeholder {
    color: var(--text-light);
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}
.form-control.is-invalid {
    border-color: var(--danger);
}
.form-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.form-text.text-danger {
    color: var(--danger) !important;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-600);
    cursor: pointer;
}

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.input-group-text {
    padding: 10px 14px;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-300);
    border-right: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}
.input-group-text + .form-control {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
.table thead th {
    background: var(--gray-100);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}
.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}
.table tbody tr {
    transition: var(--transition-fast);
}
.table tbody tr:hover {
    background: var(--primary-50);
}
.table tbody tr:last-child td {
    border-bottom: none;
}
.table .no-data {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-light);
}
.table .no-data i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 50px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-primary { background: var(--primary-50); color: var(--primary-700); }
.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-info { background: var(--info-light); color: var(--info-dark); }
.badge-dark { background: var(--dark); color: white; }

/* ---- Alerts ---- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}
.alert i {
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.alert-success { background: var(--success-light); color: var(--success-dark); border-left: 4px solid var(--success); }
.alert-danger { background: var(--danger-light); color: var(--danger-dark); border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning-dark); border-left: 4px solid var(--warning); }
.alert-info { background: var(--primary-50); color: var(--primary-700); border-left: 4px solid var(--primary-500); }
.alert .close-alert {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition-fast);
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
}
.alert .close-alert:hover { opacity: 1; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}
.modal-lg { max-width: 800px; }
.modal-sm { max-width: 400px; }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}
.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header h1 i {
    color: var(--primary-600);
}
.page-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.page-header .breadcrumb a {
    color: var(--text-secondary);
}
.page-header .breadcrumb a:hover {
    color: var(--primary-600);
}
.page-header .breadcrumb .separator {
    color: var(--text-light);
}

/* ---- Search & Filter Bar ---- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.search-box {
    position: relative;
    flex: 1;
    max-width: 320px;
}
.search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    background: var(--surface);
}
.search-box input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}
.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}
.pagination a {
    color: var(--text-secondary);
    border: 1px solid var(--gray-200);
    background: var(--surface);
}
.pagination a:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}
.pagination .active {
    background: var(--gradient-primary);
    color: white;
    border: none;
}
.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ---- Dropdown ---- */
.dropdown {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    min-width: 180px;
    z-index: 100;
    display: none;
    animation: slideDown 0.2s ease;
    overflow: hidden;
}
.dropdown-menu.active { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text);
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover {
    background: var(--primary-50);
    color: var(--primary-600);
}
.dropdown-item.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}
.dropdown-divider {
    border-top: 1px solid var(--gray-200);
    margin: 4px 0;
}

/* ---- Avatar ---- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }
.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}
.avatar-placeholder.sm { font-size: 0.75rem; }
.avatar-placeholder.lg { font-size: 1.4rem; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}
.empty-state > i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}
.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 0.9rem;
    max-width: 360px;
    margin: 0 auto 20px;
}

/* ---- Embed Containers ---- */
.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin: 12px 0;
    background: var(--dark);
}
.embed-container iframe,
.embed-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.embed-image {
    margin: 12px 0;
}
.embed-image img {
    border-radius: var(--radius-md);
    max-height: 400px;
    object-fit: contain;
}
.embed-audio {
    margin: 12px 0;
}
.embed-audio audio {
    width: 100%;
}
.ref-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary-50);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin: 4px 0;
    word-break: break-all;
}

/* ---- Task Card (for tugas list) ---- */
.task-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: var(--transition);
    display: flex;
    gap: 16px;
}
.task-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}
.task-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}
.task-info {
    flex: 1;
    min-width: 0;
}
.task-info h4 {
    margin-bottom: 4px;
    font-size: 1rem;
}
.task-info h4 a {
    color: var(--text);
}
.task-info h4 a:hover {
    color: var(--primary-600);
}
.task-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.task-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.task-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* ---- Progress Bar ---- */
.progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 50px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 50px;
    transition: width 0.6s ease;
}
.progress-bar.primary { background: var(--gradient-primary); }
.progress-bar.success { background: var(--gradient-success); }
.progress-bar.warning { background: var(--gradient-accent); }
.progress-bar.danger { background: var(--gradient-danger); }

/* ---- Tabs ---- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab-link {
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab-link:hover {
    color: var(--primary-600);
}
.tab-link.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
    font-weight: 600;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ---- Utility ---- */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.p-0 { padding: 0 !important; }
.hidden { display: none !important; }

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---- Loading Overlay ---- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}
.loading-overlay.active {
    display: flex;
}
.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* ---- Toast Notification ---- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideRight 0.3s ease;
    font-size: 0.875rem;
}
.toast.success { border-color: var(--success); }
.toast.danger { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--primary-500); }

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

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    .content-area {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .card-body {
        padding: 16px;
    }
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: 100%;
    }
    h1 { font-size: 1.4rem; }
    .task-card {
        flex-direction: column;
        padding: 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .btn-group {
        width: 100%;
        flex-direction: column;
    }
    .btn-group .btn {
        width: 100%;
        flex: none;
        margin-bottom: 4px;
    }
    td .btn-group {
        width: auto;
        flex-direction: row;
        flex-wrap: nowrap;
    }
    td .btn-group .btn {
        width: auto;
        margin-bottom: 0;
    }
    .modal-footer .btn-group {
        flex-direction: row;
    }
    .modal-footer .btn-group .btn {
        width: auto;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    .page-header h1 {
        font-size: 1.2rem;
    }
    .stat-card {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .stat-info h4 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    .stat-info p {
        font-size: 0.75rem;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-header .btn-group {
        margin-top: 12px;
    }
    .card-body {
        padding: 12px;
    }
    .table tbody td, .table thead th {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-header {
        padding: 16px;
    }
    .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
        margin-top: 4px;
    }
    .avatar-xl {
        width: 60px;
        height: 60px;
    }
}

/* ---- File Upload Style ---- */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.file-upload:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}
.file-upload.dragover {
    border-color: var(--primary-500);
    background: var(--primary-50);
}
.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}
.file-upload i {
    font-size: 2rem;
    color: var(--primary-400);
    margin-bottom: 8px;
}
.file-upload p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.file-upload .filename {
    margin-top: 8px;
    font-weight: 500;
    color: var(--primary-600);
}

/* ---- Print ---- */
@media print {
    .sidebar, .topbar, .btn, .toolbar, .pagination {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .content-area {
        padding: 0 !important;
        margin-top: 0 !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
