:root {
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --bg: #f5fbff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #dbeafe;
    --white: #ffffff;
    --danger: #ef4444;
    --success: #16a34a;
    --shadow: 0 12px 30px rgba(14, 165, 233, .10);
    --radius: 18px;
}
*{box-sizing:border-box}
body{margin:0;font-family:Arial,sans-serif;background:linear-gradient(180deg,#eef9ff 0%,#f8fcff 100%);color:var(--text)}
a{text-decoration:none;color:inherit}
.app-shell{min-height:100vh}
.page-wrap,.auth-wrap{max-width:1120px;margin:0 auto;padding:28px 18px}
.auth-wrap{display:flex;align-items:center;justify-content:center;min-height:100vh}
.card{background:var(--white);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.form-card,.table-card,.receipt-card,.wide-card,.auth-card{padding:22px}
.auth-card{width:100%;max-width:460px}
.wide-card{max-width:900px;width:100%}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:20px;flex-wrap:wrap}
h1,h2,h3{margin:0 0 8px}
.muted{color:var(--muted);margin:0}
.btn{background:linear-gradient(135deg,var(--primary) 0%,var(--primary-dark) 100%);color:#fff;border:none;border-radius:14px;padding:12px 18px;cursor:pointer;font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.btn-outline{background:#fff;color:var(--primary-dark);border:1px solid var(--primary)}
.btn-danger{background:linear-gradient(135deg,#fb7185 0%,var(--danger) 100%)}
.btn-sm{padding:8px 12px;border-radius:10px;font-size:12px}
.full-btn{width:100%;margin-top:14px}
label{display:block;font-weight:700;margin-bottom:8px}
input,select,textarea{width:100%;padding:12px 14px;border:1px solid #cbd5e1;border-radius:14px;background:#fff;outline:none}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(56,189,248,.12)}
.grid-form{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.grid-form .full{grid-column:1/-1}
.actions-row{display:flex;justify-content:flex-end}
.dashboard{display:grid;grid-template-columns:250px 1fr;min-height:100vh}
.sidebar{background:#f0f9ff;border-right:1px solid var(--line);padding:26px 18px}
.sidebar h2{font-size:22px;margin-bottom:18px}
.sidebar nav{display:grid;gap:8px}
.sidebar nav a{padding:12px 14px;border-radius:14px;color:#0c4a6e;font-weight:700}
.sidebar nav a.active,.sidebar nav a:hover{background:#e0f2fe}
.content{padding:28px 18px}
.stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px;margin-bottom:18px}
.stat-card span{display:block;color:var(--muted);margin-bottom:8px}
.stat-card strong{font-size:30px}
.filter-bar{display:grid;grid-template-columns:2fr 1fr auto;gap:12px}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:14px 10px;border-bottom:1px solid #e2e8f0;text-align:left;vertical-align:top}
.table th{background:#f8fdff}
.text-right{text-align:right}
.actions-cell{display:flex;gap:8px;flex-wrap:wrap}
.alert,.success{padding:12px 14px;border-radius:12px;margin-bottom:14px}
.alert{background:#fee2e2;color:#991b1b}
.success{background:#dcfce7;color:#166534}
.receipt-head{display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;border-bottom:1px solid #e2e8f0;padding-bottom:18px;margin-bottom:18px}
.receipt-logo{max-height:72px;max-width:180px;display:block;margin-bottom:10px}
.logo-placeholder{width:64px;height:64px;border-radius:18px;background:#e0f2fe;color:#0369a1;display:flex;align-items:center;justify-content:center;font-size:26px;font-weight:800;margin-bottom:10px}
.receipt-meta div{display:flex;justify-content:space-between;gap:16px;margin-bottom:8px}
.receipt-section{margin-bottom:22px}
.detail-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.action-cluster{display:flex;gap:12px;flex-wrap:wrap}
@media print{
    .no-print{display:none!important}
    body{background:#fff}
    .receipt-card{box-shadow:none;border:none;padding:0}
}
@media (max-width:900px){
    .dashboard{grid-template-columns:1fr}
    .sidebar{border-right:none;border-bottom:1px solid var(--line)}
}
@media (max-width:700px){
    .grid-form,.stats-grid,.detail-grid,.filter-bar{grid-template-columns:1fr}
    .table{display:block;overflow-x:auto}
}
