/* Add here all your CSS customizations */
.emp-topics {
    color: #6a6c6d !important;
}

.emp-topics:hover {
    color: #a4b2a8 !important;
    transition: 2s ease !important;
}

.emp-topics-img {
    width: 44px !important;
    border-radius: 5px !important;
    margin-bottom: 5px !important;
}

.error-msg {
    color: red !important;
    font-size: 14px !important;
    font-weight: bold !important;
}

.show_details:hover {
    background: #dbe1dd !important;
    transition: 2s ease !important;
}

/* Image Upload */
.col-container {
    height: 250px;
    width: 100%;
    position: relative;
}

.col-container .col-wrapper {
    position: relative;
    height: 200px;
    width: 100%;
    border-radius: 10px;
    background: #fff;
    border: 2px dashed #c2cdda;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.col-wrapper.active {
    border: none;
}

.col-wrapper .image {
    position: absolute;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-wrapper img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.col-wrapper .icon {
    font-size: 100px;
    color: #9658fe;
    padding-left: 10px;
}

.col-wrapper .text {
    font-size: 15px;
    font-weight: 500;
    color: #5b5b7b;
}

.col-wrapper #cancel-btn i {
    position: absolute;
    font-size: 15px;
    right: 15px;
    top: 15px;
    color: #9658fe;
    cursor: pointer;
    display: none;
}

.col-wrapper.active:hover #cancel-btn i {
    display: block;
}

.col-wrapper #cancel-btn i:hover {
    color: #e74c3c;
}

.col-wrapper .file-name {
    position: absolute;
    bottom: 0px;
    width: 100%;
    padding: 8px 0;
    font-size: 16px;
    color: #fff;
    display: none;
    background: linear-gradient(135deg, #3a8ffe 0%, #9658fe 100%);
}

.col-wrapper.active:hover .file-name {
    display: block;
}

.col-container #custom-btn {
    margin-top: 10px;
    display: block;
    width: 100%;
    height: 50px;
    border: none;
    outline: none;
    border-radius: 25px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(135deg, #3a8ffe 0%, #9658fe 100%);
}

.col-container #custom-btn-file,
.upload-excel {
    margin-top: 10px;
    margin-left: 10px;
    display: block;
    width: 20%;
    height: 50px;
    border: none;
    outline: none;
    border-radius: 25px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    background: linear-gradient(135deg, #3a8ffe 0%, #9658fe 100%);
}

.hidegalimage {
    display: none;
}

/* Edit, Delete Buttons */
.edit-item,
.delete-item {
    padding: 0px 7px 0px 7px !important;
    align-content: center !important;
}

/* Data Tables */
.common-thead {
    background-color: #c6c6c6 !important;
}

/* Search Result */
.search-list {
    height: 150px !important;
    overflow-y: auto;
}

.search-result {
    padding: 10px !important;
    border-radius: 5px;
    font-size: 16px;
}

.search-result:hover {
    background-color: #e4e8e5;
    transition: opacity 0.25s ease-in-out;
    -moz-transition: opacity 0.25s ease-in-out;
    -webkit-transition: opacity 0.25s ease-in-out;
}

/* Theme variables and overrides (semantic tokens) */
:root {
    --bg: #f8f8f8;
    --surface: #ffffff;
    --text: #222222;
    --muted: #777777;
    --primary: #800000; /* University Maroon */
    --secondary: #640101; /* Darker Maroon */
    --tertiary: #b89047; /* Elegant Gold */
    --quaternary: #383f48;
    --page-header-bg: #800000;
    --page-header-text: #ffffff;
}

.dark {
    --bg: #0b1220;
    --surface: #0f1724;
    --text: #e6eef8;
    --muted: #94a3b8;
    --primary: #c53030; /* Bright Crimson/Maroon for Dark Mode */
    --secondary: #9b1c1c;
    --tertiary: #d4af37;
    --quaternary: #95a0ab;
    --page-header-bg: #0f1724;
    --page-header-text: #e6eef8;
}

/* Global Poppins Typography Adaptations */
html,
body,
input,
select,
textarea,
button {
    font-family: 'Poppins', sans-serif !important;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure primary buttons always have readable text and rounded edges */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    border-radius: 8px !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
}

/* Theme toggle: visible in light and dark */
#theme-toggle {
    background: var(--surface) !important;
    color: var(--primary) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html.dark #theme-toggle {
    background: transparent !important;
    color: var(--page-header-text) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* Glassmorphism Header Adaptations */
.header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.01) !important;
    transition: all 0.3s ease !important;
}
html.dark .header {
    background: rgba(15, 23, 42, 0.85) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

html,
body {
    background: var(--bg) !important;
    color: var(--text) !important;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(128, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Page Header & Breadcrumbs Adaptations */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    color: var(--page-header-text) !important;
    box-shadow: 0 8px 25px rgba(128, 0, 0, 0.08) !important;
    border-bottom: 3px solid var(--tertiary) !important;
    padding: 12px 20px !important;
    margin: -15px -15px 25px -15px !important;
    min-height: 74px !important;
    overflow: hidden !important;
    border-radius: 0 0 12px 12px !important;
}
.page-header h2 {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
}
.page-header .breadcrumbs a,
.page-header .breadcrumbs span,
.page-header .breadcrumbs li {
    color: rgba(255, 255, 255, 0.8) !important;
}
.page-header .breadcrumbs a:hover {
    color: #ffffff !important;
}

/* Sidebar Left Adaptations */
.sidebar-left,
.sidebar-right {
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.02) !important;
}
.sidebar-left .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}
ul.nav-main {
    padding: 15px 8px !important;
}
ul.nav-main > li > a {
    border-radius: 10px !important;
    margin: 4px 6px !important;
    padding: 10px 14px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.2s ease !important;
}
ul.nav-main > li > a i {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.2s ease !important;
}
ul.nav-main > li > a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}
ul.nav-main > li > a:hover i {
    color: #ffffff !important;
}
ul.nav-main > li.nav-active > a {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(128, 0, 0, 0.2) !important;
}
ul.nav-main > li.nav-active > a i,
ul.nav-main > li.nav-active > a span {
    color: #ffffff !important;
}

