/*
 * Inspiria UI System
 * Core visual layer for the Inspiria application.
 * Keep brand changes centralized in :root.
 */

:root {
    --primary: #016938;
    --primary-hover: #005b25;
    --primary-soft: #edf7f2;
    --primary-border: #cfe7dc;

    --secondary: #bf931c;
    --success: #168a50;
    --warning: #c79f38;
    --danger: #dc2626;
    --info: #2b8a62;

    --bg-page: #f8faf8;
    --bg-surface: #ffffff;
    --bg-muted: #f3f7f4;
    --bg-sidebar: #ffffff;

    --text: #173126;
    --text-soft: #52675e;
    --text-muted: #8a9a92;
    --border: #e1e9e4;
    --border-strong: #cfdad3;

    --sidebar-width: 264px;
    --sidebar-collapsed-width: 82px;
    --topbar-height: 72px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(1, 105, 56, .05);
    --shadow-md: 0 8px 28px rgba(1, 105, 56, .10);

    --transition: 180ms ease;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.app {
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    transition: width var(--transition), transform var(--transition);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 168px;
    height: 42px;
    object-fit: contain;
}

.sidebar-close,
.sidebar-toggle {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-soft);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.sidebar-close:hover,
.sidebar-toggle:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-user {
    margin: 14px 14px 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-muted);
}

.user-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}

.user-meta {
    min-width: 0;
    flex: 1;
}

