.card-tools > .btn { margin-left: .35rem; }
.form-label { font-weight: 600; }
.badge-status { min-width: 95px; }
.item-table td, .item-table th { vertical-align: middle; }
input[type="checkbox"] { width: 16px; height: 16px; vertical-align: middle; }
label > input[type="checkbox"] { margin-right: .45rem; }

:root {
    --bs-body-font-family: "Inter", "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --odoo-primary: #183a69;
    --odoo-primary-dark: #0f2c53;
    --odoo-sidebar: #15345c;
    --odoo-sidebar-soft: #214674;
    --odoo-surface: #ffffff;
    --odoo-border: #d8dee8;
    --odoo-muted: #667085;
    --odoo-bg: #eef3f8;
    --tab-active: #eb4d5c;
    --tab-inactive: #f7f8fb;
}

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

body {
    background: var(--odoo-bg) !important;
    color: #1f2937;
}

body.layout-fixed {
    overflow-x: hidden;
}

.login-page {
    background:
      radial-gradient(circle at top right, rgba(113,75,103,.14), transparent 28%),
      linear-gradient(135deg, #f7f3f6 0%, #f8fafc 45%, #eef2ff 100%);
}

.login-box .login-logo a {
    color: #1f2937;
    font-weight: 700;
}

.login-card-body {
    padding: 2rem;
}

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

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 46px !important;
    min-height: 46px !important;
    background:
        radial-gradient(circle at 85% -30%, rgba(255,255,255,.3), transparent 25%),
        linear-gradient(90deg, #10345f 0%, #1c4a84 32%, #205a9a 58%, #1d4478 100%) !important;
    border: none !important;
    box-shadow: 0 1px 0 rgba(6, 24, 44, .25) !important;
    z-index: 1040;
}

.app-header::before,
.app-header::after {
    display: none !important;
}

.app-header .container-fluid {
    height: 46px !important;
    padding-left: 14px;
    padding-right: 14px;
}

.app-header .navbar-nav {
    gap: .1rem;
}

.app-header .nav-link,
.app-header .nav-link span,
.app-header .nav-link i,
.app-header .navbar-text {
    color: rgba(255,255,255,.92) !important;
}

.app-header .nav-link {
    height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: .45rem;
    padding: 0 .7rem;
}

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

.app-header .app-title {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.app-header .app-user-greeting {
    font-size: .9rem;
    color: rgba(255,255,255,.88) !important;
}

.app-header .btn-outline-danger {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255,255,255,.34);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255,255,255,.12);
    --bs-btn-hover-border-color: rgba(255,255,255,.45);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(255,255,255,.14);
    --bs-btn-active-border-color: rgba(255,255,255,.45);
    --bs-btn-padding-y: .27rem;
    --bs-btn-padding-x: .65rem;
    --bs-btn-font-size: .8rem;
    box-shadow: none !important;
}

.notification-bell {
    position: relative;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    overflow: visible;
}

.notification-bell .bi-bell {
    display: block;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--odoo-primary);
}

.bell-shake {
    animation: bellShake 1s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes bellShake {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-14deg); }
    30% { transform: rotate(12deg); }
    40% { transform: rotate(-12deg); }
    50% { transform: rotate(8deg); }
    60% { transform: rotate(-8deg); }
    70% { transform: rotate(4deg); }
    80% { transform: rotate(-4deg); }
    90% { transform: rotate(2deg); }
    100% { transform: rotate(0deg); }
}

.notification-dropdown {
    min-width: 320px;
    max-height: 420px;
    overflow-y: auto;
}

.app-sidebar {
    position: fixed;
    top: 46px !important;
    left: 0;
    bottom: 0;
    width: 250px !important;
    background: var(--odoo-sidebar) !important;
    color: #d1d5db;
    box-shadow: none !important;
    border-right: 1px solid rgba(255,255,255,.05);
    transition: transform .22s ease, width .22s ease;
    z-index: 1030;
}

.sidebar-brand {
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
}

.app-sidebar .sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: .9rem 1rem;
}

.app-sidebar .brand-text {
    display: block;
    color: #fff;
    font-size: .93rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar .sidebar-wrapper {
    height: calc(100vh - 46px - 52px);
    padding: .6rem .55rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar {
    width: 8px;
}

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

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 999px;
}

.app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.28);
}

.app-sidebar .nav-sidebar,
.app-sidebar .sidebar-menu {
    gap: .15rem;
}

.app-sidebar .nav-item {
    width: 100%;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 38px;
    padding: .52rem .72rem;
    border-radius: .45rem;
    color: #d7dbe3;
    transition: background-color .15s ease, color .15s ease;
}

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

