:root {
  --brand: #f4b400;
  --brand-strong: #dc9900;
  --brand-soft: #fff7d6;
  --ink: #17191f;
  --ink-soft: #5f6673;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --line: #e8eaf0;
  --sidebar: #15171c;
  --sidebar-soft: #22252d;
  --success: #198754;
  --danger: #dc3545;
  --info: #0d6efd;
  --purple: #7950f2;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(27, 31, 43, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: #f2f4f7; }
a { color: inherit; }
.app-layout { min-height: 100vh; }
.app-sidebar { width: 278px !important; background: var(--sidebar); color: #fff; border: 0 !important; }
.sidebar-inner { min-height: 100vh; display: flex; flex-direction: column; padding: 24px 18px 18px; }
.brand-lockup { color: #fff; text-decoration: none; display: block; padding: 6px 10px 20px; }
.brand-word { display: block; color: var(--brand); font-size: 2rem; line-height: 1; font-weight: 950; font-style: italic; letter-spacing: -.08em; }
.brand-subtitle { display: block; margin-top: 8px; font-size: .72rem; color: rgba(255,255,255,.52); text-transform: uppercase; letter-spacing: .08em; }
.sidebar-user { display: flex; gap: 12px; align-items: center; padding: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; margin-bottom: 18px; }
.sidebar-avatar, .user-dot { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--brand); color: #171717; font-weight: 900; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: .9rem; }
.sidebar-user small { color: rgba(255,255,255,.56); font-size: .76rem; margin-top: 2px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; padding-right: 2px; }
.sidebar-section { padding: 16px 13px 5px; color: rgba(255,255,255,.38); font-size: .67rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.sidebar-link { text-decoration: none; color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 8px 11px; border-radius: 12px; font-size: .9rem; font-weight: 650; transition: .2s ease; }
.sidebar-link span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.055); }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.sidebar-link.active { color: #171717; background: var(--brand); box-shadow: 0 10px 26px rgba(244,180,0,.22); }
.sidebar-link.active span { background: rgba(0,0,0,.08); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.08); padding: 18px 8px 0; }
.sidebar-footer small, .sidebar-footer strong { display: block; }
.sidebar-footer small { color: rgba(255,255,255,.38); font-size: .7rem; }
.sidebar-footer strong { font-size: .85rem; }
.btn-icon-light { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; }
.app-content-shell { min-height: 100vh; }
.app-main { padding: 34px 38px 48px; max-width: 1800px; margin: 0 auto; }
.mobile-topbar { height: 66px; padding: 10px 16px; background: var(--sidebar); color: #fff; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1020; }
.mobile-brand { text-decoration: none; color: #fff; text-align: center; }
.mobile-brand span { display: block; color: var(--brand); font-weight: 900; font-style: italic; }
.mobile-brand small { font-size: .64rem; color: rgba(255,255,255,.55); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-header h1 { margin: 4px 0 6px; font-size: clamp(1.7rem, 2.8vw, 2.6rem); font-weight: 850; letter-spacing: -.035em; }
.page-header p { margin: 0; color: var(--ink-soft); max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 850; color: var(--brand-strong); }
.eyebrow.light { color: #ffe08a; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); text-decoration: none; font-size: .9rem; margin-bottom: 8px; }
.back-link:hover { color: var(--ink); }
.surface-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-surface, .preview-surface { padding: 26px; }
.section-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.section-heading h2 { font-size: 1.05rem; margin: 0 0 2px; font-weight: 800; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: .85rem; }
.section-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; background: var(--brand-soft); color: var(--brand-strong); font-size: 1.15rem; flex: 0 0 auto; }
.btn { border-radius: 11px; font-weight: 700; padding: .66rem .95rem; }
.btn-sm { padding: .45rem .72rem; }
.btn-primary-brand { background: var(--brand); border-color: var(--brand); color: #161616; box-shadow: 0 9px 22px rgba(244,180,0,.2); }
.btn-primary-brand:hover, .btn-primary-brand:focus { background: #e5a700; border-color: #e5a700; color: #111; transform: translateY(-1px); }
.btn-soft { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-soft:hover { background: var(--surface-soft); border-color: #d9dce4; }
.btn-icon { width: 39px; height: 39px; padding: 0; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-remove-item { color: var(--danger); }
.form-label { font-size: .79rem; font-weight: 800; color: #383d47; margin-bottom: 7px; }
.form-control, .form-select { min-height: 46px; border-radius: 11px; border-color: #dfe2e8; background-color: #fff; }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(244,180,0,.14); }
.form-control::placeholder { color: #adb2bc; }
.required-mark { color: var(--danger); margin-left: 3px; }
.field-error { color: var(--danger); font-size: .78rem; margin-top: 6px; display: flex; gap: 5px; align-items: flex-start; }
.field-error.field-warning { color: #8a6400; }
.form-text { color: #7c828e; font-size: .76rem; }
.money-wrapper { position: relative; }
.money-wrapper .money-prefix { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); z-index: 3; font-size: .76rem; font-weight: 850; color: #6f7580; pointer-events: none; }
.money-wrapper .money-input { padding-left: 66px; }
.split-document-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 24px; align-items: start; }
.preview-surface { min-width: 0; }
.file-preview { min-height: 430px; border: 1px dashed #cfd3dc; border-radius: 16px; background: #f7f8fa; padding: 10px; overflow: hidden; }
.file-preview.large { min-height: 610px; }
.file-preview iframe, .file-preview img { width: 100%; height: 100%; min-height: 405px; border: 0; border-radius: 10px; object-fit: contain; background: #fff; }
.file-preview.large iframe, .file-preview.large img { min-height: 580px; }
.preview-placeholder { min-height: 405px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #858b96; gap: 9px; }
.preview-placeholder i { font-size: 3.2rem; color: #b7bcc5; }
.preview-placeholder strong { color: #515762; }
.sticky-summary { position: sticky; top: 24px; }
.sticky-form-actions { position: sticky; bottom: 14px; z-index: 50; margin-top: 24px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.93); backdrop-filter: blur(12px); box-shadow: 0 16px 42px rgba(17,20,28,.12); display: flex; justify-content: flex-end; gap: 10px; border: 1px solid rgba(230,232,238,.9); }
.repeatable-row { border: 1px solid var(--line); border-radius: 15px; padding: 16px; margin-bottom: 12px; background: #fbfbfc; transition: .2s ease; }
.repeatable-row:hover { border-color: #d6dae2; box-shadow: 0 8px 20px rgba(24,28,38,.045); }
.info-panel { display: flex; gap: 12px; background: #f4f7ff; color: #34456e; padding: 14px; border-radius: 14px; }
.info-panel p { margin: 3px 0 0; font-size: .8rem; }
.employee-check-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.employee-check-grid label { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; font-weight: 700; }
.employee-check-grid label:hover { border-color: var(--brand); background: var(--brand-soft); }
.employee-check-grid input { width: 18px; height: 18px; accent-color: var(--brand-strong); }
.filter-grid { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr auto; gap: 14px; align-items: end; padding: 20px; }
.filter-grid.compact { grid-template-columns: minmax(230px, 2fr) minmax(180px, 1fr) auto; }
.filter-grid label { display: block; font-size: .72rem; font-weight: 800; color: #646a75; margin-bottom: 6px; }
.filter-action { display: flex; }
.stat-strip { background: linear-gradient(135deg, #1b1d22, #2a2e37); color: #fff; padding: 20px 24px; border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-strip span, .stat-strip strong { display: block; }
.stat-strip span { color: rgba(255,255,255,.57); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.stat-strip strong { font-size: 1.8rem; margin-top: 3px; }
.modern-table thead th { background: #f7f8fa; color: #747a86; border-bottom: 1px solid var(--line); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; padding: 14px 16px; white-space: nowrap; }
.modern-table tbody td { padding: 15px 16px; vertical-align: middle; border-color: #f0f1f4; }
.modern-table tbody tr:hover { background: #fffdf6; }
.chip { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #f1f3f6; color: #4e5560; font-size: .75rem; font-weight: 750; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.status-badge.large { padding: 9px 14px; font-size: .78rem; }
.status-success { color: #087443; background: #dcf8ea; }
.status-danger { color: #a91f2d; background: #ffe2e5; }
.status-warning { color: #8a6400; background: #fff1bd; }
.status-info { color: #145db5; background: #deecff; }
.status-primary { color: #154fa2; background: #dce9ff; }
.status-purple { color: #5d32bd; background: #eee5ff; }
.status-muted { color: #626873; background: #eceef1; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.visual-stat { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 15px; }
.visual-stat-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #f2f4f7; font-size: 1.25rem; }
.visual-stat small, .visual-stat strong { display: block; }
.visual-stat small { color: var(--ink-soft); font-size: .76rem; }
.visual-stat strong { margin-top: 3px; font-size: 1.35rem; }
.visual-stat-primary { background: linear-gradient(135deg, #252831, #15171c); color: #fff; }
.visual-stat-primary small { color: rgba(255,255,255,.6); }
.visual-stat-primary .visual-stat-icon { background: var(--brand); color: #111; }
.visual-stat-success .visual-stat-icon { background: #dff7eb; color: var(--success); }
.visual-stat-danger .visual-stat-icon { background: #ffe4e7; color: var(--danger); }
.metric-hero { display: flex; flex-direction: column; gap: 7px; }
.metric-hero span:first-child { color: var(--ink-soft); font-size: .8rem; }
.metric-hero strong { font-size: clamp(2rem, 4vw, 3.3rem); letter-spacing: -.05em; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; margin: 0; }
.detail-grid.single { grid-template-columns: 1fr; }
.detail-grid div { min-width: 0; }
.detail-grid dt { color: #818793; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.detail-grid dd { margin: 0; font-weight: 650; }
.detail-wide { grid-column: 1 / -1; }
.empty-state { text-align: center; padding: 52px 24px; color: #858b96; }
.empty-state.compact { padding: 24px; }
.empty-state i { font-size: 2.8rem; color: #c2c6ce; }
.empty-state h3 { color: #4d535e; font-size: 1.05rem; margin: 12px 0 4px; }
.delivery-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.delivery-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; transition: .22s ease; }
.delivery-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px rgba(27,31,43,.12); }
.delivery-card-top { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.delivery-card h2 { font-size: 1.06rem; margin: 4px 0 0; }
.delivery-route { display: flex; gap: 10px; margin: 18px 0; color: #626974; }
.delivery-route span { color: var(--brand-strong); }
.delivery-route p { margin: 0; font-size: .84rem; }
.delivery-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px; background: #f7f8fa; border-radius: 13px; }
.delivery-meta small, .delivery-meta strong { display: block; }
.delivery-meta small { color: #888e99; font-size: .68rem; }
.delivery-meta strong { font-size: .83rem; margin-top: 2px; }
.process-track.compact { height: 7px; background: #eceef2; border-radius: 999px; margin: 17px 0; overflow: hidden; }
.process-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #ffcf3f); border-radius: inherit; transition: width .4s ease; }
.assigned-team { display: flex; justify-content: space-between; align-items: center; color: #6b717d; font-size: .78rem; }
.avatar-stack { display: flex; align-items: center; }
.avatar-mini { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: #20232a; color: #fff; border: 2px solid #fff; margin-left: -6px; font-size: .68rem; font-weight: 800; }
.stretched-card-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #222; font-size: .8rem; font-weight: 800; margin-top: 16px; }
.process-card { padding: 24px 30px; }
.process-track:not(.compact) { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; min-height: 82px; }
.process-track:not(.compact)::before { content: ""; position: absolute; top: 20px; left: 8%; right: 8%; height: 6px; border-radius: 999px; background: #e9ebef; }
.process-track:not(.compact) .process-fill { position: absolute; top: 20px; left: 8%; max-width: 84%; height: 6px; z-index: 1; }
.process-node { position: relative; z-index: 2; text-align: center; color: #a0a5ae; }
.process-node i { width: 42px; height: 42px; margin: 0 auto 8px; display: grid; place-items: center; border-radius: 50%; background: #e9ebef; color: #8b919b; border: 4px solid #fff; box-shadow: 0 0 0 1px #e2e5ea; }
.process-node span { font-size: .72rem; font-weight: 750; }
.process-node.active { color: #272b32; }
.process-node.active i { background: var(--brand); color: #111; }
.evidence-image { height: 280px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: #f7f8fa; margin-bottom: 12px; }
.evidence-image img { width: 100%; height: 100%; object-fit: contain; }
.ranking-row, .activity-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid #eff0f3; text-decoration: none; }
.ranking-row:last-child, .activity-row:last-child { border-bottom: 0; }
.ranking-row small, .activity-row small { display: block; color: #858b96; font-size: .73rem; }
.activity-row { color: inherit; }
.activity-row:hover { color: inherit; background: #fffdf6; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.activity-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); border-radius: 11px; flex: 0 0 auto; }
.activity-row > div { flex: 1; }
.system-message-modal { border: 0; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.18); }
.system-message { display: flex; gap: 16px; padding: 28px 28px 15px; }
.message-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; font-size: 1.5rem; flex: 0 0 auto; }
.message-success .message-icon { color: var(--success); background: #dff7eb; }
.message-error .message-icon { color: var(--danger); background: #ffe4e7; }
.message-warning .message-icon { color: #a17600; background: #fff1bd; }
.message-info .message-icon { color: var(--info); background: #dfecff; }
.system-message h5 { font-weight: 850; margin: 4px 0 6px; }
.system-message p { color: var(--ink-soft); margin: 0; }
.global-loader { position: fixed; inset: 0; z-index: 3000; background: rgba(18,20,25,.58); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; }
.global-loader.show { display: flex; }
.loader-card { width: min(90vw, 330px); background: #fff; border-radius: 22px; padding: 30px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.22); }
.loader-card strong, .loader-card small { display: block; }
.loader-card small { color: #858b96; margin-top: 5px; }
.loader-orbit { height: 54px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.loader-orbit span { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); animation: loaderBounce 1.1s infinite ease-in-out; }
.loader-orbit span:nth-child(2){animation-delay:.15s}.loader-orbit span:nth-child(3){animation-delay:.3s}
@keyframes loaderBounce { 0%,80%,100%{transform:scale(.65);opacity:.45}40%{transform:scale(1);opacity:1} }
.auth-body { min-height: 100vh; background: #111318; }
.login-page-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-visual-panel { position: relative; color: #fff; overflow: hidden; background: radial-gradient(circle at 20% 10%, rgba(244,180,0,.24), transparent 35%), linear-gradient(145deg,#17191f 0%,#222630 100%); }
.login-visual-panel::after { content:""; position:absolute; width:520px; height:520px; border:1px solid rgba(255,255,255,.08); border-radius:50%; right:-180px; bottom:-180px; box-shadow:0 0 0 80px rgba(255,255,255,.025),0 0 0 160px rgba(255,255,255,.018); }
.login-visual-content { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; padding: 54px 64px; }
.login-brand span { color: var(--brand); display: block; font-size: 2.2rem; font-weight: 950; font-style: italic; letter-spacing: -.08em; }
.login-brand small { color: rgba(255,255,255,.5); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; }
.login-hero-copy { margin: auto 0; max-width: 700px; }
.login-hero-copy h1 { font-size: clamp(3rem, 6vw, 5.8rem); line-height: .95; letter-spacing: -.07em; margin: 15px 0 24px; font-weight: 900; }
.login-hero-copy p { color: rgba(255,255,255,.66); font-size: 1.06rem; max-width: 570px; }
.login-feature-row { display: flex; flex-wrap: wrap; gap: 22px; color: rgba(255,255,255,.7); font-size: .78rem; }
.login-feature-row div { display: flex; align-items: center; gap: 7px; }
.login-feature-row i { color: var(--brand); }
.login-form-panel { background: #f5f6f8; display: grid; place-items: center; padding: 36px; }
.login-form-card { width: min(100%, 440px); }
.login-logo-mini { display: inline-grid; place-items: center; width: 55px; height: 55px; border-radius: 16px; background: var(--brand); color: #111; font-weight: 900; margin-bottom: 24px; }
.login-form-head h2 { font-weight: 900; letter-spacing: -.04em; margin-bottom: 7px; }
.login-form-head p { color: var(--ink-soft); margin-bottom: 28px; }
.floating-field { position: relative; margin-bottom: 16px; }
.floating-field > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #7d838f; z-index: 2; }
.floating-field .form-control { height: 58px; padding: 22px 48px 8px 46px; background: #fff; }
.floating-field label { position: absolute; left: 46px; top: 18px; color: #828894; pointer-events: none; transition: .16s ease; }
.floating-field input:focus + label, .floating-field input:not(:placeholder-shown) + label { top: 7px; font-size: .68rem; color: var(--brand-strong); }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #777d88; }
.login-error { display: flex; gap: 10px; align-items: center; background: #ffe7e9; color: #a72533; border-radius: 13px; padding: 13px; margin-bottom: 16px; font-size: .85rem; }
.login-security { text-align: center; margin-top: 23px; color: #858b96; font-size: .75rem; }
@media (min-width: 992px) { .app-sidebar { position: fixed; inset: 0 auto 0 0; transform: none !important; visibility: visible !important; } .app-content-shell { margin-left: 278px; } }
@media (max-width: 1199.98px) { .delivery-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .split-document-layout { grid-template-columns: 1fr; } .sticky-summary { position: static; } }
@media (max-width: 991.98px) { .app-main { padding: 24px 18px 40px; } .mobile-topbar { display: flex !important; } .app-sidebar .sidebar-inner { min-height: 100%; } .dashboard-grid { grid-template-columns: 1fr 1fr; } .login-page-shell { grid-template-columns: 1fr; } .login-visual-panel { display: none; } }
@media (max-width: 767.98px) { .page-header { align-items: flex-start; } .page-actions { width: 100%; } .page-actions .btn { flex: 1; } .filter-grid, .filter-grid.compact { grid-template-columns: 1fr; } .filter-action .btn { width: 100%; } .dashboard-grid, .delivery-card-grid { grid-template-columns: 1fr; } .detail-grid { grid-template-columns: 1fr; } .detail-wide { grid-column: auto; } .process-track:not(.compact) { overflow-x: auto; min-width: 620px; } .process-card { overflow-x: auto; } .sticky-form-actions { bottom: 8px; } .login-form-panel { padding: 24px 18px; } }
/* Compatibility polish for templates that still use standard Bootstrap cards. */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header, .card-footer { border-color: var(--line); padding: 16px 20px; }
.card-header { font-weight: 800; }
.table thead th { color: #747a86; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.alert { border: 0; border-radius: 13px; }
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 28px 75px rgba(0,0,0,.2); overflow: hidden; }
.modal-header, .modal-footer { border-color: var(--line); padding: 18px 22px; }
.modal-body { padding: 22px; }
/* Visual refinements for commercial and financial workspaces. */
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8a909b; z-index: 2; }
.input-icon .form-control { padding-left: 42px; }
.filter-wide { min-width: 260px; }
.record-count { font-size: .74rem; font-weight: 800; color: #747a86; background: #f3f4f7; border-radius: 999px; padding: 7px 11px; }
.document-number { color: var(--ink); font-weight: 900; text-decoration: none; }
.document-number:hover { color: var(--brand-strong); }
.visual-stat > div { min-width: 0; }
.visual-stat span:not(.visual-stat-icon) { display: block; color: var(--ink-soft); font-size: .74rem; margin-top: 2px; }
.visual-stat-primary span:not(.visual-stat-icon) { color: rgba(255,255,255,.62); }
.visual-stat-warning .visual-stat-icon { color: #9a6c00; background: #fff0ba; }
.financial-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.financial-card { display: block; min-height: 285px; background: linear-gradient(155deg, #fff 0%, #fafbfc 100%); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 23px; text-decoration: none; color: var(--ink); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; overflow: hidden; position: relative; }
.financial-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -80px; top: -80px; border-radius: 50%; background: rgba(244,180,0,.08); }
.financial-card:hover { color: var(--ink); transform: translateY(-4px); border-color: #d7d9df; box-shadow: 0 25px 60px rgba(27,31,43,.13); }
.financial-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; position: relative; z-index: 1; }
.financial-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #171717; background: var(--brand); font-size: 1.35rem; }
.financial-card > small { color: var(--ink-soft); font-weight: 750; }
.financial-card h2 { font-size: 1.25rem; font-weight: 900; margin: 5px 0 2px; }
.financial-card p { color: var(--ink-soft); font-size: .84rem; }
.financial-balance { padding: 15px 0; margin: 17px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.financial-balance span, .financial-balance strong { display: block; }
.financial-balance span { color: var(--ink-soft); font-size: .72rem; }
.financial-balance strong { margin-top: 4px; font-size: 1.18rem; }
.financial-meta { display: flex; justify-content: space-between; gap: 12px; color: #747a86; font-size: .75rem; }
.financial-open { position: absolute; left: 23px; bottom: 20px; font-size: .78rem; font-weight: 850; color: var(--brand-strong); }
.grid-span-full { grid-column: 1 / -1; }
@media (min-width: 768px) {
  .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .filter-grid.compact { grid-template-columns: minmax(260px, 2fr) minmax(165px, .8fr) minmax(165px, .8fr) auto; }
}
.signature-pad-wrap { position: relative; border: 1.5px dashed #c8ccd5; border-radius: 15px; overflow: hidden; background: repeating-linear-gradient(0deg,#fff,#fff 39px,#f1f2f5 40px); }
.signature-pad-wrap canvas { width: 100%; height: 210px; display: block; touch-action: none; cursor: crosshair; }
.signature-pad-wrap > span { position: absolute; left: 0; right: 0; bottom: 9px; text-align: center; color: #a0a5af; font-size: .72rem; pointer-events: none; }

/* =========================================================
   SIDEBAR NEGRO Y CON SCROLL INDEPENDIENTE
   ========================================================= */

.app-body {
    min-height: 100vh;
    background: #f2f4f7;
}

.app-layout {
    min-height: 100vh;
}

/* Contenedor principal del menú */
.app-sidebar,
.app-sidebar.offcanvas,
.app-sidebar.offcanvas-start {
    --bs-offcanvas-width: 278px;
    --bs-offcanvas-bg: #0d0d0f;
    --bs-offcanvas-color: #ffffff;

    width: 278px !important;
    height: 100vh;
    height: 100dvh;
    background: #0d0d0f !important;
    color: #ffffff !important;
    border: 0 !important;
    overflow: hidden;
}

/* Contenedor interior */
.app-sidebar .sidebar-inner {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 24px 18px 18px;

    display: flex;
    flex-direction: column;

    background: #0d0d0f;
    overflow: hidden;
}

/* Encabezado del offcanvas en celular */
.app-sidebar .offcanvas-header {
    flex: 0 0 auto;
    background: #0d0d0f;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Logo */
.app-sidebar .brand-lockup {
    flex: 0 0 auto;
    color: #ffffff;
}

/* Tarjeta del usuario */
.app-sidebar .sidebar-user {
    flex: 0 0 auto;
    background: #19191d;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Esta es la parte que podrá desplazarse */
.app-sidebar .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;

    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;

    padding-right: 7px;
    padding-bottom: 18px;

    scrollbar-width: thin;
    scrollbar-color: #55555f transparent;
}

/* Scrollbar para Chrome, Edge y navegadores Chromium */
.app-sidebar .sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar-thumb {
    background: #46464f;
    border-radius: 20px;
}

.app-sidebar .sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #666671;
}

/* Enlaces */
.app-sidebar .sidebar-link {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.76);
}

.app-sidebar .sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.app-sidebar .sidebar-link.active {
    color: #171717;
    background: #f4b400;
}

/* Títulos de secciones */
.app-sidebar .sidebar-section {
    color: rgba(255, 255, 255, 0.43);
}

/* Pie del sidebar siempre visible */
.app-sidebar .sidebar-footer {
    flex: 0 0 auto;
    margin-top: 0;
    padding: 16px 8px 0;
    background: #0d0d0f;
}

/* Barra superior de celular */
.mobile-topbar {
    background: #0d0d0f !important;
    color: #ffffff;
}

/* Botón para abrir el menú en celular */
.mobile-topbar .btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Escritorio */
@media (min-width: 992px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: auto;
        left: 0;
        z-index: 1030;

        height: 100vh;
        height: 100dvh;

        transform: none !important;
        visibility: visible !important;
    }

    .app-content-shell {
        margin-left: 278px;
        min-height: 100vh;
    }
}

/* Celulares y tabletas */
@media (max-width: 991.98px) {
    .app-sidebar,
    .app-sidebar.offcanvas {
        height: 100vh;
        height: 100dvh;
        background: #0d0d0f !important;
    }

    .app-sidebar .sidebar-inner {
        height: calc(100dvh - 57px);
        min-height: 0;
        padding-top: 18px;
    }

    .app-sidebar .sidebar-nav {
        min-height: 0;
        overflow-y: auto;
    }
}/* SIGI expanded navigation */
.sidebar-collapse-toggle{width:100%;border:0;background:transparent;text-align:left}.sidebar-collapse-toggle.active-parent{color:#fff;background:rgba(255,255,255,.07)}.sidebar-collapse-toggle[aria-expanded="true"] .collapse-chevron{transform:rotate(180deg)}.collapse-chevron{transition:transform .2s ease;width:auto!important;height:auto!important;background:transparent!important}.sidebar-submenu{padding:3px 0 6px 48px}.sidebar-sublink{display:flex;align-items:center;gap:9px;color:rgba(255,255,255,.62);text-decoration:none;font-size:.82rem;font-weight:650;padding:8px 10px;border-radius:10px;margin:2px 0}.sidebar-sublink:hover{color:#fff;background:rgba(255,255,255,.07)}.sidebar-sublink.active{color:#171717;background:var(--brand)}.sidebar-count,.notification-dot{background:#dc3545;color:#fff;border-radius:999px;font-size:.62rem;font-weight:800;min-width:19px;height:19px;display:inline-grid;place-items:center;padding:0 5px}.sidebar-count{margin-left:auto}.notification-dot{position:absolute;top:-7px;right:-7px;border:2px solid var(--sidebar)}
@media(max-width:767.98px){.surface-card.form-surface{padding:20px 16px}.modern-table{min-width:720px}.page-actions .btn,.page-actions form{flex:1}.page-actions form .btn{width:100%}.vacation-calendar{margin-inline:-6px}}

/* Access denied - light INCOMA experience */
.access-denied-light{margin:0;min-height:100vh;background:radial-gradient(circle at 10% 10%,#fff8d9 0,transparent 35%),linear-gradient(145deg,#f8f9fb,#eef1f4);color:#17191f}.access-denied-shell{min-height:100vh;display:grid;place-items:center;padding:28px}.access-denied-light-card{width:min(620px,100%);background:#fff;border:1px solid #e8ebef;border-radius:28px;box-shadow:0 24px 70px rgba(23,25,31,.12);padding:clamp(28px,6vw,58px);text-align:center}.denied-logo{height:70px;display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:10px}.denied-logo img{max-width:220px;max-height:64px;object-fit:contain}.denied-logo strong{font-size:2rem;color:#f2ab00;letter-spacing:.06em}.denied-logo small{background:#17191f;color:#fff;border-radius:8px;padding:5px 7px}.denied-shield{width:76px;height:76px;border-radius:24px;background:#fff3c4;color:#a66b00;display:grid;place-items:center;font-size:2rem;margin:18px auto}.access-denied-light-card h1{font-weight:800;font-size:clamp(2rem,5vw,3.4rem);line-height:1.05;max-width:520px;margin:10px auto 18px}.access-denied-light-card>p{color:#667085;max-width:510px;margin:0 auto}.denied-user{display:flex;align-items:center;gap:12px;text-align:left;background:#f7f8fa;border-radius:16px;padding:14px 18px;margin:28px auto 0;max-width:380px}.denied-user>i{font-size:2rem;color:#f2ab00}.denied-user small,.denied-user span{display:block;color:#667085;font-size:.75rem}.denied-user strong{display:block}.denied-help{display:block;color:#8a93a2;margin-top:22px}

/* V5: separación visual de etiquetas/valores y refuerzo responsive sin cambiar la interfaz. */
.detail-grid dt {
    margin-bottom: 7px;
}

.detail-grid dd {
    margin-top: 0;
    line-height: 1.5;
}

.form-label {
    margin-bottom: .55rem;
}

.modern-table th,
.modern-table td {
    vertical-align: middle;
}

@media (max-width: 575.98px) {
    .page-header {
        gap: 18px;
    }

    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .page-actions .btn,
    .page-actions form,
    .page-actions form .btn {
        width: 100%;
    }

    .metric-strip {
        grid-template-columns: 1fr !important;
    }

    .financial-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Treasury V6 cards: keep dates and actions from overlapping on any viewport. */
.financial-card { display:flex; flex-direction:column; min-height:360px; }
.financial-card-metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:16px 0 12px; }
.financial-card-metrics > div { background:#f6f7f9; border:1px solid var(--line); border-radius:14px; padding:11px 12px; min-width:0; }
.financial-card-metrics .metric-wide { grid-column:1/-1; }
.financial-card-metrics span,.financial-card-metrics strong { display:block; }
.financial-card-metrics span { color:var(--ink-soft); font-size:.69rem; }
.financial-card-metrics strong { margin-top:3px; font-size:.95rem; overflow-wrap:anywhere; }
.financial-meta { flex-wrap:wrap; margin-bottom:16px; }
.financial-open { position:static; margin-top:auto; padding-top:14px; display:inline-flex; align-items:center; gap:6px; }
.financial-icon-bank { position:relative; z-index:1; }
@media(max-width:575.98px){.financial-card{min-height:auto}.financial-card-metrics{grid-template-columns:1fr}.financial-card-metrics .metric-wide{grid-column:auto}.financial-meta{display:grid;grid-template-columns:1fr;gap:6px}}

/* V6.3 — Repartos: control del auxiliar y detalle realmente móvil. */
.delivery-process-track .process-fill {
    width: var(--delivery-progress);
}

.delivery-status-current {
    max-width: 100%;
    text-align: center;
    overflow-wrap: anywhere;
}

.delivery-info-grid dd,
.delivery-mobile-item strong,
.delivery-mobile-item p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.delivery-employee-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.delivery-mobile-items {
    padding: 12px 16px 18px;
}

.delivery-mobile-item {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(23, 25, 31, .05);
}

.delivery-mobile-item + .delivery-mobile-item {
    margin-top: 12px;
}

.delivery-mobile-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.delivery-mobile-item-head > div {
    min-width: 0;
}

.delivery-mobile-item-head strong,
.delivery-mobile-item-head small {
    display: block;
}

.delivery-mobile-item-head strong {
    line-height: 1.3;
    color: var(--ink);
}

.delivery-mobile-item-head small {
    margin-top: 5px;
    color: var(--ink-soft);
    font-size: .73rem;
}

.delivery-quantity-pill {
    flex: 0 0 auto;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff3c4;
    color: #7a5200;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.delivery-mobile-item-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.delivery-mobile-item-meta > div,
.delivery-mobile-item-note {
    min-width: 0;
    background: #f7f8fa;
    border-radius: 13px;
    padding: 10px 12px;
}

.delivery-mobile-item-meta span,
.delivery-mobile-item-note > span {
    display: block;
    color: var(--ink-soft);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 3px;
}

.delivery-mobile-item-meta b {
    font-size: .9rem;
}

.delivery-mobile-item-note {
    margin-top: 10px;
}

.delivery-mobile-item-note p {
    margin: 0;
    line-height: 1.45;
    font-size: .86rem;
}

@media (max-width: 767.98px) {
    .delivery-page-header {
        gap: 14px;
    }

    .delivery-page-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .delivery-page-actions .btn,
    .delivery-status-current {
        width: 100%;
        justify-content: center;
    }

    .delivery-process-card {
        padding: 18px 16px;
        overflow: hidden;
    }

    .delivery-process-track.process-track:not(.compact) {
        min-width: 0;
        min-height: 0;
        overflow: visible;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .delivery-process-track.process-track:not(.compact)::before {
        top: 21px;
        bottom: 21px;
        left: 20px;
        right: auto;
        width: 4px;
        height: auto;
        border-radius: 999px;
    }

    .delivery-process-track .process-fill {
        display: none;
    }

    .delivery-process-track .process-node {
        min-width: 0;
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        text-align: left;
    }

    .delivery-process-track .process-node i {
        width: 42px;
        height: 42px;
        margin: 0;
    }

    .delivery-process-track .process-node span {
        font-size: .82rem;
        line-height: 1.2;
    }

    .delivery-section-heading {
        padding: 18px 16px 0 !important;
    }

    .delivery-section-heading .section-icon {
        flex: 0 0 auto;
    }

    .delivery-products-section {
        overflow: hidden;
    }

    .delivery-info-card,
    .delivery-status-card,
    .delivery-report-card,
    .delivery-evidence-section {
        overflow: hidden;
    }

    .delivery-info-grid dd {
        font-size: .92rem;
        line-height: 1.5;
    }

    .delivery-evidence-modal {
        margin: 10px;
    }

    .delivery-evidence-modal .modal-content {
        max-height: calc(100dvh - 20px);
        overflow: auto;
    }

    .signature-pad-wrap canvas {
        max-width: 100%;
        height: auto;
        touch-action: none;
    }
}

@media (max-width: 399.98px) {
    .delivery-mobile-items {
        padding-inline: 12px;
    }

    .delivery-mobile-item {
        padding: 14px;
        border-radius: 16px;
    }

    .delivery-mobile-item-meta {
        grid-template-columns: 1fr;
    }
}

/* V6.4.3 · Customer directory mobile cards */
.min-w-0 { min-width: 0; }
.mobile-detail-list { display: grid; gap: 10px; }
.mobile-detail-list > div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.mobile-detail-list dt {
    color: var(--muted, #6b7280);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.mobile-detail-list dd {
    margin: 0;
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
}
@media (max-width: 399.98px) {
    .mobile-detail-list > div { grid-template-columns: 1fr; gap: 3px; }
    .mobile-detail-list dd { text-align: left; }
}

/* V6.4.4 · Responsive warehouse transfer records */
.mobile-record-list {
    display: grid;
    gap: 12px;
}

.mobile-record-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
    overflow-wrap: anywhere;
}

.mobile-record-card strong,
.mobile-record-card div {
    min-width: 0;
}

@media (max-width: 767.98px) {
    .page-actions form,
    .page-actions .btn {
        width: 100%;
    }

    .mobile-record-card .badge {
        max-width: 45%;
        white-space: normal;
        text-align: center;
    }
}

/* V6.5 · Responsive application polish: products, quotes, deliveries and shared layouts. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.app-main,
.surface-card,
.row > *,
.section-heading > div,
.page-header > div,
.page-actions,
.table-responsive {
    min-width: 0;
}

.page-header h1,
.section-heading h2,
.detail-grid dd,
.product-information,
.ranking-row strong {
    overflow-wrap: anywhere;
}

/* El importe nunca debe partirse a medio número; que envuelva el nombre. */
.ranking-row > span {
    white-space: nowrap;
    flex-shrink: 0;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.detail-grid dt {
    margin-bottom: 8px;
    line-height: 1.25;
}

.detail-grid dd {
    line-height: 1.55;
}

/* Product list */
.product-list-shell {
    overflow: hidden;
}

.product-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.product-list-heading h2 {
    margin: 3px 0 0;
    font-size: 1.15rem;
    font-weight: 850;
}

.product-essential-table tbody td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.product-list-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.product-list-identity img,
.product-mobile-card-head img,
.product-list-placeholder {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 16px;
    object-fit: cover;
}

.product-list-placeholder {
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: 1.45rem;
}

.product-list-identity > div {
    min-width: 0;
}

.product-list-identity strong {
    display: block;
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.4;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.product-list-identity small {
    display: block;
    margin-top: 5px;
    color: var(--ink-soft);
    font-size: .76rem;
}

.product-stock-value {
    display: inline-grid;
    place-items: center;
    min-width: 54px;
    min-height: 42px;
    padding: 7px 12px;
    border-radius: 13px;
    font-size: 1.05rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.product-stock-value.has-stock {
    color: #087443;
    background: #dcf8ea;
}

.product-stock-value.no-stock {
    color: #a91f2d;
    background: #ffe2e5;
}

.product-availability-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.product-availability-value small {
    color: var(--ink-soft);
    font-size: .72rem;
    font-weight: 750;
    white-space: nowrap;
}

.product-document-actions {
    white-space: nowrap;
}

.product-document-actions .btn + .btn {
    margin-left: 6px;
}

.product-price-value strong,
.product-price-value small {
    display: block;
}

.product-price-value strong {
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
}

.product-price-value small {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: .72rem;
}

.product-detail-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.product-mobile-list,
.quote-mobile-list,
.quote-item-mobile-list {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.product-mobile-card,
.quote-mobile-card,
.quote-item-mobile-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 25, 31, .055);
}

.product-mobile-card-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.product-mobile-card-head > div {
    min-width: 0;
}

.product-mobile-card-head h2 {
    margin: 1px 0 5px;
    font-size: 1rem;
    line-height: 1.38;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.product-mobile-card-head small {
    color: var(--ink-soft);
    font-size: .72rem;
}

.product-mobile-metrics {
    display: grid;
    grid-template-columns: minmax(92px, .65fr) minmax(0, 1.35fr);
    gap: 10px;
    margin: 15px 0;
}

.product-mobile-metrics > div {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: #f7f8fa;
}

.product-mobile-metrics span,
.product-mobile-metrics strong,
.product-mobile-metrics small {
    display: block;
}

.product-mobile-metrics span {
    color: var(--ink-soft);
    font-size: .67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.product-mobile-metrics strong {
    margin-top: 4px;
    font-size: .98rem;
    overflow-wrap: anywhere;
}

.product-mobile-metrics small {
    margin-top: 3px;
    color: var(--ink-soft);
    font-size: .67rem;
}

/* Product detail */
.product-detail-hero {
    display: grid;
    grid-template-columns: minmax(270px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.product-image-card {
    display: grid;
    place-items: center;
    min-height: 390px;
    padding: 22px;
    overflow: hidden;
}

.product-image-card img {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    border-radius: 16px;
}

.product-image-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    color: var(--ink-soft);
}

.product-image-empty i {
    font-size: 4rem;
    color: #c3c7cf;
}

.product-title-strip {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.product-title-strip h2 {
    margin: 5px 0 4px;
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.product-title-strip small {
    color: var(--ink-soft);
}

.product-facts-grid {
    padding-bottom: 24px;
}

.product-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.product-price-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8f9fb;
}

.product-price-card.primary {
    border-color: #ead078;
    background: #fff9df;
}

.product-price-card.cost {
    background: #f4f7ff;
}

.product-price-card.calculator {
    background: #fff;
}

.product-price-card span,
.product-price-card strong,
.product-price-card small,
.product-price-card div {
    display: block;
}

.product-price-card span {
    color: var(--ink-soft);
    font-size: .7rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.product-price-card strong {
    margin: 7px 0 2px;
    font-size: clamp(1.22rem, 2.3vw, 1.75rem);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.product-price-card small,
.product-price-card div {
    margin-top: 6px;
    color: var(--ink-soft);
    font-size: .77rem;
    line-height: 1.45;
}

.stock-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stock-breakdown-grid article {
    min-width: 0;
    padding: 17px;
    border: 1px solid #e9ecf0;
    border-radius: 16px;
    background: #f7f8fa;
}

.stock-breakdown-grid span,
.stock-breakdown-grid strong {
    display: block;
}

.stock-breakdown-grid span {
    color: #667085;
    font-size: .76rem;
    overflow-wrap: anywhere;
}

.stock-breakdown-grid strong {
    margin-top: 5px;
    font-size: 1.55rem;
}

.stock-breakdown-grid .stock-total {
    color: #fff;
    background: #17191f;
}

.stock-breakdown-grid .stock-total span {
    color: #d0d5dd;
}

.stock-unallocated {
    border-style: dashed !important;
}

.margin-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}

.margin-compare article {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.margin-compare span,
.margin-compare strong,
.margin-compare small {
    display: block;
}

.margin-compare span {
    color: var(--ink-soft);
    font-size: .68rem;
    font-weight: 800;
}

.margin-compare strong {
    margin: 4px 0;
    font-size: 1.2rem;
    overflow-wrap: anywhere;
}

.margin-compare .price-secondary {
    margin-top: 12px;
    color: #475467;
    font-size: 1rem;
}

.margin-chip {
    display: inline-flex !important;
    width: max-content;
    max-width: 100%;
    margin-top: 12px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef2f6;
    color: #344054;
    font-size: .75rem;
    font-weight: 800;
}

.margin-new {
    border-color: #eed687 !important;
    background: #fff9df;
}

/* Quotes */
.quote-list-shell,
.quote-products-section {
    overflow: hidden;
}

.quote-list-heading,
.quote-section-heading {
    padding: 22px 24px 18px;
}

.quote-mobile-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.quote-mobile-card-top > div {
    min-width: 0;
}

.quote-mobile-card h2 {
    margin: 5px 0 0;
    font-size: 1.03rem;
    line-height: 1.35;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.quote-mobile-card-top .status-badge {
    max-width: 42%;
    white-space: normal;
    text-align: center;
}

.quote-mobile-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.quote-mobile-details > div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 13px;
    background: #f7f8fa;
}

.quote-mobile-details dt {
    color: var(--ink-soft);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.quote-mobile-details dd {
    margin: 4px 0 0;
    font-size: .86rem;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.quote-mobile-details .quote-mobile-total {
    grid-column: 1 / -1;
    color: #fff;
    background: #17191f;
}

.quote-mobile-details .quote-mobile-total dt {
    color: rgba(255,255,255,.62);
}

.quote-mobile-details .quote-mobile-total dd {
    font-size: 1.16rem;
}

.quote-detail-actions form,
.quote-detail-actions form .btn {
    min-width: 0;
}

.quote-item-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.quote-item-mobile-head > div {
    min-width: 0;
}

.quote-item-mobile-head small,
.quote-item-mobile-head span {
    display: block;
    color: var(--ink-soft);
    font-size: .71rem;
}

.quote-item-mobile-head h3 {
    margin: 4px 0 7px;
    font-size: 1rem;
    line-height: 1.38;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.quote-quantity-pill {
    display: grid !important;
    place-items: center;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border-radius: 14px;
    background: var(--brand-soft);
    color: #795300 !important;
    font-size: .95rem !important;
    font-weight: 900;
}

.quote-item-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.quote-item-mobile-grid > div {
    min-width: 0;
    padding: 10px 11px;
    border-radius: 13px;
    background: #f7f8fa;
}

.quote-item-mobile-grid span,
.quote-item-mobile-grid strong,
.quote-item-mobile-grid small {
    display: block;
}

.quote-item-mobile-grid span {
    color: var(--ink-soft);
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.quote-item-mobile-grid strong {
    margin-top: 4px;
    font-size: .84rem;
    overflow-wrap: anywhere;
}

.quote-item-mobile-grid small {
    margin-top: 2px;
    color: var(--ink-soft);
    font-size: .65rem;
}

.quote-totals {
    width: min(100%, 440px);
    margin-left: auto;
    padding: 22px 26px;
}

.quote-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 9px 0;
}

.quote-totals strong {
    text-align: right;
    overflow-wrap: anywhere;
}

.quote-totals .total {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 2px solid var(--brand);
    font-size: 1.2rem;
}

.quote-totals .total strong {
    font-size: 1.45rem;
}

.quote-totals .profitability-total {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px dashed var(--line);
}

/* Responsive document forms */
.document-item,
.external-document-item,
.delivery-item-row {
    overflow: hidden;
}

.document-remove-column,
.delivery-remove-column {
    display: flex;
    align-items: flex-end;
}

.document-remove-column .btn,
.delivery-remove-column .btn {
    flex: 0 0 auto;
}

.document-summary-card {
    overflow: hidden;
}

/* Deliveries */
.delivery-list-card {
    min-width: 0;
    overflow: hidden;
}

.delivery-list-card .delivery-card-top > div,
.delivery-list-card .delivery-route,
.delivery-list-card .assigned-team {
    min-width: 0;
}

.delivery-list-card h2,
.delivery-list-card .delivery-route p {
    overflow-wrap: anywhere;
}

.delivery-dashboard-panel {
    min-width: 0;
}

@media (max-width: 1199.98px) {
    .product-detail-hero {
        grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    .product-detail-hero {
        grid-template-columns: 1fr;
    }

    .product-image-card {
        min-height: 280px;
    }

    .product-image-card img {
        max-height: 350px;
    }

    .stock-breakdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-main {
        width: 100%;
        padding: 20px 12px calc(34px + env(safe-area-inset-bottom));
    }

    .page-header {
        gap: 16px;
        margin-bottom: 18px !important;
    }

    .page-header h1 {
        margin-top: 5px;
        font-size: 1.72rem;
        line-height: 1.14;
    }

    .page-header p {
        font-size: .88rem;
        line-height: 1.5;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .page-actions .btn,
    .page-actions form,
    .page-actions form .btn {
        width: 100%;
        justify-content: center;
    }

    .surface-card {
        border-radius: 17px;
    }

    .surface-card.form-surface,
    .form-surface,
    .preview-surface {
        padding: 18px 14px;
    }

    .section-heading {
        align-items: flex-start;
        gap: 11px;
        margin-bottom: 19px;
    }

    .section-heading h2 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .section-heading p {
        margin-top: 3px;
        font-size: .79rem;
        line-height: 1.45;
    }

    .section-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .form-control,
    .form-select,
    .input-group-text {
        min-width: 0;
        font-size: 16px;
    }

    .form-label {
        display: block;
        margin-bottom: 8px;
        line-height: 1.35;
    }

    .detail-grid {
        gap: 0;
    }

    .detail-grid > div {
        padding: 13px 0;
        border-bottom: 1px solid var(--line);
    }

    .detail-grid > div:last-child {
        border-bottom: 0;
    }

    .detail-grid dt {
        margin-bottom: 7px;
        font-size: .67rem;
    }

    .detail-grid dd {
        font-size: .92rem;
    }

    .filter-grid,
    .filter-grid.compact {
        padding: 16px 14px;
        gap: 13px;
    }

    .filter-action .btn {
        min-height: 46px;
    }

    .sticky-form-actions {
        display: grid;
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
        gap: 8px;
        bottom: max(7px, env(safe-area-inset-bottom));
        margin-inline: -4px;
        padding: 9px;
        border-radius: 15px;
    }

    .sticky-form-actions .btn {
        width: 100%;
        min-width: 0;
        padding-inline: 8px;
    }

    .modal-dialog {
        margin: 8px;
    }

    .modal-content {
        max-height: calc(100dvh - 16px);
        border-radius: 17px;
    }

    .modal-body {
        overflow-y: auto;
        padding: 18px 15px;
    }

    .modal-header,
    .modal-footer {
        padding: 15px;
    }

    .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    .product-list-heading,
    .quote-list-heading,
    .quote-section-heading {
        padding: 18px 14px 14px;
    }

    .product-list-heading,
    .quote-list-heading {
        align-items: flex-start;
    }

    .product-list-heading .record-count,
    .quote-list-heading .record-count {
        flex: 0 0 auto;
    }

    .product-title-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-price-grid {
        grid-template-columns: 1fr;
    }

    .product-price-card {
        padding: 16px;
    }

    .product-price-card strong {
        font-size: 1.35rem;
    }

    .stock-breakdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-section-heading {
        flex-wrap: wrap;
    }

    .product-section-heading .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    .margin-compare {
        grid-template-columns: 1fr;
    }

    .margin-compare > i {
        justify-self: center;
        transform: rotate(90deg);
    }

    .stack-table-wrap {
        overflow: visible;
    }

    .mobile-stack-table {
        display: block;
        min-width: 0 !important;
        width: 100%;
    }

    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table tbody,
    .mobile-stack-table tr,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }

    .mobile-stack-table tbody {
        display: grid;
        gap: 12px;
    }

    .mobile-stack-table tbody tr {
        padding: 12px 14px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 7px 20px rgba(23, 25, 31, .05);
    }

    .mobile-stack-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px, .8fr) minmax(0, 1.2fr);
        gap: 12px;
        align-items: start;
        padding: 9px 0 !important;
        border: 0;
        border-bottom: 1px solid #eff1f4;
        text-align: right !important;
        overflow-wrap: anywhere;
    }

    .mobile-stack-table tbody td:last-child {
        border-bottom: 0;
    }

    .mobile-stack-table tbody td::before {
        content: attr(data-label);
        color: var(--ink-soft);
        font-size: .67rem;
        font-weight: 850;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .mobile-stack-table .stack-table-empty {
        padding: 0;
    }

    .mobile-stack-table .stack-table-empty td {
        display: block;
        text-align: center !important;
    }

    .mobile-stack-table .stack-table-empty td::before {
        display: none;
    }

    .quote-totals {
        width: 100%;
        padding: 17px 14px 20px;
    }

    .quote-totals > div {
        align-items: flex-start;
    }

    .quote-totals .total strong {
        font-size: 1.25rem;
    }

    .quote-info-grid > div.alert {
        padding: 13px;
    }

    .document-item,
    .external-document-item,
    .delivery-item-row {
        padding: 15px 13px;
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 7px 20px rgba(23, 25, 31, .045);
    }

    .document-item .row,
    .external-document-item .row,
    .delivery-item-row .row {
        --bs-gutter-y: 1rem;
    }

    .document-remove-column,
    .delivery-remove-column {
        align-items: stretch;
    }

    .document-remove-column .btn,
    .delivery-remove-column .btn {
        width: 100%;
        height: 44px;
        color: var(--danger);
        background: #fff1f2;
        border-color: #ffd5da;
    }

    .product-information {
        padding: 10px 11px;
        border-radius: 12px;
        background: #f7f8fa;
        line-height: 1.5;
    }

    .profitability-tools,
    .profitability-metrics {
        min-width: 0;
    }

    .profitability-metrics {
        display: grid;
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .summary-lines > div,
    .quote-mini-total {
        align-items: flex-start;
    }

    .summary-lines strong,
    .quote-mini-total strong {
        max-width: 55%;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .delivery-list-grid {
        gap: 12px;
    }

    .delivery-list-card {
        padding: 16px;
        border-radius: 18px;
        box-shadow: 0 8px 24px rgba(23, 25, 31, .055);
    }

    .delivery-list-card:hover {
        transform: none;
    }

    .delivery-list-card .delivery-card-top {
        flex-direction: column;
    }

    .delivery-list-card .delivery-card-top .status-badge {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .delivery-list-card .delivery-route {
        margin: 14px 0;
    }

    .delivery-list-card .delivery-meta {
        grid-template-columns: 1fr;
    }

    .delivery-form-page .section-heading,
    .delivery-items-form-section .section-heading {
        flex-wrap: wrap;
    }

    .delivery-items-form-section .section-heading .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    .delivery-team-card {
        position: static;
    }

    .delivery-dashboard-stats {
        grid-template-columns: 1fr;
    }

    .delivery-dashboard-panel {
        padding: 18px 14px !important;
    }

    .ranking-row {
        align-items: flex-start;
    }

    .ranking-row > span {
        flex: 0 0 auto;
        max-width: 42%;
        text-align: right;
    }
}

@media (max-width: 399.98px) {
    .app-main {
        padding-inline: 10px;
    }

    .product-mobile-metrics,
    .quote-mobile-details,
    .quote-item-mobile-grid,
    .stock-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .quote-mobile-details .quote-mobile-total {
        grid-column: auto;
    }

    .product-mobile-card,
    .quote-mobile-card,
    .quote-item-mobile-card {
        padding: 14px;
    }

    .product-list-identity img,
    .product-mobile-card-head img,
    .product-list-placeholder {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .mobile-stack-table tbody td {
        grid-template-columns: 1fr;
        gap: 4px;
        text-align: left !important;
    }

    .sticky-form-actions {
        grid-template-columns: 1fr;
    }
}


/* Búsqueda dinámica de productos */
.product-live-search-wrap {
    position: relative;
    margin-bottom: 0;
}

/* El <select> nativo se conserva debajo del buscador (funciona sin JS y con
   teclado), pero visualmente debe leerse como un solo control compuesto en
   vez de dos campos sueltos. */
.product-live-search-wrap .customer-select-search,
.product-live-search-wrap .product-select-search {
    margin-bottom: 0 !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.product-live-search-wrap + select.searchable-customer-select,
.product-live-search-wrap + select.searchable-product-select {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top-color: transparent;
    margin-top: -1px;
}

.product-live-search-wrap + select.searchable-customer-select:focus,
.product-live-search-wrap + select.searchable-product-select:focus {
    border-top-color: var(--brand);
}

.product-live-results {
    position: absolute;
    z-index: 1080;
    top: calc(100% - .35rem);
    left: 0;
    right: 0;
    max-height: 310px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(20, 23, 31, .16);
}

.product-live-result {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    line-height: 1.35;
}

.product-live-result:hover,
.product-live-result:focus {
    outline: 0;
    background: #f4f5f7;
}

.product-live-result i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--brand-strong);
}

.product-live-empty {
    padding: 12px;
    color: var(--ink-soft);
    text-align: center;
    font-size: .9rem;
}

#product-results-region {
    transition: opacity .16s ease;
}

#product-results-region.live-results-loading {
    opacity: .52;
    pointer-events: none;
}
