/* =====================================================================
   SPM Sriti — Modern LMS theme
   Matches the redesigned login page (Poppins, navy->blue gradient,
   rounded cards, soft shadows, green accent).
   Loaded AFTER adminlte.min.css in the main layout.
   ===================================================================== */

:root {
    --lms-primary: #16a34a;
    --lms-dark: #0f172a;
    --lms-accent: #22c55e;
    --lms-gradient: linear-gradient(135deg, #052e16 0%, #0a6e33 55%, #16a34a 100%);
    --lms-gradient-btn: linear-gradient(135deg, #16a34a, #15803d);
    --lms-radius: 8px;
}

/* ---------- base ---------- */
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
    background: #f1f5f9 !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Segoe UI', sans-serif !important;
}

/* ---------- top navbar ---------- */
.main-header.navbar {
    border: none;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .12);
    background: var(--lms-gradient) !important;
}

.main-header.navbar[class*="bg-gradient"] {
    background: var(--lms-gradient) !important;
}

.main-header .nav-link {
    color: rgba(255, 255, 255, .85) !important;
}

.main-header .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .08) !important;
    border-radius: 6px;
}

/* ---------- sidebar ---------- */
.main-sidebar.sidebar-light-primary,
.sidebar {
    --lms-sidebar: #0f172a;
}

.main-sidebar {
    background: var(--lms-gradient) !important;
}

.main-sidebar .brand-link {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: 0 16px 0 20px;
    display: flex;
    align-items: center;
    height: 57px;
}

.main-sidebar .brand-link .brand-image {
    width: 38px;
    height: 38px;
    max-height: 38px;
    margin: 0 2px 0 0;
    border-radius: 6px;
    flex: 0 0 auto;
}

.main-sidebar .brand-link .brand-text {
    color: #fff !important;
    font-weight: 700;
    font-size: 28px;
    line-height: 38px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.nav-sidebar .nav-header {
    color: rgba(255, 255, 255, .45) !important;
}

/* kill the flat-mode white left-bar indicators on tree items */
.nav-sidebar.nav-flat .nav-item .nav-link::before,
.nav-sidebar.nav-flat .nav-item .nav-treeview .nav-link::before,
.nav-treeview .nav-link::before {
    content: none !important;
    display: none !important;
}

.nav-sidebar.nav-flat .nav-item .nav-link {
    border-left: none !important;
}

.nav-treeview {
    border-left: none !important;
}

.nav-sidebar .nav-link {
    color: rgba(255, 255, 255, .78) !important;
    border-radius: 6px;
    margin: 2px 6px;
    padding: 8px 10px 8px 12px;
    display: flex;
    align-items: center;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.nav-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
}

.nav-sidebar .nav-link.active,
.nav-sidebar .nav-item > .nav-link.active {
    background: linear-gradient(90deg, #0a6e33, #16a34a) !important;
    color: #fff !important;
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 12px !important;
}

.nav-sidebar .nav-icon,
.nav-sidebar .nav-link > i,
.nav-sidebar .nav-link p > i.far,
.nav-sidebar .nav-link p > i.fas {
    color: inherit;
    width: 1.35rem;
    margin-right: 12px;
    text-align: center;
    font-size: 14px;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
}

/* angle arrows (expand/collapse) sit inside their own space, never on the wording */
.nav-sidebar .nav-link p {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0 !important;
    min-width: 0;
}

.nav-sidebar .nav-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 450;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.nav-sidebar .nav-link p .right,
.nav-sidebar .nav-link p > i.right {
    flex: 0 0 auto !important;
    position: static !important;
    float: none !important;
    margin: 0 0 0 auto;
    font-size: 14px;
    color: rgba(255, 255, 255, .6);
}

/* collapsed sidebar (toggled): slim icon-only strip, but keeps the
   AdminLTE hover-expand behaviour (hover widens to 250px).
   Desktop only — on mobile (<992px) AdminLTE's off-canvas behaviour
   (hidden sidebar + hamburger overlay) must not be overridden. */
@media (min-width: 992px) {
    .sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) {
        width: 4.6rem !important;
        margin-left: 0 !important;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-link {
        width: 4.6rem !important;
        height: 57px !important;
        padding: 0 !important;
        justify-content: center;
        overflow: hidden;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-link .brand-image {
        width: 34px;
        height: 34px;
        border-radius: 6px;
        margin: 0;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-link {
        width: 3.6rem !important;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 10px 0 !important;
        margin: 3px auto !important;
        border-radius: 6px;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-link p {
        display: none !important;
    }

    .sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-sidebar .nav-icon {
        margin: 0 !important;
        width: 1.4rem;
        font-size: 16px;
    }
}

/* ---------- cards ---------- */
.card {
    border-radius: var(--lms-radius);
    border: none;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08) !important;
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: none;
}

.card-header[class*="bg-gradient"] {
    padding: 14px 18px;
}

.card-header.bg-gradient-green {
    background: var(--lms-gradient) !important;
}

.card-header.bg-gradient-gray-light {
    background: #f8fafc !important;
}

.card-title {
    font-weight: 600;
}

.card .card-footer {
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
}

/* modal */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
}

.modal-header[class*="bg-gradient"] {
    background: var(--lms-gradient) !important;
    color: #fff;
}

/* ---------- buttons ---------- */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: transform .15s, box-shadow .2s, background .2s;
}

.btn-primary:not(.btn-tool):not(.dropdown-item),
.btn-success:not(.btn-tool):not(.dropdown-item) {
    border: none;
}

.btn-primary {
    background: var(--lms-gradient-btn) !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, .35);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, .25);
}