.app-sidebar .nav-link.active {
    background: var(--odoo-primary) !important;
    color: #fff !important;
}

.app-sidebar .nav-link .nav-icon {
    flex: 0 0 1.1rem;
    width: 1.1rem;
    margin: 0;
    text-align: center;
    font-size: .95rem;
}

.app-sidebar .nav-link p {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: .88rem;
    font-weight: 500;
}

.app-sidebar .sidebar-nav-label {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar .sidebar-group {
    margin-top: .2rem;
}

.app-sidebar .sidebar-group > .nav-link {
    background: transparent;
}

.app-sidebar .sidebar-group .nav-arrow {
    margin-left: auto;
    font-size: .78rem;
    opacity: .85;
    transition: transform .18s ease;
}

.app-sidebar .sidebar-group.menu-open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

.app-sidebar .nav-treeview {
    display: none;
    margin: .2rem 0 .25rem;
    padding-left: 0;
}

.app-sidebar .sidebar-group.menu-open > .nav-treeview {
    display: block;
}

.app-sidebar .nav-treeview .nav-link {
    min-height: 34px;
    margin: .08rem 0;
    padding: .42rem .72rem .42rem 1.65rem;
    border-radius: .42rem;
    background: transparent !important;
}

.app-sidebar .nav-treeview .nav-link.active {
    background: rgba(255,255,255,.11) !important;
}

.app-sidebar .nav-treeview .nav-link:hover {
    background: rgba(255,255,255,.06) !important;
}

.app-sidebar .nav-treeview .nav-icon {
    font-size: .42rem;
    opacity: .9;
}


.app-tabs-wrap {
    position: fixed;
    top: 46px;
    left: 250px;
    right: 0;
    height: 38px;
    background: linear-gradient(180deg, #f7f8fb 0%, #edf2f7 100%);
    border-bottom: 1px solid #cfd8e3;
    z-index: 1035;
    transition: left .22s ease;
}

.app-tabs {
    display: flex;
    align-items: end;
    gap: .3rem;
    padding: 6px 10px 0;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.app-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 220px;
    padding: 6px 10px;
    border: 1px solid #cfd8e3;
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    background: var(--tab-inactive);
    color: #355070;
    text-decoration: none;
    line-height: 1;
    min-height: 30px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.app-tab.active {
    background: #fff;
    color: #20314d;
    position: relative;
}

.app-tab.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 3px;
    background: var(--tab-active);
    border-radius: 7px 7px 0 0;
}

.app-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .78rem;
    font-weight: 600;
}

.app-tab-close {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 auto;
}

.app-tab-close:hover {
    background: rgba(15, 44, 83, .08);
    color: #102a43;
}

.app-main {
    margin-left: 250px !important;
    margin-top: 84px !important;
    padding: 0 !important;
    min-height: calc(100vh - 84px);
    background: var(--odoo-bg);
    transition: margin-left .22s ease;
}

.app-content {
    min-height: calc(100vh - 84px);
    padding: 1rem !important;
}

.sidebar-collapse .app-sidebar,
.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

.sidebar-collapse .app-main,
.sidebar-collapsed .app-main {
    margin-left: 0 !important;
}

.sidebar-collapse .app-tabs-wrap,
.sidebar-collapsed .app-tabs-wrap {
    left: 0 !important;
}

.card {
    background: var(--odoo-surface);
    border: 1px solid var(--odoo-border) !important;
    border-radius: .5rem !important;
    box-shadow: none !important;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: .7rem 1rem;
    border-bottom: 1px solid #eceff3;
    background: #fff;
}

.card-header .card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    padding: .8rem 1rem;
    border-top: 1px solid #eceff3;
    background: #fafafa;
}

.card-outline,
.card-primary,
.card-success,
.card-warning,
.card-danger {
    border-top: 1px solid var(--odoo-border) !important;
}

.table-responsive {
    overflow-x: auto;
}

.table-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
    border-radius: .4rem;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #fafafa;
    --bs-table-hover-bg: #f5f6f8;
    margin-bottom: 0;
}

.table th,
.table td {
    padding: .7rem .75rem;
    white-space: nowrap;
    vertical-align: middle;
    border-color: #eceff3;
    font-size: .88rem;
}

.table thead th {
    background: #f8f9fb;
    color: #374151;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.small-box {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 1rem;
    border-radius: .5rem;
    border: 1px solid var(--odoo-border);
    background: #fff !important;
    color: #111827 !important;
    box-shadow: none !important;
}

