/* ==========================================================================
   AMEE Admin - Custom Theme Overrides
   Modern SaaS-style visual refresh (Linear/Vercel inspired)
   Applied AFTER style.bundle.css to override Metronic defaults
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --amee-sidebar-bg: #f0f2f5;
    --amee-sidebar-hover: #e4e7ec;
    --amee-sidebar-active: #dce0e8;
    --amee-cyan: #05c3dd;
    --amee-cyan-light: rgba(5, 195, 221, 0.08);
    --amee-cyan-ring: rgba(5, 195, 221, 0.25);
    --amee-green: #48d597;
    --amee-radius: 8px;
    --amee-radius-sm: 6px;
    --amee-radius-xs: 4px;
    --amee-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
    --amee-shadow-hover: 0 4px 16px rgba(0,0,0,0.10), 0 8px 24px rgba(0,0,0,0.08);
    --amee-transition: 0.2s ease;
    --amee-border: #e8ecf1;
    --amee-text-muted: #8a92a6;
}

/* ---------- Sidebar ---------- */
#kt_aside {
    background: #fff !important;
    border-right: 1px solid var(--amee-border) !important;
}

#kt_aside .aside-logo {
    background: #fff !important;
    border-bottom: 1px solid var(--amee-border) !important;
}

#kt_aside .aside-menu {
    background-color: transparent !important;
}

/* Sidebar menu section labels */
#kt_aside .menu-section {
    color: var(--amee-cyan) !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.08em !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
}

/* Sidebar menu items */
#kt_aside .menu-title {
    color: #4b5675 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: color var(--amee-transition) !important;
}

#kt_aside .menu-icon i,
#kt_aside .menu-icon .svg-icon {
    color: #a1a5b7 !important;
    transition: color var(--amee-transition) !important;
}

#kt_aside .menu-link {
    margin: 1px 10px !important;
    border-radius: var(--amee-radius-sm) !important;
    transition: all var(--amee-transition) !important;
}

#kt_aside .menu-link:hover {
    background-color: rgba(5, 195, 221, 0.06) !important;
}

#kt_aside .menu-link:hover .menu-title,
#kt_aside .menu-link:hover .menu-icon i,
#kt_aside .menu-link:hover .menu-icon .svg-icon {
    color: var(--amee-cyan) !important;
}

/* Active state */
#kt_aside .menu-link.active {
    background: linear-gradient(135deg, rgba(5,195,221,0.10) 0%, rgba(72,213,151,0.08) 100%) !important;
}

#kt_aside .menu-link.active .menu-title {
    color: #049fb5 !important;
    font-weight: 600 !important;
}

#kt_aside .menu-link.active .menu-icon i,
#kt_aside .menu-link.active .menu-icon .svg-icon {
    color: var(--amee-cyan) !important;
}

/* Active indicator bar */
#kt_aside .menu-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--amee-cyan), var(--amee-green));
}

/* Sub-menus */
#kt_aside .menu-sub {
    background-color: transparent !important;
    margin: 0 !important;
    padding-left: 0.5rem !important;
}

#kt_aside .menu-sub .menu-link {
    padding-left: 2.25rem !important;
}

#kt_aside .menu-bullet .bullet {
    width: 5px !important;
    height: 5px !important;
    background-color: #c4c8d4 !important;
    transition: all var(--amee-transition) !important;
}

#kt_aside .menu-link:hover .menu-bullet .bullet,
#kt_aside .menu-link.active .menu-bullet .bullet {
    background-color: var(--amee-cyan) !important;
    transform: scale(1.3) !important;
}

/* Menu arrow color */
#kt_aside .menu-arrow::after {
    color: #a1a5b7 !important;
}

/* Sidebar toggle icon */
#kt_aside_toggle .svg-icon svg path,
#kt_aside_toggle .svg-icon svg rect {
    fill: #a1a5b7 !important;
}

