/* app-sales.css: rules that exist in Sales only. The shared Odoo look is css/mysolar-ui.css (loaded first, never edited here).
   Tokens only: var(--odoo-*), no raw hex, no !important. */

/* ===== navbar: the package's o_main_navbar, made sticky; the nine tabs scroll sideways; two-row mode (fitBar) ===== */
header.o_main_navbar { position: sticky; top: 0; z-index: 100; height: auto; min-height: var(--odoo-navbar-h); background: var(--odoo-body-bg); }
header.o_main_navbar.bar-2row { flex-wrap: wrap; padding-bottom: 0; }
header.o_main_navbar #nv { flex: 1 1 auto; margin: 0 0 0 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
header.o_main_navbar #nv::-webkit-scrollbar { display: none; }
header.o_main_navbar.bar-2row #nv { order: 3; flex: 1 1 100%; margin: 6px 0 0; padding: 0 15px 8px; }
header.o_main_navbar .hdr-r { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; }
header.o_main_navbar.bar-2row .hdr-r, header.o_main_navbar.bar-2row #co-wrap { padding-top: 0; padding-bottom: 0; }
header.o_main_navbar .spin { border-color: var(--odoo-gray-300); border-top-color: var(--odoo-primary); }
/* keyboard focus on the nav items, systray buttons and the company chip: the 2px teal outline (4.6:1 on the page grey) */
.o_main_navbar .o_nav_entry:focus-visible, .o_main_navbar .o_navbar_btn:focus-visible, .o_main_navbar .o_user_menu_btn:focus-visible,
.o_main_navbar .co-trigger:focus-visible { outline: 2px solid var(--odoo-link); outline-offset: -2px; box-shadow: none; }
.o_main_navbar .o_navbar_btn[aria-expanded="true"], .o_main_navbar .o_user_menu_btn[aria-expanded="true"] { background: var(--odoo-hover-bg); }
.o_main_navbar .o_navbar_btn { max-width: 240px; }
#who .o_user_menu_btn { max-width: 200px; }
#who .who-name { min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#who[hidden] { display: none; }
@media (max-width: 991.98px) {
  header.o_main_navbar { flex-wrap: wrap; padding: 10px 0 0; }
  header.o_main_navbar .hdr-r { padding-right: 8px; }
  header.o_main_navbar #nv { order: 3; flex: 1 1 100%; margin: 6px 0 0; padding: 0 15px 8px; }
  #who .who-name { display: none; }
}
@media (max-width: 575.98px) {
  .o_main_navbar .o_navbar_btn { padding: 0 6px; }
}

/* dropdown menus are opened by the `hidden` attribute (index.html toggleMenu), not by the package's .show class */
.dropdown-menu:not([hidden]) { display: block; }
.dropdown-menu[hidden] { display: none; }
.dropdown-menu .dropdown-item { display: block; }

/* the period panel (month + fiscal year) */
.dropdown-menu.per-menu { min-width: 260px; padding: 12px 16px 16px; }
.per-menu label { display: block; margin: 12px 0 8px; font-size: var(--odoo-fs-base); font-weight: 500; color: var(--odoo-heading-color); }
.per-menu label:first-child { margin-top: 0; }
.per-row { display: flex; gap: 4px; align-items: center; }
.per-row .btn { flex: 0 0 auto; min-width: 32.3px; padding: 0 8px; font-size: 16px; line-height: 1; }
.per-row .btn:disabled { opacity: .45; }
.per-fy { color: var(--o-muted); }
.o-caret { font-size: 10px; color: var(--odoo-gray-600); }

/* account menu header (name + role) */
#who-menu .who-h { padding: 6px 20px 4px; color: var(--o-muted); white-space: nowrap; }
#who-menu .who-h b { display: block; color: var(--odoo-heading-color); font-weight: 500; font-size: var(--odoo-fs-base); }
#who-menu .who-h .role { text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .3px; color: var(--odoo-primary); }

