/* PrintPress POS - Styles */

:root {
    --primary: #1a56db;
    --primary-dark: #1e429f;
    --success: #057a55;
    --warning: #c27803;
    --danger: #c81e1e;
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --sidebar-width: 240px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a56db 0%, #0e2a6e 100%);
}

.auth-card {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-header h1 { font-size: 1.5rem; color: var(--primary); }
.auth-header p { color: var(--text-muted); font-size: .9rem; }
.brand-icon-lg { font-size: 3rem; margin-bottom: .5rem; }
.auth-footer { text-align: center; margin-top: 1rem; font-size: .8rem; color: var(--text-muted); }

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-brand {
    padding: 1.1rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
    flex-shrink: 0;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.35);
}

.brand-text strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-text small {
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.85rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-label {
    display: block;
    padding: 0.5rem 0.75rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.2rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.nav-link.active {
    background: rgba(26, 86, 219, 0.2);
    color: #fff;
    border-left-color: #3b82f6;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-link.active .nav-icon {
    opacity: 1;
    color: #60a5fa;
}

.nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 1rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.35rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.sidebar-user-info small {
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: capitalize;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Main wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar / Header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
    padding: 0 1.5rem;
    min-height: 64px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.sidebar-toggle:hover {
    background: var(--bg);
    border-color: #d1d5db;
}

.sidebar-toggle .icon-close {
    display: none;
}

.sidebar-toggle.is-open .icon-menu {
    display: none;
}

.sidebar-toggle.is-open .icon-close {
    display: block;
}

.fullscreen-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fullscreen-toggle:hover {
    background: var(--bg);
    border-color: #d1d5db;
    color: var(--primary);
}

.fullscreen-toggle.is-fullscreen {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--primary);
}

.fullscreen-toggle .icon-exit-fs {
    display: none;
}

.fullscreen-toggle.is-fullscreen .icon-enter-fs {
    display: none;
}

.fullscreen-toggle.is-fullscreen .icon-exit-fs {
    display: block;
}

body.is-fullscreen .topbar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.topbar-title {
    min-width: 0;
}

.topbar-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.topbar-chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    white-space: nowrap;
}

.meta-chip svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.currency-chip {
    color: var(--primary);
    background: #eff6ff;
    border-color: #bfdbfe;
}

.topbar-user-menu {
    position: relative;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.15s, box-shadow 0.15s;
}

.topbar-user-btn:hover {
    transform: scale(1.05);
}

.topbar-user-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.topbar-user-btn[aria-expanded="true"] .topbar-user-avatar {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.topbar-user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1d4ed8 0%, #3b82f6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    border: 2px solid #fff;
    transition: box-shadow 0.15s;
}

.topbar-user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
}

.topbar-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    padding: 0.4rem 0;
    z-index: 300;
    animation: dropdownIn 0.15s ease;
}

.topbar-user-dropdown.show {
    display: block;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
    padding: 0.75rem 1rem 0.65rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.35rem;
}

.user-dropdown-header strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-header small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    text-transform: capitalize;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    font-size: 0.86rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s;
}

.user-dropdown-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.user-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.35rem 0;
}

.user-dropdown-logout {
    color: var(--danger);
}

.user-dropdown-logout:hover {
    background: #fef2f2;
    color: var(--danger);
}

/* Profile page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-width: 900px;
}

.profile-form {
    padding: 1.25rem;
}

@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.main-content {
    flex: 1;
    min-width: 0;
}

.content-area {
    padding: 1.5rem;
    max-width: 1400px;
}

/* Cards & Stats */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 { font-size: 1rem; }
.card > table, .card > form, .card > p { }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat-label { display: block; font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; margin-top: .25rem; }
.stat-warning { border-left: 4px solid var(--warning); }
.stat-danger { border-left: 4px solid var(--danger); }
.stat-success { border-left: 4px solid var(--success); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
    background: var(--bg);
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--text-muted);
}
.data-table td { padding: .75rem 1rem; border-top: 1px solid var(--border); }
.data-table tr:hover td { background: #fafafa; }
.summary-table td { padding: .6rem 1.25rem; }
.highlight-row td { background: #f0fdf4; font-weight: 600; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; }
.form-group small { font-weight: 400; color: var(--text-muted); }
.required { color: var(--danger); }

input, select, textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1rem;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s, opacity .15s;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.25rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    flex-wrap: wrap;
}

.toolbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 280px;
    min-width: 0;
}