/* Modern Card and Panel containers */
.card,
.panel,
.panel-body,
.content-panel {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
    margin-bottom: 25px !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease !important;
}
.card:hover,
.panel:hover,
.content-panel:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05) !important;
}
.card .card-header,
.panel .panel-heading,
.content-panel .panel-heading {
    background: rgba(128, 0, 0, 0.01) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    padding: 16px 20px !important;
}
.card-title,
.card-header h2 {
    color: var(--primary) !important;
    font-weight: 600 !important;
    font-size: 17px !important;
    position: relative !important;
    display: inline-block !important;
    padding-bottom: 6px !important;
}
.card-title::after,
.card-header h2::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 24px !important;
    height: 3px !important;
    background-color: var(--tertiary) !important;
    border-radius: 2px !important;
}

/* Modernized Buttons */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 8px 16px !important;
    transition: all 0.2s ease !important;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(128, 0, 0, 0.1) !important;
}
.btn:active {
    transform: translateY(1px);
}

/* Form inputs styling */
.form-control,
select.form-control,
textarea.form-control {
    border-radius: 10px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 10px 14px !important;
    background-color: #fafafa !important;
    color: var(--text) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.form-control:focus {
    background-color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.08) !important;
}

/* Ensure modal actions are legible */
.modal-block .btn-primary,
.modal .btn-primary,
.mfp-wrap .btn-primary {
    color: #ffffff !important;
}

/* Ensure modal header/footer use semantic surface colors */
.modal-block .card-header,
.modal-block .card-footer {
    background: var(--surface) !important;
    color: var(--text) !important;
}

/* Header: keep right-side controls aligned and prevent collapsing */
.header .header-right {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-right: 16px;
}

.theme-toggle-container {
    display: inline-flex;
    align-items: center;
}

#theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--page-header-text);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Ensure userbox stays inline and doesn't wrap */
.header .userbox {
    white-space: nowrap;
}

@media only screen and (max-width: 767px) {
    .header .header-right {
        gap: 6px;
        padding-right: 8px;
    }
    #theme-toggle {
        width: 32px;
        height: 32px;
    }
}

/* Modernized Tables and DataTables */
.table,
.dataTables_wrapper table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