/* ===== scorecards: markup is o_scorecard* (package); these hooks keep the tile clickable and its sparkline ===== */
.kpi { position: relative; overflow: hidden; }
.kpi[onclick] { cursor: pointer; }
.kpi[onclick]:hover { background: var(--odoo-gray-100); }
.kpi-go { cursor: pointer; }
.kpi-accent { display: none; }
.kpi-val { overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .o_scorecard_value { font-size: var(--odoo-fs-h2); line-height: 1.2; } }

/* ===== buttons the package has no class for: the outlined red button (Terminate, Delete) ===== */
.btn-red { background: var(--odoo-light); border-color: var(--odoo-danger); color: var(--odoo-badge-danger-text); }
.btn-red:hover { background: var(--odoo-danger-bg-subtle); border-color: var(--odoo-danger); color: var(--odoo-badge-danger-text); }

/* ===== (i) info button + its popover: package look, fixed-position popover placed by infoTip() ===== */
.o_info_btn { cursor: pointer; }
.o_info_pop { position: fixed; max-width: calc(100vw - 24px); white-space: normal; }
.o_info_pop[hidden] { display: none; }
@media print { .o_info_pop { display: none; } }

/* ===== list tables: package o_list_table plus what only Sales draws (money columns, bold first column, totals) ===== */
.o_list_table { color: var(--odoo-body-color); }
.o_list_table thead th:last-child, .o_list_table tbody td:last-child, .o_list_table tfoot td:last-child { padding-right: 16px; }
.o_list_table tbody td { font-variant-numeric: tabular-nums; }
.o_list_table tbody td:first-child { font-weight: 500; }
.o_list_table thead th.num, .o_list_table tbody td.num, .o_list_table tfoot td.num { text-align: right; padding-right: 4.8px; }
.o_list_table thead th.num:last-child, .o_list_table tbody td.num:last-child, .o_list_table tfoot td.num:last-child { padding-right: 16px; }
.o_list_table tfoot td { background: var(--odoo-light); text-align: left; }
.o_list_table tfoot td:first-child { padding-left: 16px; }

/* ===== dialogs: package modal; drill-downs are wide, the user dialogs are narrow ===== */
.modal-dialog.usr-modal { max-width: 460px; }
#modal .modal-dialog.modal-lg { max-width: 960px; }
#modal .modal-content, #usr-dlg .modal-content { max-height: 85vh; }

/* the Filters popover is a flex row of columns; the dropdown rule above would make it a block */
.dropdown-menu.o_search_bar_menu:not([hidden]) { display: flex; }

/* ===== cards: package o_card with an o_card_title row; .card .card-h .card-b stay as hooks (JS, print section bars, tests) ===== */
.o_card.card { padding: 0; margin-bottom: 16px; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 16px 0; }
.card-h .o_card_title { margin: 0; }
.card-h small { font-size: var(--odoo-fs-small); font-weight: 400; color: var(--o-muted); }
.card-b { padding: 8px 16px 16px; overflow-x: auto; }

/* the facet pill of the Dashboard period, Entry day/person and Print day: a pill that hugs its facets (not a search box) */
.cp-facets { display: flex; align-items: center; flex-wrap: wrap; flex: 0 1 auto; gap: 8px; min-height: 36.5px; padding: 4px 8px; max-width: 100%;
  background: var(--odoo-light); border: 1px solid var(--odoo-gray-400); border-radius: var(--odoo-radius-pill); }

/* the login "Forgot password?" link button is 23 px high in the CRM login (no vertical padding); the package .btn-link is 33 */
.o_auth_links .btn-link { padding-top: 0; padding-bottom: 0; }

/* login: the green "reset link is on its way" notice sits right under the button, like the CRM login */
#auth-notice { margin: 12px 0 0; }

/* login with the Admin Hub (only shown when the server says so): a full-width button under the form */
.o_auth_hub { margin: 16px 0 0; }
.o_auth_hub .btn { display: block; width: 100%; text-align: center; }

/* Print tab: the Day / Month switch is made of words, not icons */
.pr-mode .o_switch_view { width: auto; padding: 2px 12px; }