.user-name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    margin-top: 1px;
    font-size: 12px;
    color: var(--text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-toggle {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    border-radius: 8px;
}

.user-menu-toggle:hover {
    color: var(--primary);
    background: #fff;
}

.sidebar-scroll {
    position: relative;
    height: calc(100vh - var(--topbar-height) - 92px);
    overflow: hidden;
    padding: 8px 10px 24px;
}

.sidebar-nav,
.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav .menu-title {
    padding: 18px 12px 8px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-nav > li > a,
.sidebar-nav .nav-second-level > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    margin: 3px 0;
    padding: 10px 12px;
    color: #526071;
    font-weight: 600;
    border-radius: 10px;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

.sidebar-nav > li > a:hover,
.sidebar-nav .nav-second-level > li > a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-nav > li > a svg,
.sidebar-nav > li > a i {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.sidebar-nav .mm-active > a {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-nav .nav-second-level {
    padding: 2px 0 4px 29px;
}

.sidebar-nav .nav-second-level > li > a {
    min-height: 38px;
    margin: 1px 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
}

.sidebar-nav .has-arrow::after,
.sidebar-nav .menu-arrow {
    margin-left: auto;
}

.menu-disabled {
    pointer-events: none;
    opacity: .45;
    cursor: default;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 1030;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: left var(--transition);
}

.topbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-title {
    min-width: 0;
}

.topbar-title h1 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 750;
}

.topbar-title span {
    display: block;
    margin-top: 1px;
    color: var(--text-soft);
    font-size: 12px;
}

/* Page */
.page-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    transition: margin-left var(--transition);
}

.page-content {
    min-height: calc(100vh - var(--topbar-height) - 58px);
    padding: 24px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-heading h2,
.page-heading h3,
.page-heading h4 {
    margin: 0;
    color: var(--text);
    font-weight: 750;
}

.footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: var(--text-soft);
    font-size: 12px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.sidebar-backdrop {
    display: none;
}

/* Generic components */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--bg-surface);
}

.card-header {
    padding: 16px 18px;
    background: transparent;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-body {
    padding: 18px;
}

.card-footer {
    padding: 14px 18px;
    background: var(--bg-muted);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

.btn {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 650;
    box-shadow: none !important;
    transition: all var(--transition);
}

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

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

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

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

.btn-light {
    color: var(--text);
    background: #fff;
    border-color: var(--border);
}

.form-group {
    margin-bottom: 1rem;
}

label,
.form-label {
    color: #344054;
    font-size: 13px;
    font-weight: 650;
}

.required-label::after {
    content: " *";
    color: var(--danger);
}

.form-control,
.custom-select {
    min-height: 42px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    box-shadow: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.custom-select:focus {
    border-color: rgba(1, 105, 56, .72);
    box-shadow: 0 0 0 3px rgba(1, 105, 56, .12);
}

textarea.form-control {
    min-height: 110px;
}

.input-group-text {
    color: var(--text-soft);
    background: var(--bg-muted);
    border-color: var(--border-strong);
}

.table-responsive {
    border-radius: var(--radius-md);
}

.table {
    margin-bottom: 0;
    color: var(--text);
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-muted);
    color: #475467;
    font-size: 12px;
    font-weight: 750;
    vertical-align: middle;
}

.table td {
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #fbfdff;
}

.badge {
    padding: .45em .7em;
    border-radius: 7px;
    font-weight: 650;
}

.dropdown-menu {
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    padding: 9px 10px;
    color: #475467;
    border-radius: 8px;
    font-size: 13px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--primary);
    background: var(--primary-soft);
}

.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .18);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

.modal-title {
    font-weight: 750;
}

.alert {
    border-radius: 10px;
    border-width: 1px;
}

.pagination .page-link {
    min-width: 36px;
    height: 36px;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px !important;
    color: var(--text-soft);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* Select2 */
.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap4 .select2-selection,
.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    min-height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: rgba(1, 105, 56, .72);
    box-shadow: 0 0 0 3px rgba(1, 105, 56, .12);
}

.select2-dropdown {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}

/* DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    min-height: 36px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #fff !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 8px;
}

/* Summernote */
.note-editor.note-frame {
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
}

.note-editor.note-frame .note-toolbar {
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}

/* Utility compatibility */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.text-muted { color: var(--text-soft) !important; }

/* Collapsed desktop sidebar */
@media (min-width: 992px) {
    .app.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .app.sidebar-collapsed .topbar {
        left: var(--sidebar-collapsed-width);
    }

    .app.sidebar-collapsed .page-wrapper {
        margin-left: var(--sidebar-collapsed-width);
    }

    .app.sidebar-collapsed .sidebar-header {
        padding: 0 14px;
        justify-content: center;
    }

    .app.sidebar-collapsed .brand-logo {
        width: 48px;
        max-width: 48px;
        object-fit: cover;
        object-position: left center;
    }

    .app.sidebar-collapsed .sidebar-user {
        padding: 8px;
        justify-content: center;
    }

    .app.sidebar-collapsed .user-meta,
    .app.sidebar-collapsed .user-menu-toggle,
    .app.sidebar-collapsed .menu-title,
    .app.sidebar-collapsed .sidebar-nav > li > a > span:not(.menu-arrow),
    .app.sidebar-collapsed .sidebar-nav > li > a .menu-arrow,
    .app.sidebar-collapsed .nav-second-level {
        display: none !important;
    }

    .app.sidebar-collapsed .sidebar-nav > li > a {
        justify-content: center;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Tablet / mobile */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }

    .topbar {
        left: 0;
        padding: 0 16px;
    }

    .page-wrapper {
        margin-left: 0;
    }

    .page-content {
        padding: 18px 14px;
    }

    .footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .app.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(15, 23, 42, .42);
    }

    .app.sidebar-open .sidebar-backdrop {
        display: block;
    }
}

@media (max-width: 575.98px) {
    :root {
        --topbar-height: 64px;
    }

    .topbar-title h1 {
        font-size: 16px;
    }

    .topbar-title span {
        display: none;
    }

    .page-content {
        padding-top: 14px;
    }

    .card-body {
        padding: 15px;
    }
}

/* ================================================================
   LEGACY LAYOUT COMPATIBILITY
   ---------------------------------------------------------------
   Keeps existing Inspiria Blade views usable while the application
   is migrated gradually to the new generic layout classes.
   This section intentionally replaces visual dependencies that were
   previously supplied by the old commercial theme.
   ================================================================ */

/* Base wrappers used by the existing app.blade.php */
#wrapper {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