#kt_aside_toggle:hover .svg-icon svg path,
#kt_aside_toggle:hover .svg-icon svg rect {
    fill: var(--amee-cyan) !important;
}

/* Sidebar logo — prevent overflow when minimized */
#kt_aside .aside-logo img {
    transition: all var(--amee-transition) !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

body.aside-minimize:not(.aside-hoverable-active) #kt_aside .aside-logo img {
    height: 20px !important;
    max-width: 30px !important;
    object-fit: contain !important;
    object-position: left center !important;
    clip-path: inset(0 0 0 0) !important;
}

/* Sidebar scrollbar */
#kt_aside .hover-scroll-overlay-y::-webkit-scrollbar {
    width: 4px !important;
}
#kt_aside .hover-scroll-overlay-y::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.06) !important;
    border-radius: 4px !important;
}

/* Sidebar user card at bottom */
.aside-user-card {
    padding: 0.75rem 1rem;
    margin: 0 10px 10px;
    border-radius: var(--amee-radius-sm);
    background: linear-gradient(135deg, rgba(5,195,221,0.08) 0%, rgba(72,213,151,0.06) 100%);
    border: 1px solid rgba(5,195,221,0.12);
    transition: all var(--amee-transition);
}
.aside-user-card:hover {
    background: linear-gradient(135deg, rgba(5,195,221,0.12) 0%, rgba(72,213,151,0.10) 100%);
}
.aside-user-card .aside-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #05c3dd, #48d597);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.aside-user-card .aside-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e2235;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aside-user-card .aside-user-email {
    font-size: 0.7rem;
    color: var(--amee-text-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide user card when sidebar is minimized */
body.aside-minimize:not(.aside-hoverable-active) .aside-user-card {
    display: none !important;
}

/* Topbar profile button */
.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    border-radius: var(--amee-radius-sm);
    border: 1px solid var(--amee-border);
    background: #fff;
    cursor: pointer;
    transition: all var(--amee-transition);
}
.topbar-user-btn:hover {
    border-color: rgba(5,195,221,0.3);
    box-shadow: 0 2px 8px rgba(5,195,221,0.10);
}
.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #05c3dd, #48d597);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.topbar-user-info {
    text-align: left;
    line-height: 1.2;
    min-width: 0;
}
.topbar-user-info .topbar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e2235;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.topbar-user-info .topbar-user-role {
    font-size: 0.68rem;
    color: var(--amee-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* ---------- Header ---------- */
#kt_header {
    background-color: #fff !important;
    border-bottom: 1px solid var(--amee-border) !important;
    box-shadow: none !important;
}

#kt_header .page-title h1 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #1e2235 !important;
}

/* Breadcrumbs */
#kt_header .breadcrumb {
    font-size: 0.8rem !important;
}

#kt_header .breadcrumb .breadcrumb-item.text-muted a {
    color: var(--amee-text-muted) !important;
    transition: color var(--amee-transition) !important;
}

#kt_header .breadcrumb .breadcrumb-item.text-muted a:hover {
    color: var(--amee-cyan) !important;
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--amee-border) !important;
    border-radius: var(--amee-radius) !important;
    box-shadow: var(--amee-shadow) !important;
    overflow: hidden;
}

/* Disable hover effects on utility cards (bulk action bar, etc.) */
#bulk-action-bar.card {
    box-shadow: none !important;
}

.card-header {
    border-bottom: 1px solid var(--amee-border) !important;
    background-color: #fff !important;
    border-radius: var(--amee-radius) var(--amee-radius) 0 0 !important;
}

.card-body {
    border-radius: 0 0 var(--amee-radius) var(--amee-radius) !important;
    padding-top: 1.25rem !important;
}

/* ---------- Search input in list card header ---------- */
.card-header .form-control-solid {
    background-color: #fff !important;
    border: 1px solid var(--amee-border) !important;
}

.card-header .form-control-solid:focus {
    border-color: var(--amee-cyan) !important;
    box-shadow: 0 0 0 3px var(--amee-cyan-ring) !important;
    background-color: #fff !important;
}