html.dark .table,
html.dark .dataTables_wrapper table {
    border-color: rgba(255, 255, 255, 0.04) !important;
}

.table thead th {
    background: rgba(128, 0, 0, 0.06) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    padding: 14px 16px !important;
    border-bottom: 2px solid rgba(128, 0, 0, 0.1) !important;
    border-top: none !important;
}

html.dark .table thead th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--page-header-text) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
}

.table td {
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    vertical-align: middle !important;
    color: var(--text) !important;
}

html.dark .table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

/* Subtle zebra stripes */
.table tbody tr:nth-child(odd) td {
    background-color: rgba(128, 0, 0, 0.01) !important;
}
html.dark .table tbody tr:nth-child(odd) td {
    background-color: rgba(255, 255, 255, 0.008) !important;
}

/* Row hover transitions */
.table tbody tr:hover td {
    background-color: rgba(128, 0, 0, 0.03) !important;
    transition: background-color 0.15s ease !important;
}
html.dark .table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Table cells background clip */
.table td,
.table th {
    background-clip: padding-box !important;
}

/* Inputs and controls inside DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary) !important;
    outline: none !important;
}

/* Pagination buttons styling */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    transition: all 0.2s ease !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

/* Dashboard & form refinements */
.card .card-body {
    background: transparent !important;
    padding: 18px !important;
}

.panel,
.panel-body,
.content-panel {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
    border: none !important;
}

.form-control {
    border-radius: 10px !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    padding: 10px 14px !important;
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.btn-primary,
.btn-gradient:not(.btn-outline) {
    box-shadow: 0 6px 14px rgba(14, 22, 30, 0.06);
}

/* Make image thumbnails blend with surface */
.table .img-thumbnail,
.profile-picture img {
    background: transparent !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Small responsive tweak for wide tables inside cards */
.table-responsive {
    padding: 8px 0;
}

/* Additional visual refinements */
/* Row hover and selection */
.table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.04) !important;
}
html.dark .table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Card headers and section headers */
.card .card-header,
.panel .panel-heading,
.content-panel .panel-heading {
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.03),
        transparent
    ) !important;
    color: var(--page-header-text) !important;
    padding: 14px 18px !important;
}

/* Make table headings a little taller and clearer */
.table thead th {
    padding: 14px 12px !important;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* DataTable search placeholder and controls */
.dataTables_wrapper .dataTables_filter input::placeholder {
    color: var(--muted) !important;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    padding: 8px 10px !important;
}

/* Pagination alignment */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Small tweak for empty action columns */
.table td .actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Ensure contrast for small UI pieces like badges */
.badge {
    background: rgba(0, 0, 0, 0.08);
    color: var(--page-header-text);
}

/* Icons, spacing, and density tweaks */
.nav-main > li > a {
    padding: 12px 18px !important;
}
.nav-main > li > a i,
.nav-main > li > a .fas,
.nav-main > li > a .fa {
    width: 22px;
    display: inline-block;
    text-align: center;
    margin-right: 10px;
    font-size: 16px;
    color: var(--primary) !important;
}

.header .userbox .profile-picture img,
.header .userbox .profile-picture {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Compact table mode - apply class 'table-compact' for denser tables */
.table.table-compact th,
.table.table-compact td {
    padding: 6px 8px !important;
    line-height: 1.15 !important;
}

/* Default table density adjusted slightly */
.table th,
.table td {
    padding: 10px 12px !important;
}

/* Smooth hover transitions */
.table td,
.table th {
    transition:
        background 150ms ease,
        color 150ms ease;
}

/* Responsive tweaks: allow horizontal scroll and reduce paddings on small screens */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

@media only screen and (max-width: 991px) {
    .table th,
    .table td {
        padding: 8px 10px !important;
    }
    .nav-main > li > a i {
        margin-right: 8px;
    }
    .header .userbox .profile-picture img {
        width: 36px !important;
        height: 36px !important;
    }
}

/* Forms: reduce vertical density and improve label spacing */
.form-group {
    margin-bottom: 12px !important;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted) !important;
    font-size: 13px;
}

/* Ensure small action icons in tables are legible */
.table .actions a,
.table .actions button {
    padding: 6px 8px !important;
    min-width: 36px;
    height: 36px;
    border-radius: 6px;
}

/* Utility: apply compact tables on admin lists */
.admins-table.table-compact th,
.admins-table.table-compact td {
    padding: 8px 10px !important;
}

/* Force DataTables and plain tables to use semantic surfaces in dark mode
   and modernize the table container so it doesn't render as a white sheet. */
html.dark .dataTables_wrapper,
html.dark .dataTables_wrapper .dataTables_scroll,
html.dark .dataTables_wrapper .dataTables_scrollBody,
html.dark .dataTables_wrapper .dataTables_scrollHead,
html.dark .dataTables_wrapper .dataTables_scrollHeadInner,
html.dark .dataTables_wrapper .dataTables_scrollBody table,
html.dark .dataTables_wrapper table,
html.dark .table {
    background: transparent !important;
    color: var(--text) !important;
}

/* Make the scrolling body use the surface token (removes white block) */
html.dark .dataTables_wrapper .dataTables_scrollBody {
    background: var(--surface) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
}

/* Ensure header and cells read correctly in dark */
html.dark .dataTables_wrapper .dataTables_scrollHeadInner thead th,
html.dark .table thead th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--page-header-text) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

