/* Ensure Bootstrap Datepicker calendar always floats above cards/modals */
.datepicker { z-index: 9999 !important; }

/* ── Notification bell ──────────────────────────────────────────────────── */
.notification-unread {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}
.notification-item {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f7;
    transition: background 0.15s ease;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background-color: #f8f9fa; }
#notification-dropdown { min-width: 340px; }
#notification-list .text-wrap { word-break: break-word; white-space: normal !important; }

.d-flex-new {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
}

:root {
    --macsat-brand-950: #052e16;
    --macsat-brand-900: #064e3b;
    --macsat-brand-800: #065f46;
    --macsat-brand-700: #047857;
    --macsat-brand-600: #059669;
    --macsat-brand-500: #10b981;
    --macsat-slate-950: #0f172a;
    --macsat-slate-900: #1e293b;
    --macsat-slate-700: #334155;
    --macsat-slate-500: #64748b;
    --macsat-slate-300: #cbd5e1;
    --macsat-slate-200: #e2e8f0;
    --macsat-slate-100: #f1f5f9;
    --macsat-slate-50: #f8fafc;
    --macsat-surface: rgba(255, 255, 255, 0.76);
    --macsat-surface-strong: rgba(255, 255, 255, 0.92);
    --macsat-shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --macsat-shadow-panel: 0 26px 60px rgba(15, 23, 42, 0.1);
    --macsat-radius-xl: 28px;
    --macsat-radius-lg: 22px;
    --macsat-radius-md: 16px;
}

html {
    scroll-behavior: smooth;
}

body[data-layout="horizontal"] {
    min-height: 100vh;
    color: var(--macsat-slate-900);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.15), transparent 26%),
        radial-gradient(circle at bottom right, rgba(6, 78, 59, 0.12), transparent 20%),
        linear-gradient(140deg, #f7faf8 0%, #eef4f1 46%, #f9fbfa 100%);
}

body[data-layout="horizontal"]::before {
    display: none;
}

#layout-wrapper,
.macsat-shell,
.macsat-content-shell,
.main-content,
.page-content {
    position: relative;
    z-index: 1;
}

#layout-wrapper {
    min-height: 100vh;
}

.macsat-shell {
    display: flex;
    gap: 1.25rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.25rem 1rem;
}

.macsat-sidebar-shell {
    width: 300px;
    flex: 0 0 300px;
    align-self: flex-start;
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--macsat-radius-xl);
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.98), rgba(5, 46, 22, 0.98));
    box-shadow: 0 30px 80px rgba(5, 46, 22, 0.26);
}

.macsat-sidebar-brand {
    padding: 1.2rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.macsat-sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
}

.macsat-sidebar-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.macsat-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.macsat-brand-name {
    color: #ecfdf5;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.macsat-brand-subtitle {
    color: rgba(236, 253, 245, 0.65);
    font-size: 0.9rem;
    margin-top: 0.28rem;
}

.macsat-sidebar-body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 1rem;
}

.macsat-sidebar-section-label {
    padding: 0 0.75rem 0.7rem;
    color: rgba(236, 253, 245, 0.45);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.macsat-side-link,
.macsat-side-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: rgba(236, 253, 245, 0.86);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s ease;
    box-shadow: none;
}

.macsat-side-link {
    gap: 0.85rem;
}

.macsat-side-group-toggle {
    justify-content: space-between;
}

.macsat-side-link:hover,
.macsat-side-link.active,
.macsat-side-group-toggle:hover,
.macsat-side-group-toggle.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.macsat-side-link i,
.macsat-side-group-label i {
    font-size: 1.1rem;
}

.macsat-side-group {
    margin-bottom: 0.25rem;
}

.macsat-side-group-label {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.macsat-side-group-toggle .bx-chevron-down {
    transition: transform 0.2s ease;
}

.macsat-side-group-toggle[aria-expanded="true"] .bx-chevron-down {
    transform: rotate(180deg);
}

.macsat-side-submenu {
    padding: 0.35rem 0 0.45rem 1rem;
}

.macsat-side-sublink {
    display: block;
    margin: 0.2rem 0;
    padding: 0.78rem 0.95rem;
    border-radius: 16px;
    color: rgba(236, 253, 245, 0.7);
    font-size: 0.88rem;
    text-decoration: none;
    transition: 0.2s ease;
}

.macsat-side-sublink:hover,
.macsat-side-sublink.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.macsat-content-shell {
    min-width: 0;
    flex: 1 1 auto;
}

#page-topbar {
    background: transparent !important;
    box-shadow: none !important;
}

#page-topbar .navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    height: auto;
}

#page-topbar .navbar-header > .d-flex,
#page-topbar .navbar-header > .d-flex:last-child {
    align-items: center;
    gap: 0.75rem;
}

.app-search .position-relative {
    position: relative;
}

.app-search .form-control {
    width: min(420px, 42vw);
    height: 52px;
    padding: 0.85rem 1rem 0.85rem 3rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 20px;
    background: var(--macsat-surface-strong);
    box-shadow: var(--macsat-shadow-soft);
    color: var(--macsat-slate-900);
}

.app-search .bx-search-alt {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--macsat-brand-700);
    font-size: 1.1rem;
}

#page-topbar .navbar-header > .d-flex:first-child {
    flex: 1 1 auto;
}

#page-topbar .navbar-header > .d-flex:last-child {
    justify-content: flex-end;
}

.header-item {
    height: 50px !important;
    min-width: 50px;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 18px !important;
    background: var(--macsat-surface-strong) !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
    color: var(--macsat-slate-700) !important;
    transition: 0.2s ease;
}

.header-item:hover,
.header-item:focus {
    color: var(--macsat-slate-950) !important;
    transform: translateY(-1px);
}

