/* ==========================================================================
   LOGISTIC KVA - MODERN ENTERPRISE DESIGN SYSTEM
   Brand: DEVYT Trading & Logistic (Refined Navy & Sky Blue)
   ========================================================================== */

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  --nav: #0f172a;
  --nav-surface: #1e293b;
  --nav-hover: rgba(255, 255, 255, 0.08);
  --nav-active: #0284c7;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-subtle: #f1f5f9;
  --brand: #0284c7;
  --brand-hover: #0369a1;
  --brand-accent: #38bdf8;
  --soft: #f0f9ff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom modern scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

button, input, select, textarea {
  font: inherit;
}
button, a, input, select, summary {
  touch-action: manipulation;
}

/* Base button styles */
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #1e293b;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.25;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}
.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.2);
}
.primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}
.secondary {
  background: #f8fafc;
  color: #0369a1;
  border-color: #bae6fd;
}
.secondary:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
}
.danger {
  color: var(--danger);
  border-color: #fecaca;
}
.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}
.small {
  padding: 5px 9px;
  font-size: 0.78rem;
  border-radius: 5px;
}
.text-button {
  background: transparent;
  border-color: transparent;
  color: var(--brand);
  padding: 4px 8px;
}
.text-button:hover {
  background: rgba(2, 132, 199, 0.08);
  border-color: transparent;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Inputs & Form Controls */
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  padding: 7px 10px;
  color: var(--ink);
  min-height: 36px;
  font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}
input[readonly] {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}
input[aria-invalid=true], select[aria-invalid=true] {
  border-color: var(--danger);
  background: #fef2f2;
}
input[type=checkbox] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--brand);
}
textarea {
  resize: vertical;
  min-height: 75px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  min-width: 0;
}
.field small {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
}
.field .field-error {
  color: var(--danger);
  min-height: 0;
  font-size: 0.74rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ==========================================================================
   SHELL & ODOO ENTERPRISE TOP NAVBAR LAYOUT (Clean Light Modern)
   ========================================================================== */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  background: #f8fafc;
}

/* Odoo Main Navbar (Top bar) */
.odoo-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 50px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  user-select: none;
}

.odoo-navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  min-width: 0;
}

.odoo-brand {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding-right: 14px;
  border-right: 1px solid #edf2f7;
  height: 32px;
  flex-shrink: 0;
}

.odoo-brand .brand-logo {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}

.odoo-menu {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
}

.odoo-nav-btn {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.odoo-nav-btn:hover {
  background: #f1f5f9;
  color: #005186;
}

.odoo-nav-btn.active {
  background: #edf6fc;
  color: #005186;
  font-weight: 600;
}

.odoo-dropdown {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.dropdown-caret {
  transition: transform 0.15s ease;
  color: #94a3b8;
  margin-left: 2px;
}

.odoo-dropdown:hover .dropdown-caret,
.odoo-dropdown.open .dropdown-caret {
  transform: rotate(180deg);
  color: #005186;
}

.odoo-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% - 3px);
  left: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  padding: 5px;
  z-index: 200;
  animation: odooDropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes odooDropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.odoo-dropdown:hover .odoo-dropdown-menu,
.odoo-dropdown.open .odoo-dropdown-menu {
  display: block;
}

.odoo-menu-item,
.odoo-dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left !important;
  padding: 8px 14px;
  border-radius: 6px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.odoo-menu-item:hover,
.odoo-dropdown-item:hover {
  background: #f1f5f9;
  color: #005186;
  font-weight: 600;
}

.odoo-menu-item.active,
.odoo-dropdown-item.active {
  background: #edf6fc;
  color: #005186;
  font-weight: 600;
}

.active-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: #bae6fd;
  color: #0369a1;
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #64748b;
}

.odoo-nav-btn:hover .nav-icon,
.odoo-nav-btn.active .nav-icon,
.odoo-dropdown-item:hover .nav-icon,
.odoo-dropdown-item.active .nav-icon {
  color: #005186;
}