html.dark .dataTables_wrapper .dataTables_scrollBody td,
html.dark .dataTables_wrapper .dataTables_scrollBody tr td,
html.dark .table tbody td {
    background: transparent !important;
    color: var(--text) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02) !important;
}

/* Row hover and selected state (subtle) */
html.dark .dataTables_wrapper .dataTables_scrollBody tr:hover td,
html.dark .table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Modern table container: rounded, padded, and elevated slightly */
.card .table-responsive,
.dataTables_wrapper {
    background: transparent !important;
}
.table-modern-container {
    background: var(--surface) !important;
    border-radius: 10px !important;
    padding: 12px !important;
    box-shadow: 0 8px 30px rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Top-level strong dark-mode overrides (fix parsing issues from nested rules) */
html.dark .dataTables_wrapper,
html.dark .dataTables_wrapper *,
html.dark .dataTables_wrapper table,
html.dark table.dataTable,
html.dark .table.dataTable,
html.dark .dataTables_scrollBody,
html.dark .dataTables_scrollBody table,
html.dark .table,
html.dark .table-responsive {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text) !important;
}

html.dark .dataTables_wrapper .dataTables_scrollBody,
html.dark .table-responsive {
    background: var(--surface) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
}

html.dark .dataTables_wrapper thead th,
html.dark .dataTables_wrapper .dataTables_scrollHeadInner thead th,
html.dark .table thead th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--page-header-text) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

html.dark .dataTables_wrapper tbody td,
html.dark .dataTables_wrapper tr td,
html.dark .table tbody td {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02) !important;
}

html.dark .dataTables_wrapper tbody td[style],
html.dark .dataTables_wrapper tr[style],
html.dark .table tbody td[style] {
    background: transparent !important;
    background-color: transparent !important;
}

html.dark table a,
html.dark .dataTables_wrapper table a {
    color: var(--primary) !important;
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--text) !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
}

/* Usage: wrap your table in a div.table-modern-container to apply
   the modern look. For DataTables, the wrapper will inherit the look. */

/* Reduce cell contrast for a softer, modern look */
.table thead th {
    text-transform: none !important;
    font-size: 14px !important;
    color: var(--page-header-text) !important;
}
.table tbody td a {
    color: var(--primary) !important;
}

/* When JS sets inline backgrounds, these rules still override */
.dataTables_wrapper .dataTables_scrollBody,
.dataTables_wrapper table,
.dataTables_wrapper .table {
    background-image: none !important;
}

/* Apply modern container styles to tables inside cards by default */
.card .table-responsive {
    background: var(--surface) !important;
    border-radius: 10px !important;
    padding: 12px !important;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.35) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Dashboard visual improvements: stat cards and section polish */
.stat-card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02),
        transparent
    ) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    color: var(--text) !important;
    padding: 18px !important;
    border-radius: 10px !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-card .value {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--page-header-text) !important;
}
.stat-card .label {
    font-size: 12px !important;
    color: var(--muted) !important;
}

