/* KVPL Rubber Contract System — Apple-inspired interface layer
   UI-only overrides. Existing template hooks and backend behaviour are preserved. */

:root {
  --ui-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ui-bg: #f5f5f7;
  --ui-surface: #ffffff;
  --ui-surface-2: #fbfbfd;
  --ui-sidebar: rgba(250, 250, 252, .90);
  --ui-text: #1d1d1f;
  --ui-muted: #6e6e73;
  --ui-faint: #8e8e93;
  --ui-border: rgba(60, 60, 67, .14);
  --ui-border-strong: rgba(60, 60, 67, .24);
  --ui-blue: #0071e3;
  --ui-blue-hover: #0077ed;
  --ui-blue-soft: rgba(0, 113, 227, .10);
  --ui-green: #248a3d;
  --ui-orange: #c93400;
  --ui-red: #d70015;
  --ui-purple: #8944ab;
  --ui-radius: 16px;
  --ui-radius-sm: 11px;
  --ui-shadow: 0 1px 2px rgba(0,0,0,.03), 0 8px 24px rgba(0,0,0,.055);
  --ui-shadow-raised: 0 16px 44px rgba(0,0,0,.12);
}

html[data-kvpl-theme="dark"] {
  --ui-bg: #000000;
  --ui-surface: #1c1c1e;
  --ui-surface-2: #242426;
  --ui-sidebar: rgba(20, 20, 22, .92);
  --ui-text: #f5f5f7;
  --ui-muted: #a1a1a6;
  --ui-faint: #8e8e93;
  --ui-border: rgba(255,255,255,.12);
  --ui-border-strong: rgba(255,255,255,.22);
  --ui-blue: #2997ff;
  --ui-blue-hover: #409cff;
  --ui-blue-soft: rgba(41, 151, 255, .15);
  --ui-green: #30d158;
  --ui-orange: #ff9f0a;
  --ui-red: #ff453a;
  --ui-purple: #bf5af2;
  --ui-shadow: 0 1px 2px rgba(0,0,0,.20), 0 12px 32px rgba(0,0,0,.24);
}

html, body { font-family: var(--ui-font) !important; }
body.kvpl-modern-shell { background: var(--ui-bg) !important; color: var(--ui-text) !important; font-size: 14px; letter-spacing: -.01em; }
body.kvpl-modern-shell *, body.kvpl-modern-shell *::before, body.kvpl-modern-shell *::after { font-family: inherit; }

