@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --secondary-color: #e9ecef;
    --text-dark: #2b2d42;
    --text-muted: #8d99ae;
    --sidebar-bg: #1e2129;
    --sidebar-width: 260px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Wrapper & Sidebar */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: calc(var(--sidebar-width) * -1);
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    transition: margin .25s ease-out;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

#sidebar-wrapper .list-group {
    width: var(--sidebar-width);
    padding: 1rem 0;
}

.sidebar-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--primary-color);
}

.sidebar-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Content Area */
#page-content-wrapper {
    width: 100%;
    min-width: 0;
}

body.sb-sidenav-toggled #sidebar-wrapper {
    margin-left: 0;
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        width: 100%;
    }

    body.sb-sidenav-toggled #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
    }
}

/* Navbar */
.navbar {
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 1rem;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 500;
}

/* Cards */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    border-radius: 1rem 1rem 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Cards Specifics */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-success {
    background-color: #2ec4b6 !important;
}

.bg-warning {
    background-color: #ff9f1c !important;
    color: #fff !important;
}

.bg-danger {
    background-color: #e71d36 !important;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(67, 97, 238, 0.4);
}

/* Tables */
.table {
    vertical-align: middle;
}

.table thead th {
    border-bottom: 2px solid #f0f0f0;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table td {
    padding: 1rem 0.75rem;
    color: var(--text-dark);
}

/* Responsive Tables (Card View on Mobile) */
@media (max-width: 768px) {
    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 1rem;
        background: #fff;
        border-radius: 0.5rem;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        border: 1px solid #e9ecef;
        padding: 0.5rem;
    }

    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    /* Adjust padding/alignment for specific cell types if needed */
    .table td {
        padding: 0.75rem 1rem;
    }
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    .sticky-summary {
        position: static;
        top: auto;
    }

    .card {
        box-shadow: 0 8px 14px rgba(0, 0, 0, 0.05);
    }

    .btn.w-100.w-md-auto {
        width: 100% !important;
    }
}

/* Login Page Specifics */
.login-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.login-header {
    background-color: var(--primary-color);
    padding: 2.5rem 2rem;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
}