/* Forms: refine spacing and full-width on narrow screens */
.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}
.form-row .form-group {
    flex: 1 1 auto;
}
.form-control::placeholder {
    color: var(--muted) !important;
}

/* Responsive: ensure inputs, selects and buttons stack on small screens */
@media only screen and (max-width: 767px) {
    .form-row {
        flex-direction: column;
    }
    .btn-group .btn {
        width: 100% !important;
    }
}

/* Responsive table actions: show icons only on small screens to save space */
.table .actions a .btn-text,
.table .actions button .btn-text {
    display: inline-block;
}
@media only screen and (max-width: 991px) {
    .table .actions a .btn-text,
    .table .actions button .btn-text {
        display: none !important;
    }
    .table .actions a,
    .table .actions button {
        padding: 6px !important;
        min-width: 36px !important;
    }
}

/* Improve mobile table readability: reduce paddings and font-size */
@media only screen and (max-width: 991px) {
    .table thead th {
        font-size: 13px !important;
        padding: 8px !important;
    }
    .table td,
    .table th {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
}

/* Provide a fallback compact list view for very small screens */
@media only screen and (max-width: 575px) {
    .table thead {
        display: none;
    }
    .table tbody td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .table tbody tr {
        margin-bottom: 12px;
        display: block;
    }
    .table tbody td:before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        color: var(--muted);
        margin-bottom: 6px;
    }
}

/* =====================================================
   SIDEBAR SMOOTH EXPAND / COLLAPSE ANIMATION
   ===================================================== */

/* Apply smooth width transition to the sidebar */
.sidebar-left {
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    will-change: width;
}

/* Smooth hide/show text labels inside nav items */
.sidebar-left .nav-main > li > a span,
.sidebar-left .sidebar-header .sidebar-title,
.sidebar-left .sidebar-widget {
    transition: opacity 0.22s ease, max-width 0.3s ease !important;
    white-space: nowrap;
    overflow: hidden;
}

/* When collapsed: fade labels out */
html.sidebar-left-collapsed .sidebar-left .nav-main > li > a span,
html.sidebar-left-collapsed .sidebar-left .sidebar-header .sidebar-title,
html.sidebar-left-collapsed .sidebar-left .sidebar-widget {
    opacity: 0 !important;
    max-width: 0 !important;
    pointer-events: none !important;
}

/* Collapsed: center icons */
html.sidebar-left-collapsed ul.nav-main > li > a {
    justify-content: center !important;
    padding: 12px !important;
}

/* Tooltip on collapsed icon-only mode */
html.sidebar-left-collapsed ul.nav-main > li {
    position: relative;
}
html.sidebar-left-collapsed ul.nav-main > li > a::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 9999;
    box-shadow: 0 4px 14px rgba(128,0,0,0.25);
}
html.sidebar-left-collapsed ul.nav-main > li:hover > a::after {
    opacity: 1;
}

/* Sidebar logo image: smooth fade & scale */
.sidebar-widget img {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}
html.sidebar-left-collapsed .sidebar-left .sidebar-widget img {
    opacity: 0 !important;
    transform: scale(0.7) !important;
}

/* Sidebar toggle button: spin animation on click */
.sidebar-toggle {
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
html.sidebar-left-collapsed .sidebar-toggle {
    transform: rotate(180deg) !important;
}

/* Mobile overlay sidebar: slide-in from left */
@media only screen and (max-width: 767px) {
    .sidebar-left {
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease !important;
    }
}

/* =====================================================
   MODERN DASHBOARD STAT WIDGET CARDS
   ===================================================== */

/* Override the old AdminLTE card-featured style completely */
.card.card-featured-left {
    border-left: none !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    background: var(--surface) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s ease !important;
    position: relative;
}
.card.card-featured-left::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    transform: translate(30px, -30px);
    pointer-events: none;
}
.card.card-featured-left:hover {
    transform: translateY(-6px) scale(1.01) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.1) !important;
}

/* Widget summary layout: flex row */
.widget-summary {
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
    padding: 4px 0 !important;
}

/* Icon column */
.widget-summary-col-icon {
    flex-shrink: 0 !important;
}
.summary-icon {
    width: 64px !important;
    height: 64px !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 26px !important;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease !important;
}
.card.card-featured-left:hover .summary-icon {
    transform: rotate(-6deg) scale(1.08) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.2) !important;
}