/* Legacy top navigation */
.navbar-custom {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1045;
    min-height: var(--topbar-height);
    padding: 0 18px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    backdrop-filter: blur(10px);
}

.navbar-custom > .container-fluid {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
}

.navbar-custom .navbar-brand.logo {
    width: calc(var(--sidebar-width) - 18px);
    min-width: calc(var(--sidebar-width) - 18px);
    margin: 0 12px 0 0 !important;
    padding: 0 16px 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--topbar-height);
    border-right: 1px solid var(--border);
}

.navbar-custom .logo-lg,
.navbar-custom .logo-sm {
    display: inline-flex;
    align-items: center;
}

.navbar-custom .logo-lg img {
    width: auto;
    max-width: 176px;
    height: 46px !important;
    object-fit: contain;
}

.navbar-custom .logo-sm {
    display: none;
}

.navbar-custom .menu-left {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.button-menu-mobile {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
    transition: background var(--transition), color var(--transition);
}

.button-menu-mobile:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.button-menu-mobile .menu-icon,
.button-menu-mobile .close-icon {
    width: 20px;
    height: 20px;
}

.button-menu-mobile .close-icon {
    display: none;
}

/* Legacy left navigation */
.left-side-menu {
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    z-index: 1040;
    width: var(--sidebar-width);
    overflow: hidden;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    transition: width var(--transition), transform var(--transition);
}

.left-side-menu .sidebar-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-side-menu .user-profile {
    flex: 0 0 auto;
    min-height: 72px;
    margin: 12px 12px 6px !important;
    padding: 11px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.left-side-menu .user-profile .avatar-sm {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    margin-right: 0 !important;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}

.left-side-menu .user-profile .avatar-xs {
    display: none;
}

.left-side-menu .user-profile .media-body {
    min-width: 0;
    flex: 1 1 auto;
}

.left-side-menu .user-profile .media-body h6 {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-side-menu .pro-user-desc {
    display: block;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-side-menu .profile-dropdown-menu {
    flex: 0 0 auto;
}

.left-side-menu .profile-dropdown-menu > .dropdown-toggle {
    width: 30px;
    height: 30px;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    border-radius: 8px;
}

.left-side-menu .profile-dropdown-menu > .dropdown-toggle::after {
    display: none;
}

.left-side-menu .profile-dropdown-menu > .dropdown-toggle:hover {
    color: var(--primary);
    background: #fff;
}

#sidebar-menu,
.slimscroll-menu {
    position: relative;
}

#sidebar-menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px 10px 24px;
    scrollbar-width: thin;
    scrollbar-color: #d8e0e8 transparent;
}

#sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

#sidebar-menu::-webkit-scrollbar-thumb {
    background: #d8e0e8;
    border-radius: 999px;
}

/* Legacy navigation reset: prevents the raw bullet list seen when
   the old theme stylesheet is removed. */
#menu-bar,
#menu-bar ul,
#sidebar-menu > ul,
#sidebar-menu ul.nav-second-level {
    margin: 0;
    padding: 0;
    list-style: none !important;
}

#menu-bar > li,
#menu-bar .nav-second-level > li {
    margin: 0;
    padding: 0;
    list-style: none !important;
}

#menu-bar .menu-title,
#sidebar-menu .menu-title {
    margin: 0;
    padding: 17px 11px 7px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

#menu-bar > li > a,
#menu-bar .nav-second-level > li > a {
    position: relative;
    min-height: 43px;
    margin: 3px 0;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #526071;
    background: transparent;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 600;
    text-decoration: none !important;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}

#menu-bar > li > a:hover,
#menu-bar > li.mm-active > a,
#menu-bar > li > a.active,
#menu-bar .nav-second-level > li > a:hover,
#menu-bar .nav-second-level > li.mm-active > a,
#menu-bar .nav-second-level > li > a.active {
    color: var(--primary);
    background: var(--primary-soft);
}

#menu-bar > li > a svg,
#menu-bar > li > a i {
    width: 18px;
    height: 18px;
    min-width: 18px;
    flex: 0 0 auto;
}