/* Odoo Systray (Right) */
.odoo-systray {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.account-pill .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.account-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.user-role {
  font-size: 10px;
  color: #64748b;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: #dc2626;
  border-radius: 4px;
  border: 1px solid #fee2e2;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.12s;
  margin-left: 4px;
}

.logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.odoo-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px;
  color: #475569;
  cursor: pointer;
}

.mobile-navigation {
  display: none;
}

/* Control Panel (Breadcrumb & Subheader Bar) */
.control-panel {
  position: sticky;
  top: 50px;
  z-index: 30;
  height: 42px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #64748b;
}

.bc-section {
  color: #64748b;
  font-weight: 500;
}

.bc-separator {
  color: #cbd5e1;
}

.bc-page {
  color: #0f172a;
  font-weight: 600;
}

/* Main Content Area */
.main {
  flex: 1 0 auto;
  min-width: 0;
  width: 100%;
  background: #f8fafc;
}

/* Full-Width Workspace Container (100% Horizontal Expansion) */
.workspace {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 16px 24px 48px;
  box-sizing: border-box;
}

/* Page Header */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 4px;
}
h1 {
  font-size: 1.45rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #0f172a;
  margin: 0 0 4px;
}
h2 {
  font-size: 0.98rem;
  font-weight: 650;
  color: #0f172a;
  margin: 0;
}
h3 {
  font-size: 0.9rem;
  font-weight: 650;
  margin: 0 0 10px;
}
p {
  line-height: 1.5;
  margin: 0 0 12px;
}
.muted {
  color: var(--muted);
  font-size: 0.82rem;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Cards & Panels */
.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.panel-title {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-body {
  padding: 18px;
}
.step {
  font-size: 0.72rem;
  color: var(--brand);
  background: var(--soft);
  border-radius: 4px;
  padding: 2px 6px;
  margin-right: 8px;
  font-weight: 700;
}
.pricing-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(370px, 1fr);
  gap: 18px;
  align-items: start;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.full {
  grid-column: 1 / -1;
}
.section-divider {
  grid-column: 1 / -1;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 650;
  color: #334155;
}

/* Tabs & Segmented Navigation */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 8px;
  width: max-content;
  margin-bottom: 18px;
  border: 1px solid #e2e8f0;
}
.tabs button {
  border: 0;
  background: transparent;
  color: #64748b;
  min-width: 130px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 6px;
}
.tabs button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Sub-nav tabs for modules like Ocean Freight / Ocean Bookings */
.sub-nav-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.sub-nav-tab, .tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
  border-radius: 6px 6px 0 0;
}
.sub-nav-tab:hover, .tab-btn:hover {
  color: var(--brand);
  background: rgba(2, 132, 199, 0.05);
}
.sub-nav-tab.active, .tab-btn.active {
  color: var(--brand);
  font-weight: 700;
  border-bottom-color: var(--brand);
  background: transparent;
}

