/* =============================================================
   Dvelopin Cloud — Custom Styles
   Built on Bootstrap 5.3.8 (no SB Admin)
   ============================================================= */

/* -------------------------------------------------------------
   1. CSS Custom Properties
   ------------------------------------------------------------- */
:root {
    --bs-primary: #086686;
    --bs-primary-rgb: 8, 102, 134;
    --dv-navy: #0c2635;
    --dv-teal: #367c94;
    --dv-dark-accent: #18303e;
    --dv-sidebar-width: 60px;
    --dv-navbar-height: 56px;
    --dv-page-bg: #f2f6fc;
}

/* -------------------------------------------------------------
   2. Global
   ------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--dv-page-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.925rem;
    font-weight: 400;
    line-height: 1.5;
    color: #3e4756;
    overflow-x: hidden;
}

a { color: var(--bs-primary); }
a:hover { color: #064d66; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: #1a2332;
}

/* -------------------------------------------------------------
   3. Top Navbar
   ------------------------------------------------------------- */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    height: var(--dv-navbar-height);
    background-color: var(--dv-navy);
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.top-navbar .navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.top-navbar .navbar-brand img {
    height: 26px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* Hamburger — mobile only */
.hamburger-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.75rem;
    cursor: pointer;
}

/* Navbar right section (avatar dropdown) */
.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* Avatar toggle button */
.avatar-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

/* Avatar circle */
.avatar-circle-small {
    width: 36px;
    height: 36px;
    background-color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--dv-navy);
    line-height: 1;
    flex-shrink: 0;
}

/* Remove dropdown caret */
.top-navbar .dropdown-toggle::after {
    display: none;
}

/* User dropdown */
.top-navbar .dropdown-menu {
    min-width: 220px;
    border: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    padding: 0;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

/* User dropdown header */
.dropdown-header-user {
    background-color: var(--dv-teal);
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.dropdown-header-user strong {
    display: block;
    font-weight: 600;
}

.dropdown-header-user span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.top-navbar .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.top-navbar .dropdown-item:hover {
    background-color: #f0f4f8;
}

/* -------------------------------------------------------------
   4. Sidebar (desktop ≥992px only)
   ------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: var(--dv-navbar-height);
    left: 0;
    bottom: 0;
    width: var(--dv-sidebar-width);
    background-color: var(--dv-teal);
    z-index: 1020;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Nav icons wrapper — enables drill-down sliding */
.sidebar-nav-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Each nav level (for drill-down animation) */
.sidebar-nav-level {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: transform 0.2s ease;
}

.sidebar-nav-level.active {
    transform: translateX(0);
}

.sidebar-nav-level.slide-out-left {
    transform: translateX(-100%);
}

.sidebar-nav-level.slide-in-right {
    transform: translateX(100%);
}

/* Individual sidebar nav items (links and buttons) */
.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: color 0.15s, background-color 0.15s;
    font-size: 1.1rem;
}

.sidebar-nav-item:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.sidebar-nav-item.active {
    color: #fff;
    background-color: rgba(255,255,255,0.15);
}

/* Active left bar indicator */
.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #fff;
    border-radius: 0 2px 2px 0;
}

.sidebar-nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Back arrow in drill-down */
.sidebar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    color: rgba(255,255,255,0.6);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.sidebar-back:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
}

/* Divider between sections */
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 0.25rem 0;
}

/* Gear icon pinned to bottom — height matches footer */
.sidebar-bottom {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.sidebar-bottom .sidebar-nav-item {
    height: 40px;
}

/* Hide sidebar on mobile */
@media (max-width: 991.98px) {
    .sidebar {
        display: none;
    }
}

/* -------------------------------------------------------------
   5. Content Wrapper
   ------------------------------------------------------------- */
.content-wrapper {
    margin-top: var(--dv-navbar-height);
    min-height: calc(100vh - var(--dv-navbar-height));
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .content-wrapper {
        margin-left: var(--dv-sidebar-width);
    }
}

.content-wrapper main {
    flex: 1;
}

/* -------------------------------------------------------------
   6. Page Header Bar
   ------------------------------------------------------------- */
.page-header-bar {
    background-color: #fff;
    border-bottom: 1px solid #e0e5ec;
    padding: 0.875rem 1.5rem;
}

.page-header-bar h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--dv-navy);
}

