/* Office Accounts ERP — Odoo-inspired design system on Bootstrap 5.3 */
:root {
  --o-brand: #714B67;
  --o-brand-rgb: 113, 75, 103;
  --o-brand-dark: #5a3b52;
  --o-brand-soft: #f3edf2;
  --o-accent: #017E84;
  --o-nav-h: 46px;
  --o-canvas: #f9fafb;
  --o-card: #ffffff;
  --o-border: #dee2e6;
  --o-border-soft: #eceef1;
  --o-text-muted: #6c757d;
  --o-label: #4c4c4c;
  --bs-primary: var(--o-brand);
  --bs-primary-rgb: var(--o-brand-rgb);
  --bs-link-color: #017E84;
  --bs-link-color-rgb: 1, 126, 132;
  --bs-link-hover-color: #015a5e;
  --bs-body-font-family: "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: .875rem;
  --bs-body-color: #212529;
  --bs-border-radius: 4px;
  --bs-border-color: var(--o-border);
}
[data-bs-theme="dark"] {
  --o-brand-soft: #3a2c37;
  --o-canvas: #1c1f24;
  --o-card: #262a30;
  --o-border: #3a3f47;
  --o-border-soft: #31353c;
  --o-text-muted: #9aa1aa;
  --o-label: #c5cad1;
  --bs-body-bg: #1c1f24;
  --bs-body-color: #e3e6ea;
  --bs-link-color: #4fc3c8;
  --bs-link-color-rgb: 79, 195, 200;
  --bs-link-hover-color: #7fd8dc;
  --bs-border-color: var(--o-border);
}
html, body { background: var(--o-canvas); }
body { font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.num, td.money, th.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { font-weight: 500; border-radius: 4px; }
.btn-primary { --bs-btn-bg: var(--o-brand); --bs-btn-border-color: var(--o-brand); --bs-btn-hover-bg: var(--o-brand-dark); --bs-btn-hover-border-color: var(--o-brand-dark); --bs-btn-active-bg: #4d3246; --bs-btn-disabled-bg: var(--o-brand); --bs-btn-disabled-border-color: var(--o-brand); }
.btn-secondary, .btn-light { --bs-btn-bg: #e7e9ed; --bs-btn-border-color: #e7e9ed; --bs-btn-color: #374151; --bs-btn-hover-bg: #d8dadd; --bs-btn-hover-border-color: #d8dadd; --bs-btn-hover-color: #111827; }
[data-bs-theme="dark"] .btn-secondary, [data-bs-theme="dark"] .btn-light { --bs-btn-bg: #3a3f47; --bs-btn-border-color: #3a3f47; --bs-btn-color: #e3e6ea; --bs-btn-hover-bg: #474d56; --bs-btn-hover-color: #fff; }
.btn-light.border { border-color: #e7e9ed !important; }
.btn-outline-primary { --bs-btn-color: var(--o-brand); --bs-btn-border-color: var(--o-brand); --bs-btn-hover-bg: var(--o-brand); --bs-btn-hover-border-color: var(--o-brand); --bs-btn-active-bg: var(--o-brand); }
.btn-success { --bs-btn-bg: #28a745; --bs-btn-border-color: #28a745; }
.btn-link { --bs-btn-color: var(--bs-link-color); }
.btn-sm { --bs-btn-padding-y: .28rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .82rem; }
.text-primary { color: var(--o-brand) !important; }
[data-bs-theme="dark"] .text-primary { color: #d1a7c7 !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--o-accent); box-shadow: 0 0 0 .15rem rgba(1, 126, 132, .15); }
.form-check-input:checked { background-color: var(--o-accent); border-color: var(--o-accent); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--o-label); margin-bottom: .2rem; }
.form-control, .form-select { font-size: .875rem; }

/* ---------- navbar (Odoo top bar) ---------- */
.o-navbar { height: var(--o-nav-h); background: var(--o-brand); color: #fff; display: flex; align-items: stretch; position: sticky; top: 0; z-index: 1030; box-shadow: 0 1px 2px rgba(0,0,0,.15); padding: 0 .25rem; }
[data-bs-theme="dark"] .o-navbar { background: #3f2b3a; }
.o-navbar a, .o-navbar .o-nav-btn { color: rgba(255,255,255,.92); display: flex; align-items: center; padding: 0 .75rem; height: 100%; border: 0; background: transparent; font-size: .9rem; white-space: nowrap; gap: .4rem; text-decoration: none; }
.o-navbar a:hover, .o-navbar .o-nav-btn:hover, .o-navbar .show > .o-nav-btn, .o-navbar a.active { background: rgba(0,0,0,.12); color: #fff; }
.o-navbar .o-apps-btn { font-size: 1.15rem; padding: 0 .9rem; }
.o-navbar .o-app-name { font-weight: 600; font-size: 1.02rem; padding-right: 1rem; }
.o-menu { display: flex; align-items: stretch; overflow: hidden; }
.o-nav-right { margin-left: auto; display: flex; align-items: stretch; }
.o-nav-right .o-nav-btn { padding: 0 .6rem; font-size: 1.05rem; position: relative; }
.o-badge { position: absolute; top: 6px; right: 2px; background: #e74c3c; color: #fff; font-size: .6rem; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 999px; text-align: center; }
.o-avatar { width: 28px; height: 28px; border-radius: 4px; background: #fff; color: var(--o-brand); font-weight: 700; font-size: .72rem; display: inline-grid; place-items: center; }
.o-company { font-size: .8rem; opacity: .85; padding: 0 .75rem; display: flex; align-items: center; }
.o-navbar .dropdown-menu { margin-top: 0 !important; border-top-left-radius: 0; border-top-right-radius: 0; }
.o-search-nav { display: flex; align-items: center; padding: 0 .5rem; position: relative; }
.o-search-nav input { height: 30px; width: 240px; border-radius: 4px; border: 0; background: rgba(255,255,255,.18); color: #fff; padding: 0 .6rem 0 1.9rem; font-size: .84rem; transition: width .2s, background .2s; }
.o-search-nav input::placeholder { color: rgba(255,255,255,.75); }
.o-search-nav input:focus { outline: 0; background: #fff; color: #212529; width: 340px; }
.o-search-nav > .bi { position: absolute; left: 1.05rem; color: rgba(255,255,255,.85); font-size: .85rem; pointer-events: none; }
.o-search-nav input:focus ~ .bi, .o-search-nav:focus-within > .bi { color: #6c757d; }
.erp-search-results { position: absolute; top: calc(100% + 2px); right: .5rem; width: 420px; background: var(--o-card); color: var(--bs-body-color); border: 1px solid var(--o-border); border-radius: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.18); max-height: 70vh; overflow: auto; display: none; z-index: 1050; }
.erp-search-results.show { display: block; }
.erp-search-results .grp { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--o-text-muted); padding: .6rem .9rem .2rem; }
.erp-search-results a { display: flex !important; gap: .7rem; align-items: center; padding: .45rem .9rem !important; height: auto !important; color: inherit !important; }
.erp-search-results a:hover, .erp-search-results a.focus { background: var(--o-brand-soft) !important; text-decoration: none; }
@media (max-width: 991.98px) { .o-search-nav, .o-company { display: none; } }
.o-mobile-menu { display: none !important; }

/* ---------- app switcher (home menu) ---------- */
.o-home { min-height: calc(100vh - var(--o-nav-h)); background: radial-gradient(ellipse at top left, #f6eef4 0, transparent 55%), radial-gradient(ellipse at bottom right, #e7f4f4 0, transparent 50%), var(--o-canvas); padding: 3.5rem 1rem; }
[data-bs-theme="dark"] .o-home { background: radial-gradient(ellipse at top left, #2f2430 0, transparent 55%), radial-gradient(ellipse at bottom right, #1d2c2d 0, transparent 50%), var(--o-canvas); }
.o-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 1.6rem 1rem; max-width: 820px; margin: 0 auto; }
.o-app { display: flex; flex-direction: column; align-items: center; gap: .55rem; color: var(--bs-body-color); text-decoration: none !important; padding: .5rem; border-radius: 8px; transition: transform .12s; }
.o-app:hover { transform: translateY(-3px); }
.o-app-icon { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-size: 2rem; box-shadow: 0 6px 14px rgba(0,0,0,.14), inset 0 -3px 0 rgba(0,0,0,.08); position: relative; overflow: hidden; }
.o-app-icon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.28), transparent 45%); }
.o-app-label { font-size: .85rem; font-weight: 500; text-align: center; line-height: 1.2; }
.o-home-search { max-width: 520px; margin: 0 auto 2.5rem; }

/* ---------- control panel ---------- */
.o-control { background: var(--o-card); border-bottom: 1px solid var(--o-border); padding: .55rem 1rem .6rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.o-control-left { display: flex; flex-direction: column; gap: .35rem; min-width: 0; flex: 1 1 380px; }
.o-control-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; flex: 1 1 380px; }
.o-breadcrumb { display: flex; align-items: center; gap: .35rem; font-size: 1.15rem; min-height: 32px; flex-wrap: wrap; }
.o-breadcrumb a { color: var(--o-accent); }
.o-breadcrumb .sep { color: var(--o-text-muted); font-size: .9rem; }
.o-breadcrumb .current { font-weight: 500; color: var(--bs-body-color); }
.o-cp-buttons { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.o-searchbar { display: flex; align-items: stretch; border: 1px solid var(--o-border); border-radius: 4px; background: var(--o-card); width: 100%; max-width: 560px; min-height: 32px; }
.o-searchbar > .bi-search { padding: 0 .55rem; display: flex; align-items: center; color: var(--o-text-muted); }
.o-searchbar .facets { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .15rem 0; }
.o-facet { display: inline-flex; align-items: stretch; border-radius: 3px; overflow: hidden; font-size: .75rem; border: 1px solid #d0d4da; }
.o-facet .k { background: var(--o-accent); color: #fff; padding: 0 .4rem; display: flex; align-items: center; }
.o-facet .v { background: #f1f3f5; padding: 0 .4rem; display: flex; align-items: center; color: #333; }
[data-bs-theme="dark"] .o-facet .v { background: #3a3f47; color: #e3e6ea; }
.o-searchbar input { border: 0; outline: 0; flex: 1; min-width: 120px; background: transparent; padding: 0 .4rem; color: inherit; }
.o-searchbar .toggle { border: 0; border-left: 1px solid var(--o-border); background: transparent; padding: 0 .6rem; color: var(--o-text-muted); }
.o-searchbar .toggle:hover { background: var(--o-canvas); }
.o-filter-menu { width: min(760px, 94vw); padding: 0; }
.o-filter-menu .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.o-filter-menu .col-f { padding: .8rem 1rem; border-right: 1px solid var(--o-border-soft); }
.o-filter-menu .col-f:last-child { border-right: 0; }
.o-filter-menu h6 { font-size: .78rem; font-weight: 700; display: flex; gap: .4rem; align-items: center; color: var(--o-label); margin-bottom: .6rem; }
.o-pager { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--o-text-muted); }
.o-pager .btn { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .45rem; }

/* ---------- content ---------- */
.erp-content { padding: 0; margin-left: var(--o-side-w); transition: margin-left .2s; min-width: 0; }
.o-content { padding: 1rem; }
.o-content-flush { padding: 0; }
.o-list { background: var(--o-card); border-bottom: 1px solid var(--o-border); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--o-card); border-bottom: 1px solid var(--o-border); padding: .55rem 1rem; margin: -1rem -1rem 1rem; }
.page-title { font-size: 1.15rem; font-weight: 500; margin: 0; display: flex; align-items: center; gap: .5rem; }
.page-title .bi { display: none; }
.page-desc { color: var(--o-text-muted); font-size: .8rem; max-width: 860px; margin-top: .1rem; }
.breadcrumb { display: none; }

/* ---------- cards / kpi ---------- */
.card { --bs-card-border-color: var(--o-border); --bs-card-bg: var(--o-card); border-radius: 4px; box-shadow: none; }
.card-header { background: transparent; border-bottom-color: var(--o-border-soft); font-weight: 600; padding: .65rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; }
.card-header .bi { color: var(--o-brand); }
[data-bs-theme="dark"] .card-header .bi { color: #d1a7c7; }
.kpi { padding: .9rem 1rem; display: flex; gap: .85rem; align-items: center; height: 100%; text-decoration: none !important; color: inherit; }
.kpi-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.kpi-label { font-size: .72rem; color: var(--o-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 1.22rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }
a.kpi:hover { background: var(--o-canvas); }
.tone-primary { background: var(--o-brand-soft); color: var(--o-brand); }
.tone-success { background: rgba(40,167,69,.12); color: #218838; }
.tone-danger { background: rgba(220,53,69,.12); color: #c82333; }
.tone-warning { background: rgba(255,193,7,.18); color: #a07800; }
.tone-info { background: rgba(1,126,132,.12); color: var(--o-accent); }
.tone-secondary { background: rgba(108,117,125,.14); color: #5a6268; }
[data-bs-theme="dark"] .tone-primary { color: #d1a7c7; }

/* ---------- list view ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .42rem .75rem; border-bottom-color: var(--o-border-soft); }
.table thead th { font-size: .8rem; color: var(--bs-body-color); font-weight: 700; background: var(--o-card); white-space: nowrap; border-bottom: 1px solid var(--o-border); }
.table thead th a { color: inherit; }
.table thead th a:hover { color: var(--o-accent); text-decoration: none; }
.table-hover tbody tr:hover > * { background: rgba(var(--o-brand-rgb), .05); }
.table tbody tr.clickable { cursor: pointer; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.table td:first-child a { white-space: nowrap; }
.o-list-total td { font-weight: 700; border-top: 1px solid var(--o-border); background: var(--o-canvas); }
.status-badge { font-weight: 500; font-size: .74rem; padding: .3em .65em; border-radius: 999px; }
.text-bg-secondary.status-badge { background: #e9ecef !important; color: #495057 !important; }
.text-bg-primary.status-badge { background: rgba(var(--o-brand-rgb), .12) !important; color: var(--o-brand) !important; }
.text-bg-info.status-badge { background: rgba(1,126,132,.13) !important; color: var(--o-accent) !important; }
.text-bg-success.status-badge { background: rgba(40,167,69,.14) !important; color: #1e7e34 !important; }
.text-bg-warning.status-badge { background: rgba(255,193,7,.22) !important; color: #856404 !important; }
.text-bg-danger.status-badge { background: rgba(220,53,69,.13) !important; color: #bd2130 !important; }
.text-bg-dark.status-badge { background: #495057 !important; color: #fff !important; }
[data-bs-theme="dark"] .text-bg-secondary.status-badge { background: #3a3f47 !important; color: #ced4da !important; }
[data-bs-theme="dark"] .text-bg-primary.status-badge { color: #e0b8d6 !important; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--o-brand-soft); color: var(--o-brand); border-radius: 3px; padding: .15rem .55rem; font-size: .75rem; font-weight: 500; }

/* ---------- form view: statusbar + sheet + chatter ---------- */
.o-statusbar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--o-card); border-bottom: 1px solid var(--o-border); padding: .45rem 1rem; }
.o-statusbar .o-sb-buttons { display: flex; gap: .35rem; flex-wrap: wrap; }
.o-arrows { display: flex; flex-wrap: wrap; }
.o-arrows .step { position: relative; padding: .3rem .9rem .3rem 1.3rem; font-size: .76rem; background: var(--o-card); color: var(--o-text-muted); border: 1px solid var(--o-border); border-left: 0; margin-left: -1px; text-transform: uppercase; letter-spacing: .02em; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); font-weight: 500; }
.o-arrows .step:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); padding-left: .9rem; border-left: 1px solid var(--o-border); border-radius: 3px 0 0 3px; }
.o-arrows .step.current { background: var(--o-accent); color: #fff; border-color: var(--o-accent); }
.o-arrows .step.done { color: var(--bs-body-color); }
.o-form-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 1400px) { .o-form-wrap.with-chatter { grid-template-columns: minmax(0, 1fr) 390px; } .o-form-wrap.with-chatter .o-chatter { border-left: 1px solid var(--o-border); min-height: calc(100vh - 150px); } }
.o-sheet-bg { padding: 1rem; }
.o-sheet { background: var(--o-card); border: 1px solid var(--o-border); max-width: 1140px; margin: 0 auto; padding: 1.5rem 2rem 2rem; position: relative; box-shadow: 0 5px 20px -10px rgba(0,0,0,.15); }
@media (max-width: 767.98px) { .o-sheet { padding: 1rem; } .o-sheet-bg { padding: .5rem; } }
.o-sheet-kind { font-size: .8rem; color: var(--o-text-muted); }
.o-sheet-title { font-size: 1.9rem; font-weight: 500; line-height: 1.2; margin: 0 0 1.1rem; word-break: break-word; }
.o-ribbon { position: absolute; top: 0; right: 0; width: 130px; height: 130px; overflow: hidden; pointer-events: none; }
.o-ribbon span { position: absolute; top: 28px; right: -38px; transform: rotate(45deg); width: 180px; text-align: center; padding: .3rem 0; color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.o-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; margin-bottom: 1rem; }
@media (max-width: 767.98px) { .o-group { grid-template-columns: 1fr; } }
.o-field { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: .5rem; padding: .32rem 0; align-items: baseline; }
.o-field .lbl { font-weight: 700; color: var(--o-label); font-size: .84rem; }
.o-field .val { word-break: break-word; }
.o-notebook .nav-tabs { border-bottom-color: var(--o-border); margin-top: .5rem; }
.o-notebook .nav-link { color: var(--o-text-muted); border-radius: 0; font-weight: 500; padding: .45rem 1rem; }
.o-notebook .nav-link.active { color: var(--bs-body-color); border-color: var(--o-border) var(--o-border) var(--o-card); }
.o-notebook .tab-pane { padding-top: .75rem; }
.o-sheet .card { border: 0; }
.o-sheet .card-header { padding-left: 0; padding-right: 0; }
.o-sheet .card-body { padding-left: 0; padding-right: 0; }
.o-sheet .table-responsive { border: 1px solid var(--o-border-soft); border-radius: 3px; }
/* editable sheet: Odoo-style underlined inputs */
.o-sheet-edit .form-control, .o-sheet-edit .form-select { border: 0; border-bottom: 1px solid var(--o-border); border-radius: 0; padding-left: .15rem; background-color: transparent; }
.o-sheet-edit .form-control:focus, .o-sheet-edit .form-select:focus { box-shadow: none; border-bottom: 2px solid var(--o-accent); }
.o-sheet-edit .input-group .btn { border-radius: 0; }
.o-sheet-edit .lines-table .form-control, .o-sheet-edit .lines-table .form-select { border-bottom-color: transparent; }
.o-sheet-edit .lines-table tr:hover .form-control, .o-sheet-edit .lines-table tr:hover .form-select, .o-sheet-edit .lines-table .form-control:focus, .o-sheet-edit .lines-table .form-select:focus { border-bottom-color: var(--o-border); }
.o-sheet-edit .readonly-calc { background: transparent !important; font-weight: 700; }
.form-section { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--o-label); font-weight: 700; border-bottom: 1px solid var(--o-border); padding-bottom: .3rem; margin-top: .75rem; }
.lines-table { min-width: 900px; }
.lines-table td { padding: .25rem .3rem !important; vertical-align: top; }
.lines-table thead th { font-size: .78rem; }
.lines-table .form-control, .lines-table .form-select { font-size: .84rem; padding: .3rem .4rem; }
.lines-table tfoot td { font-weight: 600; border: 0; }
.required-mark::after { content: ' *'; color: #dc3545; }
.readonly-calc { background: var(--o-canvas) !important; font-weight: 600; }
.sticky-actions { display: flex; gap: .5rem; justify-content: flex-end; padding: .75rem 0 0; }

/* chatter */
.o-chatter { background: var(--o-card); padding: 1rem 1.1rem; }
@media (max-width: 1399.98px) { .o-chatter { max-width: 1140px; margin: 0 auto 1rem; width: calc(100% - 2rem); border: 1px solid var(--o-border); } }
.o-chatter h6 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--o-label); margin: .25rem 0 .7rem; display: flex; justify-content: space-between; align-items: center; }
.o-msg { display: flex; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--o-border-soft); }
.o-msg:last-child { border-bottom: 0; }
.o-msg-av { width: 32px; height: 32px; border-radius: 4px; background: var(--o-brand); color: #fff; display: grid; place-items: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.o-msg-av.sys { background: #6c757d; }
.o-msg-av.ok { background: #28a745; } .o-msg-av.bad { background: #dc3545; }
.o-msg-head { font-size: .82rem; } .o-msg-head .t { color: var(--o-text-muted); font-size: .75rem; margin-left: .3rem; }
.o-msg-body { font-size: .82rem; color: var(--o-label); word-break: break-word; }
.o-chatter-sep { text-align: center; font-size: .72rem; color: var(--o-text-muted); margin: .6rem 0; position: relative; }
.attach-tile { display: flex; gap: .55rem; align-items: center; padding: .4rem .55rem; border: 1px solid var(--o-border); border-radius: 4px; background: var(--o-canvas); }

/* misc detail helpers (legacy partials) */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem 1.5rem; }
.detail-grid dt { font-size: .78rem; color: var(--o-label); font-weight: 700; margin-bottom: .1rem; }
.detail-grid dd { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.4rem; }
.timeline .dot { position: absolute; left: 0; top: .3rem; width: .8rem; height: .8rem; border-radius: 999px; border: 3px solid var(--o-accent); }
.timeline .dot.success { border-color: #28a745; } .timeline .dot.danger { border-color: #dc3545; } .timeline .dot.muted { border-color: #adb5bd; }

/* ---------- QuickBooks-style blocks ---------- */
.qb-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.qb-action { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1rem .5rem; border: 1px solid var(--o-border); border-radius: 6px; background: var(--o-card); color: var(--bs-body-color); text-decoration: none !important; font-weight: 500; font-size: .85rem; transition: border-color .15s, box-shadow .15s; }
.qb-action:hover { border-color: var(--o-accent); box-shadow: 0 4px 14px rgba(1,126,132,.12); }
.qb-action .ic { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 1.2rem; }
.money-bar { display: flex; height: 26px; border-radius: 3px; overflow: hidden; background: var(--o-border-soft); }
.money-bar > div { height: 100%; }
.money-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-bottom: .45rem; }
.money-legend .amt { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-legend .cap { font-size: .75rem; color: var(--o-text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }

/* ---------- Crystal Reports style ---------- */
.cr-toolbar { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; background: #e9ecef; border: 1px solid #ced4da; border-bottom: 0; padding: .35rem .5rem; border-radius: 4px 4px 0 0; }
[data-bs-theme="dark"] .cr-toolbar { background: #2d3138; border-color: #3a3f47; }
.cr-toolbar .btn { --bs-btn-bg: #f8f9fa; --bs-btn-border-color: #ced4da; --bs-btn-color: #212529; --bs-btn-hover-bg: #fff; }
.cr-viewport { background: #8a8f96; border: 1px solid #ced4da; padding: 1.25rem; overflow: auto; border-radius: 0 0 4px 4px; }
[data-bs-theme="dark"] .cr-viewport { background: #111317; border-color: #3a3f47; }
.cr-page { background: #fff; color: #1a1a1a; max-width: 1100px; min-height: 600px; margin: 0 auto; padding: 32px 38px 24px; box-shadow: 0 2px 12px rgba(0,0,0,.35); font-family: "Segoe UI", Arial, sans-serif; font-size: 12px; }
.cr-page.landscape { max-width: 1400px; }
.cr-rh { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: start; border-bottom: 3px double #333; padding-bottom: 10px; margin-bottom: 4px; }
.cr-rh .logo img { max-height: 54px; max-width: 160px; }
.cr-rh .logo .mono { width: 48px; height: 48px; background: var(--o-brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 22px; border-radius: 6px; }
.cr-rh .center { text-align: center; }
.cr-rh .co { font-size: 17px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.cr-rh .co-sub { font-size: 10.5px; color: #555; }
.cr-rh .title { font-size: 15px; font-weight: 700; margin-top: 6px; color: #1f3a5f; text-transform: uppercase; letter-spacing: .04em; }
.cr-rh .period { font-size: 11.5px; color: #333; font-style: italic; }
.cr-rh .meta { text-align: right; font-size: 10.5px; color: #444; line-height: 1.5; }
.cr-params { font-size: 10.5px; color: #333; padding: 4px 0 8px; border-bottom: 1px solid #999; margin-bottom: 0; display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.cr-params b { color: #000; }
table.cr { width: 100%; border-collapse: collapse; }
table.cr thead th { background: #1f3a5f; color: #fff; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 6px 6px; text-align: left; border: 0; }
table.cr thead th.money { text-align: right; }
table.cr td { padding: 3px 6px; font-size: 11.5px; border-bottom: 1px dotted #d4d4d4; vertical-align: top; white-space: pre-wrap; }
table.cr td.money { text-align: right; white-space: nowrap; font-family: "Consolas", "Courier New", monospace; font-size: 11.5px; }
table.cr tr.r-group td { background: #dce6f1; color: #1f3a5f; font-weight: 700; border-bottom: 1px solid #9fb4cc; padding-top: 5px; }
table.cr tr.r-subtotal td { font-weight: 700; border-top: 1px solid #333; border-bottom: 0; background: #f4f6f9; }
table.cr tr.r-total td { font-weight: 700; border-top: 1px solid #000; border-bottom: 3px double #000; background: #eaeef3; font-size: 12px; }
table.cr tr.r-muted td { color: #666; font-style: italic; }
table.cr tr.r-danger td.money { color: #b00020; }
table.cr tbody tr.r-row:nth-child(even) td { background: #fafafa; }
table.cr tr.clickable:hover td { background: #fff8d6 !important; cursor: pointer; }
.cr-summary { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; padding: 8px 0 2px; font-size: 11.5px; border-bottom: 1px solid #999; margin-bottom: 8px; }
.cr-pf { border-top: 1px solid #333; margin-top: 16px; padding-top: 5px; display: flex; justify-content: space-between; font-size: 10px; color: #555; }
.cr-note { font-size: 10.5px; color: #444; margin-top: 8px; font-style: italic; }
.report-card { transition: transform .12s, box-shadow .12s; text-decoration: none !important; color: inherit; display: block; height: 100%; }
.report-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--o-text-muted); }
.empty-state .bi { font-size: 3rem; color: #c8cdd3; display: block; margin-bottom: .6rem; }
.empty-state h6 { color: var(--bs-body-color); font-weight: 600; font-size: 1rem; }
.loading-bar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, #f9d9ef, #4fc3c8); z-index: 2000; width: 0; opacity: 0; }
.loading-bar.active { opacity: 1; width: 70%; transition: width 4s cubic-bezier(.1,.6,.2,1); }
.table-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }
.toast-container { z-index: 2100; }
.dropdown-menu { --bs-dropdown-border-color: var(--o-border); border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: .86rem; }
.dropdown-item:active { background: var(--o-brand); }
.notif-menu { width: 360px; max-height: 480px; overflow: auto; }
.notif-item { display: flex; gap: .6rem; padding: .6rem .9rem; color: inherit !important; border-bottom: 1px solid var(--o-border-soft); text-decoration: none !important; }
.notif-item.unread { background: var(--o-brand-soft); }
.nav-tabs .nav-link.active { color: var(--bs-body-color); font-weight: 600; }
.nav-tabs .nav-link { color: var(--o-text-muted); }
.chart-box { min-height: 280px; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(circle at 20% 20%, #8f5f84 0, transparent 45%), radial-gradient(circle at 80% 70%, #017E84 0, transparent 40%), #2b1f29; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-form { display: grid; place-items: center; padding: 2rem; background: var(--o-card); }
.erp-brand-mark { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #8f5f84, #5b3a53); display: inline-grid; place-items: center; font-weight: 700; color: #fff; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }
@media print {
  .o-navbar, .o-sidebar, .o-control, .o-statusbar, .no-print, .o-chatter, .cr-toolbar, .page-head .btn, .sticky-actions { display: none !important; }
  .cr-viewport { background: #fff; padding: 0; border: 0; } .cr-page { box-shadow: none; padding: 0; max-width: none; }
  .o-sheet { box-shadow: none; border: 0; }
}

/* ---------- Sidebar (Odoo style): app tiles → menu → submenu, accordion at every level ---------- */
:root { --o-side-w: 282px; --o-side-mini: 64px; --o-side-bg: #ffffff; --o-side-text: #374151; --o-side-muted: #6b7280; --o-side-hover: #f3f4f6; --o-side-line: #e5e7eb; --o-side-active: #f4edf2; }
[data-bs-theme="dark"] { --o-side-bg: #1f1d24; --o-side-text: #d6d3dc; --o-side-muted: #9a96a3; --o-side-hover: #2a2730; --o-side-line: #34303b; --o-side-active: #3a2c37; }
.o-navbar .o-app-name { gap: .55rem; }
.o-logo { width: 26px; height: 26px; border-radius: 6px; background: #fff; color: var(--o-brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.o-trail { align-items: center; color: rgba(255,255,255,.75); font-size: .85rem; }
.o-trail span + span::before { content: "\203A"; margin: 0 .45rem; opacity: .7; }
.o-trail span:last-child { color: #fff; font-weight: 500; }
.o-sidebar { position: fixed; top: var(--o-nav-h); bottom: 0; left: 0; width: var(--o-side-w); background: var(--o-side-bg); color: var(--o-side-text); border-right: 1px solid var(--o-side-line); z-index: 1020; display: flex; flex-direction: column; transition: width .18s, transform .2s; }
.o-side-search { position: relative; padding: .7rem .75rem .5rem; }
.o-side-search i { position: absolute; left: 1.4rem; top: 50%; transform: translateY(-35%); color: var(--o-side-muted); font-size: .8rem; }
.o-side-search input { width: 100%; border: 1px solid var(--o-side-line); background: var(--o-side-hover); color: var(--o-side-text); border-radius: 6px; padding: .38rem .6rem .38rem 1.9rem; font-size: .84rem; outline: none; }
.o-side-search input:focus { border-color: var(--o-brand); background: var(--o-side-bg); box-shadow: 0 0 0 3px rgba(113,75,103,.12); }
.o-side-scroll { flex: 1; overflow-y: auto; padding: .15rem 0 1rem; scrollbar-width: thin; scrollbar-color: var(--o-side-line) transparent; }
.o-side-list { list-style: none; margin: 0; padding: 0; }
.o-side-link { display: flex; align-items: center; gap: .65rem; margin: 1px .55rem; padding: .42rem .55rem; border-radius: 6px; color: var(--o-side-text); text-decoration: none; font-size: .875rem; cursor: pointer; user-select: none; position: relative; }
.o-side-link:hover { background: var(--o-side-hover); color: var(--o-side-text); }
.o-side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-caret { font-size: .68rem; color: var(--o-side-muted); transition: transform .2s; }
.o-side-link.collapsed > .o-caret { transform: rotate(-90deg); }
.o-app-tile { width: 28px; height: 28px; flex-shrink: 0; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .92rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tile) 82%, #fff) 0%, var(--tile) 55%, color-mix(in srgb, var(--tile) 80%, #000) 100%); box-shadow: 0 1px 2px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.25); }
.lvl-0 > li > .o-side-link { font-weight: 500; padding: .38rem .5rem; }
.lvl-0 > li > .o-side-link.trail { color: var(--o-brand); font-weight: 600; }
[data-bs-theme="dark"] .lvl-0 > li > .o-side-link.trail { color: #e3b8d8; }
.lvl-1, .lvl-2 { position: relative; }
.lvl-1::before { content: ""; position: absolute; left: 1.6rem; top: 2px; bottom: 4px; border-left: 1px solid var(--o-side-line); }
.lvl-1 .o-side-link { margin-left: 2.05rem; font-size: .845rem; padding: .34rem .55rem; }
.o-side-ic { font-size: .85rem; color: var(--o-side-muted); width: 1rem; text-align: center; }
.lvl-2::before { content: ""; position: absolute; left: 3.05rem; top: 2px; bottom: 4px; border-left: 1px dashed var(--o-side-line); }
.lvl-2 .o-side-link { margin-left: 3.4rem; font-size: .82rem; padding: .3rem .55rem; color: var(--o-side-muted); }
.lvl-2 .o-side-link:hover { color: var(--o-side-text); }
.o-side-link.active { background: var(--o-side-active); color: var(--o-brand) !important; font-weight: 600; }
.o-side-link.active::before { content: ""; position: absolute; left: -.55rem; top: 5px; bottom: 5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--o-brand); }
.lvl-1 .o-side-link.active::before, .lvl-2 .o-side-link.active::before { left: -.5rem; }
.o-side-link.active .o-side-ic { color: var(--o-brand); }
[data-bs-theme="dark"] .o-side-link.active { color: #e3b8d8 !important; }
.lvl-0 > li > .o-side-link.active { background: var(--o-side-active); }
.o-side-foot { border-top: 1px solid var(--o-side-line); padding: .6rem .9rem; display: flex; align-items: center; gap: .6rem; font-size: .8rem; }
.o-side-foot .o-avatar { flex-shrink: 0; background: var(--o-brand); color: #fff; border-radius: 50%; }
.o-side-foot b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.o-side-foot small { color: var(--o-side-muted); }
.o-side-empty { color: var(--o-side-muted); font-size: .82rem; padding: .8rem 1.2rem; }
.o-sidebar mark { padding: 0; background: rgba(227,163,59,.35); color: inherit; border-radius: 2px; }
.o-side-backdrop { display: none; }
/* mini rail (desktop ☰): only app tiles; hovering the rail expands it over the page */
html.side-mini .erp-content { margin-left: var(--o-side-mini); }
html.side-mini .o-sidebar:not(:hover) { width: var(--o-side-mini); }
html.side-mini .o-sidebar:not(:hover) .o-side-label, html.side-mini .o-sidebar:not(:hover) .o-caret, html.side-mini .o-sidebar:not(:hover) .collapse,
html.side-mini .o-sidebar:not(:hover) .o-side-search, html.side-mini .o-sidebar:not(:hover) .o-side-empty { display: none !important; }
html.side-mini .o-sidebar:hover { box-shadow: 6px 0 24px rgba(0,0,0,.15); }
html.side-mini .o-sidebar:not(:hover) .lvl-0 > li > .o-side-link { justify-content: center; }
@media (max-width: 991.98px) {
  .erp-content, html.side-mini .erp-content { margin-left: 0; }
  .o-sidebar, html.side-mini .o-sidebar { width: var(--o-side-w) !important; transform: translateX(-100%); box-shadow: 4px 0 16px rgba(0,0,0,.2); }
  html.side-open .o-sidebar { transform: none; }
  html.side-open .o-side-backdrop { display: block; position: fixed; inset: var(--o-nav-h) 0 0 0; background: rgba(0,0,0,.3); z-index: 1019; }
}
@media print { .erp-content { margin-left: 0 !important; } }
.vt-tile:hover { background: var(--o-canvas); }
/* chart of accounts */
.coa-dr { background: rgba(1,126,132,.12); color: #017E84; font-weight: 600; }
.coa-cr { background: rgba(113,75,103,.13); color: #714B67; font-weight: 600; }
[data-bs-theme="dark"] .coa-cr { color: #d9a9cf; }
.coa-type { font-size: .78rem; padding: .1rem .45rem; border-radius: 10px; background: var(--o-side-hover); }
.coa-asset { color: #1D6FA5; } .coa-liability { color: #B45309; } .coa-equity { color: #6D28D9; } .coa-income { color: #15803D; } .coa-expense { color: #B91C1C; }

/* ---------- Journal voucher grid (SAP Business One style) ---------- */
.sap-grid { border: 1px solid #b9c3cf; border-collapse: collapse; background: #fff; font-size: .86rem; }
[data-bs-theme="dark"] .sap-grid { background: #1d1b22; border-color: #3a3642; }
.sap-grid thead th { background: linear-gradient(#f4f6f8, #e2e7ec); color: #2b3440; font-weight: 600; font-size: .78rem; border: 1px solid #b9c3cf; padding: .35rem .5rem; white-space: nowrap; }
[data-bs-theme="dark"] .sap-grid thead th { background: #2a2730; color: #ddd; border-color: #3a3642; }
.sap-grid tbody td { border: 1px solid #d4dbe3; padding: 0 !important; vertical-align: middle; }
[data-bs-theme="dark"] .sap-grid tbody td { border-color: #34303b; }
.sap-grid tbody tr:nth-child(even) td { background: #f7f9fb; }
[data-bs-theme="dark"] .sap-grid tbody tr:nth-child(even) td { background: #221f27; }
.sap-grid tbody td.line-no { background: linear-gradient(#f4f6f8, #e8ecf0) !important; text-align: center; color: #56606b; font-size: .78rem; width: 3rem; padding: .35rem 0 !important; }
.sap-grid .form-control, .sap-grid .form-select { border: 0 !important; border-radius: 0; background-color: transparent; box-shadow: none !important; padding: .35rem .5rem; min-height: 2rem; font-size: .86rem; }
.sap-grid .form-control:focus, .sap-grid .form-select:focus { background-color: #fff8cf; outline: 1px solid #e0b100; outline-offset: -1px; }
[data-bs-theme="dark"] .sap-grid .form-control:focus, [data-bs-theme="dark"] .sap-grid .form-select:focus { background-color: #3a3420; }
.sap-grid tbody tr:hover td { background: #eef4fb; }
.sap-grid [data-remove-line] { padding: .2rem .5rem; }
.sap-grid tfoot td { border: 0; padding: .3rem .5rem; font-size: .84rem; }
.sap-grid tr.sap-total td { background: #f1f4f7; font-weight: 600; border-top: 1px solid #b9c3cf; }
[data-bs-theme="dark"] .sap-grid tr.sap-total td { background: #26232b; }
