:root {
    --color-primary-green: #146c43;
    --color-dark-green: #0e482d;
    --color-light-mint: #e2f0d9;
    --color-gold-accent: #cba135;
    --color-alert-red: #dc3545;
    --color-bg-main: #ffffff;
    --color-bg-light: #f8f9fa;
    --color-text-dark: #212529;
    --color-text-muted: #6c757d;
    --color-border: #dee2e6;
    --primary: var(--color-primary-green);
    --secondary: var(--color-dark-green);
    --accent: var(--color-gold-accent);
    --light: var(--color-light-mint);
    --white: var(--color-bg-main);
    --text-dark: var(--color-text-dark);
    --gray: var(--color-text-muted);
}

@import url('https://fonts.googleapis.com/css?family=Inter:100,200,300,400,500,600,700,800,900&display=swap');

.card {
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--color-border);
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light) !important;
    background:
        linear-gradient(180deg, var(--light) 0%, var(--color-bg-light) 42%, var(--white) 100%) !important;
    background-attachment: fixed !important;
    background-size: cover !important;
    -webkit-background-size: cover !important;
    min-height: 100vh;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
    overflow-x: hidden;
    color: var(--text-dark);
}

body.login-page {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(21, 128, 61, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(134, 239, 172, 0.24), transparent 28%),
        linear-gradient(135deg, #f9fff9 0%, #eefbf1 48%, #e0f5e6 100%);
    color: #113522;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow-x: hidden;
    animation: fadeIn 0.8s ease both;
}

body.login-page.page-background {
    background:
        radial-gradient(circle at top left, rgba(21, 128, 61, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(134, 239, 172, 0.24), transparent 28%),
        linear-gradient(135deg, #f9fff9 0%, #eefbf1 48%, #e0f5e6 100%) !important;
    background-attachment: fixed !important;
    background-size: cover !important;
}

body.login-page main.container {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 100vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-x: hidden;
}

body.login-page main.container > .alert {
    width: min(1200px, calc(100% - 32px));
    margin: 24px auto 0;
    z-index: 2;
}

.auth-shot-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow-x: hidden;
}

.auth-layout {
    position: relative;
    width: min(100%, 520px);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: clamp(16px, 2.4vw, 24px);
    box-sizing: border-box;
}

.auth-shot-form-panel {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: auto;
    padding: 0;
    background: transparent;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 1px rgba(20, 108, 67, 0.08), 0 10px 24px rgba(20, 108, 67, 0.16), 0 2px 5px rgba(20, 108, 67, 0.12);
    border: 1px solid rgba(20, 108, 67, 0.12);
    padding: clamp(22px, 3vw, 30px);
    box-sizing: border-box;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    line-height: 1.2;
}

.auth-brand-subtitle {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.auth-hero {
    background: transparent;
    padding: 0 0 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    min-height: auto;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-bottom: 12px;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(20, 108, 67, 0.12);
    color: #146c43;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.auth-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.auth-hero p {
    font-size: 14px;
    color: rgba(17, 53, 34, 0.7);
    max-width: 100%;
    margin: 0;
    line-height: 1.65;
}

.auth-body {
    background: transparent;
    margin-top: 0;
    padding: 0;
    border-radius: 0;
}

.auth-body form {
    display: grid;
    gap: 14px;
}

.auth-fields {
    display: grid;
    gap: 12px;
}

.auth-field {
    position: relative;
}

.auth-input-wrap {
    position: relative;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
}

.auth-field input {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(20, 108, 67, 0.16);
    padding: 0 44px 0 42px;
    background: rgba(20, 108, 67, 0.05);
    color: #113522;
    font-size: 14px;
    transition: border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.auth-field input:focus {
    border-color: rgba(20, 108, 67, 0.6);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(20, 108, 67, 0.16);
    outline: none;
}

.auth-field input::placeholder {
    color: var(--gray);
    opacity: 1;
}

.auth-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.48);
    font-size: 15px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    font-size: 15px;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 2px 0 6px;
    flex-wrap: wrap;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
}

.remember-me input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #111111;
}

.auth-btn {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #146c43 0%, #1f874f 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(20, 108, 67, 0.2);
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(20, 108, 67, 0.25);
}

.auth-btn:disabled {
    opacity: 0.8;
    cursor: wait;
    transform: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: rgba(0, 0, 0, 0.42);
    font-size: 11px;
    gap: 0.5rem;
    margin: 18px 0 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
}

.company-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 14px;
    min-height: 40px;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.72);
    text-decoration: none;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #111111;
}