/* -------------------------------------------------------------
   7. Footer
   ------------------------------------------------------------- */
.site-footer {
    background-color: var(--dv-navy);
    color: rgba(255,255,255,0.5);
    padding: 0.8rem 1rem;
    font-size: 0.8rem;
    margin-top: auto;
}

/* -------------------------------------------------------------
   8. Offcanvas — Mobile Menu
   ------------------------------------------------------------- */
.offcanvas.mobile-nav {
    width: 280px;
    background-color: var(--dv-teal);
    color: #fff;
    border-right: none;
}

.offcanvas.mobile-nav .offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 1rem;
}

.offcanvas.mobile-nav .offcanvas-body {
    padding: 0.5rem 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

.mobile-nav-item.active {
    color: #fff;
    background-color: rgba(255,255,255,0.2);
}

.mobile-nav-item i {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.mobile-nav-heading {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
}

/* -------------------------------------------------------------
   9. Auth Pages (preserved from previous work)
   ------------------------------------------------------------- */
body.auth-page {
    background: linear-gradient(135deg, #0c2635 0%, #086686 50%, #367c94 100%);
    min-height: 100vh;
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand-logo {
    display: block;
    margin: 0 auto;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.auth-brand-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

body.auth-page .card {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
}

body.auth-page .card-header {
    background-color: #fff;
    border-bottom: 2px solid #086686;
}

body.auth-page .card-header h3 {
    color: #0c2635;
    font-size: 1.35rem;
    margin: 0;
}

body.auth-page .card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

#layoutAuthentication {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#layoutAuthentication_content {
    flex: 1;
}

body.auth-page #layoutAuthentication_footer footer {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.5);
}

body.auth-page #layoutAuthentication_footer .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* -------------------------------------------------------------
   10. Component Overrides
   ------------------------------------------------------------- */

/* Buttons */
.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #065a76;
    --bs-btn-hover-border-color: #065a76;
    --bs-btn-active-bg: #054a63;
    --bs-btn-active-border-color: #054a63;
    --bs-btn-focus-shadow-rgb: 8, 102, 134;
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: #065a76;
    --bs-btn-active-border-color: #065a76;
}

/* Cards */
.card {
    border: 1px solid #e0e5ec;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #edf0f5;
    font-weight: 600;
}

/* Dashboard cards */
.dash-card {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: inherit;
}

.dash-card .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Dropdown active */
.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--bs-primary);
}

/* Form focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--dv-teal);
    box-shadow: 0 0 0 0.2rem rgba(54, 124, 148, 0.2);
}

/* Focus outlines */
*:focus {
    outline: none !important;
}

button:active,
button:focus,
.btn:focus,
.btn:active {
    box-shadow: none !important;
    outline: 0 none !important;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.page-link { color: var(--bs-primary); }
.page-link:hover { color: #064d66; }

/* Nav tabs */
.nav-tabs .nav-link {
    color: #6c757d;
    font-size: 0.9rem;
}
.nav-tabs .nav-link:hover {
    color: var(--bs-primary);
}
.nav-tabs .nav-link.active {
    color: var(--bs-primary);
    font-weight: 600;
}

/* Tables */
.table > thead {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

/* Tooltips */
.tooltip {
    font-size: 0.8rem;
}

.tooltip .tooltip-inner {
    background-color: var(--dv-navy);
    padding: 0.35rem 0.65rem;
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^='right'] .tooltip-arrow::before {
    border-right-color: var(--dv-navy);
}

/* Alerts */
.alert {
    font-size: 0.88rem;
    border-radius: 0.375rem;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--bs-primary) !important;
}

/* Dropdowns general */
.dropdown-menu {
    font-size: 0.88rem;
    border: 0;
    box-shadow: 0 0.25rem 1rem rgba(0,0,0,.12);
    border-radius: 0.375rem;
}

/* Form check */
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
