:root {
    --htp-sidebar-width: 250px;
    --htp-brand-color: #0d6efd;
}

body {
    background-color: #f4f6f9;
}

/* ===== Login page ===== */
.login-body {
    background: linear-gradient(135deg, #f6a521 0%, #e8722c 35%, #c1440e 70%, #7a2e12 100%);
    background-size: 300% 300%;
    animation: htpGradientShift 16s ease infinite;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

@keyframes htpGradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-wrapper {
    min-height: 100vh;
    padding: 15px;
    position: relative;
    z-index: 2;
}

.login-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.login-decor-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.16);
    animation: htpFloat 9s ease-in-out infinite;
}

.decor-1 { font-size: 5.5rem; top: 8%;  left: 8%;  animation-delay: 0s; }
.decor-2 { font-size: 3rem;   top: 18%; right: 12%; animation-delay: 1.2s; }
.decor-3 { font-size: 4rem;   bottom: 14%; left: 14%; animation-delay: 2.4s; }
.decor-4 { font-size: 3.5rem; bottom: 10%; right: 10%; animation-delay: 3.6s; }
.decor-5 { font-size: 2.5rem; top: 45%; left: 4%;  animation-delay: 0.8s; }
.decor-6 { font-size: 2.75rem; top: 60%; right: 6%; animation-delay: 2s; }

@keyframes htpFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-22px) rotate(6deg); }
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    animation: htpCardIn .6s ease-out;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25) !important;
}

@keyframes htpCardIn {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card-top {
    background: linear-gradient(135deg, #0d6efd 0%, #084298 100%);
    height: 64px;
    position: relative;
}

.login-icon-ring {
    position: absolute;
    left: 50%;
    bottom: -34px;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: htpIconPulse 3s ease-in-out infinite;
}

@keyframes htpIconPulse {
    0%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(13, 110, 253, .35); }
    50% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(13, 110, 253, 0); }
}

.login-icon {
    font-size: 2rem;
    color: var(--htp-brand-color);
}

.login-title {
    font-weight: 700;
    letter-spacing: .3px;
}

.login-subtitle i {
    color: #e8722c;
}

.login-input-group .input-group-text {
    background-color: #f8f9fa;
    color: #7a2e12;
}

.login-input-group .form-control:focus {
    box-shadow: none;
    border-color: #f0ad4e;
}

.login-input-group:focus-within .input-group-text {
    border-color: #f0ad4e;
    background-color: #fff6e9;
}

.login-toggle-pw {
    border-color: #ced4da;
}

.login-btn {
    background: linear-gradient(135deg, #0d6efd 0%, #084298 100%);
    border: none;
    padding: .6rem 1rem;
    font-weight: 600;
    letter-spacing: .3px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(13, 110, 253, .35);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-card-footer {
    background-color: #fbf3e8;
    color: #a15b1f;
    padding: .5rem;
    border-top: 1px solid #f0e2cc;
}

/* ===== App layout ===== */
.htp-wrapper {
    display: flex;
    min-height: 100vh;
}

.htp-sidebar {
    width: var(--htp-sidebar-width);
    background: linear-gradient(180deg, #1a2432 0%, #131b26 100%) !important;
    color: #aab4c2;
    min-height: 100vh;
    flex-shrink: 0;
    transition: margin-left .25s ease-in-out;
}

/* Bootstrap's .offcanvas-lg utility resets background/border/shadow to nothing
   above the lg breakpoint (by design, for the "responsive offcanvas becomes a
   normal static block" pattern) - restore our own chrome there too. */
@media (min-width: 992px) {
    .htp-sidebar {
        border-right: 1px solid rgba(255, 255, 255, .06);
        box-shadow: 2px 0 12px rgba(0, 0, 0, .12) !important;
    }
}

.htp-sidebar .offcanvas-body {
    min-height: 0;
}

/* Slim, unobtrusive scrollbar for the nav column when it overflows */
.htp-sidebar .offcanvas-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
    overflow-y: auto;
}

.htp-sidebar .offcanvas-body::-webkit-scrollbar {
    width: 6px;
}

.htp-sidebar .offcanvas-body::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, .18);
    border-radius: 3px;
}

.htp-sidebar .offcanvas-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, .3);
}

/* ===== Brand header ===== */
.htp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.1rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    flex-shrink: 0;
}

.htp-brand-mobile {
    background: linear-gradient(180deg, #1a2432 0%, #131b26 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    padding: .6rem .85rem;
}

.htp-brand-mobile .htp-brand {
    padding: 0;
    border-bottom: none;
}

.htp-brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d6efd 0%, #084298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, .35);
}

.htp-brand-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .2px;
    color: #fff;
    line-height: 1.2;
}

.htp-brand-subtitle {
    font-size: .7rem;
    color: #7c8aa0;
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* ===== Section label ===== */
.htp-nav-section-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #5c6b80;
    padding: 1rem 1.15rem .4rem;
}

/* ===== Sidebar links (top-level: Dashboard, Masters) ===== */
.htp-sidebar .htp-nav {
    padding: .5rem .6rem .75rem;
}