/* Clean Notifications & Alerts */
.hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.notice {
  padding: 11px 14px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  border-radius: 7px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 14px;
  color: #0369a1;
}
.notice.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.errors {
  padding: 12px 16px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  border-radius: 7px;
  color: #b91c1c;
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.errors ul {
  padding-left: 18px;
  margin: 5px 0;
}

/* Metrics & Values */
.kpi-stack {
  padding: 4px 18px;
}
.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.metric:last-child {
  border-bottom: 0;
}
.metric .label {
  font-size: 0.82rem;
  color: #475569;
}
.metric small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 3px;
}
.metric .value {
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  color: #0f172a;
}
.metric .value small {
  display: inline;
  font-size: 0.78rem;
  font-weight: 400;
}
.metric.main-price .value {
  font-size: 1.5rem;
  color: var(--brand-hover);
}
.positive {
  color: #059669;
}
.negative {
  color: var(--danger);
}
.total-bar {
  background: #0f172a;
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 7px;
}
.total-bar span {
  font-size: 0.82rem;
  color: #94a3b8;
}
.total-bar strong {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.result-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.result-empty .empty-symbol {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 10px;
}
.result-foot {
  padding: 12px 18px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}
.resolved {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.resolved div {
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
  min-width: 0;
}
.resolved dt {
  font-size: 0.74rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.resolved dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Modern Badge System */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}
.badge.green {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge.red {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.badge.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge.yellow {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge.purple {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
}

/* Clean Data Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 7px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
  text-align: left;
}
th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  padding: 10px 14px;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}
tbody tr:hover {
  background: #f8fafc;
}
td.num, th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
tfoot td {
  font-weight: 700;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}
.nowrap {
  white-space: nowrap;
}
.subline {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--muted);
}
summary {
  cursor: pointer;
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 600;
}
summary:hover {
  background: #f8fafc;
}
.bottom-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}
.stat-strip {
  display: flex;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  font-size: 0.82rem;
}
.stat-strip strong {
  font-size: 1.15rem;
  margin-right: 4px;
}
.catalog-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.catalog-tools .field {
  min-width: 200px;
}
.catalog-tools .search {
  flex: 1;
}
.empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}

/* Modals & Dialogs */
dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  width: min(780px, calc(100vw - 32px));
  max-height: 88vh;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  color: var(--ink);
  background: #ffffff;
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
dialog .panel-title {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}
dialog .panel-body {
  max-height: 65vh;
  overflow-y: auto;
}
dialog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
  line-height: 1.5;
}

/* Login Page */
.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-story {
  background: var(--nav);
  color: #ffffff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-story .brand {
  margin: 0;
  padding: 0;
  border: 0;
  justify-content: flex-start;
}
.login-story h1 {
  font-size: 2.4rem;
  max-width: 420px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  color: #ffffff;
}
.login-story p {
  color: #94a3b8;
  max-width: 400px;
}
.login-caption {
  border-top: 1px solid #1e293b;
  padding-top: 18px;
  color: #64748b;
  font-size: 0.8rem;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  background: #ffffff;
}
.login-form {
  width: min(100%, 360px);
}
.login-form h1 {
  margin-bottom: 8px;
}
.login-form .field {
  margin-bottom: 14px;
}
.login-form .primary {
  width: 100%;
  margin-top: 6px;
}
.login-kicker {
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Toast Notifications */
#toast {
  position: fixed;
  top: 20px;
  right: 24px;
  background: #0f172a;
  border-left: 4px solid var(--brand);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 7px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  max-width: min(420px, 90vw);
  font-size: 0.84rem;
  display: none;
  pointer-events: none;
}
#toast.visible {
  display: block;
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
.version-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.version-control select {
  width: auto;
}
.audit-detail {
  max-width: 500px;
  max-height: 200px;
  overflow: auto;
  font-family: monospace;
  font-size: 0.72rem;
  white-space: pre-wrap;
}
.source-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.source-metrics .panel {
  margin: 0;
  padding: 16px;
}
.source-metrics strong {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 6px;
}

/* Master-Detail Vertical Layout (Danh mục & định mức) */
.master-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.master-sidebar {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  position: sticky;
  top: 100px;
  overflow: hidden;
}

.master-sidebar-title {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.master-sidebar-title .count-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.master-vertical-nav {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}

.master-nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.master-nav-item:hover {
  background: #f1f5f9;
  color: #005186;
}

.master-nav-item.active {
  background: #edf6fc;
  color: #005186;
  font-weight: 600;
  border-left: 3px solid #005186;
}

.master-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.master-item-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.master-nav-item.active .master-item-count {
  background: #bae6fd;
  color: #0369a1;
}

.master-sidebar-hint {
  padding: 12px 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  background: #fafbfc;
}

.master-content {
  min-width: 0;
}

.master-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.master-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  background: #ffffff;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-wrap: wrap;
}

.master-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.master-search-wrap .search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  pointer-events: none;
}

.master-search-wrap input {
  padding-left: 34px;
  height: 36px;
  font-size: 13px;
}

.master-inactive-check {
  font-size: 12px;
  color: #475569;
  margin: 0;
  white-space: nowrap;
}

.master-records-badge {
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
  background: #e0f2fe;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .master-layout {
    grid-template-columns: 1fr;
  }
  .master-sidebar {
    position: static;
  }
  .master-vertical-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px;
  }
}
.derived-master {
  background: var(--soft);
  padding: 16px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  margin-top: 18px;
}
.derived-master input {
  font-weight: 650;
  background: #ffffff;
}
.derived-master p {
  margin-top: 10px;
  margin-bottom: 0;
}

/* Dashboard Styles */
.dashboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.kpi-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.kpi-card.highlight-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-color: #bae6fd;
}
.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kpi-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kpi-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 3px;
}
.kpi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.tag-item {
  font-size: 0.72rem;
  color: #475569;
}
.action-panel {
  border-left: 4px solid var(--brand);
}
.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
  gap: 12px;
}
.action-icon {
  font-size: 1.1rem;
}
.action-details {
  flex: 1;
  font-size: 0.84rem;
}
.action-reason {
  font-size: 0.75rem;
}
.text-warning {
  color: #b45309;
}
.dashboard-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}