.toolbar-search-field {
    position: relative;
    flex: 1;
    min-width: 160px;
}

.toolbar-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.toolbar-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem 0.55rem 2.35rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    background: #f8fafc;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.toolbar-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.toolbar-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.toolbar-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.toolbar-btn-outline {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
}

.toolbar-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.toolbar-btn-filter {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text-muted);
}

.toolbar-btn-filter:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.toolbar-btn-filter.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.toolbar-date-input {
    height: 38px;
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--surface);
}

.data-table tr.row-inactive td {
    opacity: 0.65;
}

.search-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.search-form input[type="text"], .search-input { min-width: 220px; width: auto; flex: 1; }
.actions { white-space: nowrap; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    background: var(--bg);
    white-space: nowrap;
}

.badge-date {
    border-radius: 6px;
    padding: 0.28rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.badge-success { background: #def7ec; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fde8e8; color: var(--danger); }

/* Alerts */
.alert {
    padding: .85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-success { background: #def7ec; color: #03543f; border: 1px solid #bcf0da; }
.alert-danger { background: #fde8e8; color: #9b1c1c; border: 1px solid #f8b4b4; }

.empty-state { text-align: center; color: var(--text-muted); padding: 2rem; }

/* Quick actions */
.quick-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.action-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    background: var(--card);
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

/* POS styles live in assets/css/pos.css (loaded on sales.php) */

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.show { display: flex; }

.modal-content {
    background: var(--card);
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-lg { max-width: 680px; }
.modal-md { max-width: 520px; }
.modal-xl { max-width: 920px; width: 100%; }
.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}
.modal-header h3 { font-size: 1.1rem; margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0.15rem;
    flex-shrink: 0;
}
.modal-close:hover { color: var(--text); }
.modal-content form { padding: 1.25rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
}
.modal-product-name { font-weight: 600; margin-bottom: 1rem; color: var(--primary); }

/* Product modal */
.product-modal {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.product-modal .modal-header {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.product-modal .modal-header p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-modal .product-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
}

.product-modal .modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.product-modal .modal-footer {
    padding: 0.85rem 1.25rem;
    margin: 0;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.form-section {
    margin-bottom: 1.15rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}

.form-section-title small {
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0;
}

.product-modal .form-group {
    margin-bottom: 0;
}

.product-modal .form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.product-modal input,
.product-modal select,
.product-modal textarea {
    box-sizing: border-box;
    width: 100%;
    background: #f8fafc;
    border-radius: 8px;
}

.product-modal input:focus,
.product-modal select:focus,
.product-modal textarea:focus {
    background: #fff;
}

.product-modal .form-group label small {
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
}

.supplier-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.supplier-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
}

.supplier-form-row-full {
    grid-template-columns: 1fr;
}

.supplier-form-row-single .form-group {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .supplier-form-row {
        grid-template-columns: 1fr;
    }
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Receipt */
.receipt { padding: 1rem 1.25rem; font-size: .875rem; }
.receipt-header { text-align: center; margin-bottom: 1rem; border-bottom: 1px dashed var(--border); padding-bottom: .75rem; }
.receipt-header h2 { font-size: 1.1rem; }
.receipt-table { width: 100%; border-collapse: collapse; margin: .75rem 0; font-size: .8rem; }
.receipt-table th, .receipt-table td { padding: .35rem .25rem; border-bottom: 1px solid var(--border); }
.receipt-totals { border-top: 1px dashed var(--border); padding-top: .75rem; }
.receipt-total { font-size: 1rem; font-weight: 700; }

/* Print & Price List */
.print-header, .print-footer { padding: 1rem 1.25rem; }
.print-header h2 { font-size: 1.2rem; }
.print-header p { color: var(--text-muted); font-size: .85rem; }
.printable-area .data-table { margin: 0; }

.price-list-card {
    overflow: hidden;
    border: 1px solid var(--border);
}

.price-list-card .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
    border-bottom: none;
}

.price-list-card .print-header-main h2 {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.price-list-card .print-header-brand {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.price-list-card .print-header-filter {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: #bfdbfe;
}

.price-list-card .print-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: #cbd5e1;
    text-align: right;
}

.price-list-card .print-header-meta strong {
    color: #e2e8f0;
    font-weight: 600;
}

.price-list-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.price-list-table thead th {
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.price-list-table .col-num,
.price-list-table .col-qty {
    width: 48px;
    text-align: center;
}

.price-list-table .col-money {
    text-align: right;
    white-space: nowrap;
}

.price-list-table .col-name {
    min-width: 160px;
}

.price-list-table .col-sale {
    font-weight: 700;
    color: #1d4ed8;
}

.price-list-table .sku-code {
    font-size: 0.78rem;
    font-family: ui-monospace, Consolas, monospace;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #475569;
}

.price-list-card .print-footer {
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

.price-list-card .print-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media print {
    .price-list-card .print-header {
        background: #fff !important;
        color: #000 !important;
        border-bottom: 2px solid #000;
        padding: 0.75rem 0;
    }

    .price-list-card .print-header-main h2,
    .price-list-card .print-header-brand,
    .price-list-card .print-header-filter,
    .price-list-card .print-header-meta,
    .price-list-card .print-header-meta strong {
        color: #000 !important;
    }

    .price-list-table .col-sale {
        color: #000 !important;
    }
}

/* Inventory */
.inventory-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.inventory-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.inventory-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.inventory-stat-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.inventory-stat-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.inventory-stat-warning {
    border-left: 4px solid var(--warning);
}

.inventory-stat-danger {
    border-left: 4px solid var(--danger);
}

.inventory-card .card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.card-header-sub {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.inventory-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.inventory-table thead th {
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.inventory-table .col-num {
    text-align: center;
    white-space: nowrap;
}

.inventory-table .col-name {
    min-width: 140px;
}

.inventory-table .sku-code {
    font-size: 0.78rem;
    font-family: ui-monospace, Consolas, monospace;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #475569;
}

.inventory-table .col-date {
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.inventory-table .col-actions {
    white-space: nowrap;
}

.inventory-table .col-actions .btn {
    margin-right: 0.25rem;
}

.inventory-table .col-actions .btn:last-child {
    margin-right: 0;
}

.btn-active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.adjust-product-name {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 768px) {
    .inventory-stats {
        grid-template-columns: 1fr;
    }
}

/* Print Jobs */
.jobs-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.jobs-stat {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.jobs-stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.jobs-stat-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.jobs-stat-money {
    font-size: 1.25rem;
}

.jobs-stat-primary {
    border-left: 4px solid var(--primary);
}

.jobs-stat-success {
    border-left: 4px solid var(--success);
}

.jobs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.25rem;
    align-items: start;
}

.jobs-form-card .card-header,
.jobs-history-card .card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.jobs-form {
    display: flex;
    flex-direction: column;
}

.jobs-form-body {
    padding: 1.15rem 1.25rem 0.5rem;
}

.jobs-form-body .form-section {
    margin-bottom: 1rem;
}

.jobs-form-body .form-section:last-child {
    margin-bottom: 0;
}

.jobs-form-body .form-group {
    margin-bottom: 0.85rem;
}

.jobs-form-body .form-group:last-child {
    margin-bottom: 0;
}

.jobs-form-body input,
.jobs-form-body select,
.jobs-form-body textarea {
    box-sizing: border-box;
    background: #f8fafc;
    border-radius: 8px;
}

.jobs-form-body input:focus,
.jobs-form-body select:focus,
.jobs-form-body textarea:focus {
    background: #fff;
}

.jobs-form-footer {
    padding: 0.85rem 1.25rem 1.15rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.jobs-search-bar {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.jobs-search-bar .toolbar-search {
    flex: 1;
    max-width: none;
}

.jobs-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.jobs-table thead th {
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.jobs-table .col-num {
    text-align: center;
    white-space: nowrap;
}

.jobs-table .col-money {
    text-align: right;
    white-space: nowrap;
}

.jobs-table .col-charged {
    font-weight: 700;
    color: #1d4ed8;
}

.jobs-table .col-name {
    min-width: 110px;
}

.jobs-table .col-date {
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.jobs-table .job-code {
    font-size: 0.75rem;
    font-family: ui-monospace, Consolas, monospace;
    background: #f1f5f9;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    color: #475569;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .jobs-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .jobs-stats {
        grid-template-columns: 1fr;
    }

    .jobs-form-body .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* End of Day Report */
.eod-date-form {
    align-items: center;
}

.eod-date-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    margin: 0;
}

.eod-date-input {
    width: auto;
    min-width: 160px;
    max-width: 180px;
    padding-left: 0.75rem !important;
}

.eod-card {
    overflow: hidden;
    border: 1px solid var(--border);
}

.eod-card .eod-print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
    border-bottom: none;
}

.eod-card .print-header-main h2 {
    margin: 0.15rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.eod-card .print-header-brand {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.eod-card .print-header-filter {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: #bfdbfe;
}

.eod-card .print-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: #cbd5e1;
    text-align: right;
}

.eod-card .print-header-meta strong {
    color: #e2e8f0;
    font-weight: 600;
}

.eod-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1.15rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.eod-kpi {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.eod-kpi-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.eod-kpi-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.eod-kpi-featured {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.eod-kpi-featured .eod-kpi-value {
    color: #1d4ed8;
    font-size: 1.3rem;
}

.eod-kpi-success {
    border-color: #86efac;
    background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}

.eod-kpi-success .eod-kpi-value {
    color: #047857;
}

.eod-kpi-warning {
    border-left: 3px solid var(--warning);
}

.eod-section {
    border-bottom: 1px solid var(--border);
}

.eod-section:last-child {
    border-bottom: none;
}

.eod-section-header {
    padding: 0.9rem 1.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border-bottom: 1px solid var(--border);
}

.eod-section-header h3 {
    margin: 0;
    font-size: 1rem;
}

.eod-summary-table td {
    padding: 0.7rem 1.5rem;
}

.eod-summary-table .col-money {
    text-align: right;
    white-space: nowrap;
    width: 160px;
}

.eod-summary-total td {
    background: #f0fdf4;
    font-weight: 600;
    border-top: 2px solid #bbf7d0;
}

.eod-summary-total .col-money strong {
    color: #047857;
    font-size: 1.05rem;
}

.eod-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.eod-table thead th {
    background: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.eod-table .col-money {
    text-align: right;
    white-space: nowrap;
}

.eod-table .col-charged {
    font-weight: 700;
    color: #1d4ed8;
}

.eod-table .col-name {
    min-width: 100px;
}

.eod-table .col-date {
    white-space: nowrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.eod-empty {
    padding: 2rem 1.5rem;
    margin: 0;
}

@media (max-width: 1024px) {
    .eod-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .eod-kpi-grid {
        grid-template-columns: 1fr;
    }

    .eod-date-form {
        flex-wrap: wrap;
    }

    .eod-date-input {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
}

@media print {
    .eod-card .eod-print-header {
        background: #fff !important;
        color: #000 !important;
        border-bottom: 2px solid #000;
        padding: 0.75rem 0;
    }

    .eod-card .print-header-main h2,
    .eod-card .print-header-brand,
    .eod-card .print-header-filter,
    .eod-card .print-header-meta,
    .eod-card .print-header-meta strong {
        color: #000 !important;
    }

    .eod-kpi-grid {
        background: #fff;
        padding: 0.75rem 0;
    }

    .eod-kpi {
        break-inside: avoid;
    }

    .eod-table .col-charged {
        color: #000 !important;
    }
}

@media print {
    .sidebar, .sidebar-overlay, .topbar, .toolbar, .no-print, .modal-footer, .sidebar-toggle, .fullscreen-toggle { display: none !important; }
    .main-wrapper { margin-left: 0 !important; }
    .content-area { padding: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .stat-card { box-shadow: none; border: 1px solid #ddd; }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .content-area { padding: 1.25rem; }
    .topbar { padding: 0 1.25rem; }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: flex;
    }

    .topbar {
        padding: 0 1rem;
        min-height: 56px;
    }

    .topbar-title h1 {
        font-size: 1.05rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .topbar-chips .date-chip .chip-text {
        display: none;
    }

    .topbar-chips .currency-chip .chip-text {
        font-size: 0.72rem;
    }

    .topbar-user-dropdown {
        right: -0.5rem;
        min-width: 200px;
    }

    .content-area {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .toolbar-search {
        flex: 1 1 auto;
        width: 100%;
    }

    .toolbar-actions {
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .search-form {
        width: 100%;
    }

    .search-form input[type="text"],
    .search-input {
        min-width: 0;
        flex: 1;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar-chips {
        gap: 0.35rem;
    }

    .meta-chip {
        padding: 0.35rem 0.55rem;
        font-size: 0.72rem;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-btn {
        min-width: 100%;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item-subtotal {
        width: 100%;
        text-align: right;
        margin-top: 0.25rem;
    }
}

/* Prevent body scroll when mobile menu open */
body.sidebar-open {
    overflow: hidden;
}

/* Dashboard */
.db-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.db-hero-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.db-hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.db-hero-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 560px;
}

.db-hero-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.db-hero-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.db-kpi-row {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.db-kpi {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
}

.db-kpi-featured {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
    color: #fff;
}

.db-kpi-featured .db-kpi-label,
.db-kpi-featured .db-kpi-foot {
    color: #94a3b8;
}

.db-kpi-featured .db-kpi-value {
    color: #fff;
}

.db-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.db-kpi-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.db-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.db-kpi-foot {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.db-kpi-trend {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.db-kpi-featured .db-kpi-trend.trend-up { color: #6ee7b7; }
.db-kpi-featured .db-kpi-trend.trend-down { color: #fca5a5; }
.db-kpi-featured .db-kpi-trend.trend-neutral { color: #cbd5e1; }

.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }
.trend-neutral { color: var(--text-muted); }

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.db-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}

.db-main, .db-aside { min-width: 0; }

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.db-chart-stats {
    display: flex;
    gap: 1.25rem;
    text-align: right;
}

.db-chart-stats small {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-chart-stats strong {
    font-size: 0.95rem;
}

.db-chart-area {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.65rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    min-height: 240px;
    align-items: end;
}

.db-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 200px;
    position: relative;
}

.db-bar-group:hover .db-bar-tooltip { opacity: 1; transform: translateY(0); }

.db-bar-tooltip {
    position: absolute;
    top: 0;
    background: #0f172a;
    color: #fff;
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    transition: 0.15s;
    pointer-events: none;
    z-index: 2;
    text-align: center;
}

.db-bar-tooltip em {
    display: block;
    font-style: normal;
    color: #94a3b8;
    font-size: 0.65rem;
}

.db-bar-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: 1.5rem;
}

.db-bar {
    width: 100%;
    max-width: 44px;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    border-radius: 6px 6px 2px 2px;
    min-height: 8px;
    transition: height 0.3s ease;
}

.db-bar-today {
    background: linear-gradient(180deg, #34d399, #059669);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.db-bar-day {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.db-bar-date {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.db-triple-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.db-table code.db-code,
.db-code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem;
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--primary);
}

.pay-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--bg);
}

.pay-cash { background: #d1fae5; color: #047857; }
.pay-mobile_money { background: #dbeafe; color: #1d4ed8; }
.pay-bank_card { background: #ede9fe; color: #6d28d9; }

.db-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
}

.db-empty-sm { padding: 1.5rem 1rem; }

.db-empty p { margin-bottom: 0.75rem; }

.db-list {
    list-style: none;
    padding: 0;
}

.db-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.db-list li:last-child { border-bottom: none; }

.db-rank {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--bg);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-list-body {
    flex: 1;
    min-width: 0;
}

.db-list-body strong {
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-list-body span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.db-alerts { padding: 0.5rem; }

.db-alert {
    display: block;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 0.15s;
}

.db-alert:last-child { margin-bottom: 0; }

.db-alert strong {
    display: block;
    font-size: 0.82rem;
    margin-bottom: 0.15rem;
}

.db-alert p {
    font-size: 0.75rem;
    margin: 0;
    line-height: 1.4;
}

.db-alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.db-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.db-alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.db-alert:hover { filter: brightness(0.97); }

.db-accounts { padding: 0.25rem 0; }

.db-account-row {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 1.15rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.db-account-row span { color: var(--text-muted); }
.db-account-deduct strong { color: var(--danger); }

.db-account-total {
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    background: #f0fdf4;
    font-weight: 600;
}

.db-pay-split { padding: 0.75rem 1.15rem 1rem; }

.db-pay-item { margin-bottom: 0.85rem; }
.db-pay-item:last-child { margin-bottom: 0; }

.db-pay-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
}

.db-pay-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.db-pay-bar span {
    display: block;
    height: 100%;
    border-radius: 3px;
}

.db-pay-item small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.db-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.db-metric {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.db-metric:nth-child(2n) { border-right: none; }
.db-metric:nth-last-child(-n+2) { border-bottom: none; }

.db-metric span {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}

.db-metric strong {
    font-size: 0.88rem;
}

.db-timeline {
    list-style: none;
    padding: 0;
}

.db-timeline li {
    padding: 0.8rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.db-timeline li:last-child { border-bottom: none; }

.db-timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.db-timeline-head strong { font-size: 0.85rem; }

.db-timeline p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.db-timeline time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.db-shortcuts {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.db-shortcuts h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.db-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
}

.db-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
    transition: 0.15s;
    text-align: center;
}

.db-shortcut svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.db-shortcut:hover {
    border-color: #bfdbfe;
    background: #f8fafc;
    transform: translateY(-1px);
}

@media (max-width: 1200px) {
    .db-kpi-row { grid-template-columns: repeat(3, 1fr); }
    .db-kpi-featured { grid-column: span 3; }
    .db-layout { grid-template-columns: 1fr; }
    .db-triple-grid { grid-template-columns: 1fr; }
    .db-shortcuts-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .db-hero { align-items: flex-start; }
    .db-hero-title { font-size: 1.3rem; }
    .db-kpi-row { grid-template-columns: 1fr 1fr; }
    .db-kpi-featured { grid-column: span 2; }
    .db-chart-stats { display: none; }
    .db-chart-area { min-height: 200px; padding: 1rem 0.75rem; }
    .db-bar-group { height: 160px; }
    .db-shortcuts-grid { grid-template-columns: repeat(2, 1fr); }
    .db-metrics { grid-template-columns: 1fr; }
    .db-metric { border-right: none !important; }
    .db-metric:last-child { border-bottom: none; }
}

@media (max-width: 480px) {
    .db-kpi-row { grid-template-columns: 1fr; }
    .db-kpi-featured { grid-column: span 1; }
    .db-hero-actions { width: 100%; }
    .db-hero-actions .btn { flex: 1; justify-content: center; }
    .db-shortcuts-grid { grid-template-columns: 1fr 1fr; }
}

