/* Shell: light header, slate sidebar, teal accent #0f766e */

.app-body {
    margin: 0;
    background: #f1f5f9;
    color: #334155;
    font-family: "Plus Jakarta Sans", "Inter", "Open Sans", sans-serif;
}

.app-sidebar {
    --bs-offcanvas-width: 260px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #1e293b !important;
    color: #e2e8f0;
    border: 0;
}

.app-brand {
    display: flex;
    flex: 0 0 64px;
    align-items: center;
    height: 64px;
    padding: 0 1.25rem;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 2;
}

.app-brand img {
    height: 36px;
    width: auto;
}

.app-brand-mark {
    display: none;
    height: 32px;
    width: 32px;
}

.app-flyout-label {
    display: none;
}

.app-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem 0.75rem 1.5rem;
}

.app-nav > ul > li {
    margin-bottom: 0.15rem;
}

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
}

.app-nav .nav-link .fa {
    width: 1.15rem;
    text-align: center;
}

.app-nav .nav-caret {
    margin-left: auto;
    font-size: 0.85rem;
    opacity: 0.7;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.app-nav > ul > li > .nav-link.active,
.app-subnav a.active {
    color: #fff;
    background: #0f766e;
}

.app-subnav {
    padding: 0.25rem 0 0.4rem 1.6rem;
}

.app-subnav a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.92rem;
}

.app-subnav a:hover,
.app-subnav a:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.app-main {
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: 64px;
    padding: 0 1.25rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-header-title {
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.app-sidebar-toggle,
.app-user-btn {
    color: #334155;
    border: 0;
    background: transparent;
}

.app-sidebar-toggle:hover,
.app-user-btn:hover,
.app-user-btn:focus {
    color: #0f766e;
    background: #f0fdfa;
}

.app-user {
    margin-left: auto;
}

.app-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.app-content {
    padding: 1.25rem;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem 1.25rem;
    color: #64748b;
    font-size: 0.85rem;
}

.app-footer-copy {
    margin-left: auto;
    text-align: right;
}

.app-footer a {
    color: #0f766e;
    text-decoration: none;
}

.app-footer a:hover,
.app-footer a:focus {
    color: #115e59;
    text-decoration: underline;
}

@media (min-width: 992px) {
    .app-sidebar.offcanvas-lg {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px !important;
        height: 100vh !important;
        transform: none !important;
        visibility: visible !important;
        z-index: 1030;
        transition: width 0.2s ease;
    }

    .app-main {
        margin-left: 260px;
        transition: margin-left 0.2s ease;
    }

    .app-body.sidebar-collapsed .app-sidebar.offcanvas-lg,
    .app-body.sidebar-collapsed .app-nav {
        overflow: visible;
    }

    .app-body.sidebar-collapsed .app-sidebar.offcanvas-lg {
        width: 72px !important;
    }

    .app-body.sidebar-collapsed .app-main {
        margin-left: 72px;
    }

    .app-body.sidebar-collapsed .app-brand {
        justify-content: center;
        padding: 0;
    }

    .app-body.sidebar-collapsed .app-brand-full {
        display: none;
    }

    .app-body.sidebar-collapsed .app-brand-mark {
        display: block;
    }

    .app-body.sidebar-collapsed .app-nav {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }

    .app-body.sidebar-collapsed .app-nav > ul > li {
        position: relative;
    }

    .app-body.sidebar-collapsed .app-nav > ul > li > .nav-link {
        justify-content: center;
        gap: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .app-body.sidebar-collapsed .app-nav > ul > li > .nav-link span,
    .app-body.sidebar-collapsed .app-nav .nav-caret {
        display: none;
    }

    .app-body.sidebar-collapsed .app-nav > ul > li:has(.active) > .nav-link {
        color: #fff;
        background: #0f766e;
    }

    .app-body.sidebar-collapsed .app-nav .collapse {
        display: none;
    }

    .app-body.sidebar-collapsed .app-nav > ul > li:hover > .collapse,
    .app-body.sidebar-collapsed .app-nav > ul > li:focus-within > .collapse {
        display: block;
        position: absolute;
        left: 100%;
        top: 0;
        width: 220px;
        height: auto !important;
        padding: 0.35rem;
        background: #1e293b;
        border-radius: 0 8px 8px 0;
        box-shadow: 8px 8px 24px rgba(15, 23, 42, 0.28);
        z-index: 1040;
    }

    .app-body.sidebar-collapsed .app-flyout-label {
        display: block;
        padding: 0.35rem 0.75rem 0.15rem;
        color: #fff;
        font-weight: 600;
        font-size: 0.85rem;
    }

    .app-body.sidebar-collapsed .app-nav > ul > li:hover > .collapse .app-subnav,
    .app-body.sidebar-collapsed .app-nav > ul > li:focus-within > .collapse .app-subnav {
        margin: 0;
        padding: 0.15rem 0 0.15rem;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
    }
}

@media (min-width: 992px) and (prefers-reduced-motion: reduce) {
    .app-sidebar.offcanvas-lg,
    .app-main {
        transition: none;
    }
}

/* Bootstrap 4 class names still emitted by forms, tables, and helpers */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.float-xs-left { float: left !important; }
.float-xs-right { float: right !important; }
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.text-xs-center { text-align: center !important; }
.text-xs-left { text-align: left !important; }
.text-xs-right { text-align: right !important; }

.mb-1 { margin-bottom: 1rem !important; }
.m-1 { margin: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.m-0 { margin: 0 !important; }

.btn-block {
    display: block;
    width: 100%;
}

.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.form-inline .form-control,
.form-inline select.form-control {
    width: auto;
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 240px;
}

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

.help-block {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #64748b;
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.input-group > .form-control {
    width: 1%;
}

.tag {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.tag-success { background: #16a34a; color: #fff; }
.tag-danger { background: #dc2626; color: #fff; }
.tag-warning { background: #d97706; color: #fff; }
.tag-info { background: #0f766e; color: #fff; }

.btn-outline-primary {
    color: #0f766e;
    border-color: #0f766e;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff;
    background: #0f766e;
    border-color: #0f766e;
}

.box {
    margin-bottom: 1rem;
}

.table-responsive {
    margin-top: 0.5rem;
}

select.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    background-color: #fff;
}

.alert-dismissible .close {
    float: right;
    background: transparent;
    border: 0;
    font-size: 1.25rem;
    line-height: 1;
}

#nprogress .bar {
    background: #0f766e;
    height: 3px;
}

#nprogress .peg {
    box-shadow: 0 0 10px #0f766e, 0 0 5px #0f766e;
}

#nprogress .spinner {
    display: none;
}

#ajaxDiv.is-updating {
    pointer-events: none;
}

.app-content.is-loading #ajaxDiv {
    opacity: 0.45;
}

.ajax-status {
    position: fixed;
    z-index: 1035;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.95rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    color: #0f766e;
    font-weight: 600;
    font-size: 0.875rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ajax-status-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #ccfbf1;
    border-top-color: #0f766e;
    border-radius: 50%;
    animation: ajax-status-spin 0.7s linear infinite;
}

@keyframes ajax-status-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ajax-status-spinner {
        animation: none;
        border-color: #0f766e;
    }
}
