/* RDCC admin shell: light neutral layout with green accents */
:root {
    --rdcc-green: #1f7a3f;
    --rdcc-green-deep: #14532d;
    --rdcc-green-soft: rgba(31, 122, 63, 0.14);
    --rdcc-grey-50: #fafafa;
    --rdcc-grey-100: #f3f4f6;
    --rdcc-grey-200: #e5e7eb;
    --rdcc-grey-300: #d1d5db;
    --rdcc-grey-500: #6b7280;
    --rdcc-black: #111827;
}

html,
body {
    color: var(--rdcc-black);
    background: #ffffff;
}

body {
    background:
        radial-gradient(circle at top right, rgba(31, 122, 63, 0.06), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

a {
    color: var(--rdcc-green);
}

a:hover,
a:focus {
    color: var(--rdcc-green-deep);
}

.btn-primary,
.btn-success,
.btn-info {
    background: linear-gradient(180deg, var(--rdcc-green) 0%, var(--rdcc-green-deep) 100%) !important;
    border-color: var(--rdcc-green-deep) !important;
    color: #fff !important;
    margin-bottom: 20px;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus,
.btn-info:hover,
.btn-info:focus {
    filter: brightness(1.04);
}

.admin #header,
.navbar,
.navbar-default,
.sidebar,
.sidebar-left,
.header,
.topbar,
.main-header,
.navbar-inverse {
    background: #ffffff !important;
    color: var(--rdcc-black) !important;
}

.admin #header {
    border-bottom: 1px solid var(--rdcc-grey-200);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.hide-menu {
    width: 40px;
    height: 40px;
    margin: 12px 0 0 8px;
    border-radius: 10px;
    background: transparent;
    color: var(--rdcc-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hide-menu:hover,
.hide-menu:focus {
    background: var(--rdcc-green-soft);
    color: var(--rdcc-green-deep);
    transform: translateY(-1px);
}

.hide-menu i {
    font-size: 16px;
    line-height: 1;
}

#top_search,
.top-search {
    align-items: center;
}

#top_search input,
#search_input {
    border-radius: 999px !important;
    background: #ffffff !important;
    border: 1px solid var(--rdcc-grey-200) !important;
    color: var(--rdcc-black) !important;
    box-shadow: none !important;
}

#top_search input::placeholder,
#search_input::placeholder {
    color: var(--rdcc-grey-500) !important;
}

.navbar-nav > li > a,
.mobile-icon-menu > li > a,
.mobile-menu-toggle {
    color: var(--rdcc-black) !important;
}

#menu,
.sidebar {
    background: linear-gradient(180deg, var(--rdcc-green) 0%, var(--rdcc-green-deep) 100%) !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.12);
}

#menu.sidebar,
#menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 110 !important;
}

#menu #logo,
#menu li.tw-mt-\[63px\],
#menu li.sm\:tw-mt-0 {
    background: linear-gradient(180deg, var(--rdcc-green-deep) 0%, var(--rdcc-green) 100%) !important;
}

#menu #logo {
    height: 144px !important;
    padding: 14px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#menu #logo .sidebar-logo {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#menu #logo .sidebar-logo-collapsed {
    display: none !important;
}

#menu #logo a.logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 4px !important;
    border-radius: 22px !important;
    background: #fff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden !important;
}

#menu #logo a.logo img {
    width: 100% !important;
    max-width: 220px !important;
    height: auto !important;
    max-height: 120px !important;
    object-fit: contain !important;
}

#menu .menu-item > a,
#menu .menu-item a,
#menu .menu-text,
#menu .sub-menu-text,
#menu .menu-icon,
#menu .fa.arrow,
#menu .badge,
#menu .nav > li > a,
#menu .nav-second-level > li > a {
    color: #ffffff !important;
}

#menu .menu-item > a,
#menu .nav > li > a,
#menu .nav-second-level > li > a,
#menu .menu-text,
#menu .sub-menu-text {
    font-weight: 700 !important;
}

#menu .nav > li > a,
#menu .nav-second-level > li > a {
    border-radius: 14px !important;
}