/* Unified Odoo Standard Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  box-sizing: border-box;
  min-height: 44px;
}
.pagination-info {
  font-size: 0.82rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-info strong {
  color: #0f172a;
  font-weight: 600;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pagesize-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
}
.pagesize-select {
  padding: 3px 8px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  min-height: 28px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pagesize-select:focus {
  border-color: #005186;
  box-shadow: 0 0 0 2px rgba(0, 81, 134, 0.15);
}
.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pag-btn {
  padding: 3px 8px !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  min-height: 28px !important;
  min-width: 28px !important;
  border-radius: 5px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.12s ease !important;
  line-height: 1 !important;
}
.pag-btn:hover:not(:disabled) {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #005186 !important;
}
.pag-btn:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
.page-indicator, .page-current {
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  padding: 0 6px;
  white-space: nowrap;
}
.page-indicator strong, .page-current strong {
  color: #0f172a;
  font-weight: 700;
}

/* Print Styles */
#print-area {
  display: none;
}
.devyt-print-wrapper {
  font-family: "Times New Roman", Times, serif;
  color: #000;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.35;
}
.devyt-hdr-tbl {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}
.devyt-hdr-tbl td {
  border: 0 !important;
  padding: 0 !important;
  vertical-align: middle;
}
.devyt-hdr-logo {
  width: 135px;
  text-align: left;
}
.devyt-hdr-logo img {
  max-width: 130px;
  max-height: 48px;
  display: block;
}
.devyt-hdr-co {
  text-align: center;
  padding: 0 8px !important;
}
.devyt-co-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a3b68;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.devyt-co-addr, .devyt-co-contact {
  font-size: 10.5px;
  font-style: italic;
  line-height: 1.35;
  color: #222;
}
.devyt-hdr-iso {
  width: 160px;
  text-align: left;
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
}
.devyt-title-box {
  text-align: center;
  margin: 12px 0 8px 0;
}
.devyt-doc-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0 0 3px 0;
  text-transform: uppercase;
}
.devyt-doc-ref {
  font-size: 11.5px;
  font-style: italic;
  color: #333;
}
.devyt-salutation-box {
  margin-bottom: 8px;
  font-size: 13px;
}
.devyt-salut-row {
  margin-bottom: 3px;
  line-height: 1.35;
}
.devyt-cust-name {
  font-size: 13.5px;
}
.devyt-cust-code {
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
  color: #444;
}
.devyt-salut-p {
  margin: 2px 0;
  line-height: 1.35;
}
.devyt-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #000;
  margin-bottom: 8px;
}
.devyt-table th, .devyt-table td {
  border: 1px solid #000;
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.3;
}
.devyt-table th {
  background: #f6f6f6;
  font-weight: 700;
  text-align: center;
}
.devyt-table .col-stt {
  width: 36px;
  text-align: center;
}
.devyt-table .col-service {
  text-align: left;
}
.devyt-table .col-unit {
  width: 95px;
  text-align: center;
}
.devyt-table .col-price {
  width: 115px;
  text-align: right;
}
.devyt-table .col-note {
  width: 160px;
  text-align: left;
}
.devyt-sec-header td {
  background: #fafafa;
  font-weight: 700;
  padding-left: 6px;
}
.devyt-totals-tbl {
  width: 340px;
  margin-left: auto;
  margin-top: 4px;
  margin-bottom: 8px;
  border-collapse: collapse;
}
.devyt-totals-tbl td {
  padding: 2.5px 0;
  font-size: 12.5px;
  border: 0;
}
.devyt-totals-tbl .lbl {
  text-align: right;
  padding-right: 12px;
}
.devyt-totals-tbl .val {
  text-align: right;
  white-space: nowrap;
}
.devyt-totals-tbl .grand-total td {
  border-top: 1px solid #000;
  padding-top: 4px;
  font-size: 13.5px;
}
.devyt-notes-box {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 12px;
}
.devyt-notes-box p {
  margin: 2px 0;
}
.devyt-sign-tbl {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  page-break-inside: avoid;
  break-inside: avoid;
}
.devyt-sign-tbl td {
  border: 0;
  vertical-align: top;
  text-align: center;
  width: 50%;
  padding: 0 10px;
}
.devyt-sign-tbl .sign-title {
  font-size: 13px;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.devyt-sign-tbl .sign-hint {
  font-size: 11px;
  font-style: italic;
  color: #333;
}
.devyt-sign-tbl .sign-space {
  height: 50px;
}
@media print {
  @page {
    size: A4 portrait;
    margin: 0.8cm;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    font-family: "Times New Roman", Times, serif !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #app, #toast, #modal {
    display: none !important;
  }
  #print-area {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: #fff !important;
    color: #000 !important;
  }
  .devyt-print-wrapper {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  table {
    border-collapse: collapse;
  }
  tr {
    break-inside: avoid;
  }
}

/* Dialog & Responsive Overrides */
dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  overflow: hidden;
}
dialog > .panel-title, dialog > .bottom-actions {
  flex-shrink: 0;
}
dialog > .panel-body {
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .workspace {
    padding: 18px;
  }
  .topbar {
    padding: 0 18px;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 10px 14px;
  }
  .brand {
    margin-bottom: 8px;
  }
  .sidebar-footer, .nav-section-title {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
  }
  .nav button {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 7px 10px;
  }
  .nav-icon {
    display: none;
  }
  .topbar {
    height: 50px;
    padding: 8px 14px;
  }
  .breadcrumb {
    display: none;
  }
  .account {
    width: 100%;
  }
  .account button {
    margin-left: auto;
  }
  .workspace {
    padding: 16px 12px;
  }
  .dashboard-tables-grid {
    grid-template-columns: 1fr;
  }
}