/* printing any screen (Reports, Dashboard, Ratios ...): the compact print table of the old page rules, now that tables carry o_list_table
   (its screen sizes would otherwise win), and a card body never clips a wide table at the page edge */
@media print {
  .card-b { overflow: visible; }
  .o_list_table { font-size: 10px; line-height: 1.35; }
  .o_list_table thead th { position: static; height: auto; padding: 4px 6px; font-size: 10px; white-space: normal; background: var(--odoo-gray-100); color: var(--odoo-body-color); }
  .o_list_table tbody tr { height: auto; }
  .o_list_table tbody td, .o_list_table tfoot td { height: auto; padding: 4px 6px; font-size: 10px; white-space: normal; }
}

/* ===== data-entry fields are clear boxes =====
   Users could not see where to type: inside .o_form_sheet and .o-flat the package draws .o_input as a flat bottom line, which reads as plain text.
   Every fillable control there (text, number, date, select, textarea) becomes a bordered white box with the teal focus ring. Read-only / calculated
   values keep the package's plain-text look (no border), so "fill here" and "calculated" are easy to tell apart. A faint teal tint marks the blocks
   where people type. CSS only; checkbox, radio, range, file and hidden inputs are not .o_input and are untouched. */
.o_form_sheet .o_input:not([readonly]), .o-flat .o_input:not([readonly]) {
  height: var(--odoo-input-h); min-height: var(--odoo-input-h); padding: 6px 8px; box-sizing: border-box;
  border: 1px solid var(--odoo-gray-400); border-radius: var(--odoo-radius); background-color: var(--odoo-light);
}
.o_form_sheet textarea.o_input:not([readonly]), .o-flat textarea.o_input:not([readonly]) { height: auto; min-height: 52px; resize: vertical; }
.o_form_sheet .o_input:hover:not([readonly]):not(:disabled), .o-flat .o_input:hover:not([readonly]):not(:disabled) {
  border-color: var(--odoo-gray-500); background-color: var(--odoo-light);
}
.o_form_sheet .o_input:focus:not([readonly]), .o-flat .o_input:focus:not([readonly]) {
  border-color: var(--odoo-focus-border); box-shadow: var(--odoo-focus-ring); outline: 0;
}
.o_form_sheet .o_input:disabled:not([readonly]), .o-flat .o_input:disabled:not([readonly]) {
  border-color: var(--odoo-gray-300); background-color: var(--odoo-gray-100); opacity: .65; cursor: not-allowed;
}
.o_form_sheet .o_input.is-invalid, .o-flat .o_input.is-invalid { border-color: var(--odoo-danger); }
/* selects keep their arrow inside the box (the package flat select reserved 16px at the right edge) */
.o_form_sheet .o_input_select:not([readonly]), .o-flat .o_input_select:not([readonly]) { padding-right: 24px; background-position: right 8px center; }
/* "fill here" cue: faint teal band + accent on the blocks where people type */
.e-zone, .e3 .e3-field, .e-line.o-flat, .e-petty.o-flat {
  background: color-mix(in srgb, var(--odoo-teal-tint) 35%, var(--odoo-light));
  border-left: 3px solid var(--odoo-focus-border); border-radius: var(--odoo-radius); padding: 8px 12px;
}
.e-zone { padding-top: 12px; }
table.o-flat tbody td:has(.o_input:not([readonly]):not(:disabled)) { background: color-mix(in srgb, var(--odoo-teal-tint) 35%, var(--odoo-light)); }
table.o-flat td .o_input:not([readonly]) { min-width: 64px; }
/* inside a list table the box overlaps the cell padding by the difference, so rows stay at the package height (40 px, the shared parity gate) */
table td .o_input:not([readonly]) { margin: calc((23.7px - var(--odoo-input-h)) / 2) 0; }

/* wide screens: the page content keeps a readable width, centred (the navbar stays full width); below 1400 px nothing changes */
@media screen and (min-width: 1440px) {
  main#mn { max-width: 1400px; margin-left: auto; margin-right: auto; }
}