#menu .nav > li > a:hover,
#menu .nav > li.active > a,
#menu .nav > li > a:focus,
#menu .nav > li.active > a:focus,
#menu .nav-second-level > li > a:hover,
#menu .nav-second-level > li.active > a,
#menu .nav-second-level > li > a:focus,
#menu .nav-second-level > li.active > a:focus {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
}

#menu .nav > li.active > a,
#menu .nav-second-level > li.active > a,
.sidebar #side-menu > li.active > a,
.sidebar #side-menu .submenu .nav-second-level > li.active > a {
    border-left: 3px solid var(--rdcc-green) !important;
}

.sidebar #side-menu > li.active > a {
    background: rgba(255, 255, 255, 0.16) !important;
}

.sidebar #side-menu .submenu .nav-second-level > li.active > a {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14) !important;
}

.sidebar #side-menu .submenu .nav-second-level > li.active > a::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ffffff;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 0 4px rgba(31, 122, 63, 0.12);
}

#menu .submenu,
#menu .nav-second-level {
    background: rgba(255, 255, 255, 0.06) !important;
}

.sidebar .submenu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.sidebar .submenu.open,
.sidebar li.active > .submenu,
.sidebar li.mm-active > .submenu,
.sidebar li.active > ul.nav-second-level,
.sidebar li.mm-active > ul.nav-second-level,
.sidebar .nav-second-level.collapse.in,
.sidebar .nav-second-level.collapse.show {
    max-height: 400px;
    opacity: 1;
}

.sidebar .submenu > .nav-second-level {
    display: block;
}

.sidebar .fa.arrow:before {
    content: "\f107" !important;
    display: inline-block;
    transition: transform 0.28s ease;
}

.sidebar li.open > a > .fa.arrow:before {
    transform: rotate(180deg);
}

#menu .nav-second-level > li > a:hover,
#menu .nav-second-level > li > a:active,
#menu .nav-second-level > li > a:focus-visible {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    outline: none !important;
    box-shadow: none !important;
}

#menu .nav-second-level > li > a:hover .sub-menu-text,
#menu .nav-second-level > li > a:hover .menu-icon,
#menu .nav-second-level > li > a:active .sub-menu-text,
#menu .nav-second-level > li > a:active .menu-icon,
#menu .nav-second-level > li > a:focus-visible .sub-menu-text,
#menu .nav-second-level > li > a:focus-visible .menu-icon {
    background: transparent !important;
    color: #ffffff !important;
}

.sidebar-backdrop {
    display: none;
}

.tw-bg-white,
.panel,
.panel-body,
.panel_s {
    margin-top: 30px;
    background-color: rgb(255 255 255 / var(--tw-bg-opacity));
    border-radius: .375rem;
}

.tw-bg-white,
.panel,
.modal-content,
.card {
    border-color: var(--rdcc-grey-200);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
    border-radius: 16px;
}

.panel-heading,
.modal-header,
.table thead th {
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    color: var(--rdcc-black);
    border-color: var(--rdcc-grey-200);
}

.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
    border-color: #d1d5db;
}

.table > tbody > tr.expense-row-material > td {
    background-color: rgba(34, 197, 94, 0.08) !important;
}