/* Gradient icons per accent colour */
.summary-icon.bg-primary {
    background: linear-gradient(135deg, #800000 0%, #a00000 100%) !important;
}
.summary-icon.bg-secondary {
    background: linear-gradient(135deg, #640101 0%, #8a1010 100%) !important;
}
.summary-icon.bg-warning {
    background: linear-gradient(135deg, #b89047 0%, #d4af60 100%) !important;
}
.summary-icon.bg-quaternary {
    background: linear-gradient(135deg, #383f48 0%, #525c6a 100%) !important;
}
.summary-icon.bg-success {
    background: linear-gradient(135deg, #1a7a4a 0%, #22a060 100%) !important;
}
.summary-icon.bg-danger {
    background: linear-gradient(135deg, #b42020 0%, #e03030 100%) !important;
}
.summary-icon.bg-info {
    background: linear-gradient(135deg, #1464a0 0%, #1e80cc 100%) !important;
}

/* Text column */
.widget-summary-col:not(.widget-summary-col-icon) {
    flex: 1 !important;
    min-width: 0 !important;
}
.widget-summary .summary h4.title {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    color: var(--muted) !important;
    margin: 0 0 4px 0 !important;
}
.widget-summary .summary .amount {
    font-size: 34px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    line-height: 1.1 !important;
    letter-spacing: -1px !important;
    display: block !important;
}
.widget-summary .summary-footer {
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(0,0,0,0.05) !important;
}
html.dark .widget-summary .summary-footer {
    border-top-color: rgba(255,255,255,0.05) !important;
}
.widget-summary .summary-footer a {
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    color: var(--primary) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: gap 0.2s ease, color 0.2s ease !important;
}
.widget-summary .summary-footer a::after {
    content: '→';
    font-size: 13px;
    display: inline-block;
    transition: transform 0.2s ease;
}
.widget-summary .summary-footer a:hover {
    color: var(--secondary) !important;
    gap: 8px !important;
}
.widget-summary .summary-footer a:hover::after {
    transform: translateX(3px);
}

/* Dark mode text adjustments for widget cards */
html.dark .widget-summary .summary .amount {
    color: var(--text) !important;
}
html.dark .widget-summary .summary-footer a {
    color: #ef6b6b !important;
}

/* Animated entrance for dashboard cards */
@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.row .card.card-featured-left {
    animation: cardFadeUp 0.45s ease both;
}
.row .col-md-4:nth-child(1) .card { animation-delay: 0.05s; }
.row .col-md-4:nth-child(2) .card { animation-delay: 0.12s; }
.row .col-md-4:nth-child(3) .card { animation-delay: 0.19s; }
.row .col-md-4:nth-child(4) .card { animation-delay: 0.26s; }
.row .col-md-4:nth-child(5) .card { animation-delay: 0.33s; }

/* =====================================================
   SIDEBAR NAV ACTIVE: GLOW EFFECT
   ===================================================== */
ul.nav-main > li.nav-active > a {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    box-shadow: 0 4px 20px rgba(128,0,0,0.35) !important;
}

/* Micro hover ripple on nav items */
ul.nav-main > li > a {
    position: relative;
    overflow: hidden;
}
ul.nav-main > li > a::before {
    content: '';
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0);
    transition: background 0.22s ease;
    border-radius: 10px;
    pointer-events: none;
}
ul.nav-main > li > a:hover::before {
    background: rgba(255,255,255,0.06);
}

/* =====================================================
   HEADER: MAROON GRADIENT TOP BAR ACCENT
   ===================================================== */
.header::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--tertiary), var(--primary));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.header {
    position: relative;
}

/* =====================================================
   SECTION CARDS: SUBTLE TOP BORDER ACCENT
   ===================================================== */
.card:not(.card-featured-left) {
    border-top: 3px solid transparent !important;
    background-image: linear-gradient(var(--surface), var(--surface)),
                      linear-gradient(90deg, var(--primary), var(--tertiary)) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
}
html.dark .card:not(.card-featured-left) {
    border-top: 3px solid rgba(128,0,0,0.5) !important;
    background-image: none !important;
    background: var(--surface) !important;
}