/* ---------- Tables ---------- */
.table thead tr th {
    background-color: #f7f8fa !important;
    color: #5e6278 !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border-bottom: 1px solid var(--amee-border) !important;
    padding: 0.85rem 1rem !important;
}

.table thead tr:first-child th:first-child {
    border-radius: var(--amee-radius-xs) 0 0 0 !important;
}

.table thead tr:first-child th:last-child {
    border-radius: 0 var(--amee-radius-xs) 0 0 !important;
}

.table tbody tr {
    transition: background-color var(--amee-transition) !important;
    border-bottom: 1px solid #f1f3f5 !important;
}

.table tbody tr:hover {
    background-color: var(--amee-cyan-light) !important;
}

.table tbody tr td {
    padding: 0.85rem 1rem !important;
    border-bottom: none !important;
    font-size: 0.875rem !important;
    color: #3f4254 !important;
    vertical-align: middle !important;
}

.table.table-row-dashed tbody tr {
    border-bottom-style: solid !important;
    border-bottom-color: #f1f3f5 !important;
}

/* Table caption */
.table caption {
    caption-side: bottom !important;
    padding-top: 1.25rem !important;
    color: var(--amee-text-muted) !important;
    font-size: 0.8rem !important;
}

/* ---------- Inputs & Selects ---------- */
.form-control,
.form-select {
    border-radius: var(--amee-radius-xs) !important;
    border-color: var(--amee-border) !important;
    transition: border-color var(--amee-transition), box-shadow var(--amee-transition) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--amee-cyan) !important;
    box-shadow: 0 0 0 3px var(--amee-cyan-ring) !important;
}

.form-control-solid {
    border: 1px solid transparent !important;
}

.form-control-solid:focus {
    border-color: var(--amee-cyan) !important;
    box-shadow: 0 0 0 3px var(--amee-cyan-ring) !important;
    background-color: #fff !important;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--amee-radius-xs) !important;
    transition: all var(--amee-transition) !important;
    font-weight: 500 !important;
}

.btn-primary {
    background-color: var(--amee-cyan) !important;
    border-color: var(--amee-cyan) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #04afc7 !important;
    border-color: #04afc7 !important;
    box-shadow: 0 4px 12px rgba(5, 195, 221, 0.35) !important;
}

.btn-light-success:hover {
    box-shadow: 0 4px 12px rgba(72, 213, 151, 0.3) !important;
}

.btn-light-primary:hover {
    box-shadow: 0 4px 12px rgba(5, 195, 221, 0.25) !important;
}

.btn-light-danger:hover {
    box-shadow: 0 4px 12px rgba(241, 65, 108, 0.25) !important;
}

.btn-icon {
    border-radius: var(--amee-radius-xs) !important;
}

/* ---------- Badges ---------- */
.badge {
    border-radius: 4px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
    padding: 0.4em 0.65em !important;
}

/* ---------- Pagination ---------- */
.page-item .page-link {
    border-radius: var(--amee-radius-xs) !important;
    margin: 0 2px !important;
    border: none !important;
    transition: all var(--amee-transition) !important;
    font-weight: 500 !important;
}

.page-item.active .page-link {
    background-color: var(--amee-cyan) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(5, 195, 221, 0.3) !important;
}

.page-item:not(.active) .page-link:hover {
    background-color: var(--amee-cyan-light) !important;
    color: var(--amee-cyan) !important;
}

/* ---------- Filter Dropdown ---------- */
.menu-sub-dropdown {
    border-radius: var(--amee-radius-sm) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06) !important;
    border: 1px solid var(--amee-border) !important;
    overflow: hidden;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--amee-radius-sm) !important;
    border: none !important;
    font-weight: 500 !important;
}

/* ---------- SweetAlert Overrides ---------- */
.swal2-popup {
    border-radius: var(--amee-radius) !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15) !important;
}