#menu-bar > li > a > span:not(.menu-arrow) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#menu-bar .menu-arrow,
#menu-bar .has-arrow::after {
    margin-left: auto;
}

#menu-bar .nav-second-level {
    padding: 3px 0 4px 28px !important;
}

#menu-bar .nav-second-level > li > a {
    min-height: 37px;
    margin: 1px 0;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 550;
}

/* Content area used by legacy pages */
.content-page {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    background: var(--bg-page);
    transition: margin-left var(--transition);
}

.content-page > .content {
    min-height: calc(100vh - var(--topbar-height) - 58px);
    padding: 22px 22px 26px;
}

.content-page .content > .container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.content-page .page-title {
    margin: 0 0 18px !important;
    padding: 0;
}

.content-page .page-title h1,
.content-page .page-title h2,
.content-page .page-title h3,
.content-page .page-title h4,
.content-page .page-title h5 {
    margin-top: 0 !important;
    color: var(--text);
    font-weight: 750;
}

.content-page .page-title h4 {
    font-size: 20px;
}

.content-page .footer,
.content-page footer.footer {
    margin: 0;
    min-height: 58px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    color: var(--text-soft);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

/* Common legacy helper classes previously defined by the theme. */
.avatar-xs { width: 28px; height: 28px; }
.avatar-sm { width: 40px; height: 40px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }

.font-size-10 { font-size: 10px !important; }
.font-size-11 { font-size: 11px !important; }
.font-size-12 { font-size: 12px !important; }
.font-size-13 { font-size: 13px !important; }
.font-size-14 { font-size: 14px !important; }
.font-size-15 { font-size: 15px !important; }
.font-size-16 { font-size: 16px !important; }
.font-size-18 { font-size: 18px !important; }
.font-size-20 { font-size: 20px !important; }
.font-size-22 { font-size: 22px !important; }
.font-size-24 { font-size: 24px !important; }

.header-title {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
}

.icon-xs { width: 15px !important; height: 15px !important; }
.icon-sm { width: 18px !important; height: 18px !important; }
.icon-md { width: 22px !important; height: 22px !important; }

.icon-dual {
    color: currentColor;
    stroke-width: 1.8;
}

.card-box,
.box,
.panel {
    margin-bottom: 20px;
    padding: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.table-centered th,
.table-centered td {
    vertical-align: middle !important;
}

.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

.custom-control-label,
.custom-file-label {
    font-weight: 500;
}

.custom-file-label,
.custom-file-label::after {
    min-height: 42px;
    line-height: 26px;
    border-color: var(--border-strong);
}

.breadcrumb {
    padding: 0;
    margin: 0;
    background: transparent;
    font-size: 12px;
}

/* Desktop collapse support for the legacy layout. */
@media (min-width: 992px) {
    #wrapper.sidebar-collapsed .left-side-menu,
    body.sidebar-collapsed .left-side-menu {
        width: var(--sidebar-collapsed-width);
    }

    #wrapper.sidebar-collapsed .content-page,
    body.sidebar-collapsed .content-page {
        margin-left: var(--sidebar-collapsed-width);
    }

    #wrapper.sidebar-collapsed .left-side-menu .user-profile,
    body.sidebar-collapsed .left-side-menu .user-profile {
        justify-content: center;
        padding: 8px;
    }

    #wrapper.sidebar-collapsed .left-side-menu .media-body,
    #wrapper.sidebar-collapsed .left-side-menu .profile-dropdown-menu,
    #wrapper.sidebar-collapsed #menu-bar .menu-title,
    #wrapper.sidebar-collapsed #menu-bar > li > a > span,
    #wrapper.sidebar-collapsed #menu-bar .nav-second-level,
    body.sidebar-collapsed .left-side-menu .media-body,
    body.sidebar-collapsed .left-side-menu .profile-dropdown-menu,
    body.sidebar-collapsed #menu-bar .menu-title,
    body.sidebar-collapsed #menu-bar > li > a > span,
    body.sidebar-collapsed #menu-bar .nav-second-level {
        display: none !important;
    }

    #wrapper.sidebar-collapsed #menu-bar > li > a,
    body.sidebar-collapsed #menu-bar > li > a {
        justify-content: center;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Mobile compatibility for the old wrapper. */
@media (max-width: 991.98px) {
    .navbar-custom {
        min-height: var(--topbar-height);
        padding: 0 12px;
    }

    .navbar-custom .navbar-brand.logo {
        width: auto;
        min-width: 0;
        flex: 1 1 auto;
        border-right: 0;
        margin-right: 4px !important;
        padding-right: 8px;
    }

    .navbar-custom .logo-lg img {
        max-width: 148px;
        height: 40px !important;
    }

    .left-side-menu {
        width: min(286px, 86vw);
        transform: translateX(-105%);
        box-shadow: 16px 0 40px rgba(16, 24, 40, .16);
    }

    .content-page {
        margin-left: 0;
    }

    .content-page > .content {
        padding: 16px 13px 22px;
    }

    #wrapper.sidebar-open .left-side-menu,
    body.sidebar-open .left-side-menu {
        transform: translateX(0);
    }

    #wrapper.sidebar-open::after,
    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: var(--topbar-height) 0 0 0;
        z-index: 1038;
        background: rgba(15, 23, 42, .42);
    }

    #wrapper.sidebar-open .left-side-menu,
    body.sidebar-open .left-side-menu {
        z-index: 1040;
    }

    #wrapper.sidebar-open .button-menu-mobile .menu-icon,
    body.sidebar-open .button-menu-mobile .menu-icon {
        display: none;
    }

    #wrapper.sidebar-open .button-menu-mobile .close-icon,
    body.sidebar-open .button-menu-mobile .close-icon {
        display: inline-block;
    }
}

@media (max-width: 575.98px) {
    .content-page .page-title h4 {
        font-size: 18px;
    }

    .content-page > .content {
        padding-left: 11px;
        padding-right: 11px;
    }
}


/* ================================================================
   AUTHENTICATION
   Clean Inspiria authentication layout using the same design tokens.
   ================================================================ */

.authentication-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(1, 105, 56, .08), transparent 32%),
        radial-gradient(circle at 90% 90%, rgba(191, 147, 28, .08), transparent 30%),
        var(--bg-page);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    padding: 24px;
}