.btn-success:hover {
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--lms-primary);
    color: var(--lms-primary);
}

.btn-tool {
    border-radius: 4px;
}

/* ---------- forms ---------- */
.form-control,
.form-select,
select.form-control,
input.form-control,
textarea.form-control {
    border-radius: 6px;
    border: 1.5px solid #e2e8f0;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus,
select.form-control:focus {
    border-color: var(--lms-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.custom-select.form-control-sm,
select.form-control-sm {
    border-radius: 4px;
}

/* ---------- dashboard bullets ---------- */
.content .container-fluid .row {
    margin-bottom: .85rem;
}
.small-box {
    border-radius: var(--lms-radius);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .10);
}

/* equal-height stat boxes across a row */
.small-box.h-100 {
    display: flex;
    flex-direction: column;
}

.small-box.h-100 > .inner {
    flex: 1 1 auto;
    min-height: 92px;
}

.small-box.h-100 > .small-box-footer {
    margin-top: auto;
}

.small-box h3 {
    font-weight: 700;
    font-size: 30px !important;
}

.small-box .small-box-footer,
.small-box > .inner > p {
    color: rgba(255, 255, 255, .9) !important;
}

.small-box[class*="bg-"] {
    background-size: cover;
}

.small-box.bg-info {
    background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
}

.small-box.bg-success {
    background: linear-gradient(135deg, #22c55e, #15803d) !important;
}

.small-box.bg-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
}

.small-box.bg-primary {
    background: var(--lms-gradient-btn) !important;
}

.info-box {
    border-radius: 6px;
    border: none;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
}

.info-box-icon {
    border-radius: 6px 0 0 6px;
}

/* ---------- tables (compact) ---------- */
.table thead[class*="bg-gradient"] {
    background: linear-gradient(90deg, #052e16, #166534) !important;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.table > :not(caption) > * > * {
    padding: .45rem .65rem;
    font-size: 13.5px;
}

.table-sm > :not(caption) > * > *,
.table.table-sm td,
.table.table-sm th {
    padding: .35rem .55rem;
    font-size: 13px;
}

.table-hover tbody tr:hover td {
    background: rgba(22, 163, 74, .04);
}

/* ---------- pagination ---------- */
.pagination .page-link {
    border-radius: 4px !important;
    margin: 0 2px;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.pagination .page-item.active .page-link {
    background: var(--lms-gradient-btn);
    border-color: transparent;
    color: #fff;
}

/* ---------- header / breadcrumb ---------- */
h1 {
    font-weight: 700 !important;
    color: var(--lms-dark);
}

.breadcrumb {
    background: transparent;
    font-size: 13px;
}

.breadcrumb-item a {
    color: var(--lms-primary) !important;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: #64748b;
    font-weight: 600;
}

/* ---------- misc ---------- */
.progress {
    border-radius: 6px;
}

.badge {
    border-radius: 4px;
    font-weight: 600;
}

.alert {
    border-radius: 6px;
}

/* ---------- Select2 (dropdown) matching form styling ---------- */
.select2-container--default {
    display: block;
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 46px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0 40px 0 16px !important;
    display: flex;
    align-items: center;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--lms-primary) !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12) !important;
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px !important;
    padding: 0 !important;
    font-size: 14px;
    color: #0f172a;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    height: 34px !important;
    width: 28px;
    background: #f1f5f9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23475569' d='M5 6L0 0h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 10px !important;
    height: 6px !important;
    position: static !important;
    display: block;
    margin: 0 !important;
    transition: transform .15s;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(180deg);
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    right: 40px !important;
    font-size: 15px;
    color: #94a3b8;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #ef4444;
}

.select2-dropdown {
    border-radius: 6px !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .14) !important;
    overflow: hidden;
    margin-top: 4px;
    border: 1px solid #e2e8f0;
}

.select2-results__option {
    padding: 8px 14px !important;
    font-size: 14px;
}

.select2-results__option--highlighted {
    background: var(--lms-primary) !important;
    color: #fff !important;
}

.select2-container--default .select2-selection--multiple {
    height: auto !important;
    min-height: 46px;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 6px !important;
    background: #fff;
}

/* ---------- mobile polish ---------- */
@media (max-width: 991.98px) {
    /* a little breathing room at the page edges */
    .content {
        padding-left: .75rem !important;
        padding-right: .75rem !important;
    }

    /* gap between cards that wrap/stack on narrow screens */
    .content .container-fluid > .row > [class*="col-"] {
        margin-bottom: .85rem;
    }
    .content .container-fluid > .row {
        margin-bottom: .25rem;
    }

    /* stat boxes: keep text inside the card */
    .small-box h3 {
        font-size: 1.4rem !important;
        line-height: 1.25;
        white-space: normal;
        word-break: break-word;
        margin: 0 0 6px;
    }

    .small-box > .inner {
        padding: 14px 12px;
    }

    .small-box .inner p {
        font-size: 12.5px;
        margin-bottom: 0;
    }

    .small-box .small-box-footer {
        padding: .45rem 0;
        font-size: 13px;
    }

    /* oversized watermark icon -> smaller so it never covers the text */
    .small-box .icon > i,
    .small-box .icon svg {
        font-size: 44px;
        top: 12px;
        right: 10px;
    }

    /* long labels in paired rows wrap instead of overflowing */
    .content .card-body .d-flex.justify-content-between {
        flex-wrap: wrap;
        row-gap: .5rem;
    }
}