.swal2-styled.swal2-confirm {
    border-radius: var(--amee-radius-xs) !important;
}

.swal2-styled.swal2-deny {
    border-radius: var(--amee-radius-xs) !important;
}

/* ---------- Toast ---------- */
.toast {
    border-radius: var(--amee-radius-sm) !important;
    box-shadow: var(--amee-shadow-hover) !important;
    border: 1px solid var(--amee-border) !important;
}

/* ---------- Scrollbar (Global) ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.2);
}

/* ---------- Empty State ---------- */
.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2.5rem 1rem;
    color: var(--amee-text-muted);
}

.empty-state-icon i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-icon span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---------- Select2 Overrides ---------- */
.select2-container--bootstrap5 .select2-selection,
.select2-container--default .select2-selection {
    border-radius: var(--amee-radius-xs) !important;
    transition: border-color var(--amee-transition), box-shadow var(--amee-transition) !important;
}

.select2-container--bootstrap5.select2-container--focus .select2-selection,
.select2-container--bootstrap5.select2-container--open .select2-selection,
.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
    border-color: var(--amee-cyan) !important;
    box-shadow: 0 0 0 3px var(--amee-cyan-ring) !important;
}

.select2-container--bootstrap5 .select2-dropdown,
.select2-container--default .select2-dropdown {
    border-radius: var(--amee-radius-sm) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important;
    border: 1px solid var(--amee-border) !important;
}

/* Opção normal (sem hover, sem seleção) */
.select2-results__option {
    color: #1e2235 !important;
}

/* Opção selecionada (sem hover) */
.select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--selected,
.select2-container--default .select2-results__option--selected {
    background-color: var(--amee-cyan) !important;
    color: #fff !important;
}

/* Opção com hover */
.select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: rgba(5, 195, 221, 0.12) !important;
    color: #1e2235 !important;
}

/* Opção selecionada + hover */
.select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--highlighted.select2-results__option--selected,
.select2-container--default .select2-results__option--highlighted.select2-results__option--selected {
    background-color: #04afc7 !important;
    color: #fff !important;
}

/* ---------- Content container breathing room ---------- */
.content .container-fluid {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
}

@media (min-width: 992px) {
    .content .container-fluid {
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
}

/* ---------- Page Loader ---------- */
.page-loader .spinner-border {
    color: var(--amee-cyan) !important;
}

/* ---------- Scroll to top ---------- */
.scrolltop {
    border-radius: var(--amee-radius-xs) !important;
    background-color: var(--amee-cyan) !important;
}

/* ---------- Profile Dropdown ---------- */
.profile-dropdown {
    padding: 0.75rem 0 !important;
    border-radius: var(--amee-radius) !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06) !important;
    border: 1px solid var(--amee-border) !important;
}

.profile-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #05c3dd, #48d597);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 195, 221, 0.25);
}

.profile-dropdown .separator {
    border-color: var(--amee-border) !important;
    opacity: 0.6;
}

.profile-dropdown .menu-link {
    margin: 1px 8px !important;
    border-radius: var(--amee-radius-sm) !important;
    transition: all var(--amee-transition) !important;
    color: #3f4254 !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

.profile-dropdown .menu-link:hover {
    background-color: rgba(5, 195, 221, 0.06) !important;
    color: var(--amee-cyan) !important;
}

.profile-dropdown .menu-link:hover .menu-icon i {
    color: var(--amee-cyan) !important;
}

/* ---------- Sidebar Accordion Show State ---------- */
#kt_aside .menu-accordion.show > .menu-link .menu-title {
    color: #049fb5 !important;
    font-weight: 600 !important;
}

#kt_aside .menu-accordion.show > .menu-link .menu-icon i,
#kt_aside .menu-accordion.show > .menu-link .menu-icon .svg-icon {
    color: var(--amee-cyan) !important;
}

#kt_aside .menu-accordion.show > .menu-link .menu-arrow::after {
    color: var(--amee-cyan) !important;
}