#page-header-user-dropdown {
    padding: 0.35rem 0.5rem 0.35rem 0.45rem !important;
}

.header-profile-user {
    height: 38px !important;
    width: 38px !important;
    border: 2px solid rgba(16, 185, 129, 0.14);
}

.dropdown-menu {
    border: 1px solid rgba(255, 255, 255, 0.75) !important;
    border-radius: 22px !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14) !important;
    padding: 0.5rem !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: blur(18px);
}

.dropdown-item {
    border-radius: 16px !important;
    padding: 0.8rem 1rem !important;
    font-weight: 500;
    color: var(--macsat-slate-700) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(15, 23, 42, 0.05) !important;
    color: var(--macsat-slate-950) !important;
}

.topnav {
    display: none !important;
}

.page-content {
    padding: 0 !important;
    background: transparent !important;
}

.page-content > .macsat-page-shell {
    min-height: calc(100vh - 180px);
    padding: 1.75rem 1.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--macsat-radius-xl);
    background: var(--macsat-surface);
    box-shadow: var(--macsat-shadow-panel);
    backdrop-filter: blur(18px);
}

.page-title-box h4,
.card-title,
.card-title-desc {
    color: var(--macsat-slate-950);
}

.card,
.modal-content,
.swal2-popup,
.offcanvas,
.toast {
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: var(--macsat-shadow-panel) !important;
    overflow: hidden;
}

.card-header,
.modal-header,
.offcanvas-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.card-footer,
.modal-footer {
    background: transparent !important;
    border-top: 1px solid rgba(226, 232, 240, 0.9) !important;
}

.btn {
    border-radius: 16px !important;
    font-weight: 600 !important;
    padding: 0.65rem 1rem !important;
    box-shadow: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--macsat-brand-700), var(--macsat-brand-600)) !important;
    border-color: var(--macsat-brand-700) !important;
}

.btn-outline-primary {
    color: var(--macsat-brand-700) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: rgba(16, 185, 129, 0.08) !important;
    color: var(--macsat-brand-800) !important;
}

.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 46px;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--macsat-slate-900) !important;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(16, 185, 129, 0.7) !important;
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.12) !important;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(248, 250, 252, 0.8);
    --bs-table-hover-bg: rgba(236, 253, 245, 0.7);
    color: var(--macsat-slate-700);
}

.table > :not(caption) > * > * {
    padding: 1rem 1rem;
    border-bottom-color: rgba(226, 232, 240, 0.9);
}

.table thead th {
    color: var(--macsat-slate-500);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer {
    background: transparent !important;
    color: var(--macsat-slate-500);
    padding: 1.2rem 0 0 !important;
}

.footer .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.footer .row {
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--macsat-shadow-soft);
    padding: 1rem 1.25rem;
}

.footer .col-sm-6 {
    padding: 0;
}

.rightbar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: none;
    background-color: rgba(15, 23, 42, 0.42) !important;
    backdrop-filter: blur(4px);
}

body.macsat-sidebar-open .rightbar-overlay {
    display: block;
}

@media (max-width: 1199.98px) {
    .macsat-shell {
        gap: 1rem;
        padding: 1rem 0.75rem;
    }

    .macsat-sidebar-shell {
        width: 270px;
        flex-basis: 270px;
    }

    .app-search {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .macsat-shell {
        display: block;
        padding: 0.85rem 0.75rem 1rem;
    }

    .macsat-sidebar-shell {
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        z-index: 1040;
        width: min(300px, calc(100vw - 1.5rem));
        max-height: none;
        transform: translateX(calc(-100% - 1rem));
        transition: transform 0.25s ease;
    }

    body.macsat-sidebar-open .macsat-sidebar-shell {
        transform: translateX(0);
    }

    .macsat-content-shell {
        width: 100%;
    }

    #page-topbar .navbar-header {
        margin-bottom: 0.85rem;
    }

    #page-header-user-dropdown .d-xl-inline-block,
    #page-header-user-dropdown .mdi-chevron-down {
        display: none !important;
    }

    .page-content > .macsat-page-shell {
        padding: 1.25rem 1rem 1.5rem;
        border-radius: 22px;
    }
}

@media (min-width: 992px) {
    .rightbar-overlay,
    body.macsat-sidebar-open .rightbar-overlay {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .footer .row {
        border-radius: 20px;
    }

    .footer .row {
        gap: 0.5rem;
    }
}

.macsat-auth-card {
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.macsat-auth-hero {
    padding: 1.5rem 1.6rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 42%, #a855f7 100%);
    color: #fff;
}

.macsat-auth-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.76);
}

.macsat-auth-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.macsat-auth-copy {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.98rem;
    line-height: 1.6;
}

.macsat-auth-hero-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.macsat-auth-hero-mark img {
    max-width: 54px;
}

.macsat-auth-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 22px;
    background: rgba(16, 185, 129, 0.1);
}

body.macsat-auth .form-label {
    font-weight: 700;
    color: var(--macsat-slate-700);
}

body.macsat-auth .form-check-label,
body.macsat-auth .text-muted,
body.macsat-auth .text-sm {
    color: var(--macsat-slate-500) !important;
}

body.macsat-auth .btn-light {
    background: rgba(248, 250, 252, 0.95) !important;
    border-color: rgba(203, 213, 225, 0.95) !important;
    color: var(--macsat-slate-700) !important;
}

@media (max-width: 575.98px) {
    .macsat-auth-hero {
        padding: 1.3rem 1.2rem;
    }

    .macsat-auth-title {
        font-size: 1.6rem;
    }

    .macsat-auth-hero-mark {
        width: 68px;
        height: 68px;
        border-radius: 20px;
    }
}
