/* LEMAQ Gestión — estilos */
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f4f5f7; --card: #fff; --line: #e7e8ec; --line2: #f0f1f4;
  --txt: #1d1f24; --muted: #7a7f8c; --side: #1f1f1f; --side2: #2a2a2a; --sidetxt: #c9c9c9;
  --brand: #ffb400; --brand2: #f5a300; --brand-ink: #1d1f24;
  --green: #12a150; --green-bg: #e8f8ee; --blue: #2563eb; --blue-bg: #eaf1fe;
  --amber: #d97706; --amber-bg: #fff6e0; --red: #dc2626; --red-bg: #fdecec; --dark-bg: #f1f2f4;
  --r: 10px; --sh: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 13.5px; color: var(--txt); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; display: block; }
.nw { white-space: nowrap; }
.txt-red { color: var(--red); } .txt-green { color: var(--green); }
.ic { flex: none; vertical-align: middle; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 212px; background: var(--side); color: var(--sidetxt); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .25s; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 18px; height: 58px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt b { color: #fff; font-size: 13.5px; letter-spacing: .02em; }
.brand-txt small { color: var(--brand); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; }
.brand.dark .brand-txt b { color: var(--txt); }
.menu { flex: 1; overflow-y: auto; padding: 4px 10px 10px; scrollbar-width: thin; scrollbar-color: #444 transparent; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; font-size: 13px; color: var(--sidetxt); transition: background .15s, color .15s; }
.menu a span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu a:hover { background: var(--side2); color: #fff; }
.menu a.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.menu a.active .dot { display: none; }
.dot { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.side-foot { padding: 10px 18px; font-size: 11px; color: #777; border-top: 1px solid #2c2c2c; }
.main { flex: 1; margin-left: 212px; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 54px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: 16px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; height: 32px; width: 205px; color: var(--muted); background: #fafbfc; }
.search input { border: 0; outline: 0; background: transparent; font: inherit; width: 100%; color: var(--txt); }
.search:focus-within { border-color: var(--brand); background: #fff; }
.content { padding: 20px 20px 40px; max-width: 1500px; width: 100%; }
.overlay { display: none; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; display: inline-grid; place-items: center; color: #555; cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--dark-bg); color: var(--txt); }
.icon-btn.sm { width: 28px; height: 28px; }
.bell-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); border: 1.5px solid #fff; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; font: inherit; font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 8px; color: var(--txt); }
.user-btn:hover { background: var(--dark-bg); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #1d1f24; color: var(--brand); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dd-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 230px; padding: 6px; z-index: 50; }
.dropdown.open .dd-menu { display: block; }
.dd-menu > a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 7px; }
.dd-menu > a:hover { background: var(--dark-bg); }
.dd-title { padding: 8px 10px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; gap: 6px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.dd-title small { color: var(--muted); font-weight: 500; }
.dd-alerts { width: 320px; max-height: 420px; overflow-y: auto; }
.dd-empty { padding: 14px 10px; color: var(--muted); text-align: center; }
.dd-alert { align-items: flex-start !important; }
.dd-alert span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dd-alert b { font-weight: 550; font-size: 12.5px; }
.dd-alert small { color: var(--muted); }
.ai { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ai-red { background: var(--red-bg); color: var(--red); } .ai-amber { background: var(--amber-bg); color: var(--amber); } .ai-blue { background: var(--blue-bg); color: var(--blue); }

/* ---------- Tarjetas y KPIs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 12px; }
.card-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.card-head > div { display: flex; flex-direction: column; gap: 2px; }
.card-head > div:has(.btn) { flex-direction: row; align-items: center; gap: 10px; }
.count { background: var(--dark-bg); color: var(--muted); border-radius: 20px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.kpis { display: grid; gap: 14px; margin-bottom: 18px; }
.k4 { grid-template-columns: repeat(4, 1fr); } .k3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 16px 16px 16px 18px; display: flex; justify-content: space-between; gap: 10px; min-height: 80px; transition: border-color .15s, transform .15s; }
a.kpi[href]:hover { border-color: #d6d8de; transform: translateY(-1px); }
.kpi > div { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #3d414b; }
.kpi-val { font-size: 21px; font-weight: 700; margin-top: 8px; white-space: nowrap; letter-spacing: -.02em; }
.kpi-sub { color: var(--muted); margin-top: 4px; font-size: 11.5px; }
.kpi-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi-ic.sm { width: 32px; height: 32px; }
.c-dark { color: var(--txt); } .c-green { color: var(--green); } .c-blue { color: var(--blue); } .c-amber { color: var(--amber); } .c-red { color: var(--red); }
.bg-dark { background: var(--dark-bg); color: #333; } .bg-green { background: var(--green-bg); color: var(--green); } .bg-blue { background: var(--blue-bg); color: var(--blue); } .bg-amber { background: var(--amber-bg); color: var(--amber); } .bg-red { background: var(--red-bg); color: var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 18px; }
.chart-box { height: 230px; padding: 0 18px 16px; position: relative; }
.chart-box .empty { height: 100%; display: grid; place-items: center; }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 0 20px 20px; }
.quick-btn { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; font-weight: 500; transition: border-color .15s, background .15s; }
.quick-btn span { width: 32px; height: 32px; border-radius: 8px; background: var(--dark-bg); display: grid; place-items: center; color: #444; }
.quick-btn:hover { border-color: var(--brand); background: #fffcf3; }
.quick-btn:hover span { background: var(--brand); color: var(--brand-ink); }

.list { border-top: 1px solid var(--line2); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line2); }
.list-item:last-child { border-bottom: 0; border-radius: 0 0 var(--r) var(--r); }
.list-item:hover { background: #fafbfc; }
.li-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--dark-bg); display: grid; place-items: center; color: #555; flex: none; }
.li-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.li-main b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { color: var(--muted); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); border-top: 1px solid var(--line2); }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state h3 { color: var(--txt); font-size: 15px; }
.link { color: var(--brand2); font-size: 12px; font-weight: 600; }
.link:hover { text-decoration: underline; }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-green { background: var(--green-bg); color: var(--green); } .b-blue { background: var(--blue-bg); color: var(--blue); }
.b-amber { background: var(--amber-bg); color: #b45309; } .b-red { background: var(--red-bg); color: var(--red); } .b-gray { background: var(--dark-bg); color: #555; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 550; color: var(--txt); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #f7f8fa; border-color: #d6d8de; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand2); border-color: var(--brand2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; height: 40px; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-bg); border-color: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Barra de acciones / filtros ---------- */
.page-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input[type=date] { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: inherit; background: #fff; color: var(--txt); max-width: 220px; }
.search-in { display: flex; align-items: center; gap: 6px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; color: var(--muted); }
.search-in input { border: 0; outline: 0; font: inherit; width: 220px; color: var(--txt); }
.search-in:focus-within { border-color: var(--brand); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.w-input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; width: 150px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); background: #fafbfc; padding: 11px 14px; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { width: 1%; padding-left: 4px; text-align: right; white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fffcf3; }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--r); }
.card > .table-wrap:first-child .table th:last-child { border-top-right-radius: var(--r); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); gap: 10px; }
.pager div { display: flex; gap: 8px; align-items: center; }
a.ref { color: var(--blue); font-weight: 500; }
a.ref:hover { text-decoration: underline; }
.perms td { padding: 6px 14px; }
.perm-sel { height: 30px; border-radius: 7px; border: 1px solid var(--line); font: inherit; font-size: 12.5px; padding: 0 6px; }
.p-no { color: var(--muted); } .p-ver { background: var(--blue-bg); color: var(--blue); border-color: #c9dafc; } .p-editar { background: var(--green-bg); color: var(--green); border-color: #b9e8cb; }
.bar { height: 6px; background: var(--dark-bg); border-radius: 4px; overflow: hidden; width: 100px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); }
.aging { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0 20px 14px; }
.aging div { display: flex; flex-direction: column; gap: 4px; background: #fafbfc; border: 1px solid var(--line2); border-radius: 8px; padding: 10px; }
.aging span { font-size: 11px; } .aging b { font-size: 13px; white-space: nowrap; }

/* ---------- Formularios ---------- */
.form { padding: 22px; }
.form .card-head { padding: 0 0 16px; }
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.w-full { grid-column: span 6; } .w-half { grid-column: span 3; } .w-third { grid-column: span 2; }
.field label { font-weight: 550; font-size: 12.5px; color: #3d414b; }
.req { color: var(--red); font-style: normal; }
.field input, .field select, .field textarea { width: 100%; height: 38px; border: 1px solid #dcdee3; border-radius: 8px; padding: 0 11px; font: inherit; color: var(--txt); background: #fff; outline: 0; transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,180,0,.18); }
.field input.computed { background: #f6f7f9; color: #333; font-weight: 600; border-style: dashed; }
.field input.money { font-variant-numeric: tabular-nums; }
.field .help { color: var(--muted); font-size: 11.5px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.form-actions { display: flex; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line2); }
.sec { font-size: 13px; padding-top: 6px; color: var(--txt); }
.narrow { max-width: 760px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.check input { width: 16px !important; height: 16px !important; accent-color: var(--brand2); }
.tool { padding: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tool h3 { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.tool p { margin: 0; }
.tool input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; }
.tool.danger { border-color: #f6caca; }

/* ---------- Ficha ---------- */
.detail { padding: 22px; }
.detail-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px 22px; }
.d-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d-item > span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.d-item > div { font-size: 14px; word-wrap: break-word; }
.meta { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line2); color: var(--muted); font-size: 12px; }
.danger-zone { text-align: right; }

/* ---------- Avisos ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; font-weight: 500; }
.alert-ok { background: var(--green-bg); color: #0c6b37; border: 1px solid #c3ecd3; }
.alert-error { background: var(--red-bg); color: #9b1c1c; border: 1px solid #f6caca; }

/* ---------- Login / instalación ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 10% -10%, #ffe7a3 0, transparent 60%), linear-gradient(135deg, #1f1f1f 0%, #2b2b2b 100%); }
.login-card { background: #fff; width: 100%; max-width: 380px; border-radius: 16px; padding: 30px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login-card.wide { max-width: 640px; }
.login-card .brand { padding: 0; height: auto; margin-bottom: 6px; }
.login-card h2 { font-size: 20px; }
.login-card p { margin: 0; }
.login-card .field input { height: 42px; }
.checks { list-style: none; margin: 0; padding: 12px 14px; background: #fafbfc; border-radius: 10px; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks .ok { color: var(--green); } .checks .bad { color: var(--red); font-weight: 600; }

/* ---------- Impresión ---------- */
.print-body { background: #e9eaee; padding: 20px; }
.print-bar { max-width: 820px; margin: 0 auto 12px; display: flex; gap: 8px; justify-content: flex-end; }
.sheet { background: #fff; max-width: 820px; margin: 0 auto; padding: 40px 46px; box-shadow: 0 4px 20px rgba(0,0,0,.08); font-size: 12.5px; line-height: 1.5; }
.p-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 3px solid var(--brand); margin-bottom: 20px; }
.p-brand { display: flex; gap: 12px; align-items: center; }
.p-brand div { display: flex; flex-direction: column; }
.p-brand b { font-size: 17px; }
.p-brand small { color: var(--muted); font-size: 11px; }
.p-doc { text-align: right; display: flex; flex-direction: column; border: 1.5px solid var(--txt); border-radius: 8px; padding: 8px 16px; min-width: 190px; }
.p-doc span { font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.p-doc b { font-size: 16px; }
.p-box { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.p-box div, .p-fields div { display: flex; flex-direction: column; }
.p-box span, .p-fields span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.p-fields { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 18px; margin-bottom: 20px; }
.p-fields b { font-weight: 550; }
.p-table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; }
.p-table th { background: #1f1f1f; color: #fff; text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 600; }
.p-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.p-table .num { text-align: right; white-space: nowrap; }
.p-table tfoot td { border: 0; padding: 4px 10px; }
.p-table tr.tot td { font-weight: 700; font-size: 14px; border-top: 2px solid var(--txt); padding-top: 8px; }
.p-cond { background: #fffcf3; border-left: 3px solid var(--brand); padding: 10px 16px; margin: 10px 0 20px; }
.p-cond h4, .sheet h4 { font-size: 12.5px; margin-bottom: 6px; }
.p-cond ul { margin: 0 0 6px; padding-left: 18px; }
.p-sign { margin-top: 60px; display: flex; justify-content: flex-end; text-align: center; }
.p-sign.two { justify-content: space-between; }
@media print {
  @page { size: A4; margin: 14mm; }
  .no-print, .sidebar, .topbar, .page-actions .btn, .filters { display: none !important; }
  .print-body { background: #fff; padding: 0; }
  .sheet { box-shadow: none; padding: 0; max-width: none; }
  .main { margin: 0; } .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Responsive ---------- */
.only-mobile { display: none; }
@media (max-width: 1200px) { .k4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-grid; }
  .grid-2, .grid-3, .k3 { grid-template-columns: 1fr; }
  .aging { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .only-desktop, .search { display: none; }
  .k4 { grid-template-columns: 1fr 1fr; }
  .kpi-val { font-size: 17px; }
  .content { padding: 14px 12px 30px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .w-full, .w-half, .w-third { grid-column: span 1; }
  .search-in input { width: 140px; }
  .p-fields { grid-template-columns: 1fr 1fr; }
}