.table > tbody > tr.expense-row-service > td {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

.table > tbody > tr.expense-row-labor > td {
    background-color: rgba(245, 158, 11, 0.09) !important;
}

.table > tbody > tr.expense-row-default > td {
    background-color: rgba(255, 255, 255, 0.92) !important;
}

.dashboard .panel,
.dashboard .card,
.dashboard .widget,
.dashboard .tw-bg-white {
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.sidebar-logo-expanded,
.sidebar-logo-collapsed {
    width: 100%;
    justify-content: center;
}

.dashboard .panel-heading {
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    border-bottom: 1px solid var(--rdcc-grey-200);
}

.dashboard .widget-title,
.dashboard h1,
.dashboard h2,
.dashboard h3 {
    color: var(--rdcc-black);
}

body.login_admin {
    background: #fff !important;
}

.login_admin .authentication-form-wrapper {
    max-width: 28rem;
}

.login_admin .tw-pt-24 {
    padding-top: 2rem !important;
}

body.login_admin .logo {
    background-color: #fff !important;
    color: #fff !important;
    font-size: 22pt !important;
    font-weight: 700 !important;
    padding: 20px !important;
    display: flex;
    justify-content: center;
    width: min(420px, 100%) !important;
}

body.login_admin .logo img {
    max-width: 100% !important;
    max-height: 250px !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    object-fit: contain !important;
}

.login_admin .company-logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login_admin .tw-bg-white,
.login_admin .auth-login-card {
    border: 1px solid var(--rdcc-grey-200);
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
    border-radius: 20px;
    background: #ffffff;
}

.login_admin .tw-text-neutral-900 {
    color: #111827 !important;
}

body.login_admin .tw-text-sm {
    font-size: 1.1rem !important;
}

.login_admin .form-control {
    border-color: var(--rdcc-grey-200);
    color: var(--rdcc-black);
    background: #fff;
}

.login_admin .form-control:focus {
    border-color: var(--rdcc-green);
    box-shadow: 0 0 0 0.2rem rgba(31, 122, 63, 0.14);
}

.login_admin .btn-block {
    background: linear-gradient(180deg, var(--rdcc-green) 0%, var(--rdcc-green-deep) 100%) !important;
    border-color: var(--rdcc-green-deep) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login_admin .btn-block:hover,
.login_admin .btn-block:focus {
    filter: brightness(1.04);
}

@media (min-width: 1025px) {
    body #menu,
    body.hide-sidebar #menu,
    body.page-small #menu {
        width: 260px !important;
        margin-left: 0 !important;
    }

    body #wrapper,
    body #header,
    body.hide-sidebar #wrapper,
    body.hide-sidebar #header,
    body.page-small #wrapper,
    body.page-small #header {
        margin-left: 260px !important;
    }

    .hide-menu {
        display: none !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    body #menu,
    body.hide-sidebar #menu,
    body.page-small #menu {
        width: 60px !important;
        margin-left: 0 !important;
        overflow-x: hidden;
        transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body #wrapper,
    body #header,
    body.hide-sidebar #wrapper,
    body.hide-sidebar #header,
    body.page-small #wrapper,
    body.page-small #header {
        margin-left: 60px !important;
        transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body:not(.sidebar-open) #menu .menu-text,
    body:not(.sidebar-open) #menu .sub-menu-text,
    body:not(.sidebar-open) #menu .arrow,
    body:not(.sidebar-open) #menu .badge {
        opacity: 0 !important;
        width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        display: inline-block !important;
        transition: opacity 0.2s ease, width 0.2s ease;
    }

    body:not(.sidebar-open) #menu .nav-second-level,
    body:not(.sidebar-open) #menu .submenu,
    body:not(.sidebar-open) #menu .submenu.open {
        max-height: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body:not(.sidebar-open) #side-menu > li > a {
        position: relative;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-height: 40px;
        text-align: center;
    }

    body:not(.sidebar-open) #menu li a i.menu-icon {
        float: none !important;
        margin: 0 !important;
        width: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body:not(.sidebar-open) #side-menu > li > a[data-label]::after {
        content: attr(data-label);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%) translateX(6px);
        background: rgba(17, 24, 39, 0.95);
        color: #fff;
        font-size: 12px;
        line-height: 1.2;
        white-space: nowrap;
        padding: 6px 10px;
        border-radius: 6px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 1300;
        transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    }

    body:not(.sidebar-open) #side-menu > li > a[data-label]:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }

    body.sidebar-open #menu {
        width: 260px !important;
    }

    body.sidebar-open #wrapper,
    body.sidebar-open #header {
        margin-left: 260px !important;
    }

    .hide-menu {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .sidebar-logo-expanded {
        display: none !important;
    }

    .sidebar-logo-collapsed {
        display: flex !important;
    }
}

@media (max-width: 640px) {
    body #header,
    body #wrapper,
    body.hide-sidebar #header,
    body.hide-sidebar #wrapper,
    body.page-small #header,
    body.page-small #wrapper {
        margin-left: 0 !important;
    }

    body #menu,
    body.hide-sidebar #menu,
    body.page-small #menu {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100% !important;
        max-width: none;
        margin-left: 0 !important;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1200;
    }

    #menu.mobile-open {
        transform: translateX(0);
    }

    .hide-menu {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.7);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.28s ease;
        z-index: 1190;
    }

    #menu.mobile-open + .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

}