.htp-sidebar .nav-link {
    display: flex;
    align-items: center;
    color: #aab4c2;
    font-size: .89rem;
    padding: .55rem .75rem;
    border-radius: 8px;
    margin: 1px 2px;
    border-left: 3px solid transparent;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.htp-sidebar .nav-link i {
    width: 20px;
    margin-right: 8px;
    display: inline-block;
    text-align: center;
    font-size: .95rem;
    color: #7c8aa0;
    transition: color .15s ease;
}

.htp-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
}

.htp-sidebar .nav-link:hover i {
    color: #cfd8e3;
}

.htp-sidebar .nav-link.active {
    background-color: rgba(13, 110, 253, .16);
    border-left-color: #4d94ff;
    color: #fff;
    font-weight: 600;
}

.htp-sidebar .nav-link.active i {
    color: #4d94ff;
}

/* ===== Sidebar parent/child groups ===== */
.htp-nav-group {
    margin: 1px 0;
}

.htp-nav-parent {
    display: flex;
    align-items: center;
    width: calc(100% - 4px);
    background: none;
    border: none;
    color: #aab4c2;
    font-size: .89rem;
    padding: .55rem .75rem;
    margin: 1px 2px;
    border-radius: 8px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.htp-nav-parent i:first-child {
    width: 20px;
    margin-right: 8px;
    display: inline-block;
    text-align: center;
    font-size: .95rem;
    color: #7c8aa0;
    transition: color .15s ease;
}

.htp-nav-parent:hover {
    background-color: rgba(255, 255, 255, .06);
    color: #fff;
}

.htp-nav-parent:hover i:first-child {
    color: #cfd8e3;
}

.htp-nav-parent:focus-visible {
    outline: 2px solid rgba(13, 110, 253, .5);
    outline-offset: -2px;
}

.htp-nav-parent-label {
    flex-grow: 1;
    margin-left: 2px;
}

.htp-nav-chevron {
    font-size: .68rem;
    color: #5c6b80;
    transition: transform .2s ease, color .2s ease;
}

.htp-nav-parent[aria-expanded="true"] .htp-nav-chevron {
    transform: rotate(180deg);
    color: #7c8aa0;
}

.htp-nav-parent.htp-nav-parent-has-active {
    color: #fff;
    background-color: rgba(255, 255, 255, .04);
}

.htp-nav-parent.htp-nav-parent-has-active i:first-child {
    color: #4d94ff;
}

.htp-nav-children {
    position: relative;
    padding-left: 16px;
    margin: 2px 2px 4px 30px;
}

.htp-nav-children::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: rgba(255, 255, 255, .08);
}

.htp-nav-children .nav-link {
    font-size: .84rem;
    padding: .45rem .65rem;
    margin: 1px 0;
    border-left: none;
    border-radius: 6px;
}

.htp-nav-children .nav-link i {
    width: 16px;
    font-size: .85rem;
    margin-right: 7px;
}

.htp-nav-children .nav-link.active {
    background-color: rgba(13, 110, 253, .16);
    box-shadow: inset 3px 0 0 #4d94ff;
}

.htp-content {
    flex-grow: 1;
    min-width: 0;
}

.htp-topbar {
    background-color: #fff;
    border-bottom: 1px solid #e3e6ea;
    padding: .6rem 1rem;
}

.htp-main {
    padding: 1.25rem;
}

@media (max-width: 991.98px) {
    .htp-sidebar-desktop {
        display: none;
    }
}

@media (min-width: 992px) {
    .htp-sidebar-toggle-mobile {
        display: none;
    }
}

.htp-page-card {
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e3e6ea;
}

/* ===== Page header banner (used on Masters and other config-heavy pages) ===== */
.htp-page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(120deg, #0d6efd 0%, #084298 100%);
    color: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.htp-page-header-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ===== Icon tabs (Masters and similar multi-tab pages) ===== */
.htp-icon-tabs .nav-link {
    color: #495057;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: .65rem 1rem;
    transition: color .15s ease, border-color .15s ease;
}

.htp-icon-tabs .nav-link i {
    margin-right: 4px;
    color: #adb5bd;
    transition: color .15s ease;
}

.htp-icon-tabs .nav-link:hover {
    color: var(--htp-brand-color);
    border-color: #cfe2ff;
}

.htp-icon-tabs .nav-link.active {
    color: var(--htp-brand-color);
    font-weight: 600;
    border-color: var(--htp-brand-color);
    background: transparent;
}

.htp-icon-tabs .nav-link.active i {
    color: var(--htp-brand-color);
}

table.dataTable td.text-end,
table.dataTable th.text-end {
    text-align: right;
}

.select2-container .select2-selection--single {
    height: calc(1.5em + .75rem + 2px) !important;
    padding: .375rem .1rem;
}

.htp-dropdown-add {
    display: flex;
    gap: 6px;
    align-items: center;
}

.htp-dropdown-add .select2-container {
    flex-grow: 1;
}