/* Navigation */
.kvpl-sidebar {
  width: 256px !important;
  padding: 14px 12px !important;
  background: var(--ui-sidebar) !important;
  border-right: 1px solid var(--ui-border) !important;
  box-shadow: none !important;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.sidebar-brand { min-height: 56px !important; margin: 0 2px 10px !important; padding: 8px !important; border: 0 !important; border-radius: 12px !important; background: transparent !important; }
.brand-logo-shell { width: 38px !important; height: 38px !important; border-radius: 10px !important; background: #fff !important; border: 1px solid var(--ui-border) !important; box-shadow: 0 1px 4px rgba(0,0,0,.07) !important; }
.brand-logo-shell img { width: 31px !important; height: auto !important; }
.brand-name { color: var(--ui-text) !important; font-size: 14px !important; font-weight: 650 !important; letter-spacing: -.02em !important; }
.brand-sub { color: var(--ui-muted) !important; font-size: 12px !important; font-weight: 500 !important; }
.brand-chevron { display: none !important; }
.sidebar-user-switcher { margin: 0 2px 14px !important; padding: 9px !important; border: 1px solid var(--ui-border) !important; border-radius: 12px !important; background: var(--ui-surface) !important; box-shadow: 0 1px 2px rgba(0,0,0,.025) !important; }
.sidebar-primary-action { display:flex; align-items:center; justify-content:center; gap:8px; min-height:38px; margin:0 2px 12px; border-radius:10px; background:var(--ui-blue); color:#fff; font-size:12px; font-weight:620; text-decoration:none; box-shadow:0 4px 12px rgba(0,113,227,.18); }
.sidebar-primary-action:hover { background:var(--ui-blue-hover); color:#fff; }
.user-avatar { width: 32px !important; height: 32px !important; background: linear-gradient(145deg, #0a84ff, #0064c8) !important; color: #fff !important; border: 0 !important; font-size: 12px !important; }
.user-name { color: var(--ui-text) !important; font-size: 12px !important; font-weight: 600 !important; }
.user-role { color: var(--ui-muted) !important; font-size: 12px !important; }
.online-dot { background: #30d158 !important; }
.sidebar-nav { padding: 0 2px 12px !important; }
.nav-section-label { padding: 10px 10px 5px !important; color: var(--ui-faint) !important; font-size: 12px !important; font-weight: 650 !important; letter-spacing: .08em !important; }
.sidebar-nav .nav-link { min-height: 36px !important; padding: 8px 10px !important; gap: 10px !important; border-radius: 9px !important; color: var(--ui-muted) !important; font-size: 12px !important; font-weight: 520 !important; transition: background .16s ease, color .16s ease !important; }
.sidebar-nav .nav-link i { width: 17px !important; color: var(--ui-muted) !important; font-size: 15px !important; }
.sidebar-nav .nav-link:hover { background: rgba(120,120,128,.10) !important; color: var(--ui-text) !important; transform: none !important; }
.sidebar-nav .nav-link.active { background: var(--ui-blue-soft) !important; color: var(--ui-blue) !important; box-shadow: none !important; }
.sidebar-nav .nav-link.active i { color: var(--ui-blue) !important; }
.sidebar-notification-badge { background: var(--ui-red) !important; color: #fff !important; box-shadow: none !important; }
.sidebar-footer { border-top: 1px solid var(--ui-border) !important; padding: 10px 2px 0 !important; }
.sidebar-footer-link { min-height: 34px !important; padding: 7px 10px !important; border-radius: 9px !important; color: var(--ui-muted) !important; font-size: 12px !important; }
.sidebar-footer-link:hover { background: rgba(120,120,128,.10) !important; color: var(--ui-text) !important; }
.sidebar-signout:hover { color: var(--ui-red) !important; }
.sidebar-version { color: var(--ui-faint) !important; font-size: 12px !important; }

/* Workspace and command bar */
.kvpl-main { margin-left: 256px !important; min-height: 100vh; background: var(--ui-bg) !important; }
.command-bar { height: 64px !important; padding: 0 28px !important; background: rgba(245,245,247,.82) !important; border-bottom: 1px solid var(--ui-border) !important; box-shadow: none !important; backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); }
html[data-kvpl-theme="dark"] .command-bar { background: rgba(0,0,0,.78) !important; }
.workspace-icon { display: none !important; }
.command-eyebrow { color: var(--ui-faint) !important; font-size: 12px !important; font-weight: 600 !important; letter-spacing: .05em !important; }
.command-module { color: var(--ui-text) !important; font-size: 12px !important; font-weight: 600 !important; }
.global-search { width: min(340px, 30vw) !important; height: 36px !important; border: 1px solid var(--ui-border) !important; border-radius: 10px !important; background: var(--ui-surface) !important; box-shadow: none !important; }
.global-search:focus-within { border-color: var(--ui-blue) !important; box-shadow: 0 0 0 3px var(--ui-blue-soft) !important; }
.global-search input { color: var(--ui-text) !important; font-size: 12px !important; }
.global-search i, .global-search input::placeholder { color: var(--ui-faint) !important; }
.global-search kbd { border: 1px solid var(--ui-border) !important; background: var(--ui-surface-2) !important; color: var(--ui-muted) !important; box-shadow: none !important; }
.global-search-results, .notification-dropdown { border: 1px solid var(--ui-border) !important; border-radius: 14px !important; background: var(--ui-surface) !important; box-shadow: var(--ui-shadow-raised) !important; }
.command-icon { width: 36px !important; height: 36px !important; border: 1px solid var(--ui-border) !important; border-radius: 50% !important; background: var(--ui-surface) !important; color: var(--ui-muted) !important; box-shadow: none !important; }
.command-icon:hover { color: var(--ui-blue) !important; background: var(--ui-surface-2) !important; transform: none !important; }
.command-create { display:flex; align-items:center; gap:7px; height:36px; padding:0 13px; border-radius:10px; background:var(--ui-blue); color:#fff; font-size:12px; font-weight:620; text-decoration:none; }
.command-create:hover { background:var(--ui-blue-hover); color:#fff; }
.notification-count { background: var(--ui-red) !important; }
.content-wrapper { width: min(1540px, 100%) !important; margin: 0 auto !important; padding: 30px 32px 56px !important; }

/* Page hierarchy */
.kvpl-breadcrumb { margin-bottom: 16px !important; color: var(--ui-muted) !important; font-size: 12px !important; }
.kvpl-breadcrumb a { color: var(--ui-blue) !important; }
.kvpl-breadcrumb .sep, .kvpl-breadcrumb .current { color: var(--ui-faint) !important; }
.page-header, .workspace-page-header { margin-bottom: 24px !important; align-items: flex-end !important; }
.page-title { color: var(--ui-text) !important; font-size: clamp(25px, 2.2vw, 34px) !important; font-weight: 650 !important; letter-spacing: -.035em !important; line-height: 1.12 !important; }
.page-title span { color: var(--ui-muted) !important; }
.page-title small, .page-subtitle { margin-top: 7px !important; color: var(--ui-muted) !important; font-size: 12px !important; font-weight: 400 !important; line-height: 1.5 !important; letter-spacing: -.005em !important; }
.section-title, .card-title { color: var(--ui-text) !important; font-weight: 600 !important; letter-spacing: -.02em !important; }

/* Surfaces */
.card, .industrial-panel, .report-card, .filter-card, .settings-card, .form-section, .dashboard-panel, .dashboard-kpi-card, .stat-card, .metric-card {
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--ui-radius) !important;
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  box-shadow: var(--ui-shadow) !important;
}
.card-header, .industrial-panel-head, .simplified-card-header { padding: 17px 20px !important; border-bottom: 1px solid var(--ui-border) !important; background: transparent !important; color: var(--ui-text) !important; }
.card-body { padding: 20px !important; }
.industrial-panel-head h2, .simplified-card-header h2 { color: var(--ui-text) !important; font-size: 14px !important; font-weight: 620 !important; letter-spacing: -.02em !important; }
.industrial-panel-head p, .simplified-card-header p, .panel-eyebrow { color: var(--ui-muted) !important; }
.panel-eyebrow { font-size: 12px !important; font-weight: 650 !important; letter-spacing: .07em !important; }
.panel-link { color: var(--ui-blue) !important; }
.panel-count { border: 0 !important; border-radius: 999px !important; background: var(--ui-blue-soft) !important; color: var(--ui-blue) !important; box-shadow: none !important; }
.panel-count.danger { background: rgba(215,0,21,.10) !important; color: var(--ui-red) !important; }
.panel-count.warning { background: rgba(255,159,10,.13) !important; color: var(--ui-orange) !important; }
.simple-step { background: var(--ui-blue) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; }

/* KPI cards */
.dashboard-kpi-card, .industrial-kpi, .metric-card, .stat-card { overflow: hidden !important; transition: transform .18s ease, box-shadow .18s ease !important; }
.dashboard-kpi-card:hover, .industrial-kpi:hover, .metric-card:hover, .stat-card:hover { transform: translateY(-1px) !important; box-shadow: 0 10px 28px rgba(0,0,0,.08) !important; }
.kpi-value, .metric-value, .stat-value, .industrial-kpi strong { color: var(--ui-text) !important; font-variant-numeric: tabular-nums; font-weight: 650 !important; letter-spacing: -.035em !important; }
.kpi-label, .metric-label, .stat-label, .industrial-kpi span { color: var(--ui-muted) !important; }
.kpi-icon, .metric-icon { background: var(--ui-blue-soft) !important; color: var(--ui-blue) !important; border: 0 !important; border-radius: 12px !important; }

/* Inputs */
label, .form-label { color: var(--ui-text) !important; font-size: 12px !important; font-weight: 560 !important; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), select, textarea, .form-control, .form-select {
  min-height: 42px;
  border: 1px solid var(--ui-border-strong) !important;
  border-radius: 10px !important;
  background-color: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
  font-family: var(--ui-font) !important;
  font-size: 12px !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}
textarea { min-height: 92px; }
input:focus, select:focus, textarea:focus, .form-control:focus, .form-select:focus { border-color: var(--ui-blue) !important; box-shadow: 0 0 0 3px var(--ui-blue-soft) !important; outline: 0 !important; }
input::placeholder, textarea::placeholder { color: var(--ui-faint) !important; opacity: 1 !important; }
input:disabled, input[readonly], select:disabled, textarea:disabled { background: var(--ui-surface-2) !important; color: var(--ui-muted) !important; opacity: 1 !important; }
.form-hint, .form-text, small.text-muted { color: var(--ui-muted) !important; font-size: 12px !important; line-height: 1.45 !important; }
.form-check-input { border-color: var(--ui-border-strong) !important; background-color: var(--ui-surface) !important; }
.form-check-input:checked { border-color: var(--ui-blue) !important; background-color: var(--ui-blue) !important; }
.input-group-text { border-color: var(--ui-border-strong) !important; background: var(--ui-surface-2) !important; color: var(--ui-muted) !important; }
.buyer-currency-display, .currency-chip { border-color: var(--ui-border) !important; background: var(--ui-surface-2) !important; color: var(--ui-text) !important; }
.ux-password-field { position:relative; }
.ux-password-field > input { width:100%; padding-right:42px !important; }
.ux-password-toggle { position:absolute; top:50%; right:5px; display:grid; place-items:center; width:34px; height:34px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--ui-muted); transform:translateY(-50%); }
.ux-password-toggle:hover { background:var(--ui-surface-2); color:var(--ui-text); }
.contract-filter-primary { display:grid; grid-template-columns:minmax(280px,2fr) minmax(180px,1fr) minmax(180px,1fr); gap:14px; }
.contract-advanced-filters { margin-top:14px; border-top:1px solid var(--ui-border); }
.contract-advanced-filters > summary { display:flex; align-items:center; gap:10px; min-height:46px; color:var(--ui-text); cursor:pointer; list-style:none; user-select:none; }
.contract-advanced-filters > summary::-webkit-details-marker { display:none; }
.contract-advanced-filters > summary > span { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:620; }
.contract-advanced-filters > summary small { flex:1; color:var(--ui-muted); font-size:12px; }
.contract-advanced-filters > summary > i { color:var(--ui-muted); transition:transform .18s ease; }
.contract-advanced-filters[open] > summary > i { transform:rotate(180deg); }
.contract-advanced-filters .contract-filter-grid { padding-top:4px; }
.form-journey { position:sticky; top:76px; z-index:20; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:8px; margin-bottom:18px; padding:8px; border:1px solid var(--ui-border); border-radius:14px; background:var(--ui-sidebar); box-shadow:var(--ui-shadow); backdrop-filter:blur(20px); }
.form-journey > a { display:flex; align-items:center; gap:9px; min-width:0; padding:8px 10px; border-radius:10px; color:var(--ui-muted); text-decoration:none; }
.form-journey > a:hover { background:var(--ui-blue-soft); color:var(--ui-blue); }
.form-journey > a > span { display:grid; place-items:center; flex:0 0 26px; width:26px; height:26px; border-radius:50%; background:var(--ui-surface-2); color:var(--ui-muted); font-size:12px; font-weight:650; }
.form-journey > a strong,.form-journey > a small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.form-journey > a strong { color:var(--ui-text); font-size:12px; font-weight:620; }
.form-journey > a small { margin-top:2px; color:var(--ui-muted); font-size:12px; }
.form-completion { display:flex; align-items:center; gap:6px; padding:0 10px; border-left:1px solid var(--ui-border); color:var(--ui-green); font-size:12px; }
.contract-form-section { scroll-margin-top:145px; }
.simplified-form-actions { position:sticky; bottom:12px; z-index:19; border:1px solid var(--ui-border) !important; border-radius:14px !important; background:var(--ui-sidebar) !important; box-shadow:0 16px 40px rgba(0,0,0,.12) !important; backdrop-filter:blur(24px); }
.contract-more-actions { position:relative; }
.contract-more-actions > summary { list-style:none; cursor:pointer; }
.contract-more-actions > summary::-webkit-details-marker { display:none; }
.contract-more-menu { position:absolute; top:calc(100% + 7px); right:0; z-index:1050; display:grid; gap:5px; width:245px; padding:8px; border:1px solid var(--ui-border); border-radius:13px; background:var(--ui-surface); box-shadow:var(--ui-shadow-raised); }
.contract-more-menu .btn,.contract-more-menu form,.contract-more-menu form .btn { width:100%; }
.contract-more-menu .btn { justify-content:flex-start; text-align:left; }
.contract-section-tabs { position:sticky !important; top:74px !important; z-index:18 !important; overflow-x:auto !important; flex-wrap:nowrap !important; scrollbar-width:none; border:1px solid var(--ui-border) !important; border-radius:13px !important; background:var(--ui-sidebar) !important; box-shadow:var(--ui-shadow) !important; backdrop-filter:blur(22px); }
.contract-section-tabs::-webkit-scrollbar { display:none; }
.contract-section-tabs a { flex:0 0 auto; }
.contract-section-anchor,.contract-detail-hero,.approval-progress-card,#documents { scroll-margin-top:142px; }
.approval-queue-tabs { display:flex; gap:6px; margin:0 0 16px; padding:5px; overflow-x:auto; border:1px solid var(--ui-border); border-radius:13px; background:var(--ui-surface); }
.approval-queue-tabs button { display:flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:0 14px; border:0; border-radius:9px; background:transparent; color:var(--ui-muted); font:560 12px var(--ui-font); white-space:nowrap; }
.approval-queue-tabs button:hover { background:var(--ui-surface-2); color:var(--ui-text); }
.approval-queue-tabs button.active { background:var(--ui-blue-soft); color:var(--ui-blue); }
.approval-queue-tabs button span { display:grid; place-items:center; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:var(--ui-surface-2); font-size:12px; }
.approval-workspace-grid { display:block !important; }
.approval-queue-panel[hidden] { display:none !important; }
.dashboard-more-insights { margin-top:18px; }
.dashboard-more-insights > summary { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:64px; padding:10px 16px; border:1px solid var(--ui-border); border-radius:14px; background:var(--ui-surface); color:var(--ui-text); box-shadow:var(--ui-shadow); cursor:pointer; list-style:none; }
.dashboard-more-insights > summary::-webkit-details-marker { display:none; }
.dashboard-more-insights > summary > div { display:flex; align-items:center; gap:11px; }
.dashboard-more-insights > summary > div > i { display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:var(--ui-blue-soft); color:var(--ui-blue); }
.dashboard-more-insights > summary strong,.dashboard-more-insights > summary small { display:block; }
.dashboard-more-insights > summary strong { font-size:12px; font-weight:620; }
.dashboard-more-insights > summary small { margin-top:2px; color:var(--ui-muted); font-size:12px; }
.dashboard-insight-toggle { color:var(--ui-blue); font-size:12px; font-weight:600; white-space:nowrap; }
.dashboard-insight-toggle i { margin-left:5px; transition:transform .18s ease; }
.dashboard-more-insights[open] .dashboard-insight-toggle i { display:inline-block; transform:rotate(180deg); }
.dashboard-insight-content { padding-top:16px; }
.unbilled-hero { border-color:var(--ui-border) !important; border-radius:var(--ui-radius) !important; background:linear-gradient(135deg,var(--ui-surface),var(--ui-surface-2)) !important; color:var(--ui-text) !important; box-shadow:var(--ui-shadow); }
.unbilled-hero p,.allocation-help { color:var(--ui-muted) !important; }
.unbilled-kpis article { border-color:var(--ui-border) !important; border-radius:var(--ui-radius) !important; background:var(--ui-surface) !important; color:var(--ui-text) !important; box-shadow:var(--ui-shadow); }
.unbilled-kpis span { color:var(--ui-muted) !important; }
.unbilled-info { border:1px solid rgba(0,113,227,.18) !important; border-left:3px solid var(--ui-blue) !important; border-radius:12px !important; background:var(--ui-blue-soft) !important; color:var(--ui-text) !important; }

/* Buttons */
.btn { min-height: 38px; border-radius: 10px !important; padding: 8px 14px !important; font-size: 12px !important; font-weight: 580 !important; letter-spacing: -.01em !important; box-shadow: none !important; transition: background .15s ease, border-color .15s ease, transform .15s ease !important; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: var(--ui-blue) !important; background: var(--ui-blue) !important; color: #fff !important; }
.btn-primary:hover { border-color: var(--ui-blue-hover) !important; background: var(--ui-blue-hover) !important; }
.btn-outline-primary { border-color: var(--ui-blue) !important; color: var(--ui-blue) !important; background: transparent !important; }
.btn-outline-primary:hover { background: var(--ui-blue-soft) !important; color: var(--ui-blue) !important; }
.btn-outline-secondary, .btn-light, .btn-secondary { border-color: var(--ui-border) !important; background: var(--ui-surface) !important; color: var(--ui-text) !important; }
.btn-outline-secondary:hover, .btn-light:hover, .btn-secondary:hover { background: var(--ui-surface-2) !important; color: var(--ui-text) !important; }
.btn-danger, .btn-outline-danger:hover { border-color: var(--ui-red) !important; background: var(--ui-red) !important; color: #fff !important; }
.btn-outline-danger { border-color: rgba(215,0,21,.35) !important; color: var(--ui-red) !important; }
.btn-sm { min-height: 32px; padding: 6px 11px !important; font-size: 12px !important; }
.dropdown-menu { padding: 7px !important; border: 1px solid var(--ui-border) !important; border-radius: 13px !important; background: var(--ui-surface) !important; box-shadow: var(--ui-shadow-raised) !important; }
.dropdown-item { border-radius: 8px !important; color: var(--ui-text) !important; font-size: 12px !important; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--ui-blue-soft) !important; color: var(--ui-blue) !important; }

/* Tables */
.table-responsive { border: 1px solid var(--ui-border) !important; border-radius: 14px !important; background: var(--ui-surface) !important; box-shadow: none !important; }
.table { --bs-table-bg: transparent !important; --bs-table-color: var(--ui-text) !important; margin-bottom: 0 !important; color: var(--ui-text) !important; font-size: 12px !important; }
.table > :not(caption) > * > * { padding: 12px 14px !important; border-bottom-color: var(--ui-border) !important; color: inherit !important; vertical-align: middle !important; }
.table thead th { position: sticky; top: 0; z-index: 2; background: var(--ui-surface-2) !important; color: var(--ui-muted) !important; font-size: 12px !important; font-weight: 650 !important; letter-spacing: .045em !important; text-transform: uppercase; white-space: nowrap; }
.table tbody tr { transition: background .12s ease; }
.table-hover > tbody > tr:hover > * { background: var(--ui-blue-soft) !important; }
.table tbody tr:last-child td { border-bottom: 0 !important; }
.table tfoot td, .table tfoot th { background: var(--ui-surface-2) !important; font-weight: 650 !important; }
.ux-table-tools { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-bottom:1px solid var(--ui-border); background:var(--ui-surface); }
.ux-table-search { position:relative; display:block; width:min(320px,100%); margin:0; }
.ux-table-search i { position:absolute; left:12px; top:50%; z-index:1; color:var(--ui-faint); transform:translateY(-50%); }
.ux-table-search input { width:100%; min-height:36px !important; padding-left:34px !important; background:var(--ui-surface-2) !important; }
.ux-row-count { color:var(--ui-muted); font-size:12px; white-space:nowrap; }
.ux-back-to-top { position:fixed; right:22px; bottom:22px; z-index:1030; display:flex; align-items:center; gap:7px; min-height:38px; padding:0 13px; border:1px solid var(--ui-border); border-radius:999px; background:var(--ui-sidebar); color:var(--ui-text); font:600 12px var(--ui-font); box-shadow:var(--ui-shadow-raised); opacity:0; pointer-events:none; transform:translateY(8px); transition:.18s ease; backdrop-filter:blur(20px); }
.ux-back-to-top.show { opacity:1; pointer-events:auto; transform:none; }

/* Status and feedback */
.badge, .status-badge, .status-pill { border: 0 !important; border-radius: 999px !important; padding: 5px 9px !important; font-size: 12px !important; font-weight: 620 !important; box-shadow: none !important; }
.alert { border: 1px solid var(--ui-border) !important; border-radius: 13px !important; background: var(--ui-surface) !important; color: var(--ui-text) !important; box-shadow: var(--ui-shadow) !important; font-size: 12px !important; }
.alert-success { border-left: 3px solid var(--ui-green) !important; }
.alert-warning { border-left: 3px solid var(--ui-orange) !important; }
.alert-danger { border-left: 3px solid var(--ui-red) !important; }
.alert-info { border-left: 3px solid var(--ui-blue) !important; }
.modal-content { border: 1px solid var(--ui-border) !important; border-radius: 18px !important; background: var(--ui-surface) !important; color: var(--ui-text) !important; box-shadow: 0 28px 90px rgba(0,0,0,.28) !important; }
.modal-header, .modal-footer { border-color: var(--ui-border) !important; }
.pagination .page-link { border-color: var(--ui-border) !important; background: var(--ui-surface) !important; color: var(--ui-blue) !important; box-shadow: none !important; }
.pagination .active .page-link { border-color: var(--ui-blue) !important; background: var(--ui-blue) !important; color: #fff !important; }
.progress { border-radius: 999px !important; background: var(--ui-surface-2) !important; }
.progress-bar { background: var(--ui-blue) !important; }

/* Login */
body:not(.kvpl-modern-shell) .login-workspace { border-color: var(--ui-border) !important; border-radius: 24px !important; background: rgba(255,255,255,.82) !important; box-shadow: 0 28px 80px rgba(0,0,0,.14) !important; }
body:not(.kvpl-modern-shell) .login-showcase { background: radial-gradient(circle at 82% 18%, rgba(0,113,227,.16), transparent 32%), radial-gradient(circle at 18% 86%, rgba(48,209,88,.10), transparent 34%), linear-gradient(145deg,#fff,#f2f7fb) !important; }
body:not(.kvpl-modern-shell) .showcase-kicker { color: var(--ui-blue) !important; }
body:not(.kvpl-modern-shell) .login-showcase h1 { color: #1d1d1f !important; font-weight: 650 !important; letter-spacing: -.045em !important; }
body:not(.kvpl-modern-shell) .login-showcase h1 span { background: none !important; color: var(--ui-blue) !important; }
body:not(.kvpl-modern-shell) .showcase-pills span { border-color: rgba(60,60,67,.14) !important; background: rgba(255,255,255,.74) !important; color: #3a3a3c !important; }
body:not(.kvpl-modern-shell) .showcase-pills i { color: var(--ui-blue) !important; }
body:not(.kvpl-modern-shell) .login-title { color: var(--ui-text) !important; font-weight: 650 !important; letter-spacing: -.035em !important; }
body:not(.kvpl-modern-shell) .field-input { border-color: var(--ui-border-strong) !important; border-radius: 10px !important; background: var(--ui-surface) !important; color: var(--ui-text) !important; }
body:not(.kvpl-modern-shell) .field-input:focus { border-color: var(--ui-blue) !important; box-shadow: 0 0 0 3px var(--ui-blue-soft) !important; }
body:not(.kvpl-modern-shell) .login-btn { border-radius: 10px !important; background: var(--ui-blue) !important; box-shadow: none !important; font-weight: 600 !important; }
body:not(.kvpl-modern-shell) .login-btn:hover { background: var(--ui-blue-hover) !important; box-shadow: none !important; }
body:not(.kvpl-modern-shell) .login-theme-toggle { border-color: var(--ui-border) !important; border-radius: 50% !important; background: rgba(255,255,255,.82) !important; color: #3a3a3c !important; box-shadow: 0 6px 24px rgba(0,0,0,.10) !important; }
html[data-kvpl-theme="dark"] body:not(.kvpl-modern-shell) .login-workspace { background: rgba(28,28,30,.88) !important; }
html[data-kvpl-theme="dark"] body:not(.kvpl-modern-shell) .login-showcase { background: radial-gradient(circle at 82% 18%, rgba(41,151,255,.18), transparent 32%), radial-gradient(circle at 18% 86%, rgba(48,209,88,.10), transparent 34%), linear-gradient(145deg,#1c1c1e,#111113) !important; }
html[data-kvpl-theme="dark"] body:not(.kvpl-modern-shell) .login-showcase h1 { color: #f5f5f7 !important; }
html[data-kvpl-theme="dark"] body:not(.kvpl-modern-shell) .showcase-pills span { border-color: rgba(255,255,255,.12) !important; background: rgba(44,44,46,.75) !important; color: #e5e5ea !important; }

/* Responsive */
@media (max-width: 991.98px) {
  .kvpl-sidebar { width: min(310px, 88vw) !important; transform: translateX(-105%); box-shadow: 22px 0 70px rgba(0,0,0,.22) !important; }
  .kvpl-sidebar.open { transform: translateX(0); }
  .kvpl-main { margin-left: 0 !important; }
  .kvpl-topbar { height: 58px !important; padding: 0 14px !important; background: var(--ui-sidebar) !important; border-bottom: 1px solid var(--ui-border) !important; color: var(--ui-text) !important; backdrop-filter: saturate(180%) blur(22px); }
  .kvpl-topbar .text-dark { color: var(--ui-text) !important; }
  .mobile-brand-copy .fw-semibold { color: var(--ui-text) !important; font-size: 12px !important; }
  .mobile-live { color: var(--ui-muted) !important; font-size: 12px !important; }
  .mobile-create-link { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:var(--ui-blue); color:#fff; text-decoration:none; }
  .content-wrapper { padding: 22px 18px 44px !important; }
  .page-header, .workspace-page-header { align-items: flex-start !important; gap: 14px !important; }
  .contract-filter-primary { grid-template-columns:1fr 1fr; }
  .contract-filter-primary .filter-search-wide { grid-column:1 / -1; }
  .form-journey { top:68px; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .form-completion { display:none; }
}

@media (max-width: 575.98px) {
  .content-wrapper { padding: 18px 12px 36px !important; }
  .page-title { font-size: 25px !important; }
  .card, .industrial-panel, .report-card, .filter-card { border-radius: 14px !important; }
  .card-header, .industrial-panel-head, .simplified-card-header, .card-body { padding: 16px !important; }
  .btn { min-height: 40px; }
  .table > :not(caption) > * > * { padding: 11px 12px !important; }
  .ux-table-tools { align-items:stretch; flex-direction:column; }
  .ux-table-search { width:100%; }
  .ux-back-to-top span { display:none; }
  .ux-back-to-top { width:40px; height:40px; justify-content:center; padding:0; }
  .contract-filter-primary { grid-template-columns:1fr; }
  .contract-filter-primary .filter-search-wide { grid-column:auto; }
  .contract-advanced-filters > summary small { display:none; }
  .form-journey > a { justify-content:center; padding:7px; }
  .form-journey > a div { display:none; }
  .simplified-form-actions { bottom:8px; }
  .simplified-form-actions .save-guidance { display:none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .kvpl-main { margin-left: 0 !important; background: #fff !important; }
  .content-wrapper { max-width: none !important; padding: 0 !important; }
  .card, .industrial-panel, .table-responsive { box-shadow: none !important; }
}

/* 2026-08-31 global contract-form + dark-mode readability fixes */
.contract-form-validation {
  position: sticky;
  top: 128px;
  z-index: 24;
  margin: 0 0 12px !important;
}
.simple-grade-row.row-validation-error {
  border-color: rgba(215,0,21,.55) !important;
  box-shadow: 0 0 0 3px rgba(215,0,21,.09) !important;
}

/* Amendment reason: use the full card width instead of a small centred textarea. */
.simplified-contract-form .amendment-reason-card {
  display: block !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.simplified-contract-form .amendment-reason-card > .card-body.amendment-reason-layout {
  display: grid !important;
  grid-template-columns: minmax(260px,.8fr) minmax(380px,1.2fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  padding: 20px !important;
}
.amendment-reason-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.amendment-reason-intro .amendment-reason-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--ui-blue-soft) !important;
  color: var(--ui-blue) !important;
}
.amendment-reason-intro > div { display: grid; min-width: 0; }
.amendment-reason-intro strong {
  margin: 1px 0 4px !important;
  color: var(--ui-text) !important;
  font-size: 12px !important;
  font-weight: 620 !important;
  text-transform: none !important;
  letter-spacing: -.01em !important;
}
.amendment-reason-intro small {
  color: var(--ui-muted) !important;
  font-size: 10.5px !important;
  line-height: 1.45;
}
.amendment-reason-field { width: 100%; min-width: 0; }
.amendment-reason-field label { display: block; margin-bottom: 6px; }
.amendment-reason-field textarea {
  display: block;
  width: 100% !important;
  max-width: none !important;
  min-height: 92px;
  resize: vertical;
}

/* Global dark-mode contrast normalization for discovery/report cards and chips. */
html[data-kvpl-theme="dark"] .report-workspace-stat {
  border-color: var(--ui-border-strong) !important;
  background: var(--ui-surface-2) !important;
  color: var(--ui-text) !important;
}
html[data-kvpl-theme="dark"] .report-workspace-stat strong { color: #8ab8ff !important; }
html[data-kvpl-theme="dark"] .report-workspace-stat span { color: var(--ui-text) !important; }
html[data-kvpl-theme="dark"] .report-workspace-stat small { color: #c1c1c7 !important; }

html[data-kvpl-theme="dark"] .report-category-summary > div {
  border-color: var(--ui-border) !important;
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}
html[data-kvpl-theme="dark"] .report-category-summary i {
  background: rgba(41,151,255,.14) !important;
  color: #7db8ff !important;
}
html[data-kvpl-theme="dark"] .report-category-summary span {
  color: #c1c1c7 !important;
  opacity: 1 !important;
}
html[data-kvpl-theme="dark"] .report-category-summary strong {
  color: var(--ui-text) !important;
  opacity: 1 !important;
}
html[data-kvpl-theme="dark"] .report-category-label {
  border: 1px solid rgba(138,184,255,.28) !important;
  background: rgba(41,151,255,.14) !important;
  color: #b8d7ff !important;
}
html[data-kvpl-theme="dark"] .report-format-pills { color: #b9c7dc !important; }
html[data-kvpl-theme="dark"] .report-catalogue-card {
  border-color: var(--ui-border) !important;
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
}
html[data-kvpl-theme="dark"] .report-catalogue-copy h3 { color: var(--ui-text) !important; }
html[data-kvpl-theme="dark"] .report-catalogue-copy p,
html[data-kvpl-theme="dark"] .report-catalogue-metrics {
  color: #c1c1c7 !important;
  opacity: 1 !important;
}
html[data-kvpl-theme="dark"] .report-catalogue-metrics {
  border-color: var(--ui-border) !important;
}
html[data-kvpl-theme="dark"] .report-catalogue-metrics strong { color: #e5e5ea !important; }

/* Generic small-copy safeguard across dark cards so helper text never drops
   below readable contrast because of older page-specific opacity rules. */
html[data-kvpl-theme="dark"] body.kvpl-modern-shell .card small,
html[data-kvpl-theme="dark"] body.kvpl-modern-shell .industrial-panel small,
html[data-kvpl-theme="dark"] body.kvpl-modern-shell .form-hint,
html[data-kvpl-theme="dark"] body.kvpl-modern-shell .muted,
html[data-kvpl-theme="dark"] body.kvpl-modern-shell .text-muted {
  color: var(--ui-muted) !important;
  opacity: 1 !important;
}

@media (max-width: 767.98px) {
  .simplified-contract-form .amendment-reason-card > .card-body.amendment-reason-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .contract-form-validation { position: static; }
}


/* September usability revision. Shared tokens and explicit component rules override
   the older per-page skin; layout and business-state classes are preserved. */
html[data-kvpl-theme] {
  --kvpl-font: var(--ui-font);
  --kvpl-mono: var(--ui-font);
  --ui-muted: #626269;
  --ui-faint: #717179;
  --ui-blue: #0069d2;
  --ui-blue-hover: #005bb8;
}
html[data-kvpl-theme="dark"] {
  --ui-bg: #141416;
  --ui-surface: #202023;
  --ui-surface-2: #2a2a2e;
  --ui-sidebar: rgba(27,27,30,.96);
  --ui-muted: #b9b9c0;
  --ui-faint: #a2a2ab;
  --ui-blue: #75b8ff;
  --ui-blue-hover: #95c9ff;
  --kvpl-dark-bg: var(--ui-bg);
  --kvpl-dark-surface: var(--ui-surface);
  --kvpl-dark-surface-2: var(--ui-surface-2);
  --kvpl-dark-text: var(--ui-text);
  --kvpl-dark-text-2: #e4e4e9;
  --kvpl-dark-muted: var(--ui-muted);
}
html[data-kvpl-theme] body.ui-refined { font-size:14px; line-height:1.55; }
.ui-refined [hidden] { display:none !important; }
.ui-refined :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline:3px solid var(--ui-blue) !important; outline-offset:3px; }
.ui-refined .skip-link { position:fixed; top:8px; left:16px; z-index:2000; transform:translateY(-150%); padding:10px 16px; border-radius:10px; background:var(--ui-surface); color:var(--ui-blue); box-shadow:var(--ui-shadow-raised); }
.ui-refined .skip-link:focus { transform:none; }
.ui-refined .sidebar-close { align-self:flex-end; width:44px; min-height:44px; border:0; border-radius:10px; color:var(--ui-text); background:var(--ui-surface-2); }
.ui-refined.navigation-open { overflow:hidden; }
html[data-kvpl-theme] .ui-refined .sidebar-nav .nav-link { font-size:14px !important; min-height:42px !important; line-height:1.35; }
html[data-kvpl-theme] .ui-refined :is(.sidebar-primary-action,.sidebar-footer-link) { font-size:13px !important; min-height:40px !important; }
html[data-kvpl-theme] .ui-refined :is(.user-name,.brand-name,.command-module) { font-size:14px !important; }
html[data-kvpl-theme] .ui-refined .nav-section-label { font-size:11px !important; letter-spacing:.06em !important; color:var(--ui-muted) !important; }
html[data-kvpl-theme] .ui-refined :is(.user-role,.brand-sub) { font-size:12px !important; }
html[data-kvpl-theme] .ui-refined .global-search { width:min(380px,35vw) !important; min-height:42px !important; }
html[data-kvpl-theme] .ui-refined .global-search input { font-size:13px !important; min-height:0 !important; height:36px !important; border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; }
html[data-kvpl-theme] .ui-refined :is(.command-icon,.mobile-theme-toggle,.mobile-notification-link,.mobile-create-link) { width:42px !important; height:42px !important; flex-shrink:0; }
html[data-kvpl-theme] .ui-refined .content-wrapper { max-width:1600px !important; padding:28px clamp(18px,2.4vw,38px) 64px !important; }
html[data-kvpl-theme] .ui-refined :is(.modern-dashboard-hero,.contract-register-hero,.approval-workspace-hero,.operational-report-hero,.user-admin-hero,.notification-centre-hero,.unbilled-hero,.contract-detail-hero) { background:var(--ui-surface) !important; color:var(--ui-text) !important; border:1px solid var(--ui-border) !important; border-radius:20px !important; padding:26px !important; box-shadow:none !important; }
html[data-kvpl-theme] .ui-refined :is(.modern-dashboard-hero,.contract-register-hero,.approval-workspace-hero,.operational-report-hero) h1 { color:var(--ui-text) !important; font-size:clamp(26px,2.3vw,34px) !important; font-weight:600 !important; letter-spacing:-.035em; line-height:1.2; }
html[data-kvpl-theme] .ui-refined :is(.modern-dashboard-hero,.contract-register-hero,.approval-workspace-hero,.operational-report-hero) p { font-size:14px !important; line-height:1.6 !important; color:var(--ui-muted) !important; }
html[data-kvpl-theme] .ui-refined :is(.workspace-kicker,.management-kicker,.panel-eyebrow) { font-size:11px !important; color:var(--ui-muted) !important; letter-spacing:.06em !important; }
html[data-kvpl-theme] .ui-refined :is(.industrial-panel-head h2,.simplified-card-header h2,.approval-queue-head h2,.card-title) { font-size:16px !important; font-weight:600 !important; }
html[data-kvpl-theme] .ui-refined :is(.page-subtitle,.form-hint,.form-text,small.text-muted,.contract-filter-subtitle) { font-size:13px !important; color:var(--ui-muted) !important; line-height:1.5 !important; }
html[data-kvpl-theme] .ui-refined :is(.industrial-kpi,.dashboard-scope-card,.approval-queue-panel,.contract-filter-panel,.operational-filter-panel,.operational-kpi-grid article,.report-catalogue-card) { background:var(--ui-surface) !important; border:1px solid var(--ui-border) !important; box-shadow:none !important; border-radius:16px !important; color:var(--ui-text) !important; }
html[data-kvpl-theme] .ui-refined .industrial-kpi { padding:18px !important; }
html[data-kvpl-theme] .ui-refined .kpi-top span { font-size:13px !important; color:var(--ui-muted) !important; }
html[data-kvpl-theme] .ui-refined .kpi-value { font-size:30px !important; line-height:1.25; }
html[data-kvpl-theme] .ui-refined :is(.kpi-value small,.kpi-foot) { font-size:12px !important; color:var(--ui-muted) !important; }
html[data-kvpl-theme] .ui-refined :is(.btn,.quick-action,.tab-btn,.approval-queue-tabs button) { font-size:13px !important; min-height:42px; font-weight:600 !important; }
html[data-kvpl-theme] .ui-refined :is(.btn-primary,.quick-action-primary,.sidebar-primary-action,.mobile-create-link) { background:#0069d2 !important; border-color:#0069d2 !important; color:#fff !important; }
html[data-kvpl-theme] .ui-refined :is(.btn-primary,.quick-action-primary,.sidebar-primary-action):hover { background:#005bb8 !important; border-color:#005bb8 !important; }
html[data-kvpl-theme] .ui-refined .btn-success { background:#19713a !important; border-color:#19713a !important; color:#fff !important; }
html[data-kvpl-theme] .ui-refined .btn-success:hover { background:#125a2d !important; border-color:#125a2d !important; }
html[data-kvpl-theme] .ui-refined .btn-danger { background:#b4232d !important; border-color:#b4232d !important; color:#fff !important; }
.ui-refined :is(button:disabled,.btn.disabled) { opacity:.55 !important; transform:none !important; cursor:not-allowed; }
html[data-kvpl-theme] .ui-refined :is(label,.form-label) { font-size:13px !important; font-weight:600 !important; }
html[data-kvpl-theme] .ui-refined :is(.form-control,.form-select,.form-group input,.form-group select,.form-group textarea,.field-input,.simple-grade-row input,.simple-grade-row select) { font-size:14px !important; min-height:44px; }
html[data-kvpl-theme] .ui-refined :is(input,select,textarea).is-invalid,
html[data-kvpl-theme] .ui-refined .was-validated :is(input,select,textarea):invalid,
html[data-kvpl-theme] .ui-refined [aria-invalid="true"] { border-color:var(--ui-red) !important; }
.ui-refined .invalid-feedback { font-size:13px; }
.ui-refined .form-completion { color:var(--ui-muted); font-size:12px; }
.ui-refined .form-journey { grid-template-columns:repeat(3,minmax(0,1fr)); position:static; }
.ui-refined .form-completion { grid-column:1/-1; border:0; justify-content:flex-end; padding:0 8px 4px; }
.ui-refined .form-journey > a strong { font-size:13px; }
.ui-refined .form-journey > a small { font-size:12px; }
.ui-refined .contract-filter-primary { grid-template-columns:minmax(240px,2fr) repeat(2,minmax(0,1fr)); }
.ui-refined .contract-advanced-filters > summary { min-height:48px; }
.ui-refined .contract-advanced-filters > summary > span { font-size:13px; }
.ui-refined .contract-advanced-filters > summary small { font-size:12px; }
html[data-kvpl-theme] .ui-refined :is(.table-wrap,.table-responsive,.industrial-table-wrap,.ux-table-scroll) { max-width:100%; overflow-x:auto; border-color:var(--ui-border) !important; background:var(--ui-surface) !important; }
.ui-refined .ux-table-hint { margin:0; padding:8px 16px; color:var(--ui-muted); font-size:12px; background:var(--ui-surface-2); }
html[data-kvpl-theme] .ui-refined table { font-size:13px !important; color:var(--ui-text) !important; font-variant-numeric:tabular-nums; }
html[data-kvpl-theme] .ui-refined table :is(th,td) { font-size:13px !important; padding:12px 14px !important; line-height:1.5; border-color:var(--ui-border) !important; }
html[data-kvpl-theme] .ui-refined table thead th { font-size:12px !important; text-transform:none !important; letter-spacing:0 !important; color:var(--ui-muted) !important; background:var(--ui-surface-2) !important; }
html[data-kvpl-theme] .ui-refined table tfoot :is(td,th) { font-weight:600; background:var(--ui-surface-2) !important; color:var(--ui-text) !important; }
html[data-kvpl-theme] .ui-refined .contract-register-table :is(.contract-customer-name,.contract-customer-cell) { white-space:normal !important; min-width:180px; }
html[data-kvpl-theme] .ui-refined .badge { font-size:12px !important; line-height:1.25; }
html[data-kvpl-theme] .ui-refined .alert { font-size:14px !important; line-height:1.55; }
.ui-refined .dashboard-more-insights .when-open { display:none; }
.ui-refined .dashboard-more-insights[open] .when-open { display:inline; }
.ui-refined .dashboard-more-insights[open] .when-closed { display:none; }
.ui-refined .contract-more-menu { z-index:1035; max-width:calc(100vw - 32px); }
.ui-refined .contract-section-tabs { scrollbar-width:thin; }
.ui-refined .contract-section-tabs::-webkit-scrollbar { display:initial; height:4px; }
html[data-kvpl-theme] body.login-page { background:var(--ui-bg) !important; background-image:none !important; }
html[data-kvpl-theme] .login-page .login-panel { background:var(--ui-surface) !important; }
html[data-kvpl-theme] .login-page :is(.login-sub,.login-showcase p,.login-footer) { color:var(--ui-muted) !important; font-size:14px !important; }
html[data-kvpl-theme] .login-page .login-btn { background:#0069d2 !important; min-height:48px; font-size:15px; }
html[data-kvpl-theme] .login-page .field-input { min-height:48px; font-size:16px !important; }
.ui-refined .ux-password-toggle { width:40px; height:40px; }
@media (max-width:1199.98px) {
  .ui-refined .command-context { display:none; }
  .ui-refined .command-actions { width:100%; justify-content:flex-end; }
  .ui-refined .industrial-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ui-refined .contract-filter-primary { grid-template-columns:1fr 1fr; }
  .ui-refined .filter-search-wide { grid-column:1/-1; }
}
@media (max-width:991.98px) {
  html[data-kvpl-theme] .ui-refined .content-wrapper { padding:20px 16px 64px !important; }
  html[data-kvpl-theme] .ui-refined .kvpl-topbar { height:64px !important; gap:6px; }
  .ui-refined .mobile-brand-copy { flex:1; min-width:0; }
  .ui-refined .mobile-live { display:none; }
  .ui-refined .form-completion { display:flex; }
}
@media (max-width:575.98px) {
  html[data-kvpl-theme] .ui-refined :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { font-size:16px !important; }
  html[data-kvpl-theme] .ui-refined :is(.btn,.quick-action,.tab-btn,.approval-queue-tabs button) { min-height:44px; }
  html[data-kvpl-theme] .ui-refined :is(.modern-dashboard-hero,.contract-register-hero,.approval-workspace-hero,.operational-report-hero,.contract-detail-hero) { padding:20px !important; }
  .ui-refined .contract-filter-primary { grid-template-columns:1fr; }
  .ui-refined .form-journey { gap:4px; }
  .ui-refined .form-journey > a { flex-direction:column; gap:5px; padding:6px 2px; }
  .ui-refined .form-journey > a div { display:block; text-align:center; }
  .ui-refined .form-journey > a strong { white-space:normal; font-size:12px; }
  .ui-refined .form-journey > a small { display:none; }
  .ui-refined .simplified-form-actions { position:static; }
  .ui-refined .contract-register-stats,.ui-refined .approval-hero-metrics { flex-wrap:wrap; }
  .ui-refined .contract-section-tabs { top:70px !important; }
}
@media print {
  .ui-refined :is(.sidebar-close,.skip-link,.form-journey,.contract-section-tabs,.contract-more-actions) { display:none !important; }
  html[data-kvpl-theme] .ui-refined :is(.ux-table-region,.table-responsive,.table-wrap) { overflow:visible !important; max-height:none !important; }
  html[data-kvpl-theme] .ui-refined table { min-width:0 !important; width:100% !important; }
  html[data-kvpl-theme] .ui-refined table :is(td,th) { font-size:9px !important; padding:4px !important; color:#111 !important; background:white !important; }
  .ui-refined .approval-queue-panel[hidden] { display:block !important; }
  .ui-refined .approval-queue-panel { break-inside:avoid; }
}

/* Current v3.22 workflows: PO transfer, certification changes and amendments. */
html[data-kvpl-theme] .ui-refined .conversion-workspace-hero { background:var(--ui-surface) !important; color:var(--ui-text) !important; border:1px solid var(--ui-border); border-radius:20px; padding:26px; }
html[data-kvpl-theme] .ui-refined .conversion-workspace-hero p { font-size:14px !important; color:var(--ui-muted) !important; }
.ui-refined .po-destination-options > label { min-width:0 !important; flex-basis:260px; }
.ui-refined .po-destination-options > label:has(input:checked) { border-color:var(--ui-blue) !important; background:var(--ui-blue-soft); }
.ui-refined #source-table .source-check { width:20px; height:20px; cursor:pointer; }
.ui-refined #source-table tr:has(.source-check:checked) { background:var(--ui-blue-soft); }
.ui-refined #source-table .transfer-qty { min-width:150px; }
.ui-refined #source-total { white-space:nowrap; }
.ui-refined #selected-source-count { white-space:normal; text-align:right; }
.ui-refined #po-transfer-error { scroll-margin-top:88px; }
.ui-refined .contract-form-validation { top:80px; font-size:14px !important; }
@media(max-width:1100px) {
 .ui-refined .simplified-contract-form .amendment-reason-card > .card-body.amendment-reason-layout { grid-template-columns:minmax(0,1fr) !important; gap:16px; }
}
@media(max-width:575.98px) {
 .ui-refined #po-transfer-form > .d-flex { flex-wrap:wrap; }
 .ui-refined #po-transfer-form > .d-flex .btn { flex:1 1 auto; }
 .ui-refined .contract-form-validation { position:static; }
}

/* Screenshot review: compact type, one search surface, consistent native controls. */
html[data-kvpl-theme] body.ui-refined { font-size:13px; }
html[data-kvpl-theme] body.ui-refined :is(.sidebar-nav .nav-link,.user-name,.brand-name,.command-module) { font-size:13px !important; }
html[data-kvpl-theme] body.ui-refined .sidebar-nav .nav-link { min-height:38px !important; }
html[data-kvpl-theme] body.ui-refined :is(.sidebar-primary-action,.sidebar-footer-link) { font-size:12px !important; min-height:36px !important; }
html[data-kvpl-theme] body.ui-refined :is(.page-title,.modern-dashboard-hero h1,.contract-register-hero h1,.approval-workspace-hero h1,.operational-report-hero h1,.conversion-workspace-hero h1) { font-size:clamp(24px,2vw,28px) !important; }
html[data-kvpl-theme] body.ui-refined :is(.industrial-panel-head h2,.simplified-card-header h2,.approval-queue-head h2,.card-title) { font-size:14px !important; }
html[data-kvpl-theme] body.ui-refined :is(.page-subtitle,.form-hint,.form-text,.contract-filter-subtitle,.modern-dashboard-hero p,.contract-register-hero p,.approval-workspace-hero p,.operational-report-hero p,.conversion-workspace-hero p,.alert) { font-size:13px !important; }
html[data-kvpl-theme] body.ui-refined :is(label,.form-label,.kpi-top span,.btn,.quick-action,.tab-btn,.approval-queue-tabs button) { font-size:12px !important; }
html[data-kvpl-theme] body.ui-refined .kpi-value { font-size:26px !important; }
html[data-kvpl-theme] body.ui-refined table :is(th,td) { font-size:12px !important; padding:10px 12px !important; }
html[data-kvpl-theme] body.ui-refined :is(.form-control,.form-select,.form-group input,.form-group select,.form-group textarea,.simple-grade-row input,.simple-grade-row select) { font-size:13px !important; }
html[data-kvpl-theme] body.ui-refined :is(.btn,.quick-action,.tab-btn,.approval-queue-tabs button) { min-height:38px; }

/* Only the outside container draws a search border or focus indicator. */
html[data-kvpl-theme] body.ui-refined #globalSearch {
  display:flex; align-items:center; box-sizing:border-box; min-height:38px !important;
  height:38px !important; border:1px solid var(--ui-border-strong) !important;
  border-radius:10px !important; background:var(--ui-surface) !important;
  outline:0 !important; box-shadow:none !important;
}
html[data-kvpl-theme] body.ui-refined #globalSearch:focus-within {
  border-color:var(--ui-blue) !important;
  box-shadow:0 0 0 2px var(--ui-blue-soft) !important;
}
html[data-kvpl-theme] body.ui-refined #globalSearch #globalSearchInput,
html[data-kvpl-theme] body.ui-refined #globalSearch #globalSearchInput:focus,
html[data-kvpl-theme] body.ui-refined #globalSearch #globalSearchInput:focus-visible {
  appearance:none; -webkit-appearance:none; box-sizing:border-box; flex:1; min-width:0;
  width:100%; height:100% !important; min-height:0 !important; margin:0 !important;
  padding:0 62px 0 36px !important; border:0 !important; border-radius:inherit !important;
  outline:0 !important; outline-offset:0 !important; box-shadow:none !important;
  background:transparent !important; background-image:none !important;
  font-size:12px !important; line-height:normal; color:var(--ui-text) !important;
}
html[data-kvpl-theme] body.ui-refined #globalSearch > i { left:12px; top:50%; }
html[data-kvpl-theme] body.ui-refined #globalSearch kbd { top:50%; transform:translateY(-50%); font-size:10px; pointer-events:none; }
html[data-kvpl-theme] body.ui-refined #globalSearchResults { top:calc(100% + 8px); }

/* Native select behavior is retained, including keyboard selection and validation. */
html[data-kvpl-theme] body.ui-refined select {
  box-sizing:border-box; max-width:100%; min-width:0; min-height:40px;
  border:1px solid var(--ui-border-strong) !important; border-radius:10px !important;
  background-color:var(--ui-surface) !important; color:var(--ui-text) !important;
  font-family:var(--ui-font) !important; font-size:13px !important; line-height:1.45;
  padding:9px 12px; box-shadow:none !important; color-scheme:light;
}
html[data-kvpl-theme="dark"] body.ui-refined select { color-scheme:dark; }
html[data-kvpl-theme] body.ui-refined select:not([multiple]):is(:not([size]),[size="1"]) {
  appearance:none; -webkit-appearance:none; padding-right:36px !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23626269' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important; background-size:16px 16px !important;
  background-position:right 12px center !important;
}
html[data-kvpl-theme="dark"] body.ui-refined select:not([multiple]):is(:not([size]),[size="1"]) {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23b9b9c0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
html[data-kvpl-theme] body.ui-refined select[multiple],
html[data-kvpl-theme] body.ui-refined select[size]:not([size="1"]) { min-height:120px; background-image:none !important; padding:6px; }
html[data-kvpl-theme] body.ui-refined select :is(option,optgroup) { background:var(--ui-surface); color:var(--ui-text); font-family:var(--ui-font); }
html[data-kvpl-theme] body.ui-refined select option { padding:7px 10px; }
html[data-kvpl-theme] body.ui-refined select option:disabled { color:var(--ui-muted); }
html[data-kvpl-theme] body.ui-refined select:disabled { cursor:not-allowed; background-color:var(--ui-surface-2) !important; color:var(--ui-muted) !important; }
html[data-kvpl-theme] body.ui-refined select:focus { border-color:var(--ui-blue) !important; }
html[data-kvpl-theme] body.ui-refined .dropdown-menu { background:var(--ui-surface) !important; border:1px solid var(--ui-border) !important; }
html[data-kvpl-theme] body.ui-refined .dropdown-item { min-height:36px; padding:8px 12px; font-size:12px !important; }

/* Style the real upload input; retain selected filenames and the native chooser. */
html[data-kvpl-theme] body.ui-refined input[type="file"] {
  box-sizing:border-box; display:block; width:100%; max-width:100%; min-width:0;
  min-height:44px; height:auto; padding:5px 8px !important;
  border:1px dashed var(--ui-border-strong) !important; border-radius:10px !important;
  background:var(--ui-surface-2) !important; color:var(--ui-muted) !important;
  font-family:var(--ui-font) !important; font-size:12px !important;
  line-height:30px; box-shadow:none !important;
}
html[data-kvpl-theme] body.ui-refined input[type="file"]::file-selector-button {
  margin:0 10px 0 0; padding:7px 12px; min-height:32px;
  border:1px solid var(--ui-border) !important; border-radius:7px;
  background:var(--ui-surface); color:var(--ui-text);
  font:500 12px/1.3 var(--ui-font); cursor:pointer;
}
html[data-kvpl-theme] body.ui-refined input[type="file"]::file-selector-button:hover { background:var(--ui-blue-soft); border-color:var(--ui-blue) !important; color:var(--ui-blue); }
html[data-kvpl-theme] body.ui-refined input[type="file"]:focus-visible { border-color:var(--ui-blue) !important; }
html[data-kvpl-theme] body.ui-refined input[type="file"]:disabled::file-selector-button { opacity:.55; cursor:not-allowed; }
html[data-kvpl-theme] body.ui-refined input[type="file"].is-invalid,
html[data-kvpl-theme] body.ui-refined select.is-invalid,
html[data-kvpl-theme] body.ui-refined .was-validated :is(select,input[type="file"]):invalid,
html[data-kvpl-theme] body.ui-refined :is(select,input[type="file"])[aria-invalid="true"] { border-color:var(--ui-red) !important; }

/* Factory names and percentage get separate rows; metrics never force card width. */
html[data-kvpl-theme] body.ui-refined .factory-control-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)) !important; }
html[data-kvpl-theme] body.ui-refined .factory-control-head { display:grid !important; grid-template-columns:minmax(0,1fr); gap:7px; }
html[data-kvpl-theme] body.ui-refined .factory-control-head > div { min-width:0; align-items:flex-start; }
html[data-kvpl-theme] body.ui-refined .factory-control-head strong { overflow-wrap:anywhere; line-height:1.45; }
html[data-kvpl-theme] body.ui-refined .factory-code { flex:0 0 28px; }
html[data-kvpl-theme] body.ui-refined .factory-load { display:block; white-space:normal; padding-left:35px; font-size:11px !important; }
html[data-kvpl-theme] body.ui-refined .factory-control-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
html[data-kvpl-theme] body.ui-refined .factory-control-metrics > div { min-width:0; padding:8px 3px; }
html[data-kvpl-theme] body.ui-refined .factory-control-metrics span { font-size:10px !important; letter-spacing:0; white-space:normal; }
html[data-kvpl-theme] body.ui-refined :is(.factory-quantity-line,.factory-progress-foot) { flex-wrap:wrap; font-size:11px; }
@media (max-width:575.98px) {
  html[data-kvpl-theme] body.ui-refined :is(select,.form-control,.form-select,.form-group input:not([type="file"]),.form-group textarea,.simple-grade-row input,.simple-grade-row select) { font-size:16px !important; }
  html[data-kvpl-theme] body.ui-refined :is(.btn,.quick-action,.tab-btn,.approval-queue-tabs button,.sidebar-nav .nav-link) { min-height:44px !important; }
}
@media (forced-colors:active) {
  html[data-kvpl-theme] body.ui-refined select:not([multiple]):is(:not([size]),[size="1"]) { appearance:auto; background-image:none !important; }
}
@media print {
  html[data-kvpl-theme] body.ui-refined table :is(td,th) { font-size:9px !important; padding:4px !important; }
}

/* Layout audit r3: consistent alignment and intentional content spacing. */
html[data-kvpl-theme] body.ui-refined :is(.btn,.quick-action,.approval-queue-tabs button) {
  display:inline-flex; align-items:center !important; justify-content:center;
  box-sizing:border-box; gap:6px; height:auto; min-height:38px;
  padding:8px 12px !important; line-height:1.25 !important;
  vertical-align:middle; text-align:center; white-space:normal;
}
html[data-kvpl-theme] body.ui-refined .btn-sm { min-height:34px; padding:7px 10px !important; }
html[data-kvpl-theme] body.ui-refined :is(.btn,.quick-action) > :is(i.bi,svg) {
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  margin:0 !important; line-height:1 !important;
}
html[data-kvpl-theme] body.ui-refined .btn > i.bi::before { vertical-align:0; }
html[data-kvpl-theme] body.ui-refined :is(.btn,.quick-action):hover { transform:none !important; }
html[data-kvpl-theme] body.ui-refined .contract-more-menu .btn { justify-content:flex-start; text-align:left; }
html[data-kvpl-theme] body.ui-refined :is(.page-header,.workspace-page-header) {
  align-items:center !important; gap:12px !important; margin:0 0 16px !important;
  padding:0 !important; border-bottom:0 !important;
}
html[data-kvpl-theme] body.ui-refined :is(.page-header,.workspace-page-header) > .btn { flex:0 0 auto; align-self:center; }
html[data-kvpl-theme] body.ui-refined .kvpl-breadcrumb { margin-bottom:12px !important; }
html[data-kvpl-theme] body.ui-refined .content-wrapper { padding:20px clamp(16px,2vw,28px) 32px !important; }
html[data-kvpl-theme] body.ui-refined :is(.card-header,.industrial-panel-head,.simplified-card-header) { padding:14px 16px !important; gap:12px; }
html[data-kvpl-theme] body.ui-refined .card-header :is(.card-title,h2,h3,h4,h5) { margin-bottom:0 !important; }
html[data-kvpl-theme] body.ui-refined .card-body { padding:16px !important; }
html[data-kvpl-theme] body.ui-refined :is(.contract-register-hero,.approval-workspace-hero,.operational-report-hero,.conversion-workspace-hero,.unbilled-hero,.contract-detail-hero) { padding:20px !important; margin-bottom:16px; }
/* The two dashboard cards provide the surface; no second padded frame. */
html[data-kvpl-theme] body.ui-refined .modern-dashboard-hero {
  padding:0 !important; border:0 !important; background:transparent !important;
  box-shadow:none !important; gap:16px; margin-bottom:12px;
}
html[data-kvpl-theme] body.ui-refined :is(.dashboard-greeting,.dashboard-scope-card) { padding:20px !important; min-height:0 !important; }
html[data-kvpl-theme] body.ui-refined .dashboard-greeting p { margin:8px 0 16px; font-weight:400; letter-spacing:normal; }
html[data-kvpl-theme] body.ui-refined .dashboard-scope-card { align-content:start; gap:10px; }
html[data-kvpl-theme] body.ui-refined .dashboard-scope-card .factory-scope-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 12px; }
html[data-kvpl-theme] body.ui-refined .factory-scope-form label[for="financialYearScope"] { grid-column:1; grid-row:1; margin:0; }
html[data-kvpl-theme] body.ui-refined #financialYearScope { grid-column:1; grid-row:2; }
html[data-kvpl-theme] body.ui-refined .factory-scope-form label[for="factoryScope"] { grid-column:2; grid-row:1; margin:0; }
html[data-kvpl-theme] body.ui-refined #factoryScope { grid-column:2; grid-row:2; }
html[data-kvpl-theme] body.ui-refined .dashboard-meta-strip { min-height:0 !important; padding:6px 0 !important; margin-bottom:14px !important; gap:8px 16px; flex-wrap:wrap; }
html[data-kvpl-theme] body.ui-refined :is(.contract-filter-panel,.operational-filter-panel) { margin-bottom:16px; }
html[data-kvpl-theme] body.ui-refined :is(.simplified-form-actions,.contract-form-actions,.settings-save-bar) { padding:12px 16px !important; gap:12px; }
html[data-kvpl-theme] body.ui-refined :is(.modal-header,.modal-footer) { padding:14px 16px; }
html[data-kvpl-theme] body.ui-refined .modal-body { padding:16px; }
html[data-kvpl-theme] body.ui-refined .modal-footer .btn { margin:0; }
html[data-kvpl-theme] body.ui-refined .modal-footer { gap:8px; }
/* Match field/button boxes in filter bars; text cannot sit above unused height. */
html[data-kvpl-theme] body.ui-refined :is(.contract-filter-header,.operational-filter-form,.unbilled-filter-form) .btn { min-height:40px; }
html[data-kvpl-theme] body.ui-refined .document-upload-grid .btn { min-height:44px; }
@media (max-width:991.98px) {
  html[data-kvpl-theme] body.ui-refined .kvpl-main { padding-top:64px; }
  html[data-kvpl-theme] body.ui-refined .content-wrapper { padding:16px 16px 28px !important; }
}
@media (max-width:575.98px) {
  html[data-kvpl-theme] body.ui-refined :is(.btn,.btn-sm,.quick-action,.approval-queue-tabs button) { min-height:44px !important; }
  html[data-kvpl-theme] body.ui-refined :is(.page-header,.workspace-page-header) { align-items:flex-start !important; }
  html[data-kvpl-theme] body.ui-refined :is(.page-header,.workspace-page-header) > .btn { align-self:flex-start; }
  html[data-kvpl-theme] body.ui-refined :is(.dashboard-greeting,.dashboard-scope-card) { padding:16px !important; }
  html[data-kvpl-theme] body.ui-refined .dashboard-meta-strip { white-space:normal; }
  html[data-kvpl-theme] body.ui-refined :is(.simplified-form-actions,.contract-form-actions,.settings-save-bar) { position:static !important; }
}
@media print {
  html[data-kvpl-theme] body.ui-refined .kvpl-main { padding-top:0 !important; }
  html[data-kvpl-theme] body.ui-refined .content-wrapper { padding:0 !important; }
}

/* Global audit r4: hidden state takes precedence over flex/grid utility classes. */
html[data-kvpl-theme] body.ui-refined [hidden] { display:none !important; }

/* Composite search fields own a single border and focus indicator. */
html[data-kvpl-theme] body.ui-refined :is(.report-search-box,.alert-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.filter-input-icon) {
  display:flex; align-items:center; gap:8px; min-width:0; margin:0;
  padding:0 11px; border:1px solid var(--ui-border-strong) !important;
  border-radius:10px; background:var(--ui-surface-2) !important;
  color:var(--ui-text) !important; box-shadow:none !important;
}
html[data-kvpl-theme] body.ui-refined :is(.report-search-box,.alert-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.filter-input-icon):focus-within {
  border-color:var(--ui-blue) !important; outline:2px solid var(--ui-blue); outline-offset:2px;
}
html[data-kvpl-theme] body.ui-refined :is(.report-search-box,.alert-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.filter-input-icon) input {
  flex:1; width:100%; min-width:0; min-height:38px; margin:0; padding:8px 0 !important;
  border:0 !important; border-radius:0 !important; outline:none !important;
  box-shadow:none !important; background:transparent !important; color:var(--ui-text) !important;
}
html[data-kvpl-theme] body.ui-refined :is(.report-search-box,.alert-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.filter-input-icon) > i {
  position:static; transform:none; flex:none; color:var(--ui-muted) !important;
}
html[data-kvpl-theme] body.ui-refined :is(.currency-chip,.factory-chip,.operational-report-context > span,.operational-filter-count) {
  display:inline-flex; align-items:center; gap:5px; padding:4px 8px;
  background:var(--ui-blue-soft) !important; color:var(--ui-blue) !important;
  border:1px solid var(--ui-border) !important; font-family:var(--ui-font) !important;
  line-height:1.4 !important; opacity:1;
}
html[data-kvpl-theme] body.ui-refined :is(.operational-filter-heading,.industrial-filter-heading,.section-heading-row) :is(strong,h2) { color:var(--ui-text) !important; }
html[data-kvpl-theme] body.ui-refined :is(.operational-filter-heading,.industrial-filter-heading,.section-heading-row) :is(small,p) { color:var(--ui-muted) !important; }
html[data-kvpl-theme] body.ui-refined .card-header { gap:8px; }
html[data-kvpl-theme] body.ui-refined .card-header :is(h2,h3,h4,h5,h6) .badge { margin-inline-start:6px; vertical-align:middle; }
@media (max-width:575.98px) {
  html[data-kvpl-theme] body.ui-refined :is(.report-search-box,.alert-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.filter-input-icon) input { min-height:44px; font-size:16px !important; }
}
@media print {
  /* Preserve the existing print-all-approval-queues workflow. */
  html[data-kvpl-theme] body.ui-refined .approval-queue-panel[hidden] { display:block !important; }
}

/* September 6 workspace: shared sizing and layout, scoped to the new shell.
   Existing business-specific table, badge and state styles remain available. */
html[data-kvpl-theme] body.ui-makeover {
  --ui-radius:12px; --ui-radius-sm:8px;
  --ui-shadow:0 1px 3px rgba(0,0,0,.035);
  --mk-gap:16px;
  font-size:14px; line-height:1.5;
}
html[data-kvpl-theme="light"] body.ui-makeover { --ui-bg:#f6f7f9; --ui-sidebar:#eef0f3; --ui-border:#dde1e7; --ui-muted:#596474; --ui-blue:#0869d8; }
html[data-kvpl-theme="dark"] body.ui-makeover { --ui-bg:#111315; --ui-sidebar:#191c20; --ui-surface:#1c2025; --ui-surface-2:#24292f; --ui-border:#353b44; --ui-muted:#aab4c0; }
html[data-kvpl-theme] body.ui-refined.ui-makeover .content-wrapper {padding:24px 28px 28px!important;max-width:1680px;margin:0 auto;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.page-header,.workspace-page-header,.contract-register-hero,.modern-dashboard-hero,.report-workspace-hero,.unbilled-hero,.amendment-review-hero) { padding:0 0 18px!important;margin:0 0 18px!important;border:0!important;border-bottom:1px solid var(--ui-border)!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;min-height:0!important;gap:16px; }
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(h1,.page-title,.contract-register-hero h1,.report-workspace-hero h1,.unbilled-hero h1) {font-size:26px!important;line-height:1.2!important;font-weight:650!important;letter-spacing:-.7px;color:var(--ui-text)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(h2,.card-title,.industrial-panel-head h2) {font-size:15px!important;font-weight:650!important;line-height:1.4!important;letter-spacing:-.15px;margin:0;color:var(--ui-text)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.page-title small,.page-header p,.contract-register-hero p,.modern-dashboard-hero p,.report-workspace-hero p,.unbilled-hero p) {font-size:13px!important;line-height:1.5!important;margin:6px 0 0!important;color:var(--ui-muted)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.management-kicker,.workspace-kicker,.panel-eyebrow,.panel-legend-note,.dashboard-meta-strip,.dashboard-scope-card>.scope-card-icon,.scope-card-copy,.dashboard-greeting>.management-kicker,.contract-register-stats,.report-workspace-stat,.report-category-summary,.contract-detail-number,.contract-detail-customer,.contract-detail-identity>.workspace-kicker) {display:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .dashboard-scope-card {min-width:0;padding:0!important;border:0!important;background:none!important;box-shadow:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .factory-scope-form {display:grid;grid-template-columns:auto minmax(100px,150px) auto minmax(160px,240px);align-items:center;gap:8px;width:auto;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .factory-scope-form label {margin:0;white-space:nowrap;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .modern-dashboard-hero {display:flex;align-items:flex-start;flex-wrap:wrap;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .dashboard-quick-actions {margin-top:12px;gap:8px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.btn,.quick-action,.login-btn) {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 13px!important;border-radius:8px!important;font-size:13px!important;line-height:20px!important;font-weight:550!important;box-shadow:none!important;transform:none!important;text-decoration:none;vertical-align:middle;white-space:normal;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .btn-sm {min-height:32px;padding:5px 10px!important;font-size:12px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .btn :is(i,.bi) {margin:0!important;flex-shrink:0;line-height:1;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.card,.industrial-panel,.simplified-form-card,.report-catalogue-card) {border:1px solid var(--ui-border)!important;border-radius:12px!important;background:var(--ui-surface)!important;box-shadow:var(--ui-shadow)!important;overflow:visible;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.card-header,.industrial-panel-head) {padding:14px 18px!important;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:transparent!important;border-bottom:1px solid var(--ui-border)!important;min-height:0;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .card-body {padding:18px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.card.mb-4,.industrial-panel.mb-4) {margin-bottom:16px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(label,.form-label) {font-size:13px!important;line-height:1.4;font-weight:550;color:var(--ui-text);}
html[data-kvpl-theme] body.ui-refined.ui-makeover :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea) {font-family:var(--ui-font)!important;font-size:14px!important;border-radius:8px;min-height:36px;background-color:var(--ui-surface)!important;color:var(--ui-text)!important;border-color:var(--ui-border-strong)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(input,select,textarea):disabled {opacity:.65;cursor:not-allowed;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.form-hint,.form-text,.text-muted,.detail-label) {color:var(--ui-muted)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.form-hint,.form-text) {font-size:12px!important;line-height:1.5;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.filter-input-icon,.report-search-box,.search-container,.topbar-search) input {border:0!important;box-shadow:none!important;outline:none!important;background:transparent!important;border-radius:0!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(th,td) {font-size:13px!important;line-height:1.5!important;vertical-align:middle;padding:11px 13px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover th {font-size:12px!important;font-weight:600!important;text-transform:none!important;letter-spacing:0!important;background:var(--ui-surface-2)!important;color:var(--ui-muted)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.number,.text-end,.text-right) {font-variant-numeric:tabular-nums;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .table-wrap {border-radius:0 0 12px 12px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .ux-table-hint {margin:8px 14px;font-size:11px;color:var(--ui-muted);}
html[data-kvpl-theme] body.ui-refined.ui-makeover .empty-state {padding:30px 18px!important;font-size:13px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kvpl-sidebar {background:var(--ui-sidebar)!important;box-shadow:none!important;border-right:1px solid var(--ui-border);}
html[data-kvpl-theme] body.ui-refined.ui-makeover .sidebar-brand {padding-top:18px;padding-bottom:18px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .sidebar-user-switcher {padding:10px 12px!important;margin-bottom:12px;box-shadow:none!important;background:var(--ui-surface)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .sidebar-nav .nav-link {font-size:13px!important;min-height:36px;padding:8px 12px!important;border-radius:8px!important;gap:10px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .sidebar-nav .nav-link.active {background:var(--ui-surface)!important;color:var(--ui-blue)!important;box-shadow:0 1px 4px rgba(0,0,0,.04)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .nav-section-label {font-size:11px!important;text-transform:none!important;letter-spacing:0!important;color:var(--ui-muted)!important;margin-bottom:6px;}
.mk-nav-group {margin-top:16px;}.mk-nav-group summary {cursor:pointer;list-style:none;display:flex;justify-content:space-between;}.mk-nav-group summary:after {content:'+';}.mk-nav-group[open] summary:after {content:'−';}
.mk-tabs {display:flex;gap:4px;border-bottom:1px solid var(--ui-border);margin:0 0 20px;padding:0;overflow-x:auto;scrollbar-width:thin;}
.mk-tabs a {display:flex;align-items:center;justify-content:center;white-space:nowrap;min-height:44px;padding:10px 16px;color:var(--ui-muted);text-decoration:none;border-bottom:2px solid transparent;font-size:13px;font-weight:550;}
.mk-tabs a.active {color:var(--ui-blue);border-bottom-color:var(--ui-blue);}
.mk-tabs a:hover {background:var(--ui-blue-soft);border-radius:8px 8px 0 0;}
.mk-kpis {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px;}
.mk-kpis>a {display:flex;flex-direction:column;gap:5px;padding:18px 20px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface);text-decoration:none;color:var(--ui-text);}
.mk-kpis>a>span,.mk-kpis small {font-size:12px;color:var(--ui-muted);}.mk-kpis>a>strong {font-size:28px;line-height:1.3;font-weight:600;letter-spacing:-.8px;font-variant-numeric:tabular-nums;}.mk-kpis>a.mk-risk>strong {color:var(--ui-red);}
.mk-kpis>a:hover {border-color:var(--ui-blue);}
.mk-work-grid {display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:20px;align-items:start;}
.mk-task-list>a {display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid var(--ui-border);color:var(--ui-text);text-decoration:none;min-height:70px;}
.mk-task-list>a:last-child {border-bottom:0;}.mk-task-list>a:hover {background:var(--ui-surface-2);}.mk-task-list>a>i:first-child {color:var(--ui-blue);font-size:18px;}.mk-task-list>a>i:last-child {margin-left:auto;font-size:12px;color:var(--ui-muted);}
.mk-task-list strong,.mk-task-list small {display:block;}.mk-task-list strong {font-size:13px;font-weight:600;}.mk-task-list small {font-size:12px;color:var(--ui-muted);margin-top:3px;}.mk-task-value {margin-left:auto;text-align:right;flex-shrink:0;}.mk-task-value>strong {color:var(--ui-red);}
.mk-empty {display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;padding:32px 18px;color:var(--ui-muted);font-size:13px;text-align:center;}.mk-empty>i {font-size:24px;color:var(--ui-green);}.mk-empty>strong {color:var(--ui-text);}
.mk-next-action {display:flex;align-items:flex-start;gap:12px;background:var(--ui-blue-soft);padding:12px 16px;border-radius:10px;margin-bottom:16px;font-size:13px;}.mk-next-action>i {color:var(--ui-blue);font-size:18px;}.mk-next-action strong {display:block;font-size:12px;margin-bottom:2px;}.mk-next-action span {color:var(--ui-text);}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-detail-hero {padding:14px 18px!important;display:block!important;border:1px solid var(--ui-border)!important;background:var(--ui-surface)!important;margin-bottom:16px!important;min-height:0!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-detail-meta {margin:0 0 12px!important;padding:0 0 12px;border-bottom:1px solid var(--ui-border);}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-detail-metrics {display:grid!important;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px;padding:0!important;background:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-detail-metrics>div {padding:0!important;border:0!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-detail-metrics strong {font-size:20px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .approval-progress-card {padding:12px 18px!important;margin-bottom:16px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .approval-progress-head {display:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .approval-progress-track {margin:0!important;}
.mk-detail-panel {min-width:0;}.mk-detail-panel:focus {outline:none;}.mk-detail-panel:focus-visible {outline:2px solid var(--ui-blue);outline-offset:4px;}
.mk-summary-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-bottom:20px;}.mk-summary-item span {display:block;color:var(--ui-muted);font-size:12px;margin-bottom:4px;}.mk-summary-item strong {display:block;font-size:14px;overflow-wrap:anywhere;font-weight:600;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper {display:flex;position:static!important;gap:6px;padding:6px!important;box-shadow:none!important;margin:0 0 20px!important;background:var(--ui-surface-2)!important;border:1px solid var(--ui-border)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper>a {flex:1;padding:10px 12px!important;color:var(--ui-muted)!important;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;text-decoration:none;border-radius:8px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper>a.active {background:var(--ui-surface)!important;color:var(--ui-blue)!important;box-shadow:0 1px 4px rgba(0,0,0,.06);}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper small {display:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .form-completion {display:none!important;}
.mk-step-controls {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .simplified-form-actions {position:static!important;margin:16px 0 0!important;padding:16px!important;background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .simplified-core-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .simplified-card-header p {display:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-filter-panel {padding:16px!important;margin-bottom:12px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-filter-header {margin-bottom:12px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-filter-subtitle {display:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-workflow-tabs {margin-bottom:14px;}
.mk-register-tools {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;font-size:12px;color:var(--ui-muted);}
.mk-columns {position:relative;}.mk-columns>summary {list-style:none;cursor:pointer;}
.mk-column-menu {position:absolute;right:0;top:calc(100% + 6px);z-index:30;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:10px;padding:14px;min-width:220px;box-shadow:var(--ui-shadow-raised);}
.mk-check {display:flex;align-items:center;gap:8px;margin:0 0 9px;cursor:pointer;}.mk-check input {width:16px;height:16px;accent-color:var(--ui-blue);}
.mk-column-hidden {display:none!important;}
.mk-filter-chips,.mk-favourites {display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0;}
.mk-filter-chip {display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--ui-border);border-radius:6px;font-size:12px;background:var(--ui-surface);color:var(--ui-text);text-decoration:none;}
.mk-inline-controls {display:flex;align-items:center;gap:8px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .report-catalogue-grid.mk-report-list {display:flex;flex-direction:column;gap:8px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-catalogue-card {display:grid!important;grid-template-columns:130px minmax(0,1fr) auto;align-items:center;gap:16px;padding:16px!important;min-height:0!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-catalogue-icon,.mk-report-list .report-format-pills,.mk-report-list .report-catalogue-metrics {display:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-card-topline {margin:0;display:flex;align-items:center;gap:10px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-catalogue-copy h3 {font-size:14px!important;margin:0 0 4px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-catalogue-copy p {font-size:12px;margin:0;min-height:0;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-card-actions {margin:0;padding:0;border:0;}
.mk-favourite {border:0;background:none;color:var(--ui-blue);font-size:22px;padding:0 4px;min-width:32px;min-height:32px;cursor:pointer;}
.mk-help {margin-top:18px;color:var(--ui-muted);font-size:13px;}.mk-help>summary {padding:12px 0;cursor:pointer;}.mk-entry-disclosure {margin:16px 0;}.mk-entry-disclosure>summary {list-style:none;margin-bottom:12px;cursor:pointer;}
.mk-find-option,.mk-text-button {border:0;background:none;color:var(--ui-blue);font:inherit;font-size:12px!important;padding:4px 0;text-decoration:underline;cursor:pointer;}
.mk-option-dialog {width:min(580px,calc(100vw - 32px));max-height:80vh;padding:22px;border:1px solid var(--ui-border);border-radius:16px;background:var(--ui-surface);color:var(--ui-text);box-shadow:var(--ui-shadow-raised);}
.mk-option-dialog::backdrop {background:rgba(0,0,0,.4);backdrop-filter:blur(3px);}.mk-dialog-header {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;}.mk-option-results {max-height:46vh;overflow:auto;margin-top:10px;}.mk-option-result {display:block;width:100%;text-align:left;padding:12px;border:0;border-bottom:1px solid var(--ui-border);background:none;color:var(--ui-text);font-size:13px;}.mk-option-result:hover,.mk-option-result[aria-current] {background:var(--ui-blue-soft);}
.mk-file-status {display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;overflow-wrap:anywhere;padding:8px 0;}.mk-page-end {text-align:right;margin-top:24px;font-size:12px;}.mk-page-end a {color:var(--ui-muted);text-decoration:none;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .unbilled-info {border:1px solid var(--ui-border);background:var(--ui-surface);color:var(--ui-muted);font-size:13px;}.unbilled-info summary {cursor:pointer;color:var(--ui-text);font-weight:550;}
html[data-kvpl-theme] body.mk-login {background:var(--ui-bg)!important;background-image:none!important;padding:24px!important;}
html[data-kvpl-theme] body.mk-login .login-workspace {display:block;width:min(440px,100%);min-height:0;border:1px solid var(--ui-border);border-radius:20px;background:var(--ui-surface);box-shadow:0 16px 48px rgba(0,0,0,.06);}
html[data-kvpl-theme] body.mk-login .login-showcase {display:none!important;}
html[data-kvpl-theme] body.mk-login .login-panel {padding:36px!important;background:var(--ui-surface)!important;}
html[data-kvpl-theme] body.mk-login .login-mobile-logo {display:block!important;width:124px;margin:0 0 28px;}
html[data-kvpl-theme] body.mk-login .login-title {font-size:25px;font-weight:650;color:var(--ui-text);}
html[data-kvpl-theme] body.mk-login .login-sub {font-size:13px;color:var(--ui-muted);}
html[data-kvpl-theme] body.mk-login .login-btn {width:100%;min-height:42px;margin-top:8px;border-radius:8px;font-size:14px;}
html[data-kvpl-theme] body.mk-login .login-footer {line-height:1.6;font-size:11px;color:var(--ui-muted);}
@media(max-width:1199px){
  .mk-kpis {grid-template-columns:repeat(2,minmax(0,1fr));}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .factory-scope-form {grid-template-columns:auto 1fr;}
}
@media(max-width:991px){
  html[data-kvpl-theme] body.ui-refined.ui-makeover .content-wrapper {padding:16px!important;}
  .mk-work-grid {grid-template-columns:1fr;gap:16px;}
  .mk-summary-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .mk-tabs {margin-bottom:16px;}
}
@media(max-width:600px){
  html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.page-header,.contract-register-hero,.unbilled-hero) {flex-direction:column;align-items:stretch;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {font-size:16px!important;min-height:42px;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.btn,.btn-sm) {min-height:40px;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .simplified-core-grid {grid-template-columns:1fr;gap:16px;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper {gap:2px;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper>a {font-size:12px!important;padding:8px 6px!important;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-stepper>a>span {display:none!important;}
  .mk-kpis {gap:10px;}.mk-kpis>a {padding:14px;}.mk-kpis>a>strong {font-size:22px;}
  .mk-summary-grid {grid-template-columns:1fr;gap:12px;}
  .mk-task-list>a {padding:12px;gap:8px;}.mk-task-value {flex-shrink:1;}
  .mk-register-tools {align-items:flex-start;}.mk-register-tools>span {max-width:65%;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-catalogue-card {grid-template-columns:minmax(0,1fr) auto;gap:10px;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-card-topline {grid-column:1/-1;justify-content:space-between;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .mk-report-list .report-catalogue-copy p {display:none;}
  html[data-kvpl-theme] body.ui-refined.ui-makeover .po-destination-options>label {min-width:0!important;width:100%;}
  html[data-kvpl-theme] body.mk-login .login-panel {padding:28px!important;}
}
@media(prefers-reduced-motion:reduce){.ui-makeover * {scroll-behavior:auto!important;transition:none!important;animation:none!important;}}
@media print {
  html[data-kvpl-theme] body.ui-refined.ui-makeover .content-wrapper {padding:0!important;}
  .mk-detail-panel[hidden],[data-mk-panel][hidden],.contract-form-section[hidden],#mk-transfer-sources[hidden],#mk-transfer-destination[hidden],#mk-transfer-review[hidden] {display:block!important;}
  .mk-column-hidden {display:table-cell!important;}
  .mk-step-controls,.mk-tabs,.mk-column-tools,.mk-file-status,.mk-page-end {display:none!important;}
}
/* Hidden workflow panels and filtered rows must always relinquish their space. */
html[data-kvpl-theme] body.ui-refined.ui-makeover [hidden][hidden] {display:none!important;}
@media print {
 html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.mk-detail-panel,[data-mk-panel],.contract-form-section,#mk-transfer-sources,#mk-transfer-destination,#mk-transfer-review)[hidden][hidden] {display:block!important;}
 html[data-kvpl-theme] body.ui-refined.ui-makeover .amendment-comparison-table tr[hidden][hidden] {display:table-row!important;}
}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.admin-workspace-hero,.approval-workspace-hero,.certification-workspace-hero,.conversion-workspace-hero,.conversion-review-hero) {padding:0 0 18px!important;margin:0 0 18px!important;border:0!important;border-bottom:1px solid var(--ui-border)!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;min-height:0!important;gap:16px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.admin-workspace-hero,.approval-workspace-hero,.certification-workspace-hero,.conversion-workspace-hero,.conversion-review-hero) h1 {font-size:26px!important;color:var(--ui-text)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.admin-workspace-hero,.approval-workspace-hero,.certification-workspace-hero,.conversion-workspace-hero,.conversion-review-hero) p {font-size:13px!important;color:var(--ui-muted)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.approval-queue-panel,.conversion-panel,.admin-workspace-card) {background:var(--ui-surface)!important;border:1px solid var(--ui-border)!important;border-radius:12px!important;box-shadow:none!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .approval-decision-card {padding:16px!important;gap:14px;box-shadow:none!important;border-radius:8px!important;min-height:0!important;}
.mk-queue-search {display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--ui-border);}.mk-queue-search label {white-space:nowrap;margin:0;}.mk-queue-search input {max-width:360px;}.mk-queue-search .form-hint {white-space:nowrap;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-register-table .mk-column-hidden {display:none!important;}
@media(max-width:600px){.mk-queue-search{flex-wrap:wrap;gap:6px;}.mk-queue-search input{max-width:none;}.mk-queue-search .form-hint{font-size:11px;}}
@media print {html[data-kvpl-theme] body.ui-refined.ui-makeover .contract-register-table .mk-column-hidden {display:table-cell!important;}}

/* Shared search and dropdown controls, revision 2. Composite search fields own
   their only border; the inner input never draws a second surface. */
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.global-search,.alert-search-box,.report-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.role-toolbar > label,.filter-input-icon) {
 display:flex!important;align-items:center!important;gap:9px!important;padding:0 12px!important;
 border:1px solid var(--ui-border-strong)!important;border-radius:9px!important;
 background:var(--ui-surface)!important;box-shadow:none!important;min-width:0;
 min-height:38px!important;height:auto!important;color:var(--ui-text)!important;
}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.global-search,.alert-search-box,.report-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.role-toolbar > label,.filter-input-icon):focus-within {
 border-color:var(--ui-blue)!important;outline:2px solid var(--ui-blue-soft)!important;outline-offset:1px;box-shadow:none!important;
}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.global-search,.alert-search-box,.report-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.role-toolbar > label,.filter-input-icon) > input {
 display:block!important;flex:1 1 auto!important;width:100%!important;min-width:0!important;max-width:none!important;
 margin:0!important;padding:8px 0!important;min-height:36px!important;height:36px!important;
 border:0!important;border-width:0!important;border-radius:0!important;outline:0!important;
 box-shadow:none!important;background:none!important;background-color:transparent!important;
 font-size:14px!important;line-height:20px!important;color:var(--ui-text)!important;
}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.global-search,.alert-search-box,.report-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.role-toolbar > label,.filter-input-icon)>i {
 position:static!important;transform:none!important;flex:0 0 auto!important;margin:0!important;color:var(--ui-muted)!important;
}
.dashboard-filter-toolbar {display:flex;align-items:center;justify-content:flex-end;margin:0 0 16px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .dashboard-filter-toolbar .factory-scope-form {display:grid;grid-template-columns:auto minmax(130px,170px) auto minmax(180px,260px);align-items:center;gap:8px;}
.kv-dropdown {position:relative;display:block;min-width:0;width:100%;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > select.kv-native-select {
 position:absolute!important;left:0!important;top:0!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;
 padding:0!important;margin:0!important;border:0!important;opacity:0!important;clip-path:inset(50%);overflow:hidden!important;pointer-events:none;
}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > .kv-dropdown-control {
 display:block!important;width:100%!important;min-width:0!important;min-height:38px!important;height:38px!important;
 margin:0!important;padding:8px 34px 8px 12px!important;border:1px solid var(--ui-border-strong)!important;border-radius:9px!important;
 background:var(--ui-surface)!important;color:var(--ui-text)!important;box-shadow:0 1px 2px rgba(0,0,0,.025)!important;
 font:400 14px/20px var(--ui-font)!important;text-align:left!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;
 transition:border-color .12s,background-color .12s;
}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-typeahead > .kv-dropdown-control {cursor:text;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > .kv-dropdown-control:hover {border-color:var(--ui-blue)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > .kv-dropdown-control:focus-visible {
 border-color:var(--ui-blue)!important;outline:2px solid var(--ui-blue-soft)!important;outline-offset:1px;box-shadow:none!important;
}
.kv-dropdown-arrow {position:absolute;pointer-events:none;right:12px;top:5px;font-size:20px;line-height:24px;color:var(--ui-muted);}
.kv-dropdown.is-open .kv-dropdown-arrow {transform:rotate(180deg);}
.kv-dropdown.is-placeholder .kv-dropdown-control {color:var(--ui-muted)!important;}
.kv-dropdown.is-disabled {opacity:.65;}.kv-dropdown.is-disabled .kv-dropdown-control {cursor:not-allowed!important;}
.kv-dropdown-error {display:block;color:var(--ui-red);font-size:12px;line-height:1.45;margin-top:5px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > .kv-dropdown-control[aria-invalid="true"] {border-color:var(--ui-red)!important;}
.kv-dropdown-popup {position:fixed;z-index:1090;max-height:320px;min-width:0;border:1px solid var(--ui-border-strong);border-radius:11px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 12px 36px rgba(0,0,0,.18);padding:5px;overflow:hidden;font-family:var(--ui-font);}
.kv-dropdown-list {max-height:256px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown-popup > .kv-option-filter {
 width:calc(100% - 8px)!important;margin:4px!important;min-height:34px!important;height:34px!important;padding:6px 9px!important;
 border:1px solid var(--ui-border)!important;border-radius:7px!important;background:var(--ui-surface-2)!important;color:var(--ui-text)!important;font-size:13px!important;box-shadow:none!important;
}
.kv-dropdown-option {position:relative;padding:9px 28px 9px 10px;margin:2px 0;border-radius:6px;font-size:13px;line-height:1.5;cursor:pointer;overflow-wrap:anywhere;}
.kv-dropdown-option:hover,.kv-dropdown-option.is-active {background:var(--ui-blue-soft);color:var(--ui-text);}
.kv-dropdown-option[aria-selected="true"] {color:var(--ui-blue);font-weight:550;}
.kv-dropdown-option[aria-selected="true"]:after {content:'✓';position:absolute;right:10px;top:9px;}
.kv-dropdown-empty {padding:12px 10px;font-size:12px;color:var(--ui-muted);}
html[data-kvpl-theme] body.ui-refined.ui-makeover select[multiple] {padding:8px!important;background:var(--ui-surface)!important;border:1px solid var(--ui-border-strong)!important;border-radius:9px!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover select[multiple] option {padding:7px 10px;border-radius:5px;margin:2px;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .dropdown-menu {padding:6px!important;border:1px solid var(--ui-border-strong)!important;border-radius:10px!important;background:var(--ui-surface)!important;box-shadow:0 12px 36px rgba(0,0,0,.16)!important;}
html[data-kvpl-theme] body.ui-refined.ui-makeover .dropdown-item {border-radius:6px;padding:8px 11px;font-size:13px;color:var(--ui-text);}
html[data-kvpl-theme] body.ui-refined.ui-makeover .dropdown-item:hover {background:var(--ui-blue-soft)!important;}
@media(max-width:600px){
 .dashboard-filter-toolbar {display:block;}
 html[data-kvpl-theme] body.ui-refined.ui-makeover .dashboard-filter-toolbar .factory-scope-form {grid-template-columns:95px minmax(0,1fr);}
 html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > .kv-dropdown-control {height:42px!important;min-height:42px!important;font-size:16px!important;}
 html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.global-search,.alert-search-box,.report-search-box,.admin-user-toolbar > label,.master-record-toolbar > label,.role-toolbar > label,.filter-input-icon)>input {min-height:42px!important;height:42px!important;font-size:16px!important;}
 .kv-dropdown-option {min-height:42px;padding:10px 28px 10px 10px;}
}
@media print {
 .kv-dropdown-popup,.kv-dropdown-arrow,.kv-dropdown-error {display:none!important;}
 html[data-kvpl-theme] body.ui-refined.ui-makeover .kv-dropdown > .kv-dropdown-control {border:0!important;background:transparent!important;box-shadow:none!important;}
}

/* Admin search labels must reserve text space even inside a flex toolbar. */
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.admin-user-toolbar,.master-record-toolbar,.role-toolbar) {
 display:flex;flex-wrap:wrap;min-width:0;gap:12px;
}
html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.admin-user-toolbar,.master-record-toolbar,.role-toolbar) > label {
 box-sizing:border-box!important;flex:1 1 280px!important;width:100%!important;
 max-width:440px!important;min-width:0!important;margin:0!important;
}
@media(max-width:600px) {
 html[data-kvpl-theme] body.ui-refined.ui-makeover :is(.admin-user-toolbar,.master-record-toolbar,.role-toolbar) > label {
  flex-basis:100%!important;max-width:none!important;
 }
}

/* Contract approval: summary, supporting PO and decision in one view. */
.approval-review-page {max-width:1600px;margin:0 auto;}
.approval-review-header {display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px;flex-wrap:wrap;}
.approval-review-header h1 {margin:0 0 6px;}
.approval-review-header p {margin:0 0 5px;}
.approval-review-layout {display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:18px;align-items:start;}
.approval-review-layout > .card {min-width:0;}
.approval-review-summary {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 0 20px;}
.approval-review-summary dt {font-size:12px;color:var(--ui-muted);font-weight:400;}
.approval-review-summary dd {margin:4px 0 0;font-weight:550;overflow-wrap:anywhere;}
.approval-review-document {padding:12px 0;border-bottom:1px solid var(--ui-border);}
.approval-review-document p {overflow-wrap:anywhere;margin:5px 0 10px;}
.approval-review-totals {text-align:right;padding-top:12px;}
#approval-po-panel {margin-top:16px;}
#approval-po-frame {display:block;width:100%;height:65vh;min-height:320px;border:1px solid var(--ui-border);border-radius:8px;margin-top:12px;background:var(--ui-surface);}
.approval-review-history {padding:10px 0;border-bottom:1px solid var(--ui-border);}
.approval-review-history p,.approval-review-notes {white-space:pre-wrap;overflow-wrap:anywhere;}
.approval-review-page .card {margin-bottom:18px;}
.approval-review-page h2 {font-size:18px;margin:0;}
.approval-review-page h3 {font-size:15px;}
@media(max-width:1000px){.approval-review-layout {grid-template-columns:1fr;}}
@media(max-width:500px){.approval-review-summary {grid-template-columns:1fr;}}
