/* Front-end invoice styles (mobile + print) */

.mhd-ri-container{max-width:1050px;margin:0 auto;padding:18px}

.mhd-ri-invoice{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial; color:#0f172a}
.mhd-ri-invoice *{box-sizing:border-box}

.mhd-ri-topbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px;flex-wrap:wrap}
.mhd-ri-brand{display:flex;align-items:center;gap:12px}
.mhd-ri-brand img{width:90px;height:60px;object-fit:contain;border-radius:12px;background:#fff;border:1px solid #e5e7eb;padding:6px}
.mhd-ri-logo-fallback{width:64px;height:64px;border-radius:16px;background:#0f172a;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:24px}
.mhd-ri-company-name{font-weight:900;font-size:16px}
.mhd-ri-company-meta{display:flex;flex-direction:column;align-items:flex-start;gap:2px;color:#64748b;font-size:12px;line-height:1.25;margin-top:2px}
.mhd-ri-meta-item{white-space:nowrap}

.mhd-ri-actions{display:flex;gap:10px;flex-wrap:wrap}
.mhd-ri-btn{border:1px solid #e2e8f0;background:#0f172a;color:#fff;border-radius:999px;padding:9px 12px;font-weight:700;cursor:pointer;transition:.15s}
.mhd-ri-btn:hover{transform:translateY(-1px)}
.mhd-ri-btn-ghost{background:#fff;color:#0f172a}
.mhd-ri-btn.mhd-ri-copied{transform:scale(.98);opacity:.85}

.mhd-ri-header{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap}
.mhd-ri-header h1{margin:0;font-size:28px;letter-spacing:-.02em}
.mhd-ri-pill{display:inline-flex;align-items:center;gap:8px;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:800;letter-spacing:.08em;margin-top:8px}
.mhd-ri-status-draft{background:#f1f5f9;color:#334155;border:1px solid #e2e8f0}
.mhd-ri-status-sent{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}
.mhd-ri-status-paid{background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}
.mhd-ri-status-void{background:#fff1f2;color:#be123c;border:1px solid #fecdd3}

.mhd-ri-invoice-meta{display:grid;grid-template-columns:repeat(2,minmax(160px,1fr));gap:10px}
.mhd-ri-invoice-meta div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px}
.mhd-ri-invoice-meta span{display:block;color:#64748b;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.mhd-ri-invoice-meta strong{display:block;font-size:14px;margin-top:4px}

.mhd-ri-two{display:grid;grid-template-columns:1fr;gap:12px;margin-top:12px}
@media(min-width:920px){.mhd-ri-two{grid-template-columns:1fr 1fr}}

.mhd-ri-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:14px}
.mhd-ri-card h3{margin:0 0 10px;font-size:14px;color:#0f172a}
.mhd-ri-pre{white-space:pre-wrap;color:#334155;line-height:1.35}
.mhd-ri-client{display:flex;flex-direction:column;gap:2px}
.mhd-ri-client-name{font-weight:900;font-size:14px;margin-bottom:2px}

.mhd-ri-from{display:flex;flex-direction:column;gap:2px}
.mhd-ri-from-name{font-weight:900;font-size:14px;margin-bottom:2px}
.mhd-ri-from-meta{color:#475569;font-size:12px;line-height:1.25}
.mhd-ri-from-address{margin-top:6px}

.mhd-ri-custom{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.mhd-ri-custom>div{display:flex;justify-content:space-between;gap:12px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px}
.mhd-ri-custom span{color:#64748b;font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.06em}

.mhd-ri-table{margin-top:12px;background:#fff;border:1px solid #e5e7eb;border-radius:18px;overflow:hidden}
.mhd-ri-thead,.mhd-ri-tr{display:grid;grid-template-columns:1fr 120px 150px 150px;gap:10px;padding:12px}
.mhd-ri-thead{background:#0f172a;color:#fff;font-weight:800;font-size:12px;text-transform:uppercase;letter-spacing:.06em}
.mhd-ri-tr{border-top:1px solid #eef2f7;align-items:start}
.mhd-ri-item-name{font-weight:800}
.mhd-ri-item-desc{margin-top:4px;color:#475569;font-size:12px;line-height:1.35}
.right{text-align:right}

.mhd-ri-bottom{display:grid;grid-template-columns:1fr;gap:12px;margin-top:12px;align-items:start}
@media(min-width:920px){.mhd-ri-bottom{grid-template-columns:1fr 340px}}

.mhd-ri-totals{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:14px;display:flex;flex-direction:column;gap:10px}
.mhd-ri-totals>div{display:flex;justify-content:space-between;gap:10px}
.mhd-ri-totals span{color:#64748b;font-weight:700}
.mhd-ri-grand{border-top:1px dashed #e2e8f0;padding-top:10px;margin-top:4px;font-size:15px}
.mhd-ri-grand strong{font-weight:900}

.mhd-ri-note{margin-top:10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:10px}

.mhd-ri-footer{margin-top:12px;color:#64748b;font-size:12px}
.mhd-ri-muted{color:#94a3b8}

/* Template variations */
.mhd-ri-template-bold .mhd-ri-thead{background:#111827}
.mhd-ri-template-bold .mhd-ri-btn{background:#111827}
.mhd-ri-template-bold .mhd-ri-logo-fallback{background:#111827}

.mhd-ri-template-minimal .mhd-ri-header{border-radius:12px}
.mhd-ri-template-minimal .mhd-ri-card{border-radius:12px}
.mhd-ri-template-minimal .mhd-ri-table{border-radius:12px}
.mhd-ri-template-minimal .mhd-ri-thead{background:#334155}

/* My invoices list */
.mhd-ri-my{max-width:1050px;margin:0 auto;padding:18px}
.mhd-ri-my-list{display:flex;flex-direction:column;gap:10px}
.mhd-ri-my-item{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:12px 14px;text-decoration:none;color:inherit;transition:.12s}
.mhd-ri-my-item:hover{transform:translateY(-1px);box-shadow:0 10px 28px rgba(0,0,0,.08)}
.mhd-ri-my-title{font-weight:900}
.mhd-ri-my-meta{color:#64748b;font-size:12px;margin-top:4px}
.mhd-ri-my-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.mhd-ri-my-total{font-weight:900}
.mhd-ri-notice{max-width:1050px;margin:18px auto;padding:12px 14px;background:#fff;border:1px solid #e5e7eb;border-radius:16px}

@media(max-width:720px){
  .mhd-ri-invoice-meta{grid-template-columns:1fr 1fr}
  .mhd-ri-thead,.mhd-ri-tr{grid-template-columns:1fr 70px 90px 90px}
  .mhd-ri-header h1{font-size:24px}
}

/* Print */
@media print{
  body{background:#fff}
  .mhd-ri-btn{display:none !important}
  .mhd-ri-container{padding:0}
  .mhd-ri-header,.mhd-ri-card,.mhd-ri-table,.mhd-ri-totals{box-shadow:none !important}
}


.mhd-ri-product-title{font-size:18px;font-weight:700;margin:18px 0 8px;}
.mhd-ri-spacer{height:14px;}
.mhd-ri-product-subtotal{background:rgba(0,0,0,0.03);}
