:root{
  --bg:#f5f6f8;--panel:#fff;--text:#16181d;--muted:#717784;--line:#e7e9ee;
  --brand:#111827;--soft:#f0f1f4;--ok:#0f8a5f;--warn:#9a6700;--bad:#b42318;
  --radius:18px;--mobile-nav-h:72px;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
html,body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg)}
body{min-height:100vh}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button{-webkit-tap-highlight-color:transparent}
input,select,textarea{font-size:16px}
.app-shell{min-height:100vh;display:flex}
.sidebar{width:238px;background:#fff;border-right:1px solid var(--line);padding:22px 16px;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;z-index:20}
.sidebar-brand,.brand-lockup{display:flex;align-items:center;gap:12px}
.sidebar-brand{padding:0 10px 20px}
.sidebar-brand strong,.brand-lockup strong{display:block;letter-spacing:.08em}
.sidebar-brand span,.brand-lockup span{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.brand-mark{width:48px;height:48px;border-radius:16px;background:#111827;color:#fff;display:grid;place-items:center;font-weight:800;font-size:22px}
.brand-mark.small{width:36px;height:36px;border-radius:12px;font-size:17px}
nav{display:flex;flex-direction:column;gap:4px}
.sidebar nav a{padding:10px 12px;border-radius:11px;color:#4e5562;display:flex;gap:11px;align-items:center;font-size:14px}
.sidebar nav a:hover,.sidebar nav a.active{background:#f0f1f4;color:#111;font-weight:650}
.nav-label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#9ba1ad;padding:18px 12px 7px}
.sidebar-footer{margin-top:auto;padding:10px 12px;color:#a0a5af;font-size:11px}

.main{margin-left:238px;width:calc(100% - 238px);padding:0 34px 40px;min-width:0}
.topbar{height:92px;display:flex;justify-content:space-between;align-items:center}
.topbar h1{margin:0;font-size:24px;letter-spacing:-.03em}
.topbar p{margin:5px 0 0;color:var(--muted);font-size:13px}
.userbox{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--line);padding:8px 12px;border-radius:14px}
.userbox strong{display:block;font-size:13px}
.userbox a{font-size:11px;color:var(--muted)}
.avatar{width:32px;height:32px;border-radius:10px;background:#111827;color:#fff;display:grid;place-items:center;font-weight:700}
.content{max-width:1440px;margin:0 auto}
.hero{background:#111827;color:#fff;border-radius:24px;padding:28px 30px;display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:18px}
.hero h2{font-size:29px;letter-spacing:-.04em;margin:6px 0}
.hero p{margin:0;color:#bec3cd;max-width:680px;line-height:1.55}
.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#aeb4c0}
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}
.metric{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px;min-width:0}
.metric span{display:block;color:var(--muted);font-size:12px}
.metric strong{display:block;font-size:25px;letter-spacing:-.04em;margin:8px 0;white-space:nowrap}
.metric small{color:#9aa0ab}
.panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px}
.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}
.panel h3,.panel-head h3{margin:0;font-size:16px}
.panel-head p{margin:4px 0 0;color:var(--muted);font-size:12px}
.panel-head a{font-size:12px;color:#394150}
.table-wrap{overflow:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;min-width:620px}
th{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:#8c929d;text-align:left;padding:10px 12px;border-bottom:1px solid var(--line)}
td{padding:13px 12px;border-bottom:1px solid #f0f1f3;font-size:13px}
td strong{display:block}
td small{display:block;color:var(--muted);margin-top:3px}
.right{text-align:right}
.status{display:inline-flex;align-items:center;padding:5px 8px;border-radius:999px;background:#f0f1f3;font-size:10px;font-weight:750;letter-spacing:.04em;white-space:nowrap}
.status.accepted{background:#e7f7ef;color:#067647}.status.rejected{background:#feeceb;color:#b42318}.status.pending,.status.observed{background:#fff2d7;color:#8a5a00}.status.not_sent,.status.draft{background:#eef0f3;color:#5e6571}

.split{display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:16px}
.grow{min-width:0}.form-panel{height:max-content}.form-panel h3{margin-bottom:16px}
label{display:block;font-size:12px;color:#4e5562;margin-bottom:13px}
input,select,textarea{width:100%;border:1px solid #dfe2e7;background:#fff;border-radius:11px;padding:11px 12px;margin-top:6px;outline:none;color:#111;min-height:44px}
textarea{min-height:84px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:#8e949d;box-shadow:0 0 0 3px #f1f2f4}
.grid-2,.grid-3,.grid-4{display:grid;gap:12px}.grid-2{grid-template-columns:repeat(2,1fr)}.grid-3{grid-template-columns:repeat(3,1fr)}.grid-4{grid-template-columns:repeat(4,1fr)}
.check{display:flex;align-items:center;gap:8px;padding-top:20px}.check input{width:auto;margin:0;min-height:auto}
.btn{border:0;border-radius:11px;padding:11px 15px;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px}
.btn.primary{background:#111827;color:#fff}.btn.secondary{background:#f0f1f4;color:#222}.btn.wide{width:100%}.btn:disabled{opacity:.45;cursor:not-allowed}
.text-btn{font-size:12px;font-weight:700}.icon-btn{border:1px solid var(--line);background:#fff;border-radius:10px;width:42px;height:42px;cursor:pointer}
hr{border:0;border-top:1px solid var(--line);margin:22px 0}.empty{padding:36px;text-align:center;color:var(--muted);font-size:13px}
.alert{padding:11px 13px;border-radius:12px;margin:0 0 14px;font-size:13px;border:1px solid}
.alert.success{background:#eaf8f1;border-color:#b9ead4;color:#08764e}.alert.error{background:#fff0ef;border-color:#fac9c5;color:#a12b22}.alert.warning{background:#fff8e7;border-color:#f2deb0;color:#795400}

.sale-panel{max-width:1080px}
.line-items{border:1px solid var(--line);border-radius:14px;padding:12px;margin:8px 0 16px}
.line-head,.line-row{display:grid;grid-template-columns:1fr 140px 42px;gap:10px;align-items:center}
.line-head{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#8d939e;padding:0 4px 4px}
.line-row select,.line-row input{margin-top:4px}
.sale-actions{display:flex;justify-content:flex-end;gap:24px;align-items:center;border-top:1px solid var(--line);padding-top:16px}
.sale-actions span{display:block;color:var(--muted);font-size:11px}.sale-actions strong{font-size:22px}
.sunat-grid{display:grid;grid-template-columns:1.4fr .8fr;gap:16px}
.checklist{display:flex;flex-direction:column}.checklist>div{display:flex;gap:12px;padding:14px 0;border-bottom:1px solid var(--line)}
.checklist b{width:28px;height:28px;border-radius:9px;background:#eef0f3;display:grid;place-items:center}
.checklist .done b{background:#e7f7ef;color:#08764e}.checklist strong,.checklist small{display:block}.checklist small{color:var(--muted);margin-top:3px}
.sunat-state{background:#f5f6f8;border-radius:14px;padding:16px;margin:14px 0}.sunat-state span{display:block;color:var(--muted);font-size:11px}.sunat-state strong{font-size:24px}.muted{color:var(--muted);font-size:13px}

.auth-body{min-height:100vh;min-height:100dvh;display:grid;place-items:center;background:#f5f6f8;padding:24px max(14px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
.auth-shell{width:min(440px,100%)}
.brand-lockup{margin-bottom:18px;justify-content:center}
.auth-card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:26px;box-shadow:0 18px 50px rgba(15,23,42,.07)}
.auth-card h1{margin:0 0 6px;font-size:26px;letter-spacing:-.04em}.auth-card form{margin-top:20px}.install-card{width:100%}
.login-note{text-align:center;margin:16px 0 0;color:#999fa9;font-size:11px}

/* Mobile navigation */
.mobile-nav,.mobile-sheet,.mobile-sheet-backdrop{display:none}

@media(max-width:1000px){
  .sidebar{width:76px}.sidebar-brand div:last-child,.sidebar nav span,.nav-label,.sidebar-footer{display:none}
  .sidebar-brand{padding-left:4px}.main{margin-left:76px;width:calc(100% - 76px);padding:0 18px 30px}
  .cards{grid-template-columns:repeat(2,1fr)}.split,.sunat-grid{grid-template-columns:1fr}.form-panel{order:-1}
}

@media(max-width:720px){
  body{padding-bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom))}
  .sidebar{display:none}
  .main{margin:0;width:100%;padding:0 12px 24px}
  .topbar{
    height:auto;min-height:72px;position:sticky;top:0;z-index:12;background:rgba(245,246,248,.92);
    backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
    margin:0 -12px 10px;padding:calc(10px + env(safe-area-inset-top)) 14px 10px;border-bottom:1px solid rgba(231,233,238,.8)
  }
  .topbar h1{font-size:20px}.topbar p{font-size:11px;margin-top:2px}
  .userbox{padding:6px;background:transparent;border:0}.userbox .avatar{width:38px;height:38px;border-radius:12px}.userbox div:last-child{display:none}
  .hero{padding:20px;border-radius:20px;display:block;margin-bottom:12px}
  .hero h2{font-size:24px;line-height:1.08;margin:7px 0 9px}.hero p{font-size:13px}.hero .btn{margin-top:16px;width:100%}
  .cards{grid-template-columns:1fr 1fr;gap:9px;margin-bottom:12px}.metric{padding:14px;border-radius:15px}.metric strong{font-size:20px;margin:6px 0}.metric small{font-size:10px}
  .panel{padding:15px;border-radius:16px}.panel-head{align-items:flex-start}
  .split,.sunat-grid{display:block}.split>.panel+.panel,.sunat-grid>.panel+.panel{margin-top:12px}.form-panel{margin-bottom:12px}
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
  .line-items{padding:9px}.line-head{display:none}.line-row{grid-template-columns:minmax(0,1fr) 92px 42px;gap:7px;padding:4px 0}
  .sale-actions{position:sticky;bottom:calc(var(--mobile-nav-h) + 8px + env(safe-area-inset-bottom));z-index:8;background:#fff;margin:16px -15px -15px;padding:12px 15px;border-top:1px solid var(--line);box-shadow:0 -8px 20px rgba(15,23,42,.04)}
  .sale-actions .btn{min-width:138px}.sale-actions strong{font-size:19px}
  .table-wrap{margin:0 -15px;padding:0 15px}
  table{min-width:560px}
  th,td{padding-left:10px;padding-right:10px}
  .empty{padding:28px 14px}
  .auth-card{padding:22px 18px;border-radius:20px}.brand-lockup{margin-bottom:14px}.brand-mark{width:44px;height:44px;border-radius:14px}

  .mobile-nav{
    display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));height:64px;
    background:rgba(255,255,255,.96);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
    border:1px solid rgba(220,223,229,.95);border-radius:20px;box-shadow:0 12px 36px rgba(15,23,42,.16);z-index:60;padding:5px
  }
  .mobile-nav a,.mobile-nav button{
    border:0;background:transparent;border-radius:15px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
    color:#777e89;padding:2px;min-width:0
  }
  .mobile-nav a.active{background:#111827;color:#fff}
  .mobile-nav .micon{font-size:19px;line-height:22px;height:22px;display:grid;place-items:center}
  .mobile-nav small{font-size:9px;font-weight:650;white-space:nowrap}
  .mobile-nav .plus{font-size:24px}
  .mobile-nav button{font-family:inherit}

  .mobile-sheet-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.32);z-index:70}
  .mobile-sheet-backdrop.show{display:block}
  .mobile-sheet{
    display:block;position:fixed;z-index:80;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));
    background:#fff;border:1px solid var(--line);border-radius:24px;padding:8px 16px 18px;
    box-shadow:0 20px 60px rgba(15,23,42,.24);transform:translateY(calc(100% + 40px));transition:transform .22s ease
  }
  .mobile-sheet.open{transform:translateY(0)}
  .sheet-handle{width:42px;height:4px;border-radius:99px;background:#d7dae0;margin:2px auto 10px}
  .sheet-head{display:flex;justify-content:space-between;align-items:center;padding:2px 2px 12px}
  .sheet-head strong,.sheet-head span{display:block}.sheet-head span{font-size:11px;color:var(--muted);margin-top:2px}
  .sheet-close{width:38px;height:38px;border:0;border-radius:12px;background:#f1f2f4;font-size:22px}
  .sheet-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
  .sheet-grid a{border:1px solid var(--line);border-radius:15px;padding:14px;min-height:104px}
  .sheet-grid a>span{font-size:20px}.sheet-grid strong,.sheet-grid small{display:block}.sheet-grid strong{font-size:13px;margin-top:9px}.sheet-grid small{font-size:10px;color:var(--muted);margin-top:3px}
}

@media(max-width:390px){
  .cards{grid-template-columns:1fr 1fr}
  .metric span{font-size:11px}.metric strong{font-size:18px}
  .mobile-nav{left:5px;right:5px}
}


/* v0.1.2 - Home quick actions + ticket settings */
.quick-section{margin-bottom:16px}
.quick-section h3{margin:0 0 11px;font-size:16px}
.quick-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.quick-card{min-height:116px;border:1px solid var(--line);border-radius:17px;padding:14px;background:#fff;display:flex;flex-direction:column;justify-content:space-between;transition:.15s ease}
.quick-card:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(15,23,42,.06)}
.quick-card .qicon{width:38px;height:38px;border-radius:12px;background:#f1f2f4;display:grid;place-items:center;font-size:20px}
.quick-card strong{font-size:13px;line-height:1.2}
.quick-card small{color:var(--muted);font-size:10px;margin-top:4px}
.quick-card.primary-action{background:#111827;color:#fff;border-color:#111827}
.quick-card.primary-action .qicon{background:rgba(255,255,255,.12)}
.quick-card.primary-action small{color:#c7ccd5}
.ticket-preview-wrap{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;align-items:start}
.ticket-preview{background:#efefef;border-radius:18px;padding:16px;display:flex;justify-content:center;position:sticky;top:100px}
.ticket-paper{width:250px;background:#fff;color:#111;padding:16px 14px;box-shadow:0 8px 28px rgba(0,0,0,.12);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.35}
.ticket-paper .preview-logo{max-width:90px;max-height:55px;display:block;margin:0 auto 8px;object-fit:contain}
.ticket-paper h4{font-size:12px;text-align:center;margin:3px 0}
.ticket-paper p{margin:2px 0;text-align:center}
.ticket-paper hr{border:0;border-top:1px dashed #777;margin:8px 0}
.ticket-paper .row{display:flex;justify-content:space-between;gap:10px}.ticket-paper .row b{text-align:right}
.logo-preview{width:140px;height:84px;border:1px dashed #cfd3da;border-radius:12px;background:#fafafa;display:grid;place-items:center;overflow:hidden;margin-top:8px}
.logo-preview img{max-width:100%;max-height:100%;object-fit:contain}
.setting-note{font-size:11px;color:var(--muted);margin-top:-5px;margin-bottom:12px}
@media(max-width:900px){.quick-grid{grid-template-columns:repeat(2,1fr)}.ticket-preview-wrap{grid-template-columns:1fr}.ticket-preview{position:static}}
@media(max-width:720px){
  .quick-section{margin-bottom:12px}
  .quick-grid{grid-template-columns:repeat(2,1fr);gap:8px}
  .quick-card{min-height:104px;padding:12px;border-radius:15px}
  .quick-card strong{font-size:12px}
  .ticket-preview{padding:12px}
  .ticket-paper{width:min(100%,280px)}
}


/* =========================================
   HUANCA v0.1.3 - polished mobile dashboard
   ========================================= */
.mobile-dashboard{max-width:880px;margin:0 auto}
.brand-hero{
  background:linear-gradient(145deg,#153f98 0%,#1d58c4 55%,#2d6ad4 100%);
  color:#fff;border-radius:26px;padding:22px;margin-bottom:16px;
  box-shadow:0 18px 45px rgba(22,67,155,.22);position:relative;overflow:hidden
}
.brand-hero:before{
  content:"";position:absolute;width:220px;height:220px;border-radius:50%;
  background:rgba(255,255,255,.07);right:-100px;top:-110px
}
.brand-top{display:flex;align-items:center;justify-content:space-between;position:relative;z-index:1;margin-bottom:20px}
.company-identity{display:flex;align-items:center;gap:12px;min-width:0}
.company-logo{width:54px;height:54px;border-radius:50%;background:#fff;display:grid;place-items:center;overflow:hidden;box-shadow:0 4px 18px rgba(0,0,0,.12)}
.company-logo img{width:100%;height:100%;object-fit:contain;padding:5px}.company-logo span{color:#194aa8;font-size:23px;font-weight:850}
.company-identity small{display:block;font-size:10px;letter-spacing:.13em;color:rgba(255,255,255,.70)}
.company-identity h2{margin:3px 0 0;font-size:22px;line-height:1;letter-spacing:-.025em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-settings{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.12);display:grid;place-items:center;color:#fff;flex:0 0 auto}
.company-switch{position:relative;z-index:1;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.12);border-radius:17px;padding:13px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px;backdrop-filter:blur(8px)}
.company-switch span{display:block;font-size:9px;letter-spacing:.12em;color:rgba(255,255,255,.65)}
.company-switch strong{display:block;margin-top:4px;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:680px}
.company-switch.branch{background:rgba(0,0,0,.09)}

.home-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}
.home-module{
  border:0;border-radius:22px;padding:18px;color:#fff;min-height:148px;
  display:flex;flex-direction:column;justify-content:flex-end;position:relative;overflow:hidden;
  box-shadow:0 12px 30px rgba(15,23,42,.10)
}
.home-module:before{content:"";position:absolute;inset:auto -35px -55px auto;width:130px;height:130px;border-radius:50%;background:rgba(255,255,255,.10)}
.home-module .module-icon{width:48px;height:48px;border-radius:15px;background:rgba(255,255,255,.18);display:grid;place-items:center;margin-bottom:18px}
.home-module .module-icon svg{width:27px;height:27px}
.home-module strong{font-size:17px;line-height:1.08;position:relative;z-index:1}
.home-module small{font-size:10px;color:rgba(255,255,255,.78);margin-top:5px;position:relative;z-index:1}
.sale-card{background:linear-gradient(145deg,#07998e,#0ab7a5)}
.docs-card{background:linear-gradient(145deg,#11a84d,#17c364)}
.guide-card{background:linear-gradient(145deg,#922eb4,#b83bc5)}
.products-card{background:linear-gradient(145deg,#f39b21,#ffb62e)}

.home-module.full{min-height:auto;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;margin-bottom:12px;padding:17px 18px}
.stats-card{background:linear-gradient(140deg,#42a923,#63c535);color:#fff}
.stats-card .module-icon{margin:0;flex:0 0 auto}.stats-card .module-copy{display:flex;flex-direction:column;min-width:0}
.stats-card .module-copy small{margin:0;font-size:9px;letter-spacing:.1em;color:rgba(255,255,255,.78)}
.stats-card .module-copy strong{font-size:24px;margin-top:2px}
.stats-card .module-copy span{font-size:10px;color:rgba(255,255,255,.80);margin-top:2px}
.stats-card .module-arrow{margin-left:auto;font-size:32px;color:rgba(255,255,255,.8)}

.section-title-row{display:flex;align-items:end;justify-content:space-between;margin:22px 2px 10px}
.section-title-row small,.recent-head small{display:block;font-size:9px;letter-spacing:.13em;color:#9aa0ab}
.section-title-row h3,.recent-head h3{margin:3px 0 0;font-size:20px;letter-spacing:-.03em}

.manage-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}
.manage-card{background:#fff;border:1px solid var(--line);border-radius:17px;padding:14px;display:flex;align-items:center;gap:11px;min-width:0}
.manage-icon{width:42px;height:42px;border-radius:13px;background:#eef3ff;color:#2357b5;display:grid;place-items:center;flex:0 0 auto}
.manage-icon svg{width:22px;height:22px}
.manage-card div{min-width:0}.manage-card strong,.manage-card small{display:block}
.manage-card strong{font-size:13px}.manage-card small{font-size:10px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.manage-card>span:last-child{margin-left:auto;color:#a0a5ad;font-size:22px}

.recent-card{background:#fff;border:1px solid var(--line);border-radius:19px;padding:15px;margin-bottom:12px}
.recent-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:7px}
.recent-head a{font-size:11px;color:#3661b3;font-weight:700}
.recent-row{display:flex;align-items:center;gap:11px;padding:11px 0;border-top:1px solid #f0f1f3}
.recent-row:first-of-type{border-top:0}
.recent-doc{width:38px;height:38px;border-radius:12px;background:#f0f3f8;color:#274f9c;display:grid;place-items:center;font-weight:800;flex:0 0 auto}
.recent-info{min-width:0;flex:1}.recent-info strong,.recent-info small,.recent-total strong,.recent-total small{display:block}
.recent-info strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.recent-info small{font-size:9px;color:var(--muted);margin-top:3px}
.recent-total{text-align:right;flex:0 0 auto}.recent-total strong{font-size:12px}.recent-total small{font-size:8px;color:var(--muted);margin-top:3px}

@media(min-width:721px){
  .mobile-dashboard{padding-top:4px}
  .brand-hero{padding:26px}
  .home-grid{grid-template-columns:repeat(4,1fr)}
  .home-module{min-height:168px}
}
@media(max-width:720px){
  .module-dashboard .topbar{display:none}
  .module-dashboard .main{padding-top:calc(12px + env(safe-area-inset-top))}
  .brand-hero{border-radius:24px;padding:18px;margin-bottom:12px}
  .company-logo{width:50px;height:50px}
  .company-identity h2{font-size:20px}
  .company-switch{padding:12px 13px;border-radius:15px}
  .home-grid{gap:9px;margin-bottom:14px}
  .home-module{min-height:132px;border-radius:19px;padding:15px}
  .home-module .module-icon{width:43px;height:43px;margin-bottom:14px}
  .home-module strong{font-size:15px}
  .home-module.full{border-radius:19px;padding:14px 15px}
  .stats-card .module-copy strong{font-size:21px}
  .manage-grid{grid-template-columns:1fr;gap:8px}
  .manage-card{padding:12px 13px}
  .recent-card{border-radius:17px;padding:13px}
}


/* v0.1.4 - sale wizard + document lookup */
.sale-wizard{max-width:860px;margin:0 auto 20px}
.wizard-title{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:15px}
.wizard-title h2{font-size:25px;letter-spacing:-.04em;margin:4px 0 3px}.wizard-title p{margin:0;color:var(--muted);font-size:12px}
.eyebrow-dark{font-size:9px;letter-spacing:.13em;color:#3159a1;font-weight:800}
.wizard-tabs{display:grid;grid-template-columns:repeat(3,1fr);background:#e9ebef;border-radius:16px;padding:4px;margin-bottom:13px}
.wizard-tab{border:0;background:transparent;border-radius:12px;padding:9px 8px;color:#6e7580;display:flex;align-items:center;justify-content:center;gap:7px;font-weight:700}
.wizard-tab b{width:24px;height:24px;border-radius:8px;background:#d8dbe1;display:grid;place-items:center;font-size:10px}
.wizard-tab.active{background:#fff;color:#183b79;box-shadow:0 3px 12px rgba(15,23,42,.07)}
.wizard-tab.active b{background:#2357b5;color:#fff}
.wizard-step{display:none}.wizard-step.active{display:block}
.step-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:20px}
.step-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}
.step-head small{font-size:9px;letter-spacing:.12em;color:#9aa0aa}.step-head h3{margin:3px 0 0;font-size:18px}
.step-icon{width:40px;height:40px;border-radius:13px;background:#eef3ff;color:#2458b3;display:grid;place-items:center;font-size:19px;font-weight:800}
.doc-search-grid{display:grid;grid-template-columns:180px 1fr;gap:11px}
.search-input{display:flex}.search-input input{border-radius:11px 0 0 11px}.search-input button{width:50px;flex:0 0 50px;border:0;background:#2e69d5;color:#fff;border-radius:0 11px 11px 0;margin-top:6px;display:grid;place-items:center}.search-input svg{width:21px}
.lookup-state{display:flex;align-items:center;gap:8px;background:#f5f7fa;border-radius:11px;padding:10px 11px;margin:-3px 0 14px;color:#717885;font-size:11px}
.lookup-state.success{background:#eaf8f1;color:#08764e}.lookup-state.error{background:#fff4e7;color:#8a5a00}
.lookup-dot{width:8px;height:8px;border-radius:50%;background:#a8adb5;flex:0 0 auto}.lookup-state.success .lookup-dot{background:#10a36c}.lookup-state.error .lookup-dot{background:#e09a1b}
.step-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:19px;border-top:1px solid var(--line);padding-top:14px}
.step-actions .btn{min-width:130px}
.document-type-choice{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:15px}
.doc-choice{margin:0;position:relative}.doc-choice input{position:absolute;opacity:0;pointer-events:none}
.doc-choice span{border:1px solid var(--line);border-radius:14px;padding:14px;display:block;cursor:pointer}.doc-choice b,.doc-choice small{display:block}.doc-choice small{color:var(--muted);margin-top:3px}
.doc-choice input:checked+span{background:#eef3ff;border-color:#9ab5e8;color:#214e9e}
.client-summary{background:#f5f6f8;border-radius:14px;padding:13px;margin-top:5px}.client-summary span,.client-summary strong,.client-summary small{display:block}.client-summary span{font-size:9px;text-transform:uppercase;letter-spacing:.1em;color:#989ea8}.client-summary strong{font-size:13px;margin-top:4px}.client-summary small{font-size:10px;color:var(--muted);margin-top:2px}
.modern-lines{padding:0;border:0}.modern-lines .line-row{background:#f7f8fa;border:1px solid #ebedf0;border-radius:13px;padding:8px;margin-bottom:8px}
.add-product-btn{width:100%;height:46px;border:1.5px dashed #76a2e8;background:#f7faff;color:#2864c1;border-radius:13px;font-weight:750}
.sale-total-card{display:flex;align-items:center;justify-content:space-between;background:#111827;color:#fff;padding:16px;border-radius:16px;margin-top:14px}.sale-total-card span,.sale-total-card small{display:block}.sale-total-card span{font-size:13px;font-weight:750}.sale-total-card small{font-size:9px;color:#adb5c2;margin-top:2px}.sale-total-card strong{font-size:23px}
.final-actions{border-top:0;padding-top:7px}.emit-btn{background:#4cae4f!important}
@media(max-width:720px){
  .module-sales .topbar{display:none}
  .module-sales .main{padding-top:calc(14px + env(safe-area-inset-top))}
  .sale-wizard{margin-bottom:6px}.wizard-title{padding:0 3px}.wizard-title h2{font-size:23px}
  .wizard-tabs{position:sticky;top:calc(env(safe-area-inset-top) + 4px);z-index:20}
  .wizard-tab{font-size:11px;padding:8px 3px}.wizard-tab b{width:22px;height:22px}
  .step-card{padding:15px;border-radius:18px}.doc-search-grid{grid-template-columns:1fr}
  .document-type-choice{grid-template-columns:1fr 1fr}.step-actions .btn{flex:1;min-width:0}
  .modern-lines .line-row{grid-template-columns:minmax(0,1fr) 78px 40px}
  .sale-actions{position:static}
}


/* v0.1.5 - IGV + descuentos */
.discount-box{border:1px solid var(--line);border-radius:15px;padding:13px;margin-top:13px;background:#fbfbfc}
.discount-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.discount-head strong,.discount-head small{display:block}.discount-head strong{font-size:13px}.discount-head small{font-size:9px;color:var(--muted);margin-top:2px}.discount-head>span{font-size:24px;color:#a2a7b0}
.discount-controls{display:grid;grid-template-columns:1fr 140px;gap:9px}.discount-controls select,.discount-controls input{margin:0}
.tax-summary{background:#f5f6f8;border-radius:16px;padding:13px 14px;margin-top:12px}
.tax-summary>div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;font-size:12px;color:#59616e}
.tax-summary>div strong{color:#22252a;white-space:nowrap}
.tax-summary .summary-discount strong{color:#b42318}
.tax-summary .tax-total{border-top:1px solid #dfe2e7;margin-top:5px;padding-top:11px;color:#111;font-weight:800}
.tax-summary .tax-total strong{font-size:22px;color:#111827}
@media(max-width:720px){
  .discount-controls{grid-template-columns:1fr 110px}
  .tax-summary{padding:12px}
}

/* v0.1.6 */
.module-sunat .checklist .done strong{color:#0b6d4d}
@media(max-width:720px){
  .module-documents td:last-child{min-width:150px}
}