.contact-link i {
    font-size: 14px;
}

.auth-footer-note {
    margin-top: 2px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.42);
}

.auth-message {
    display: none;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
}

.auth-message.active {
    display: block;
}

.auth-message.error {
    background: #FEE2E2;
    color: #B91C1C;
}

.auth-message.info {
    background: #eef6ff;
    color: #0b5cad;
}

@media (max-width: 576px) {
    body.login-page {
        padding: 0;
    }

    .auth-hero {
        padding: 0 0 1.5rem;
        min-height: auto;
    }

    .auth-hero h1 {
        font-size: 28px;
    }

    .auth-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .auth-divider {
        margin: 1rem 0 0.65rem;
    }
}

@media (max-width: 1080px) {
    .auth-layout {
        width: min(100%, 500px);
        padding: 20px;
    }

    .auth-shot-form-panel {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .auth-layout {
        width: 100%;
        padding: 14px;
    }

    .auth-card {
        border-radius: 20px;
        padding: 20px 16px;
    }

    .auth-hero p {
        max-width: 100%;
        font-size: 14px;
    }

    .company-contact {
        flex-direction: column;
        align-items: stretch;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Background overlay gradients removed */

/* Background flicker animation removed */

/* Ensure main content sits above the animated background */
/* keep navigation and footer positioned without trapping modal descendants below backdrops */
nav.navbar, footer {
    position: relative;
    z-index: 1;
}

footer {
    margin-top: auto;
}

/* Navbar must sit above main content so its dropdowns aren't obscured */
nav.navbar {
    z-index: 1100;
}

/* Ensure dropdown menus render above other page elements */
.dropdown-menu {
    position: absolute;
    z-index: 99999 !important;
}
.navbar-brand {
    font-weight: 700;
}
.navbar-brand .company-name {
    font-weight: 700;
    color: #1e9d74; /* green to match --success */
}
.navbar-brand {
    font-weight: 700;
}
.table th, .table td {
    vertical-align: middle;
}
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.footer {
    background: transparent;
}
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
    .navbar-nav .nav-link {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .navbar-brand {
        font-size: 1rem;
    }
    .navbar .btn {
        font-size: 0.85rem;
        padding: 0.35rem 0.75rem;
    }
    .card-body {
        padding: 1rem;
    }
    .table th, .table td {
        white-space: normal;
    }
}
@media (max-width: 576px) {
    main.container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .d-flex.align-items-center {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .d-flex.align-items-center .btn {
        width: 100%;
    }
}

.compact-table th,
.compact-table td {
    padding: 0.45rem 0.55rem;
}

.compact-table tbody tr {
    line-height: 1.2;
}

.issue-toggle {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 700;
}

.issue-toggle::before {
    content: '+';
    font-size: 1rem;
}

.issue-toggle:not(.collapsed)::before {
    content: '−';
}

.issue-details-row .bg-white {
    background-color: #f8f9fa;
}

/* Ethiopian calendar styles removed — using native date inputs */

.company-settings-form {
    max-width: 1180px;
}

.company-settings-form .form-control-sm {
    width: 100%;
    max-width: none;
}

.company-settings-form textarea.form-control-sm {
    min-height: 82px;
    max-width: none;
    resize: vertical;
}

.company-settings-grid .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.company-settings-preview {
    max-width: 180px;
    max-height: 56px;
    object-fit: contain;
}

.company-settings-favicon-preview {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
/* Ensure the flame gradient shows even when body has Bootstrap utility classes */
body.bg-light {
    background: linear-gradient(180deg, var(--light) 0%, var(--color-bg-light) 45%, var(--white) 100%) !important;
    background-attachment: fixed !important;
    background-size: cover !important;
}

/* User greeting styling */
.user-greeting {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
    background: rgba(226, 240, 217, 0.92);
    border: 1px solid rgba(20, 108, 67, 0.14);
    box-shadow: 0 6px 18px rgba(20, 108, 67, 0.08);
}
.user-greeting .user-name {
    margin-left: 0.35rem;
    color: var(--secondary);
    font-weight: 800;
    opacity: 1;
}

@media (max-width: 576px) {
    .user-greeting { font-size: 0.9rem; padding: 0.35rem 0.6rem; }
}

.page-background {
    background-color: var(--light) !important;
    background-image: linear-gradient(180deg, rgba(196, 226, 245, 0.95) 0%, rgba(212, 228, 248, 0.95) 40%, rgba(255, 255, 255, 0.95) 100%) !important;
    background-attachment: fixed !important;
    background-size: cover !important;
}

body.login-page.page-background {
    background-color: #f8faf5 !important;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(20, 108, 67, 0.2), transparent 28%),
        linear-gradient(135deg, #f8faf5 0%, #ffffff 44%, #dcefe5 100%) !important;
}

.site-navbar {
    background: rgba(28, 62, 109, 0.92) !important;
}
.site-navbar .navbar-brand,
.site-navbar .nav-link,
.site-navbar .btn-outline-light {
    color: var(--white) !important;
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus,
.site-navbar .dropdown-menu a.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.brand-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
}
.brand-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
}
.brand-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.02em;
}
.user-summary .avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.35);
}
.user-greeting {
    margin-bottom: 0;
}
.user-name {
    color: var(--secondary);
    font-weight: 800;
    font-size: 0.95rem;
    margin: 0;
}
/* Print media query to override background gradient and ensure white background for printing */
@media print {
    body {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
    }
    body.bg-light,
    body.login-page {
        background: #fff !important;
        background-color: #fff !important;
        background-image: none !important;
    }
    main.container {
        background: #fff !important;
    }
    nav.navbar,
    .topbar,
    .panel,
    footer {
        display: none !important;
    }
}

/* ========== SIDEBAR STYLES ========== */
body.sidebar-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
}

main.container {
    flex: 1;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
    color: #ffffff;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);
    overflow: visible;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: none;
}

.sidebar-header {
    padding: 24px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.8rem;
    transition: none;
}

.sidebar-brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.sidebar-brand .brand-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.sidebar-brand .brand-name {
    display: inline-flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    background: transparent;
    padding: 0;
    letter-spacing: 0.2px;
}

@media (max-width: 768px) {
    .sidebar-brand .brand-name {
        display: none;
    }
    .sidebar {
        width: 72px;
    }
}

/* Collapsed sidebar state */
body.sidebar-collapsed .sidebar {
    width: 72px;
}
body.sidebar-collapsed .main-wrapper {
    margin-left: 72px;
}
body.sidebar-collapsed .sidebar-brand .brand-name,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-submenu-header {
    display: none !important;
}
body.sidebar-collapsed .nav-link { justify-content: center; }
body.sidebar-collapsed .nav-link i { margin-right: 0; }

/* Colorful menu icons */
.nav-link i.fas.fa-chart-line { color: #FFD166; }
.nav-link i.fas.fa-boxes { color: #06D6A0; }
.nav-link i.fas.fa-warehouse { color: #EF476F; }
.nav-link i.fas.fa-truck { color: #FF9F1C; }
.nav-link i.fas.fa-address-book { color: #2EC4B6; }
.nav-link i.fas.fa-robot { color: #264653; }
.nav-link i.fas.fa-door-open { color: #F77F00; }
.nav-link i.fas.fa-id-badge { color: #A7C957; }
.nav-link i.fas.fa-file-chart-line { color: #8338EC; }
.nav-link i.fas.fa-dolly { color: #FFB703; }
.nav-link i.fas.fa-shopping-cart { color: #00B4D8; }
.nav-link i.fas.fa-bell { color: #E63946; }
.nav-link i.fas.fa-user { color: #8AC926; }
.nav-link i.fas.fa-users { color: #F3722C; }
.nav-link i.fas.fa-shield-alt { color: #3A0CA3; }
.nav-link i.fas.fa-cog { color: #4361EE; }
.nav-link i.fas.fa-clipboard-list { color: #2B9348; }
.nav-link i.fas.fa-sign-out-alt { color: #6A4C93; }

/* Adjust icon spacing when labels are visible */
.nav-link i { width: 20px; text-align: center; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 8px;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    position: relative;
}

/* Topbar layout overrides when navigation is rendered in header */
.topbar .sidebar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}
.topbar .sidebar-nav .nav-link {
    color: var(--text-primary, #333);
    background: transparent;
    color: rgba(0,0,0,0.8);
}
.topbar .sidebar-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface, #fff);
    color: inherit;
    min-width: 220px;
    margin-left: 0;
    box-shadow: var(--shadow, 0 6px 18px rgba(0,0,0,0.12));
    border-radius: 6px;
    padding: 8px;
    display: none;
    opacity: 1;
    max-height: none;
}
.topbar .sidebar-submenu.show {
    display: block;
}

/* Position submenu under each parent toggle in topbar */
.topbar .nav-link-parent {
    position: relative;
}
.topbar .nav-link-parent + .sidebar-submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1100;
    min-width: 220px;
    display: none;
}
.topbar .nav-link-parent + .sidebar-submenu.show {
    display: block;
}

/* Keep labels visible by default; collapsed state above will override when needed */
.nav-label { display: inline; }
.sidebar-brand .brand-name { display: inline-flex; }

/* Remove left content offset when using topbar */
.topbar + .main-wrapper {
    margin-left: 0;
}

/* Override responsive sidebar offsets when navigation is rendered in header.topbar */
header.topbar + .main-wrapper,
header.topbar ~ .main-wrapper {
    margin-left: 0 !important;
}

/* On small screens ensure topbar nav displays inline and doesn't collapse to sidebar width */
@media (max-width: 1024px) {
    header.topbar .sidebar-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    body:not(.sidebar-collapsed) .main-wrapper {
        margin-left: 0 !important;
    }
}

/* Prevent horizontal scrollbar caused by topbar nav overflow */
html, body {
    overflow-x: hidden;
}

header.topbar,
header.topbar .sidebar-nav {
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    flex-wrap: wrap;
}

.topbar .sidebar-nav {
    max-width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border-radius: 10px;
    margin: 0 8px;
    transition: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.nav-link:hover {
    background: rgba(226, 240, 217, 0.12);
    color: #ffffff;
    transform: none;
}

.nav-link.active {
    background: rgba(203, 161, 53, 0.18);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--accent);
}

.nav-link .badge-notification {
    display: inline-block;
    padding: 2px 6px;
    background: var(--color-alert-red);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: auto;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 16px;
}

.sidebar-submenu-header {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

.nav-link-parent .nav-toggle-icon {
    margin-left: auto;
    font-size: 0.8rem;
    transition: none;
}

.nav-link-parent .nav-toggle-icon.rotate {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 8px 8px 34px;
    position: static;
    overflow: visible;
    opacity: 1;
}

.sidebar-submenu.show {
    display: flex;
}

@media (min-width: 769px) {
    body.sidebar-collapsed .sidebar-header {
        padding: 20px 12px;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        min-height: 44px;
    }

    body.sidebar-collapsed .nav-link {
        justify-content: center;
        margin: 0 10px;
        padding: 12px 0;
        overflow: visible;
    }

    body.sidebar-collapsed .nav-link:hover {
        transform: none;
    }

    body.sidebar-collapsed .nav-link-parent .nav-toggle-icon {
        display: none;
    }

    body.sidebar-collapsed .nav-link .badge-notification {
        position: absolute;
        top: 4px;
        right: 4px;
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar-submenu {
        position: fixed;
        top: 0;
        left: 82px;
        display: none;
        flex-direction: column;
        min-width: 220px;
        max-width: 260px;
        margin: 0;
        padding: 8px;
        gap: 4px;
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(14, 72, 45, 0.98) 0%, rgba(20, 108, 67, 0.98) 100%);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 18px 36px rgba(9, 30, 66, 0.3);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        transform-origin: left center;
        transition: none;
        will-change: auto;
    }

    body.sidebar-collapsed .sidebar-submenu.show {
        display: flex;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    body.sidebar-collapsed .sidebar-submenu .nav-link {
        justify-content: flex-start;
        margin: 0;
        padding: 10px 12px;
        gap: 0;
    }

    body.sidebar-collapsed .sidebar-submenu .nav-link > .nav-label {
        display: inline !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        white-space: normal;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
}

.sidebar-submenu .nav-link {
    padding: 10px 16px;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
}

.sidebar-submenu .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: none;
}

.sidebar-submenu .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: var(--light);
    box-shadow: none;
}

.main-wrapper {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: none;
}

/* Responsive sidebar for tablets */
@media (max-width: 1024px) {
    body:not(.sidebar-collapsed) .sidebar {
        width: 240px;
    }
    
    body:not(.sidebar-collapsed) .main-wrapper {
        margin-left: 240px;
    }
    
    .nav-label {
        font-size: 0.9rem;
    }
}

/* Responsive sidebar for mobile - don't collapse if already collapsed */
@media (max-width: 768px) {
    body:not(.sidebar-collapsed) .sidebar {
        width: 70px;
    }
    
    body:not(.sidebar-collapsed) .main-wrapper {
        margin-left: 70px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-brand span {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .nav-link {
        justify-content: center;
        margin: 0 4px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .nav-label,
    .sidebar-divider,
    .sidebar-submenu-header {
        display: none;
    }

    .nav-link:hover {
        transform: none;
    }
    
    .nav-link .badge-notification {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    body.sidebar-collapsed .nav-link-parent .nav-toggle-icon {
        display: none;
    }

    body.sidebar-collapsed .sidebar-submenu {
        position: fixed;
        top: 0;
        left: 78px;
        display: none;
        flex-direction: column;
        min-width: min(220px, calc(100vw - 92px));
        max-width: calc(100vw - 88px);
        margin: 0;
        padding: 8px;
        gap: 4px;
        border-radius: 14px;
        background: linear-gradient(180deg, rgba(14, 72, 45, 0.98) 0%, rgba(20, 108, 67, 0.98) 100%);
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 18px 36px rgba(9, 30, 66, 0.3);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        transform-origin: left center;
        transition: none;
    }

    body.sidebar-collapsed .sidebar-submenu.show {
        display: flex;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    body.sidebar-collapsed .sidebar-submenu .nav-link {
        justify-content: flex-start;
        margin: 0;
        padding: 10px 12px;
        gap: 0;
    }

    body.sidebar-collapsed .sidebar-submenu .nav-link > .nav-label {
        display: inline !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        white-space: normal;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== APPLICATION CLEANUP + RESPONSIVE FIXES ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

.container,
.container-fluid {
    min-width: 0;
}

.main-wrapper {
    min-width: 0;
}

main.container {
    width: 100%;
    max-width: 1320px;
}

.card {
    border-radius: 8px;
    overflow: hidden;
}

.card-body,
.modal-body,
.modal-footer,
.modal-header {
    min-width: 0;
}

.display-6 {
    font-size: clamp(1.55rem, 4vw, 2.35rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.table-responsive {
    width: 100%;
    border-radius: 8px;
}

.table-responsive > .table {
    min-width: 720px;
}

.table {
    margin-bottom: 0;
}

.table th,
.table td {
    overflow-wrap: anywhere;
}

.btn,
.form-control,
.form-select,
.input-group-text {
    min-height: 38px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: normal;
}

.mobile-menu-toggle,
.mobile-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    body {
        font-size: 0.92rem;
    }

    .row {
        --bs-gutter-x: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .d-flex.justify-content-between,
    .d-flex.align-items-center,
    .card-header.d-flex {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    body.sidebar-layout {
        display: block;
    }

    body.sidebar-layout .main-wrapper,
    body.sidebar-collapsed .main-wrapper,
    body:not(.sidebar-collapsed) .main-wrapper {
        width: 100%;
        min-height: 100vh;
        margin-left: 0 !important;
        padding-top: 56px;
    }

    .mobile-menu-toggle {
        position: fixed;
        top: 10px;
        left: 12px;
        z-index: 10050;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 8px;
        background: var(--secondary);
        color: #ffffff;
        box-shadow: 0 8px 18px rgba(9, 30, 66, 0.22);
    }

    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10020;
        display: block;
        background: rgba(15, 23, 42, 0.48);
    }

    .mobile-sidebar-backdrop[hidden] {
        display: none;
    }

    .sidebar,
    body.sidebar-collapsed .sidebar,
    body:not(.sidebar-collapsed) .sidebar {
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
        z-index: 10040;
        overflow: hidden;
    }

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

    .sidebar-header {
        min-height: 68px;
        padding: 14px 16px;
        text-align: left;
    }

    .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
        min-height: 40px;
    }

    .sidebar-brand .brand-name,
    body.sidebar-collapsed .sidebar-brand .brand-name {
        display: inline-flex !important;
        font-size: 1rem;
        line-height: 1.2;
    }

    .sidebar-nav {
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px 8px 18px;
    }

    .nav-link,
    body.sidebar-collapsed .nav-link,
    body:not(.sidebar-collapsed) .nav-link {
        justify-content: flex-start;
        min-height: 44px;
        margin: 0;
        padding: 10px 12px;
        gap: 12px;
    }

    .nav-label,
    body.sidebar-collapsed .nav-label {
        display: inline !important;
        font-size: 0.92rem;
    }

    .nav-link-parent .nav-toggle-icon,
    body.sidebar-collapsed .nav-link-parent .nav-toggle-icon {
        display: inline-flex;
        margin-left: auto;
    }

    .sidebar-submenu,
    body.sidebar-collapsed .sidebar-submenu {
        position: static;
        min-width: 0;
        max-width: none;
        margin: 2px 0 8px 32px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.sidebar-collapsed .sidebar-submenu.show {
        display: flex;
    }

    .sidebar-submenu .nav-link,
    body.sidebar-collapsed .sidebar-submenu .nav-link {
        padding: 9px 10px;
    }

    .container {
        max-width: 100%;
    }

    main.container {
        padding: 0.85rem !important;
    }

    .user-greeting {
        margin-left: 58px;
        max-width: calc(100vw - 82px);
        overflow-wrap: anywhere;
    }

    .card {
        box-shadow: none !important;
    }

    .table-responsive {
        margin-inline: -0.35rem;
        width: calc(100% + 0.7rem);
    }

    .table-responsive > .table {
        min-width: 680px;
    }

    .btn,
    .form-control,
    .form-select {
        font-size: 0.92rem;
    }

    .d-flex.justify-content-between > .btn,
    .d-flex.align-items-center > .btn,
    .card-header.d-flex > .btn,
    form .btn {
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }

    .row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
    }

    .card-body {
        padding: 0.85rem;
    }

    .modal-dialog {
        margin: 0;
        min-height: 100%;
    }

    .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }

    .modal-footer {
        align-items: stretch;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .table-responsive > .table {
        min-width: 620px;
        font-size: 0.86rem;
    }

    .company-contact {
        gap: 8px;
    }

    .contact-link {
        width: 100%;
        border-radius: 8px;
    }
}