.auth-shell {
    width: min(1180px, 100%);
    min-height: calc(100vh - 48px);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(23, 49, 38, .10);
}

.auth-shell-single {
    width: min(540px, 100%);
    min-height: auto;
    display: block;
}

.auth-brand-panel {
    position: relative;
    min-height: 100%;
    padding: 54px;
    display: flex;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(0, 91, 37, .98), rgba(1, 105, 56, .94)),
        var(--primary);
    overflow: hidden;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.auth-brand-panel::before {
    width: 330px;
    height: 330px;
    right: -150px;
    top: -100px;
    border: 1px solid rgba(255,255,255,.13);
    box-shadow:
        0 0 0 55px rgba(255,255,255,.035),
        0 0 0 110px rgba(255,255,255,.025);
}

.auth-brand-panel::after {
    width: 190px;
    height: 190px;
    left: -95px;
    bottom: -85px;
    background: rgba(191, 147, 28, .22);
    filter: blur(2px);
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 10px 14px;
    background: rgba(255,255,255,.96);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
}

.auth-brand-logo img {
    display: block;
    width: auto;
    max-width: 180px;
    height: 52px;
    object-fit: contain;
}

.auth-brand-copy {
    max-width: 390px;
    margin-top: 80px;
}

.auth-brand-accent {
    display: block;
    width: 48px;
    height: 4px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: var(--secondary);
}

.auth-brand-copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.14;
    font-weight: 780;
    letter-spacing: -.025em;
}

.auth-brand-copy p {
    margin: 14px 0 0;
    color: rgba(255,255,255,.76);
    font-size: 15px;
}