.small-box .inner h3 {
    margin: 0 0 .2rem;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.small-box .inner p {
    margin: 0;
    color: var(--odoo-muted);
    font-size: .92rem;
    font-weight: 500;
}

.small-box-icon {
    position: absolute;
    top: .9rem;
    right: .9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: .45rem;
    background: rgba(113,75,103,.08);
    color: var(--odoo-primary);
    font-size: 1.1rem;
    opacity: 1;
}

.badge {
    border-radius: 999px;
    padding: .38rem .55rem;
    font-weight: 600;
}

.text-bg-warning {
    background: #fff2cc !important;
    color: #8a5a00 !important;
}

.text-bg-info {
    background: #eef2ff !important;
    color: #4f46e5 !important;
}

.text-bg-success {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.text-bg-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.content-header-title {
    font-weight: 700;
}

.catalog-item-table td input[readonly] {
    background-color: #f8fafc;
}

.quotation-table .input-group-text {
    min-width: 56px;
}

.quotation-table [data-selected-slot-label] {
    min-width: 90px;
}

.form-control,
.form-select,
.input-group-text,
.btn {
    border-radius: .4rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #c5b2bf;
    box-shadow: 0 0 0 .2rem rgba(113,75,103,.12);
}

.btn-primary {
    --bs-btn-bg: var(--odoo-primary);
    --bs-btn-border-color: var(--odoo-primary);
    --bs-btn-hover-bg: var(--odoo-primary-dark);
    --bs-btn-hover-border-color: var(--odoo-primary-dark);
    --bs-btn-active-bg: var(--odoo-primary-dark);
    --bs-btn-active-border-color: var(--odoo-primary-dark);
}

.alert {
    border-radius: .45rem;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        z-index: 1050;
    }

    .app-tabs-wrap {
        left: 0 !important;
        top: 46px;
    }

    .app-main {
        margin-left: 0 !important;
        margin-top: 84px !important;
    }

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

    body.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 46px 0 0 0;
        background: rgba(17, 24, 39, .38);
        z-index: 1045;
    }
}


/* Mobile responsive improvements */
.app-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    body {
        overflow-x: hidden;
    }

    .app-header {
        height: 52px !important;
        min-height: 52px !important;
    }

    .app-header .container-fluid {
        height: 52px !important;
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .app-header .app-title {
        font-size: .88rem;
        max-width: 48vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-sidebar {
        top: 52px !important;
        width: min(86vw, 290px) !important;
        max-width: 290px;
        transform: translateX(-100%);
        z-index: 1055;
    }

    .app-sidebar .sidebar-wrapper {
        height: calc(100vh - 52px - 52px);
        -webkit-overflow-scrolling: touch;
    }

    .app-main {
        margin-top: 52px !important;
        margin-left: 0 !important;
        min-height: calc(100vh - 52px);
    }

    .app-content {
        min-height: calc(100vh - 52px);
        padding: .75rem !important;
    }

    .container-fluid {
        padding-left: .65rem;
        padding-right: .65rem;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding-left: .85rem;
        padding-right: .85rem;
    }

    .small-box {
        min-height: 98px;
        padding: .9rem;
    }

    .small-box .inner h3 {
        font-size: 1.45rem;
    }

    .small-box .inner p {
        font-size: .82rem;
        padding-right: 2.25rem;
    }

    .small-box-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .table th,
    .table td {
        font-size: .82rem;
        padding: .6rem .65rem;
    }

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

    body.sidebar-open {
        overflow: hidden;
    }

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

    .app-sidebar-backdrop {
        position: fixed;
        inset: 52px 0 0 0;
        background: rgba(17, 24, 39, .42);
        z-index: 1050;
    }

    body.sidebar-open .app-sidebar-backdrop {
        display: block;
    }

    body.sidebar-open::before {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .app-header .navbar-nav {
        gap: .15rem;
    }

    .app-header .nav-link {
        padding: 0 .55rem;
    }

    .app-header .btn-outline-danger {
        --bs-btn-padding-x: .55rem;
        --bs-btn-font-size: .76rem;
    }

    .notification-dropdown {
        min-width: min(92vw, 320px);
        max-width: 92vw;
    }

    .content-header .row {
        row-gap: .5rem;
    }

    .content-header-title,
    h1, h2 {
        font-size: 1.15rem;
    }

    .table-scroll-wrap {
        max-height: none;
    }
}

@media (max-width: 991.98px) {
    .app-tabs-wrap { left: 0; }
    .app-main { margin-top: 84px; }
}
