/* Readability and interaction fixes for the existing operations interface.
   Loaded after page styles so shared controls have consistent, tested states. */
:root {
  color-scheme: light;
  --ui-ink: #243b53;
  --ui-muted: #526477;
  --ui-focus: #155eaa;
  --ui-success: #087665;
  --ui-info: #155d87;
  --ui-danger: #b42332;
  --ui-warning-ink: #472a05;
  --vera-muted: #526477;
  --vera-teal-600: #087665;
  --vera-teal-700: #065f52;
  --cp-primary: #a94013;
  --cp-primary-hover: #89320e;
  --cp-success: #087665;
  --cp-success-hover: #065f52;
  --cp-info: #155d87;
  --cp-danger: #b42332;
  --cp-text-muted: #526477;
  --cp-text-label: #43576b;
}
body :is(.text-muted, .form-text, .help-block, .kpi-label, .stat-title, .statement-selection-note, .empty-state-desc) { color: var(--ui-muted) !important; }
body .text-primary { color: #175a91 !important; }
body :is(.text-success, .total-cost) { color: #086652 !important; }
body .text-info { color: #115d73 !important; }
body .text-warning { color: #805000 !important; }
body .text-danger { color: var(--ui-danger) !important; }
body .left_col .profile_info span,
body .left_col .menu_section h3 { color: #b8c9d9 !important; text-shadow: none; }
body .left_col .sidebar-menu-group-header { color: #c5d4e2 !important; }
body .left_col .nav a:focus-visible { outline-color: #f8bf74 !important; }
body :is(.ui-dark-header, .lead-header, .lead-group-header, .lead-option-header) { color: #fff; }
body :is(.ui-dark-header, .lead-header, .lead-group-header, .lead-option-header) :is(h1,h2,h3,h4,h5,h6) { color: #fff !important; }
body .modal-header { background: #17324d !important; color: #fff !important; }
body .modal-header :is(.modal-title,h1,h2,h3,h4,h5,h6,.close) { color: inherit !important; }
body .modal-header .close { opacity: 1; text-shadow: none; min-width: 36px; min-height: 36px; }
body :is(.bg-primary, .bg-info, .bg-success) { color: #fff !important; }
body .bg-primary { background: #175a91 !important; }
body .bg-info { background: #155d87 !important; }
body .bg-success { background: var(--ui-success) !important; }
body .bg-warning { background: #ffdc8a !important; color: var(--ui-warning-ink) !important; }
body :is(.card-header, .modal-header).bg-warning :is(h2,h3,h4,h5,h6,span,.text-white) { color: var(--ui-warning-ink) !important; }
body :is(.card-header.bg-info,.card-header.bg-success,.card-header.bg-primary) :is(h2,h3,h4,h5,h6) { color: #fff !important; }
body .btn.btn-success { background: var(--ui-success) !important; border-color: var(--ui-success) !important; color: #fff !important; }
body .btn.btn-success:hover { background: #065f52 !important; }
body .btn.btn-info { background: var(--ui-info) !important; border-color: var(--ui-info) !important; color: #fff !important; }
body .btn.btn-danger { background: var(--ui-danger) !important; border-color: var(--ui-danger) !important; color: #fff !important; }
body .btn.btn-warning { background: #f5b341 !important; border-color: #c88a1a !important; color: var(--ui-warning-ink) !important; }
body .btn.btn-warning:hover { background: #e8a02b !important; }
body .btn.btn-outline-primary { color: #175a91 !important; border-color: #175a91 !important; }
body .btn.btn-outline-primary:hover { color: #fff !important; background: #175a91 !important; }
body .btn.btn-outline-light { color: #fff !important; }
body .btn.btn-outline-light:hover { color: #17324d !important; background: #fff !important; }
body .btn-action-edit, body .table .btn-warning { color: #ffffff !important; }
body .btn-action-edit,
body .edit-btn,
body .btn-action-delete,
body .delete-btn,
body .btn-action-clone,
body .clone-btn {
  white-space: nowrap !important;
  word-break: keep-all !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  line-height: 1.2 !important;
  min-width: 68px !important;
}
body .btn-action-delete,
body .delete-btn {
  min-width: 76px !important;
}
body table td:has(.edit-btn),
body table td:has(.delete-btn),
body table.table td:has(.edit-btn),
body table.table td:has(.delete-btn),
body table.dataTable td:has(.edit-btn),
body table.dataTable td:has(.delete-btn) {
  white-space: nowrap !important;
  width: 1% !important;
  text-align: center !important;
  vertical-align: middle !important;
}
body table td > .edit-btn,
body table td > .delete-btn,
body table td > .clone-btn {
  white-space: nowrap !important;
  word-break: keep-all !important;
  flex-shrink: 0 !important;
}
body :is(.badge-success,.badge-info,.badge-primary) { color: #fff !important; }
body .badge-success { background: var(--ui-success) !important; }
body .badge-info { background: var(--ui-info) !important; }
body .badge-primary { background: #175a91 !important; }
body .badge-warning { color: var(--ui-warning-ink) !important; background: #ffdc8a !important; }
body .alert-danger { color: #8e1b28 !important; background: #fce8eb !important; border-color: #d7929b !important; }
body .alert-warning { color: #684200 !important; background: #fff3cd !important; border-color: #cfaf62 !important; }
body .alert-success { color: #095d47 !important; background: #e3f3ec !important; border-color: #8cbbad !important; }
body .alert-info { color: #174f72 !important; background: #e6f2fa !important; border-color: #8db4cf !important; }
body .alert .close { color: inherit !important; opacity: 1; text-shadow: none; }
body .toast-item.toast-error { background: #a82b36 !important; }
body .toast-close { color: var(--ui-muted); min-width: 32px; min-height: 32px; }
body .toast-message { color: var(--ui-muted); font-size: 14px; }
body .tab-count { color: #294b61 !important; }
body .nav-tabs .nav-link:not(.active) { color: #435568 !important; }
body .nav-tabs .nav-link.active { color: #174f72 !important; }
body .button-save { color: #fff !important; background: #087665 !important; }
body .button-print { color: #fff !important; background: #155d87 !important; }
body :is(input, select, textarea)::placeholder { color: #596b7c !important; opacity: 1; }
body select option { color: var(--ui-ink); background: #fff; }
body .form-control[readonly] { color: #384c60 !important; background: #edf1f5 !important; }
body .form-control:disabled { color: #526477 !important; opacity: 1; }
body :is(a,button,input,select,textarea,[tabindex]):focus-visible {
  outline: 3px solid var(--ui-focus) !important; outline-offset: 3px !important;
}
body .modal-header :focus-visible { outline-color: #ffdc8a !important; }
body ::selection { color: #10263d; background: #ffe0a7; }
body :is(input,textarea) { caret-color: var(--ui-focus); }
body .table { font-variant-numeric: tabular-nums; }
body table.table thead tr th, body table.dataTable thead tr th { font-size: 12px !important; line-height: 1.45; }
body .filter-container .filter-group label { font-size: 12px !important; text-transform: none !important; letter-spacing: 0 !important; }
body .filter-container .form-control { font-size: 14px !important; }
.ui-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.ui-table-scroll:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 2px; }
.ui-table-scroll, .table-responsive { scrollbar-color: #71879c #edf1f5; }
.login-session-notice { color: #174f72; background: #e6f2fa; padding: 12px 16px; border: 1px solid #8db4cf; border-radius: 6px; line-height: 1.5; }
.ui-skip-link { position: fixed; top: -80px; left: 16px; z-index: 100000; padding: 12px 18px; background: #fff; color: #17324d; }
.ui-skip-link:focus { top: 12px; }
@media (max-width: 767px) {
  body .ui-editor-body { padding: 20px 12px !important; }
  body .ui-editor-panel { padding: 20px 16px !important; }
  body .ui-dark-header { padding: 20px 16px !important; }
  body .ui-dark-header > div { flex-wrap: wrap; gap: 12px; }
  body .ui-dark-header h1 { font-size: 24px !important; }
  body .container { max-width: 100% !important; }
  body .row > [class*="col-"] { min-width: 0; }
  body :is(.form-control,.custom-select,.select2-container) { max-width: 100%; }
  body :is(input.form-control,select.form-control,textarea.form-control) { font-size: 16px !important; }
  body :is(.btn, .pagination .page-link, .input-group-append .btn) { min-height: 44px; }
  body :is(.btn-xs,.btn-sm,.btn-action-edit,.btn-action-clone,.btn-action-delete) { min-width: 44px; }
  body .filter-container .form-control { height: 44px !important; }
  body :is(.filter-container,.x_panel) { padding: 14px !important; }
  body :is(.lead-option-content,.service-section .card-body) { padding: 12px; min-width: 0; }
  body :is(.lead-header,.lead-option-header) .text-right { margin-top: 12px; text-align: left !important; }
  body .modal-body { max-height: calc(100dvh - 170px); }
  body .modal-footer { flex-wrap: wrap; gap: 8px; }
  body .sticky-quotation-dock { left: 12px; right: 12px; bottom: 12px; }
  body .sticky-quotation-dock .dock-content { flex-wrap: wrap; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .toast-card, .sticky-quotation-dock, .service-card { animation: none !important; transform: none !important; transition-property: opacity, color, background-color !important; transition-duration: 150ms !important; }
  .toast-progress-bar { transition: none !important; }
}
@media print {
  .ui-skip-link { display: none; }
  .ui-table-scroll { overflow: visible; }
}

body .hero-kpi-chip .kpi-label { color: #c4d2df !important; }
body .login-tab-btn { color: #526477; }

@media (max-width: 767px) {
  body .btn-group.d-flex { flex-wrap: wrap; gap: 8px; }
  body .btn-group.d-flex > .btn { flex: 1 1 100px; margin-left: 0; border-radius: 6px !important; }
}

body :is(.badge-info,.badge-primary,.badge-success) span { color: inherit !important; }