.auth-form-panel {
    min-height: 100%;
    padding: 54px clamp(30px, 5vw, 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
}

.auth-shell-single .auth-form-panel {
    padding: 44px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
}

.auth-card-center {
    text-align: center;
}

.auth-mobile-logo {
    display: none;
    margin-bottom: 30px;
}

.auth-logo-visible {
    display: flex;
    justify-content: center;
}

.auth-mobile-logo img {
    width: auto;
    max-width: 180px;
    height: 56px;
    object-fit: contain;
}

.auth-heading {
    margin-bottom: 30px;
}

.auth-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 780;
    letter-spacing: -.025em;
}

.auth-heading p {
    margin: 9px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.authentication-form .form-group {
    margin-bottom: 20px;
}

.authentication-form label {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.auth-input {
    position: relative;
}

.auth-input .form-control {
    height: 48px;
    padding-left: 44px;
    padding-right: 44px;
    border-radius: 11px;
    background: #fff;
}

.auth-input .form-control:focus {
    border-color: rgba(1, 105, 56, .72);
    box-shadow: 0 0 0 3px rgba(1, 105, 56, .12);
}

.auth-input-icon {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input-icon svg {
    width: 17px;
    height: 17px;
}

.auth-password-toggle {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 9px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
    color: var(--primary);
    background: var(--primary-soft);
    outline: 0;
}

.auth-password-toggle svg {
    width: 17px;
    height: 17px;
}

.auth-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 550;
}

.auth-form-options {
    margin: 2px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.auth-remember {
    min-height: 22px;
}

.auth-remember .custom-control-label {
    padding-top: 1px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 550;
    cursor: pointer;
}

.auth-remember .custom-control-label::before {
    border-color: var(--border-strong);
    border-radius: 5px;
    box-shadow: none !important;
}

.auth-remember .custom-control-input:checked ~ .custom-control-label::before {
    background: var(--primary);
    border-color: var(--primary);
}

.auth-link,
.auth-bottom-link a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.auth-link:hover,
.auth-bottom-link a:hover {
    color: var(--primary-hover);
}

.auth-submit {
    min-height: 48px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 750;
    box-shadow: 0 8px 18px rgba(1, 105, 56, .16) !important;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(1, 105, 56, .20) !important;
}

.auth-bottom-link {
    margin-top: 24px;
    color: var(--text-soft);
    text-align: center;
    font-size: 13px;
}

.auth-status-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-radius: 18px;
}

.auth-status-icon svg {
    width: 24px;
    height: 24px;
}

.auth-card .alert {
    margin-bottom: 22px;
    padding: 12px 14px;
    font-size: 13px;
}

@media (max-width: 991.98px) {
    .auth-page {
        padding: 18px;
    }

    .auth-shell {
        min-height: calc(100vh - 36px);
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        padding: 48px 28px;
    }

    .auth-mobile-logo {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .auth-page {
        padding: 0;
        background: var(--bg-surface);
    }

    .auth-shell,
    .auth-shell-single {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-form-panel,
    .auth-shell-single .auth-form-panel {
        padding: 36px 22px;
    }

    .auth-heading {
        margin-bottom: 25px;
    }

    .auth-heading h2 {
        font-size: 24px;
    }

    .auth-form-options {
        align-items: center;
    }
}

/* ================================================================
   AUTH LOGIN VISUAL REFINEMENT - FINAL
   One clean override: normal card width, balanced student visual,
   and one-screen authentication layout.
   ================================================================ */

.authentication-bg {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.auth-page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 24px;
    overflow: hidden;
}

/* Keep the original card width. */
.auth-shell {
    width: min(1180px, 100%);
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    min-height: 0;
    max-height: 900px;
    grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
}

.auth-brand-panel,
.auth-form-panel {
    height: 100%;
    min-height: 0;
}

.auth-brand-panel {
    padding: 34px 38px 30px;
}

/* Three clear zones: logo / visual / title. */
.auth-brand-content {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    justify-content: initial;
}

.auth-brand-logo {
    margin: 0 auto;
    padding: 9px 11px;
    justify-content: center;
}

.auth-brand-logo img {
    height: clamp(48px, 6vh, 56px);
    max-width: 150px;
}

/*
 * Student visual
 * - no negative margins
 * - no fixed oversized pixel width
 * - no translateY crop
 * - size is limited by BOTH available width and height
 */
.auth-brand-visual {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 4px 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.auth-brand-visual img {
    display: block;
    width: auto;
    height: auto;
    max-width: 82%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: none;
    filter: drop-shadow(0 16px 22px rgba(0, 45, 25, .16));
}

.auth-brand-copy {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-bottom: 2px;
}

.auth-brand-accent {
    margin-bottom: 13px;
}

.auth-brand-copy h1 {
    font-size: clamp(28px, 2.35vw, 38px);
    line-height: 1.08;
}

.auth-brand-copy p {
    margin-top: 9px;
}

.auth-form-panel {
    padding: 42px clamp(34px, 5vw, 76px);
    overflow: hidden;
}

/* Common laptop heights: preserve the whole visual, just scale it down. */
@media (min-width: 992px) and (max-height: 820px) {
    .auth-page {
        padding: 16px;
    }

    .auth-shell {
        height: calc(100vh - 32px);
        height: calc(100dvh - 32px);
    }

    .auth-brand-panel {
        padding: 24px 32px 22px;
    }

    .auth-brand-content {
        gap: 8px;
    }

    .auth-brand-logo {
        padding: 7px 9px;
    }

    .auth-brand-logo img {
        height: 46px;
    }

    .auth-brand-visual img {
        max-width: 78%;
        max-height: 100%;
    }

    .auth-brand-copy h1 {
        font-size: 30px;
    }

    .auth-brand-copy p {
        margin-top: 7px;
        font-size: 14px;
    }

    .auth-form-panel {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .auth-heading {
        margin-bottom: 20px;
    }

    .authentication-form .form-group {
        margin-bottom: 14px;
    }
}

/* Narrow desktop: keep the same card, slightly reduce the illustration. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .auth-brand-panel {
        padding-left: 28px;
        padding-right: 28px;
    }

    .auth-brand-visual img {
        max-width: 80%;
    }

    .auth-brand-copy h1 {
        font-size: 31px;
    }

    .auth-form-panel {
        padding-left: 42px;
        padding-right: 42px;
    }
}

/* Tablet/mobile: form only, guaranteeing one screen without scrolling. */
@media (max-width: 991.98px) {
    .authentication-bg,
    .auth-page {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    .auth-page {
        padding: 18px;
    }

    .auth-shell {
        height: calc(100dvh - 36px);
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }

    .auth-form-panel {
        height: 100%;
        min-height: 0;
        padding: 42px 28px;
        overflow: hidden;
    }

    .auth-mobile-logo {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .auth-page {
        padding: 0;
        background: var(--bg-surface);
    }

    .auth-shell,
    .auth-shell-single {
        height: 100dvh;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-form-panel,
    .auth-shell-single .auth-form-panel {
        height: 100dvh;
        min-height: 0;
        padding: clamp(22px, 5vh, 36px) 22px;
        overflow: hidden;
    }

    .auth-mobile-logo {
        margin-bottom: clamp(16px, 3vh, 26px);
    }
}

@media (max-width: 575.98px) and (max-height: 680px) {
    .auth-form-panel,
    .auth-shell-single .auth-form-panel {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .auth-mobile-logo {
        margin-bottom: 12px;
    }

    .auth-mobile-logo img {
        height: 46px;
    }

    .auth-heading {
        margin-bottom: 14px;
    }

    .auth-heading p {
        margin-top: 4px;
    }

    .authentication-form .form-group {
        margin-bottom: 10px;
    }

    .auth-input .form-control,
    .auth-submit {
        min-height: 43px;
        height: 43px;
    }

    .auth-form-options {
        margin-bottom: 12px;
    }
}