/* Whole parameter sets */
.pv-current { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px; margin:16px 0; }
.pv-current h3 { margin:8px 0 4px; }
.pv-current p { margin:0; }
.pv-changed { background:#eff8ff; }
.pv-changed .subline { color:#005186; font-weight:600; }
.pv-legacy { margin-top:16px; padding:14px; }
.pv-legacy summary { cursor:pointer; font-weight:600; }
.pv-legacy .table-wrap { margin-top:12px; }
#parameter-form .section-divider { grid-column:1/-1; }
#parameter-form input:disabled, #parameter-form textarea:disabled { color:#1e293b; opacity:1; background:#f1f5f9; }
#parameter-form input:focus-visible, #parameter-form textarea:focus-visible { outline:2px solid #005186; outline-offset:2px; }
@media(max-width:800px) {
 .pv-current { flex-direction:column; align-items:stretch; }
 #parameter-form .form-grid { grid-template-columns:minmax(0,1fr); }
 .pv-current .actions { flex-wrap:wrap; }
}

@media(max-width:800px) {
 .shell:has(.parameter-versions-layout) .odoo-menu { display:none; }
 .shell:has(.parameter-versions-layout) .odoo-navbar { padding:0 12px; }
 .shell:has(.parameter-versions-layout) .account-meta { display:none; }
 .shell:has(.parameter-versions-layout) .control-panel { height:auto; flex-direction:column; align-items:stretch; padding:8px 12px; }
 .shell:has(.parameter-versions-layout) .mobile-navigation { display:flex; align-items:center; gap:8px; }
 .shell:has(.parameter-versions-layout) .mobile-navigation span { white-space:nowrap; }
}

@media(max-width:800px) {
 .shell:has(.parameter-versions-layout) .odoo-search-trigger { padding:6px; margin-right:0; color:#005186; }
 .shell:has(.parameter-versions-layout) .odoo-search-trigger span { display:none; }
 .shell:has(.parameter-versions-layout) .odoo-navbar { gap:8px; }
}

/* Keep large full-table editors inside the dialog and allow keyboard-accessible horizontal scrolling. */
#modal:has(#master-version-form){width:min(1280px,calc(100vw - 32px));max-width:calc(100vw - 32px)}
.mv-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0 8px}
.mv-tools input{flex:1;min-width:180px}
.mv-grid{max-width:100%;overflow:auto}
.mv-grid table{width:max-content;min-width:100%}
.mv-grid td input,.mv-grid td select{width:155px;min-width:130px;margin:0}
.mv-grid th{max-width:180px;white-space:normal}
.mv-grid input[aria-invalid=true],.mv-grid select[aria-invalid=true]{border-color:#b91c1c;outline:2px solid #fecaca}
.mv-grid [hidden]{display:none}
@media(max-width:800px){#modal:has(#master-version-form){width:calc(100vw - 16px);max-width:calc(100vw - 16px)}.mv-tools{align-items:stretch}.mv-tools input{min-width:0;flex-basis:100%}}

/* Quotation typography at actual A4 size; isolated from other printed forms. */
.quote-print.devyt-print-wrapper{font-size:12pt;line-height:1.35}
.quote-print .devyt-co-name{font-size:12pt;letter-spacing:0}
.quote-print .devyt-co-addr,.quote-print .devyt-co-contact,
.quote-print .devyt-hdr-iso,.quote-print .devyt-doc-ref,
.quote-print .devyt-cust-code,.quote-print .sign-hint{font-size:9.5pt}
.quote-print .devyt-hdr-logo{width:28mm}
.quote-print .devyt-hdr-logo img{max-width:26mm}
.quote-print .devyt-hdr-iso{width:39mm;white-space:normal}
.quote-print .devyt-doc-title{font-size:16pt}
.quote-print .devyt-salutation-box,.quote-print .devyt-cust-name,
.quote-print .devyt-notes-box,.quote-print .sign-title{font-size:12pt}
.quote-print .devyt-table{table-layout:fixed}
.quote-print .devyt-table th{position:static;text-transform:none;letter-spacing:0;color:#000;word-break:normal}
.quote-print .devyt-table td{color:#000}
.quote-print .devyt-table .col-stt,.quote-print .devyt-table .col-unit{white-space:nowrap}
.quote-print .devyt-table th.col-service,.quote-print .devyt-table th.col-vehicle,.quote-print .devyt-table th.col-discount{overflow-wrap:normal}
.quote-print .devyt-table th,.quote-print .devyt-table td{font-size:12pt;line-height:1.3;padding:4px 3px;white-space:normal;overflow-wrap:anywhere}
.quote-print .devyt-table .col-stt{width:5%!important;min-width:0!important}
.quote-print .devyt-table .col-service{width:22%!important;min-width:0!important}
.quote-print .devyt-table .col-vehicle{width:9%!important;min-width:0!important}
.quote-print .devyt-table .col-unit{width:8%!important;min-width:0!important}
.quote-print .devyt-table .col-qty{width:4%!important;min-width:0!important}
.quote-print .devyt-table .col-price{width:12%!important;min-width:0!important}
.quote-print .devyt-table .col-discount{width:8%!important;min-width:0!important}
.quote-print .devyt-table .col-net-price{width:12%!important;min-width:0!important}
.quote-print .devyt-table .col-amount{width:13%!important;min-width:0!important}
.quote-print .devyt-table .col-note{width:7%!important;min-width:0!important}
.quote-print .devyt-totals-tbl{width:70%!important}
.quote-print .devyt-totals-tbl td{font-size:12pt}
.quote-print .devyt-totals-tbl .grand-total td{font-size:12pt}
@media print{
 body:has(.quote-print)>:not(#print-area){display:none!important}
 .quote-print.devyt-print-wrapper{padding:0!important;font-size:12pt!important;break-inside:auto;page-break-inside:auto}
 .quote-print .devyt-table thead{display:table-header-group}
 .quote-print .devyt-totals-tbl{break-inside:avoid}
}
