/* assets/css/style.css */

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== BRAND & LOGO ===== */
img[src*="logo"] {
    background: transparent !important;
}

/* ===== NAVBAR ===== */
.navbar-brand {
    font-size: 1rem;
}
.navbar-brand small {
    font-size: 0.55rem !important;
}
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}
.navbar-toggler-icon {
    filter: invert(1);
}

/* ===== SIDEBAR (DESKTOP) ===== */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a237e, #0d47a1);
    padding: 20px 0;
    transition: all 0.3s;
}
.sidebar .brand {
    color: white;
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}
.sidebar .brand img {
    max-height: 40px;
    background: transparent !important;
}
.sidebar .brand h5 {
    font-size: 1.1rem;
    margin-top: 5px;
}
.sidebar .brand small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}
.sidebar-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}
.sidebar-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}
.sidebar-link i {
    width: 22px;
    font-size: 0.9rem;
}

/* ===== SIDEBAR MOBILE & TOGGLE ===== */
.sidebar-mobile-toggle {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-mobile-toggle .brand-mobile {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}
.sidebar-mobile-toggle .brand-mobile small {
    font-size: 0.6rem;
    opacity: 0.8;
    display: block;
    font-weight: 400;
}
.sidebar-mobile-toggle .btn-menu {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
}
.sidebar-mobile-toggle .btn-menu:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-mobile-menu {
    background: linear-gradient(180deg, #1a237e, #0d47a1);
    padding: 10px 0;
}
.sidebar-mobile-menu .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 10px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
}
.sidebar-mobile-menu .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
}
.sidebar-mobile-menu .nav-link.active {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}
.sidebar-mobile-menu .nav-link i {
    width: 22px;
}
.sidebar-mobile-menu .nav-link.text-danger {
    color: #ff6b6b !important;
}
.sidebar-mobile-menu .nav-link.text-danger:hover {
    background: rgba(255, 0, 0, 0.15);
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
    margin-bottom: 15px;
}
.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.card-header {
    background: transparent;
    border-bottom: 2px solid #f0f0f0;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 0.95rem;
}
.card-body {
    padding: 15px 18px;
}

/* ===== TABLES ===== */
.table-responsive {
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    font-size: 0.85rem;
    margin-bottom: 0;
}
.table th {
    background: #1a237e;
    color: white;
    font-weight: 600;
    padding: 10px 12px;
    white-space: nowrap;
    font-size: 0.8rem;
}
.table td {
    padding: 8px 12px;
    vertical-align: middle;
    font-size: 0.8rem;
}
.table-hover tbody tr:hover {
    background-color: rgba(26, 35, 126, 0.04);
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.form-control:focus, .form-select:focus {
    border-color: #1a237e;
    box-shadow: 0 0 0 0.15rem rgba(26, 35, 126, 0.15);
}
.form-label {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}
.btn-primary {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    border: none;
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
    color: white;
}
.btn-success {
    background: linear-gradient(135deg, #2e7d32, #43a047);
    border: none;
    color: white;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
    color: white;
}
.btn-danger {
    background: linear-gradient(135deg, #c62828, #d32f2f);
    border: none;
    color: white;
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
    color: white;
}
.btn-warning {
    background: linear-gradient(135deg, #f57f17, #f9a825);
    border: none;
    color: white;
}
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 127, 23, 0.3);
    color: white;
}

/* ===== BADGES ===== */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.7rem;
}

/* ===== FOOTER ===== */
.footer {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    padding: 15px 0;
    margin-top: auto;
    font-size: 0.8rem;
}
.footer h5 {
    font-size: 1rem;
}
.footer h6 {
    font-size: 0.85rem;
}
.footer .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s;
}
#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #1a237e;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0d47a1;
}

/* ===== MEDIA QUERIES ===== */

/* Desktop & Tablet Medium (<= 991px) */
@media (max-width: 991px) {
    .sidebar {
        min-height: auto;
        padding: 10px 0;
    }
    .sidebar .brand {
        padding: 10px 0;
    }
    .sidebar .brand img {
        max-height: 30px;
    }
    .sidebar-link {
        padding: 8px 12px;
        font-size: 0.8rem;
        margin: 1px 5px;
    }
    .sidebar-link i {
        width: 20px;
        font-size: 0.8rem;
    }
    .main-content {
        padding: 15px !important;
    }
    h2 {
        font-size: 1.3rem;
    }
    h4 {
        font-size: 1.1rem;
    }
    h5 {
        font-size: 0.95rem;
    }
    .card-header h5 {
        font-size: 0.9rem;
    }
}

/* Tablet & Mobile (<= 768px) */
@media (max-width: 768px) {
    /* Navbar */
    .navbar-brand {
        font-size: 0.9rem;
    }
    .navbar-brand small {
        font-size: 0.5rem !important;
    }
    .navbar-brand img {
        height: 30px !important;
    }

    /* Main Content */
    .main-content {
        padding: 10px !important;
    }
    .main-content h2 {
        font-size: 1.1rem;
    }
    .main-content .card-header h5 {
        font-size: 0.85rem;
    }

    /* Tables Card View */
    .table thead {
        display: none;
    }
    .table tbody tr {
        display: block;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 10px;
        background: white;
    }
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.8rem;
    }
    .table tbody td:last-child {
        border-bottom: none;
    }
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #1a237e;
        font-size: 0.75rem;
    }
    .table tbody td .badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    .table tbody td .btn-sm {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    /* Forms & Inputs */
    .form-control, .form-select {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    .row > [class*="col-"] {
        margin-bottom: 8px;
    }

    /* Cards */
    .card {
        border-radius: 10px;
    }
    .card-body {
        padding: 12px 15px;
    }
    .card-header {
        padding: 10px 15px;
    }

    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    .btn-lg {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    /* Dashboard Stats */
    .stat-card h2 {
        font-size: 1.5rem;
    }
    .stat-card h6 {
        font-size: 0.75rem;
    }

    /* Modal */
    .modal-body {
        padding: 15px;
    }
    .modal-header h5 {
        font-size: 1rem;
    }
}

/* Small Mobile (<= 576px) */
@media (max-width: 576px) {
    h2 {
        font-size: 1.1rem;
    }
    .container-fluid {
        padding: 0 8px;
    }
    .main-content {
        padding: 10px !important;
    }
    .card-body {
        padding: 10px 12px;
    }
    .table tbody td {
        font-size: 0.75rem;
        padding: 4px 0;
    }
    .table tbody td::before {
        font-size: 0.7rem;
    }
    .badge {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
    .btn-sm {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    .form-control, .form-select {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    .sidebar-link {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, .navbar, .footer, .btn, .no-print, .sidebar-mobile-toggle, .sidebar-mobile-menu {
        display: none !important;
    }
    .main-content {
        padding: 0 !important;
    }
}