* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; margin: 0; padding: 0; background: #f5f5f5; }
.layout-main { display: flex; flex-direction: column; min-height: 100vh; }
.header { background: #1a1a2e; color: #eee; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.header-brand { font-weight: 700; font-size: 1.25rem; }
.header-nav a { color: #eee; margin-left: 1rem; }
.user-name { margin-right: 1rem; opacity: .9; }
.main { flex: 1; padding: 2rem; }
.footer { padding: 1rem 2rem; background: #16213e; color: #aaa; text-align: center; font-size: .875rem; }
.alert { padding: .75rem 1rem; margin-bottom: 1rem; border-radius: 6px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.auth-card { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.1); width: 100%; max-width: 400px; }
.auth-card h1 { margin-top: 0; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .25rem; font-weight: 500; }
.form-group input { width: 100%; padding: .5rem; border: 1px solid #ccc; border-radius: 4px; }
/* Buttons: stat-card style (teal/blue), larger size, border-radius - not sidebar color */
.btn { display: inline-block; padding: .85rem 1.6rem; background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); color: #fff; border: none; border-radius: 10px; cursor: pointer; text-decoration: none; font-size: 1rem; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.btn:hover { background: linear-gradient(135deg, #0f766e 0%, #0d5f59 100%); color: #fff; }
.btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); color: #fff; }
.btn-sm { padding: .5rem .85rem; font-size: .9rem; border-radius: 8px; font-weight: 500; }
.dash-quick-btn { padding: .9rem 1.5rem; font-size: 1rem; border-radius: 10px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid #eee; }
.table th { background: #f8f9fa; font-weight: 600; }
.table tbody tr:hover { background: #f8f9fa; }
.dashboard h1 { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: #fff; padding: 1.25rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card strong { display: block; margin-bottom: .25rem; color: #555; font-size: .875rem; }
.page h1 { margin-top: 0; }
.form-inline input, .form-inline select, .form-inline button { margin-right: .5rem; margin-bottom: .5rem; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="month"], select { padding: .5rem; border: 1px solid #ccc; border-radius: 4px; }
.receipt { max-width: 500px; }
/* POS 50mm receipt (modal + print) */
.receipt-50mm { max-width: 50mm; font-size: 11px; line-height: 1.3; padding: 8px; }
.receipt-50mm-header { text-align: center; margin-bottom: 6px; font-size: 12px; }
.receipt-50mm-meta { margin: 2px 0; }
.receipt-50mm-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.receipt-50mm-table th, .receipt-50mm-table td { padding: 2px 4px; border-bottom: 1px solid #ddd; text-align: left; }
.receipt-50mm-table th { font-weight: 600; }
.receipt-50mm-totals { margin-top: 8px; border-top: 1px dashed #333; padding-top: 6px; }
.receipt-50mm-totals p { margin: 2px 0; }
.receipt-50mm-print-btn { margin-top: 8px; }
.sales-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.muted { color: #6b7280; }
/* Record Sale: hide Refill/Complete and Empty cylinder for Supply rows – only quantity and selling price */
#sale-items .row-type-supply .line-refill-cell,
#sale-items .row-type-supply .line-empty-cell { display: none !important; }
@media print {
    body * { visibility: hidden; }
    .receipt-50mm, .receipt-50mm * { visibility: visible; }
    .receipt-50mm { position: absolute; left: 0; top: 0; max-width: 50mm; }
    .receipt-50mm-print-btn { display: none !important; }
}

/* ========== Login (reference style) ========== */
.login-layout { margin: 0; min-height: 100vh; background: #fff; font-family: system-ui, -apple-system, sans-serif; }
.auth-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 2rem; }
.auth-card { background: #fff; padding: 2.5rem; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.08); width: 100%; max-width: 420px; }
.auth-card-icon { text-align: center; margin-bottom: .5rem; color: #1a5f7a; }
.auth-card-title { text-align: center; font-size: 1.75rem; font-weight: 700; color: #1a1a2e; margin: 0 0 .25rem; }
.auth-card-subtitle { text-align: center; font-size: .9rem; color: #6b7280; margin: 0 0 1.5rem; }
.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form label { display: block; font-size: .9rem; font-weight: 500; color: #374151; margin-bottom: .35rem; }
.auth-form .form-input { width: 100%; padding: .65rem .85rem; font-size: 1rem; border: 1px solid #d1d5db; border-radius: 8px; background: #f0f4f8; color: #1f2937; }
.auth-form .form-input::placeholder { color: #9ca3af; }
.form-group-password { position: relative; }
.form-group-password .form-input { padding-right: 2.75rem; }
.password-toggle { position: absolute; right: 10px; top: 38px; background: none; border: none; cursor: pointer; padding: 4px; color: #6b7280; }
.password-toggle:hover { color: #1a1a2e; }
.form-group-checkbox { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.form-group-checkbox input { width: auto; }
.form-group-checkbox label { margin: 0; font-weight: 400; }
.btn-login { width: 100%; padding: .75rem 1rem; font-size: 1rem; font-weight: 600; background: #1a5f7a; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.btn-login:hover { background: #155a73; }
.auth-register { text-align: center; margin: 1.25rem 0 0; font-size: .9rem; color: #6b7280; }
.auth-register a { color: #1a5f7a; font-weight: 500; text-decoration: none; }
.auth-register a:hover { text-decoration: underline; }
.auth-card .alert { margin-bottom: 1rem; }

/* ========== Dashboard layout (reference style) ========== */
.dashboard-layout { margin: 0; min-height: 100vh; font-family: system-ui, -apple-system, sans-serif; display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr 4px; grid-template-areas: "header header" "sidebar main" "footer footer"; }
.dash-header { grid-area: header; background: #fff; color: #1f2937; padding: .5rem 1rem; min-height: 48px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; border-bottom: 1px solid #e5e7eb; }
.dash-header-left { display: flex; align-items: center; gap: .5rem; }
.dash-header-menu { background: none; border: none; color: #1f2937; cursor: pointer; padding: 6px; display: flex; align-items: center; justify-content: center; }
.dash-header-logo { color: #1e3a5f; display: flex; align-items: center; }
.dash-header-logo-img { width: 48px; height: 48px; object-fit: contain; display: block; }
.dash-header-title { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; margin: 0; text-align: center; color: #1f2937; }
.dash-header-title-full { display: block; }
.dash-header-title-short { display: none; }
.dash-header-right { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.dash-header-subscription { font-size: .85rem; font-weight: 600; padding: .35rem .6rem; border-radius: 6px; background: rgba(0,0,0,.06); color: #374151; }
.dash-header-subscription-low { background: #fef3c7; color: #92400e; }
.dash-header-subscription-expired { background: #fee2e2; color: #b91c1c; }
.dash-header-subscription-active { background: #d1fae5; color: #065f46; }
.dash-header-datetime { font-size: .9rem; font-weight: 700; color: #374151; }
.auth-card-logo { padding: 0; background: none; display: flex; justify-content: center; margin-bottom: .5rem; }
.auth-logo-img { width: 120px; height: 120px; object-fit: contain; display: block; }
.btn-logout { display: inline-flex; align-items: center; gap: 6px; padding: .4rem .9rem; background: #dc2626; color: #fff; border: none; border-radius: 6px; font-size: .9rem; font-weight: 500; text-decoration: none; }
.btn-logout:hover { background: #b91c1c; color: #fff; }
.dash-sidebar { grid-area: sidebar; background: #1e3a5f; color: #fff; padding: 1rem 0; display: flex; flex-direction: column; width: 220px; transition: width .2s ease; overflow: hidden; }
.dash-sidebar.collapsed { width: 64px; }
.dash-sidebar.collapsed .dash-sidebar-item span:not(.dash-sidebar-icon) { display: none; }
.dash-sidebar.collapsed .dash-sidebar-item { justify-content: center; padding: .7rem; }
.dash-sidebar.collapsed .dash-sidebar-role { font-size: 0; padding: 1rem .5rem; }
.dash-sidebar-nav { flex: 1; }
.dash-sidebar-item { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; color: rgba(255,255,255,.9); text-decoration: none; font-size: .95rem; border-left: 3px solid transparent; }
.dash-sidebar-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.dash-sidebar-item.active { background: rgba(255,255,255,.15); border-left-color: #fff; color: #fff; }
.dash-sidebar-icon { width: 22px; height: 22px; flex-shrink: 0; background: currentColor; opacity: .9; }
.dash-icon-debt { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-expense { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='12' y1='19' x2='12' y2='5'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='12' y1='19' x2='12' y2='5'/%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-dashboard { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-users { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-chart { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-settings { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-profile { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-shield { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-branch { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-icon-box { mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'/%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'/%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'/%3E%3C/svg%3E") center/contain no-repeat; }
.dash-sidebar-role { padding: 1rem 1.25rem; font-size: .75rem; font-weight: 600; letter-spacing: .05em; color: rgba(255,255,255,.8); border-top: 1px solid rgba(255,255,255,.1); }
.dash-main { grid-area: main; background: #f0f2f5; padding: 1.5rem 2rem; overflow: auto; min-width: 0; }
.dash-footer { grid-area: footer; background: #1e3a5f; }
.page { min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Dashboard welcome + metric cards */
.dash-welcome { margin-bottom: 1.5rem; }
.dash-welcome-select { margin-bottom: .5rem; font-size: .9rem; color: #374151; }
.dash-welcome-greeting { font-size: .9rem; color: #6b7280; margin-bottom: .25rem; }
.dash-welcome-name { font-size: 1.5rem; font-weight: 700; color: #1f2937; margin: 0 0 .35rem; }
.dash-welcome-intro { font-size: .95rem; color: #6b7280; margin: 0; max-width: 560px; }
/* Stat cards: wider on all sizes, 1 column on mobile (1*1), responsive grid */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
@media (max-width: 639px) {
    .dash-cards { grid-template-columns: 1fr; }
}
@media (min-width: 640px) and (max-width: 899px) {
    .dash-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .dash-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
.dash-card { padding: 1.5rem; border-radius: 10px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); min-width: 0; }
.dash-card-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; margin-bottom: .75rem; font-size: 1.1rem; font-weight: 700; }
.dash-card-label { font-size: .75rem; font-weight: 600; letter-spacing: .03em; opacity: .95; margin-bottom: .25rem; }
.dash-card-value { font-size: 1.4rem; font-weight: 700; }
.dash-card.card-teal { background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%); }
.dash-card.card-blue { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.dash-card.card-orange { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }
.dash-card.card-purple { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }
.dash-card.card-red { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.dash-quick-card {
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    padding: .4rem .9rem; /* match .btn-logout vertical size */
    min-height: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-radius: 6px; /* same radius as logout */
    font-size: .9rem;
}
.dash-quick-card .dash-card-icon {
    margin-bottom: 0;
    width: 28px;
    height: 28px;
}
.dash-quick-card .dash-card-label {
    margin-bottom: 0;
    font-size: .8rem;
}
.dash-quick-card .dash-card-value {
    font-size: .9rem;
}
.dash-section { margin-top: 1.5rem; padding: 1rem; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.dash-section h3 { margin: 0 0 .75rem; font-size: 1rem; color: #374151; }
.dash-section ul { margin: 0; padding-left: 1.25rem; color: #6b7280; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.modal-backdrop.show { opacity: 1; visibility: visible; }
.modal-box { background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.2); max-width: 500px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #6b7280; padding: 0 .25rem; line-height: 1; }
.modal-close:hover { color: #1f2937; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: .5rem; }

@media (max-width: 768px) {
    .dashboard-layout { grid-template-columns: 1fr; grid-template-areas: "header" "main" "footer"; --dash-header-height: 44px; }
    .dash-header {
        position: relative;
        z-index: 102;
        height: var(--dash-header-height);
        min-height: var(--dash-header-height);
        padding: 0 .65rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        box-sizing: border-box;
        overflow: hidden;
        gap: .5rem;
    }
    .dash-header-left { flex-shrink: 0; display: flex; align-items: center; gap: .4rem; }
    .dash-header-logo { cursor: pointer; display: flex; align-items: center; -webkit-tap-highlight-color: transparent; }
    .dash-header-logo-img { width: 44px; height: 44px; }
    .dash-header-right { flex-shrink: 0; min-width: 0; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
    .dash-header-menu { display: flex !important; flex-shrink: 0; padding: 8px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
    .dash-header-title { display: none !important; }
    .dash-header-title-full { display: none; }
    .dash-header-title-short { display: none; }
    .dash-header-subscription { display: inline-block !important; font-size: .7rem; padding: .25rem .4rem; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
    .dash-header-datetime { display: none !important; }
    .dash-header-alert { display: none !important; }
    .dash-header .btn-logout { padding: .35rem .65rem; font-size: .8rem; }
    .dash-sidebar {
        position: fixed;
        left: 0;
        top: var(--dash-header-height);
        bottom: 0;
        z-index: 99;
        width: 220px !important;
        max-width: 85vw;
        transform: translateX(-100%);
        transition: transform .25s ease;
        max-height: calc(100vh - var(--dash-header-height));
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: 4px 0 12px rgba(0,0,0,.2);
        -webkit-overflow-scrolling: touch;
    }
    .dash-sidebar.open { transform: translateX(0); }
    .dash-sidebar.collapsed { width: 220px !important; }
    .dash-sidebar.collapsed .dash-sidebar-item span:not(.dash-sidebar-icon) { display: inline; }
    .dash-sidebar.collapsed .dash-sidebar-role { font-size: .75rem; }
    .dash-main { padding: 1rem; margin-left: 0; padding-top: .5rem; }
    .dash-sidebar-overlay {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        top: var(--dash-header-height);
        bottom: 0;
        background: rgba(0,0,0,.4);
        z-index: 98;
    }
    .dashboard-layout.sidebar-open .dash-sidebar-overlay { display: block; }
}

@media (min-width: 769px) {
    .dash-header-menu {
        display: none;
    }
}
