/* Estoque de kits: presentation only; scoped independently of contract kit forms. */
.ki-view { --ki-border:#e1e8f1; --ki-muted:#687b94; color:#0e2442; display:grid; gap:20px; min-width:0; }
.ki-view *, .ki-detail-modal * { box-sizing:border-box; }
.ki-view h2, .ki-view h3, .ki-view p, .ki-detail-modal h2, .ki-detail-modal h3 { margin:0; }
.ki-view button, .ki-view input, .ki-view select, .ki-detail-modal button { font:inherit; }
.ki-view button, .ki-detail-modal button { cursor:pointer; }
.ki-view button:disabled { cursor:default; opacity:.5; }
.ki-view :is(button,input,select):focus-visible, .ki-detail-modal button:focus-visible { outline:3px solid #82bdf5; outline-offset:3px; }
.ki-view [hidden], .ki-header-actions [hidden] { display:none !important; }
.ki-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:4px; }
.ki-header h2 { font-size:var(--text-2xl); line-height:1.25; letter-spacing:-.6px; }
.ki-header p { color:var(--ki-muted); font-size:var(--text-sm); margin-top:8px; line-height:1.6; }
.ki-header-actions { display:flex; align-items:center; gap:9px; flex-shrink:0; }
.ki-view .ki-button, .ki-header-actions .ki-button, .ki-detail-modal .ki-button { display:inline-flex; justify-content:center; align-items:center; gap:8px; min-height:42px; padding:9px 14px; border:1px solid #dfe6ef; border-radius:9px; background:#fff; color:#244566; font-size:var(--text-sm); font-weight:600; box-shadow:none; white-space:nowrap; }
.ki-view .ki-button:hover, .ki-header-actions .ki-button:hover, .ki-detail-modal .ki-button:hover { background:#f3f7fc; border-color:#b7cde5; }
.ki-view svg, .ki-header-actions svg, .ki-detail-modal svg { width:18px; height:18px; flex-shrink:0; }
.ki-view .ki-primary, .ki-header-actions .ki-primary { background:#0866ca; border-color:#0866ca; color:#fff; }
.ki-view .ki-primary:hover, .ki-header-actions .ki-primary:hover { background:#0757ad; color:#fff; }
.ki-view .ki-dots, .ki-header-actions .ki-dots, .ki-detail-modal .ki-dots { width:38px; min-height:38px; padding:7px; }
.ki-section-label { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:12px; }
.ki-section-label h3 { font-size:var(--text-md); }
.ki-section-label span { color:var(--ki-muted); font-size:var(--text-xs); }
.ki-stock-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.ki-stock-card { display:flex; align-items:center; gap:17px; min-width:0; min-height:116px; padding:17px 20px; background:#fff; border:1px solid var(--ki-border); border-radius:14px; }
.ki-kit-icon { width:56px; height:56px; flex:0 0 56px; display:grid; place-items:center; border-radius:13px; color:#1167ba; background:#eaf3ff; }
.ki-kit-icon svg { width:29px; height:29px; stroke-width:1.7; }
.ki-kit-keys_standard { color:#6a56ad; background:#f1edff; }
.ki-kit-keys_premium { color:#a76c17; background:#fff3df; }
.ki-stock-card h3 { font-size:var(--text-sm); line-height:1.4; color:#58708e; font-weight:500; }
.ki-stock-card strong { display:block; font-size:var(--text-2xl); font-weight:700; line-height:1.2; margin-top:4px; font-variant-numeric:tabular-nums; }
.ki-stock-card small { color:#6b7e95; font-size:var(--text-2xs); }
.ki-flow { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:15px 20px; min-height:72px; background:#fff; border:1px solid var(--ki-border); border-radius:12px; }
.ki-flow > div > strong { display:block; font-size:var(--text-sm); }
.ki-flow small { display:block; color:var(--ki-muted); font-size:var(--text-xs); margin-top:4px; }
.ki-flow-values { display:flex; gap:30px; }
.ki-flow-values > div { display:flex; align-items:center; gap:10px; }
.ki-flow-values svg { box-sizing:content-box; padding:8px; border-radius:10px; background:#e5f6ed; color:#06824b; }
.ki-flow-values > div:last-child svg { color:#ba2e38; background:#fff0f0; }
.ki-flow-values span { font-size:var(--text-xs); color:#647991; }
.ki-flow-values strong { display:block; font-size:var(--text-xl); line-height:1.15; }
.ki-positive { color:#06824b; }
.ki-negative { color:#ba2e38; }
.ki-panel { background:#fff; border:1px solid var(--ki-border); border-radius:14px; min-width:0; }
.ki-panel-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:20px; }
.ki-panel-heading h3 { font-size:var(--text-lg); letter-spacing:-.2px; }
.ki-panel-heading p { margin-top:5px; font-size:var(--text-xs); color:var(--ki-muted); }
.ki-filters { display:grid; grid-template-columns:minmax(190px,1fr) minmax(150px,210px) minmax(160px,210px) auto; align-items:end; gap:10px; padding:0 20px 17px; }
.ki-search { display:flex; align-items:center; border:1px solid #dfe6ef; border-radius:9px; padding-left:12px; min-width:0; color:#7a8da5; }
.ki-search input { border:0; min-width:0; width:100%; height:40px; background:transparent; padding:0 10px; font-size:var(--text-sm); color:#223650; }
.ki-search:focus-within { outline:2px solid #82bdf5; outline-offset:2px; }
.ki-field { display:grid; gap:6px; min-width:0; font-size:var(--text-2xs); color:#526a87; }
.ki-filters > .ki-field > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.ki-field select, .ki-field input { width:100%; min-width:0; min-height:42px; padding:8px 10px; border:1px solid #dfe6ef; border-radius:9px; background:#fff; color:#223650; font-size:var(--text-xs); }
.ki-view .ki-active { background:#edf5ff; color:#095bbb; border-color:#b9d6f5; }
.ki-advanced { margin:0 20px 17px; padding:14px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)) auto; gap:11px; align-items:end; border:1px solid #e6edf7; border-radius:10px; background:#f8fbff; }
.ki-view .ki-clear { background:transparent; border-color:transparent; color:#0c60bc; }
.ki-active-filters { display:flex; flex-wrap:wrap; gap:6px; padding:0 20px 14px; }
.ki-active-filters span { color:#315c87; background:#edf5ff; border-radius:6px; padding:5px 8px; font-size:var(--text-2xs); overflow-wrap:anywhere; }
.ki-table-wrap { width:100%; overflow-x:auto; border-top:1px solid #e7edf4; }
.ki-table { width:100%; table-layout:fixed; border-collapse:collapse; text-align:left; font-size:var(--text-xs); }
.ki-table th { padding:13px 14px; background:#f8fafc; color:#607089; font-size:var(--text-2xs); font-weight:600; }
.ki-table td { padding:13px 14px; border-top:1px solid #edf1f6; color:#34465f; vertical-align:middle; overflow-wrap:anywhere; line-height:1.5; }
.ki-table :is(th,td):nth-child(1) { width:10%; }
.ki-table :is(th,td):nth-child(2) { width:13%; }
.ki-table :is(th,td):nth-child(3) { width:17%; }
.ki-table :is(th,td):nth-child(4) { width:6%; text-align:center; }
.ki-table :is(th,td):nth-child(5) { width:21%; }
.ki-table :is(th,td):nth-child(6) { width:10%; }
.ki-table :is(th,td):nth-child(7) { width:11%; }
.ki-table :is(th,td):nth-child(8) { width:12%; text-align:center; padding-inline:8px; }
.ki-recipient { font-weight:600; }
.ki-row-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:5px; }
.ki-view .ki-row-action { width:34px; min-width:34px; min-height:34px; padding:6px; border-radius:8px; color:#1764b0; }
.ki-view .ki-row-action svg { width:16px; height:16px; }
.ki-view .ki-row-action.ki-action-danger { color:#ba2e38; }
.ki-view .ki-row-action.ki-action-danger:hover { color:#a5222d; background:#fff0f0; border-color:#efc5ca; }
.ki-table tbody tr:hover { background:#fbfdff; }
.ki-table tbody tr[data-inventory-movement] { cursor:pointer; }
.ki-table tbody tr[data-inventory-movement]:focus-visible { outline:2px solid #82bdf5; outline-offset:-2px; background:#f3f8ff; }
.ki-date { font-variant-numeric:tabular-nums; }
.ki-table .ki-quantity { font-size:var(--text-sm); font-weight:700; font-variant-numeric:tabular-nums; }
.ki-table .ki-positive { color:#06824b; }
.ki-table .ki-negative { color:#ba2e38; }
.ki-badge { display:inline-flex; border-radius:20px; padding:5px 9px; font-size:var(--text-2xs); font-weight:600; line-height:1.35; }
.ki-in { background:#e5f6ed; color:#06824b; }
.ki-out { background:#fff0f0; color:#ba2e38; }
.ki-adjustment { background:#fff3e3; color:#92500c; }
.ki-row-state { display:block; color:#687b94; font-size:var(--text-2xs); margin-top:4px; }
.ki-view .ki-contract { display:block; width:100%; color:#0b274d; border:0; background:transparent; box-shadow:none; text-align:left; padding:0; white-space:normal; font-size:var(--text-xs); min-height:38px; }
.ki-contract strong { display:block; font-weight:600; }
.ki-contract small, .ki-manual-property small { display:block; color:#687b94; margin-top:3px; font-size:var(--text-2xs); }
.ki-contract:hover strong { text-decoration:underline; color:#0866ca; }
.ki-muted { color:#71839b; }
.ki-menu-wrap { display:inline-flex; }
.ki-view .ki-menu, .ki-header-actions .ki-menu { position:fixed; z-index:80; min-width:205px; max-width:calc(100vw - 16px); padding:6px; border:1px solid #e1e8f1; border-radius:12px; background:#fff; box-shadow:0 8px 24px #0a204426; text-align:left; }
.ki-view .ki-menu button, .ki-header-actions .ki-menu button { display:flex; align-items:center; gap:9px; width:100%; min-height:42px; padding:10px; border:0; border-radius:8px; background:transparent; box-shadow:none; text-align:left; color:#263d58; font-size:var(--text-sm); white-space:normal; }
.ki-view .ki-menu button:hover, .ki-header-actions .ki-menu button:hover { background:#f2f7fe; }
.ki-view .ki-menu .danger-text, .ki-header-actions .ki-menu .danger-text { color:#ba2e38; }
.ki-empty { display:grid; justify-items:center; gap:8px; padding:32px 15px; text-align:center; color:#687b94; }
.ki-empty strong { color:#244566; }
.ki-panel > .pagination { padding:15px 20px; margin:0; border-top:1px solid #edf1f6; }
.ki-detail-modal { position:fixed; inset:0; margin:auto; padding:0; width:min(680px,calc(100% - 32px)); max-width:100%; max-height:calc(100dvh - 32px); border:1px solid #e1e8f1; border-radius:16px; background:#fff; color:#0e2442; overflow:hidden; box-shadow:0 20px 64px #041c3b40; }
.ki-detail-modal::backdrop { background:#09182e66; }
.ki-detail-modal [data-ki-detail-content] { display:flex; flex-direction:column; max-height:calc(100dvh - 34px); min-height:0; }
.ki-detail-modal-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; padding:22px 24px; border-bottom:1px solid #ebf0f6; flex-shrink:0; }
.ki-detail-modal-heading h2 { font-size:var(--text-xl); line-height:1.4; }
.ki-detail-modal-heading p { color:#687b94; font-size:var(--text-xs); line-height:1.5; margin:6px 0 0; }
.ki-detail-modal-body { padding:22px 24px; overflow-y:auto; overscroll-behavior:contain; min-height:0; }
.ki-detail-identity { background:#f0f6ff; border:1px solid #dce8fb; border-radius:13px; overflow:hidden; }
.ki-detail-property { display:flex; align-items:center; gap:13px; padding:18px 19px 17px; }
.ki-detail-property > div, .ki-detail-person > div, .ki-detail-kit-info > div { min-width:0; }
.ki-detail-property-icon { display:grid; place-items:center; width:46px; height:46px; flex:0 0 46px; border-radius:11px; background:#dfedff; color:#1464b6; }
.ki-detail-property-icon svg { width:25px; height:25px; }
.ki-detail-label { display:block; color:#647e9e; font-size:var(--text-2xs); font-weight:500; margin-bottom:5px; }
.ki-detail-modal .ki-detail-property h3 { font-size:var(--text-2xl); font-weight:700; line-height:1.2; letter-spacing:-.45px; overflow-wrap:anywhere; }
.ki-detail-people { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; padding:0 19px 18px; }
.ki-detail-person { display:flex; align-items:center; gap:10px; padding:12px; background:#fff; border:1px solid #e2eaf6; border-radius:10px; min-width:0; }
.ki-detail-person-icon { width:36px; height:36px; flex:0 0 36px; display:grid; place-items:center; border-radius:9px; background:#e8f1fe; color:#1764b0; }
.ki-detail-person:nth-child(2) .ki-detail-person-icon { background:#eaf0f8; color:#466589; }
.ki-detail-person dt { color:#647e9e; font-size:var(--text-2xs); font-weight:500; margin-bottom:3px; line-height:1.35; }
.ki-detail-person dd { margin:0; font-size:var(--text-base); font-weight:700; line-height:1.35; overflow-wrap:anywhere; }
.ki-detail-hero { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:15px 17px; margin:14px 0 23px; background:#fff; border:1px solid #e3eaf2; border-radius:11px; }
.ki-detail-kit-info { display:flex; align-items:center; gap:12px; min-width:0; }
.ki-detail-kit-icon { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; border-radius:10px; background:#eaf3ff; color:#1167ba; }
.ki-detail-kit-keys_standard { background:#f1edff; color:#7458b6; }
.ki-detail-kit-keys_premium { background:#fff3df; color:#a76c17; }
.ki-detail-kit-label, .ki-detail-quantity small { display:block; color:#687b94; font-size:var(--text-2xs); margin-bottom:4px; }
.ki-detail-modal .ki-detail-hero h3 { font-size:var(--text-sm); line-height:1.4; overflow-wrap:anywhere; margin-bottom:6px; }
.ki-detail-hero .ki-badge { padding:4px 9px; }
.ki-detail-quantity { flex-shrink:0; min-width:67px; text-align:right; }
.ki-detail-quantity strong { display:block; font-size:var(--text-2xl); line-height:1.1; font-variant-numeric:tabular-nums; }
.ki-detail-quantity small { margin:4px 0 0; }
.ki-details { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px 20px; margin:0; }
.ki-details > div { min-width:0; }
.ki-details .ki-wide { grid-column:1/-1; }
.ki-details dt { font-size:var(--text-2xs); color:#687b94; margin-bottom:6px; }
.ki-details dd { margin:0; font-size:var(--text-sm); font-weight:600; color:#263c57; line-height:1.5; overflow-wrap:anywhere; white-space:pre-wrap; }
.ki-details > div:last-child dd { padding:12px; background:#f5f8fc; border-radius:8px; font-weight:400; }
.ki-detail-modal-footer { display:flex; justify-content:flex-end; flex-shrink:0; padding:14px 24px; border-top:1px solid #ebf0f6; }
.ki-detail-modal-footer .ki-button { min-width:100px; }
@media (max-width:480px) {
  .ki-detail-modal { width:calc(100% - 20px); max-height:calc(100dvh - 20px); border-radius:12px; }
  .ki-detail-modal [data-ki-detail-content] { max-height:calc(100dvh - 22px); }
  .ki-detail-property { padding:15px 13px; }
  .ki-detail-modal .ki-detail-property h3 { font-size:var(--text-xl); }
  .ki-detail-people { grid-template-columns:1fr; gap:8px; padding:0 13px 13px; }
  .ki-detail-person { padding:10px; }
  .ki-detail-hero { padding:12px; gap:8px; margin-bottom:18px; }
  .ki-detail-kit-icon { display:none; }
  .ki-details { grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px 13px; }
  .ki-detail-modal-footer { padding:12px 16px; }
}
.ki-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media (max-width:1200px) {
  .ki-header { align-items:flex-start; flex-direction:column; }
  .ki-filters { grid-template-columns:minmax(180px,1fr) 1fr 1fr; }
  .ki-filters > button { grid-column:1/-1; justify-self:end; }
  .ki-advanced { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ki-stock-card { padding:15px; gap:12px; }
  .ki-kit-icon { width:44px; height:44px; flex-basis:44px; }
  .ki-section-label span { text-align:right; }
}
@media (max-width:800px) {
  .ki-view { gap:16px; }
  .ki-header h2 { font-size:var(--text-2xl); }
  .ki-header-actions { flex-wrap:wrap; width:100%; }
  .ki-header-actions > button { flex:1; }
  .ki-stock-grid { grid-template-columns:1fr; gap:10px; }
  .ki-stock-card { min-height:94px; padding:14px 18px; }
  .ki-stock-card strong { font-size:var(--text-2xl); }
  .ki-flow { align-items:stretch; flex-direction:column; gap:15px; padding:15px; }
  .ki-flow-values { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .ki-flow-values > div { border:1px solid #e5ebf2; border-radius:9px; padding:10px; }
  .ki-panel-heading { padding:18px 15px; }
  .ki-panel-heading h3 { font-size:var(--text-lg); }
  .ki-filters { grid-template-columns:1fr 1fr; padding:0 14px 15px; }
  .ki-search { grid-column:1/-1; }
  .ki-filters > button { justify-self:stretch; }
  .ki-advanced { margin:0 14px 15px; padding:12px; }
  .ki-advanced > button { grid-column:1/-1; }
  .ki-active-filters { padding:0 14px 14px; }
  .ki-table, .ki-table tbody { display:block; }
  .ki-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .ki-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr) auto; padding:14px 15px; gap:10px 14px; border-bottom:1px solid #edf1f6; }
  .ki-table tbody td { display:block; width:auto !important; padding:0; border:0; text-align:left !important; }
  .ki-table td:nth-child(1) { grid-column:1; font-size:var(--text-2xs); }
  .ki-table td:nth-child(2) { grid-column:1; grid-row:2; }
  .ki-table td:nth-child(3) { grid-column:1; grid-row:4; }
  .ki-table td:nth-child(4) { grid-column:2; grid-row:4; align-self:center; text-align:right !important; }
  .ki-table td:nth-child(5) { grid-column:1/-1; grid-row:3; }
  .ki-table td:nth-child(6) { grid-column:1/-1; grid-row:5; color:#687b94; font-size:var(--text-2xs); }
  .ki-table td:nth-child(6)::before { content:'Corretor: '; }
  .ki-table td:nth-child(7) { grid-column:1/-1; grid-row:6; font-size:var(--text-xs); }
  .ki-table td:nth-child(7)::before { content:"Destinatário: "; color:#687b94; font-weight:400; }
  .ki-table td:nth-child(8) { grid-column:2; grid-row:1/3; justify-self:end; }
  .ki-row-actions { justify-content:flex-end; }
  .ki-view .ki-row-action { width:42px; min-width:42px; min-height:42px; }
  .ki-table .ki-empty-row { display:block; }
  .ki-panel > .pagination { padding:14px; flex-wrap:wrap; gap:10px; }
  .ki-detail-modal-heading, .ki-detail-modal-body { padding:20px; }
}
@media (max-width:380px) {
  .ki-header-actions { gap:6px; }
  .ki-header-actions > .ki-button { padding:8px; font-size:var(--text-2xs); }
  .ki-section-label span { display:none; }
  .ki-advanced { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) {
  .ki-view *, .ki-detail-modal * { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}

body[data-route="estoque"] .topbar { flex-wrap:wrap; gap:16px; }
body[data-route="estoque"] .topbar-heading { flex:1 1 370px; min-width:0; }
body[data-route="estoque"] .topbar-heading .eyebrow { line-height:1.5; }
body[data-route="estoque"] .topbar-actions { margin-left:auto; }
.ki-header-actions :is(button):focus-visible { outline:3px solid #82bdf5; outline-offset:3px; }
.ki-header-actions button { cursor:pointer; }
.ki-header-actions .ki-menu-wrap { display:inline-flex; }
@media (max-width:800px) {
  body[data-route="estoque"] .topbar-heading { flex-basis:100%; }
  body[data-route="estoque"] .topbar-actions { width:100%; }
  body[data-route="estoque"] #route-action-root { flex:1; min-width:0; }
}

@media (max-width:480px) {
  .ki-detail-modal-heading { padding:17px 16px; }
  .ki-detail-modal-body { padding:16px; }
}
