:root{
  --brand:#1a7a3c; --brand-dark:#145e2e; --brand-light:#e8f5ee;
  --surface:#ffffff; --surface2:#f6f8f6; --border:#e3e8e4; --border2:#cfd8d1;
  --text:#1f2a22; --text2:#6b7a70; --radius:12px; --radius-sm:8px;
  --font-body:'DM Sans',system-ui,sans-serif; --font-display:'Syne',sans-serif;
}
*{box-sizing:border-box}
body{margin:0;font-family:var(--font-body);color:var(--text);background:var(--surface2);display:flex;flex-direction:column;min-height:100vh;}

/* Topbar */
.mtz-top{background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:10px 18px;gap:12px;}
.mtz-top .brand{display:flex;align-items:center;gap:9px;font-family:var(--font-display);font-weight:700;letter-spacing:.5px;}
.mtz-top .brand svg{width:20px;height:20px;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.mtz-top .right{display:flex;align-items:center;gap:10px;font-size:12.5px;}
.mtz-user{background:rgba(255,255,255,.16);border:.5px solid rgba(255,255,255,.3);border-radius:20px;padding:4px 12px;font-weight:600;}
.mtz-logout{color:#fff;text-decoration:none;background:rgba(255,255,255,.16);border:.5px solid rgba(255,255,255,.3);border-radius:20px;padding:4px 12px;font-weight:600;}
.mtz-logout:hover{background:rgba(255,255,255,.28);}

.mtz-sub{background:var(--surface);border-bottom:.5px solid var(--border);padding:9px 18px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.mtz-sub .t{font-family:var(--font-display);font-size:13px;font-weight:700;color:var(--text);}
.mtz-sub a{color:var(--text2);text-decoration:none;font-size:12px;font-weight:600;}
.mtz-sub a:hover{color:var(--brand);}
.mtz-sub .sep{color:var(--border2);}

.mtz-main{flex:1;max-width:1040px;margin:0 auto;width:100%;padding:1.5rem;display:flex;flex-direction:column;gap:1rem;}

.card{background:var(--surface);border:.5px solid var(--border);border-radius:var(--radius);overflow:hidden;}
.card-title{background:var(--brand);color:#fff;font-family:var(--font-display);font-size:12px;font-weight:700;letter-spacing:.8px;text-transform:uppercase;padding:9px 1.1rem;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.card-body{padding:1.1rem;}

/* Grid de distribuidoras */
.dist-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;}
.dist-card{border:.5px solid var(--border);border-radius:var(--radius-sm);padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--surface);}
.dist-card .n{font-weight:700;font-size:14px;color:var(--text);}
.dist-card .id{font-size:11.5px;color:var(--text2);font-family:monospace;}
.dist-card .row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;}
.badge{display:inline-block;background:var(--brand-light);color:var(--brand-dark);border-radius:20px;padding:2px 9px;font-size:11px;font-weight:700;}

.btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border-radius:var(--radius-sm);font-family:var(--font-body);font-size:12.5px;font-weight:700;cursor:pointer;text-decoration:none;border:none;}
.btn-primary{background:var(--brand);color:#fff;}
.btn-primary:hover{background:var(--brand-dark);}
.btn-ghost{background:var(--surface2);color:var(--text2);border:.5px solid var(--border2);}
.btn-ghost:hover{background:var(--brand-light);color:var(--brand-dark);border-color:var(--brand);}
.btn svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

/* Accesos a informes */
.rep-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;}
.rep-card{border:.5px solid var(--border);border-radius:var(--radius-sm);padding:14px;text-decoration:none;color:var(--text);display:flex;align-items:center;gap:12px;background:var(--surface);transition:border-color .15s,background .15s;}
.rep-card:hover{border-color:var(--brand);background:var(--brand-light);}
.rep-ico{width:40px;height:40px;border-radius:10px;background:var(--brand-light);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.rep-ico svg{width:20px;height:20px;fill:none;stroke:var(--brand);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.rep-card .lbl{font-weight:700;font-size:13px;}
.rep-card .ds{font-size:11px;color:var(--text2);}

/* Tabla */
.m-table{width:100%;border-collapse:collapse;font-size:12.5px;}
.m-table thead th{background:#eef3f0;color:var(--text2);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;text-align:left;padding:8px 10px;border-bottom:.5px solid var(--border);white-space:nowrap;}
.m-table thead th.r,.m-table td.r{text-align:right;}
.m-table tbody td{padding:7px 10px;border-top:.5px solid var(--border);vertical-align:middle;}
.m-table tbody tr:hover{background:#fafbfa;}
.m-table tfoot td{padding:8px 10px;border-top:2px solid var(--brand);font-weight:800;color:var(--brand-dark);background:#f0f7f2;}
.mono{font-family:monospace;}

/* Filtros */
.filtros{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-bottom:12px;}
.field label{display:block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;color:var(--text2);margin-bottom:4px;}
.f-input{height:34px;border:.5px solid var(--border2);border-radius:var(--radius-sm);padding:0 10px;font-family:var(--font-body);font-size:13px;color:var(--text);background:var(--surface);outline:none;}
.f-input:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(26,122,60,.1);}

.aviso{background:#fffbeb;border:.5px solid #fde68a;border-radius:var(--radius-sm);padding:10px 14px;font-size:12.5px;color:#a16207;}

.mtz-foot{text-align:center;color:var(--text2);font-size:11.5px;padding:14px;}

/* Login */
.login-wrap{flex:1;display:flex;align-items:center;justify-content:center;padding:2rem;}
.login-card{background:var(--surface);border:.5px solid var(--border);border-radius:var(--radius);width:100%;max-width:360px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,.06);}
.login-head{background:var(--brand);color:#fff;text-align:center;padding:26px 20px 18px;}
.login-head .mark{display:inline-flex;width:46px;height:46px;border-radius:12px;background:rgba(255,255,255,.18);align-items:center;justify-content:center;margin-bottom:8px;}
.login-head .mark svg{width:24px;height:24px;}
.login-head h1{font-family:var(--font-display);margin:0;font-size:22px;letter-spacing:1px;}
.login-head p{margin:2px 0 0;font-size:12px;opacity:.9;}
.login-body{padding:20px;}
.login-body .field{margin-bottom:12px;}
.login-err{background:#fef2f2;border:.5px solid #fecaca;color:#dc2626;border-radius:var(--radius-sm);padding:8px 12px;font-size:12.5px;margin-bottom:12px;}
.cap-row{display:flex;gap:8px;align-items:center;}
.cap-row img{border:.5px solid var(--border2);border-radius:6px;height:38px;}
