/* ====== PROFESSIONAL ADMIN PANEL STYLES ====== */

* {
    box-sizing: border-box;
}

body {
    font-family:
        "Source Sans Pro",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f8f9fa;
}

/* ====== LOADING OVERLAY ====== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ====== NAVIGATION ====== */
.nav-link.loading {
    position: relative;
    color: transparent !important;
}

.nav-link.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ====== CARD STYLES ====== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    font-weight: 600;
    color: #2c3e50;
    position: relative;
}

.card-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.card-body {
    padding: 2rem;
}

.card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.25rem 2rem;
}

/* ====== BUTTON STYLES ====== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #545b62);
    border-color: #6c757d;
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    border-color: #28a745;
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-color: #dc3545;
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    border-color: #ffc107;
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-color: #17a2b8;
    color: #fff;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

/* ====== TABLE STYLES ====== */
.table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: none;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1.25rem 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.table tbody td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

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

/* ====== FORM STYLES ====== */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-text {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ====== BADGE STYLES ====== */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
}

.badge-secondary {
    background: linear-gradient(135deg, #6c757d, #545b62);
    color: #fff;
}

.badge-success {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: #fff;
}

/* ====== PROGRESS BAR ====== */
.progress {
    height: 10px;
    border-radius: 5px;
    background-color: #e9ecef;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: width 0.8s ease;
}

/* ====== MODAL STYLES ====== */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #e9ecef;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3);
}

.modal-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 2rem;
    border-radius: 0 0 16px 16px;
}

/* ====== SIDEBAR ====== */
.main-sidebar {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-dark-primary {
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%) !important;
}

.brand-link {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
}

.brand-text {
    font-weight: 700;
    color: #fff;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-panel {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
}

.user-panel .info a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 1rem 1.5rem;
    border-radius: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(8px);
}

.nav-sidebar .nav-link.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border-left: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.nav-sidebar .nav-treeview {
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 3px solid #007bff;
}

.nav-sidebar .nav-treeview .nav-link {
    padding-left: 3.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.nav-sidebar .nav-treeview .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(4px);
}

.nav-sidebar .nav-treeview .nav-link.active {
    background-color: rgba(0, 123, 255, 0.2);
    color: #fff;
    border-left: 3px solid #007bff;
}

/* ====== NAVBAR ====== */
.main-header {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.navbar-nav .nav-link {
    color: #495057;
    font-weight: 500;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-badge {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 15px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* ====== CONTENT AREA ====== */
.content-wrapper {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    min-height: 100vh;
}

.content-header {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-bottom: 1px solid #e9ecef;
    padding: 2rem 0;
    margin-bottom: 2rem;
    position: relative;
}

.content-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3, #007bff);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.content-header h1 {
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    font-weight: 600;
    font-size: 1.1rem;
}

.breadcrumb-item.active {
    color: #007bff;
    font-weight: 600;
}

/* ====== ALERT STYLES ====== */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
}

.alert::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-success::before {
    background: linear-gradient(180deg, #28a745, #1e7e34);
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-danger::before {
    background: linear-gradient(180deg, #dc3545, #c82333);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert-warning::before {
    background: linear-gradient(180deg, #ffc107, #e0a800);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-info::before {
    background: linear-gradient(180deg, #17a2b8, #138496);
}

/* ====== INFO BOX ====== */
.info-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.info-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.info-box:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.info-box:hover::before {
    transform: scaleX(1);
}

.info-box-icon {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border-radius: 16px 0 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.info-box-content {
    padding: 1.5rem;
}

.info-box-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-box-text {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ====== FOOTER ====== */
.main-footer {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 0;
    color: #6c757d;
    font-size: 0.875rem;
    position: relative;
}

.main-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #007bff, transparent);
}

/* ====== UTILITY CLASSES ====== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    max-height: 2.4em;
    line-height: 1.2;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 3;
    max-height: 3.6em;
    line-height: 1.2;
}

/* ====== ANIMATIONS ====== */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 1024px) {
    .main-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        position: fixed;
        z-index: 1039;
        width: 280px;
    }

    .main-sidebar.show {
        transform: translateX(0);
    }

    .content-wrapper {
        margin-left: 0 !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1038;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }

    .content-header {
        padding: 1.5rem 0;
        margin-bottom: 1.5rem;
    }

    .content-header h1 {
        font-size: 1.75rem;
    }

    .info-box-content {
        padding: 1.25rem;
    }

    .info-box-number {
        font-size: 1.75rem;
    }

    .table thead th,
    .table tbody td {
        padding: 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .content-header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }

    .content-header h1 {
        font-size: 1.5rem;
    }

    .info-box-content {
        padding: 1rem;
    }

    .info-box-number {
        font-size: 1.5rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .form-control {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
}

/* ====== SOFT UTILITY CLASSES ====== */
.bg-primary-soft {
    background-color: rgba(46, 89, 217, 0.15) !important;
}
.bg-danger-soft {
    background-color: rgba(220, 53, 69, 0.15) !important;
}
.bg-success-soft {
    background-color: rgba(40, 167, 69, 0.15) !important;
}
.bg-warning-soft {
    background-color: rgba(255, 193, 7, 0.15) !important;
}
.badge-primary-soft {
    background-color: rgba(46, 89, 217, 0.12) !important;
    color: #2e59d9 !important;
    box-shadow: none !important;
}
.badge-danger-soft {
    background-color: rgba(220, 53, 69, 0.12) !important;
    color: #dc3545 !important;
    box-shadow: none !important;
}
