/* Auth Pages */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #4f46e5 60%, #06b6d4 100%);
    padding: 20px;
    position: relative;
    overflow: hidden
}

.auth-layout::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, .03);
    border-radius: 50%;
    top: -200px;
    right: -200px
}

.auth-layout::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, .03);
    border-radius: 50%;
    bottom: -100px;
    left: -100px
}

.auth-card {
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, .3);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1
}

[data-theme="dark"] .auth-card {
    background: rgba(30, 41, 59, .95)
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    margin: 0 auto 12px
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary)
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary)
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600
}

.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0
}

.otp-inputs input {
    width: 52px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border-input);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast)
}

.otp-inputs input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1)
}

/* Invoice */
.invoice-preview {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    color: #0f172a
}

.invoice-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e2e8f0
}

.invoice-company .company-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary)
}

.invoice-meta {
    text-align: right
}

.invoice-meta .invoice-number {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a
}

.invoice-meta .invoice-date {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px
}

.invoice-party label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 8px;
    display: block
}

.invoice-party .party-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px
}

.invoice-totals {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px
}

.invoice-totals table {
    width: 280px
}

.invoice-totals td {
    padding: 8px 0;
    font-size: 14px
}

.invoice-totals td:last-child {
    text-align: right;
    font-weight: 600
}

.invoice-totals .total-row {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    border-top: 2px solid #e2e8f0
}

.invoice-footer-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 13px;
    color: #94a3b8
}

/* POS */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    height: calc(100vh - var(--navbar-height) - 48px)
}

.pos-products {
    overflow-y: auto
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast)
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px)
}

.product-card .product-emoji {
    font-size: 32px;
    margin-bottom: 8px
}

.product-card .product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px
}

.product-card .product-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary)
}

.pos-cart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.pos-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 700
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: background var(--transition-fast)
}

.cart-item:hover {
    background: var(--bg-tertiary)
}

.cart-item .item-info {
    flex: 1
}

.cart-item .item-name {
    font-size: 14px;
    font-weight: 600
}

.cart-item .item-price {
    font-size: 13px;
    color: var(--text-secondary)
}

.cart-item .item-qty {
    display: flex;
    align-items: center;
    gap: 8px
}

.cart-item .qty-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer
}

.cart-item .qty-value {
    font-weight: 600;
    min-width: 20px;
    text-align: center
}

.pos-cart-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary)
}

.cart-summary-row.total {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    padding: 12px 0;
    border-top: 2px solid var(--border-color);
    margin-top: 8px
}

/* Settings */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px
}

.settings-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left
}

.settings-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary)
}

.settings-menu-item.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600
}

[data-theme="dark"] .settings-menu-item.active {
    background: rgba(79, 70, 229, .15)
}

.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px
}

/* Profile */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-xl);
    color: #fff;
    margin-bottom: 24px
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    animation: slideInRight .3s ease
}

.toast.toast-success {
    border-left: 4px solid var(--success)
}

.toast.toast-error {
    border-left: 4px solid var(--danger)
}

.toast.toast-warning {
    border-left: 4px solid var(--warning)
}

.toast.toast-info {
    border-left: 4px solid var(--info)
}

.toast .toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column
}

.notification-panel.open {
    right: 0
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color)
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    cursor: pointer;
    transition: background var(--transition-fast)
}

.notification-item:hover {
    background: var(--bg-tertiary)
}

.notification-item.unread {
    background: var(--primary-50)
}

[data-theme="dark"] .notification-item.unread {
    background: rgba(79, 70, 229, .1)
}

.notification-item .notif-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0
}

.notification-item .notif-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4
}

.notification-item .notif-time {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px
}

.page-header-left h1 {
    font-size: 24px;
    font-weight: 800
}

.page-header-left p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px
}

.chart-container {
    position: relative;
    width: 100%;
    height: 300px
}

/* Utilities */
.text-center {
    text-align: center
}

.text-right {
    text-align: right
}

.text-primary-c {
    color: var(--primary) !important
}

.text-success {
    color: var(--success) !important
}

.text-danger {
    color: var(--danger) !important
}

.text-warning {
    color: var(--warning) !important
}

.text-secondary-c {
    color: var(--text-secondary) !important
}

.fw-600 {
    font-weight: 600
}

.fw-700 {
    font-weight: 700
}

.fw-800 {
    font-weight: 800
}

.mt-1 {
    margin-top: 8px
}

.mt-2 {
    margin-top: 16px
}

.mt-3 {
    margin-top: 24px
}

.mb-1 {
    margin-bottom: 8px
}

.mb-2 {
    margin-bottom: 16px
}

.mb-3 {
    margin-bottom: 24px
}

.d-flex {
    display: flex
}

.align-center {
    align-items: center
}

.justify-between {
    justify-content: space-between
}

.flex-wrap {
    flex-wrap: wrap
}

.flex-1 {
    flex: 1
}

.w-100 {
    width: 100%
}

.hidden {
    display: none !important
}

/* Spinner / Loading */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg)
    }

    to {
        transform: rotate(360deg)
    }
}

.animate-fadeIn {
    animation: fadeIn .3s ease
}

.animate-fadeInUp {
    animation: fadeInUp .4s ease
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px
}

/* Responsive */
@media(max-width:1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .grid-2 {
        grid-template-columns: 1fr
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto
    }

    .settings-layout {
        grid-template-columns: 1fr
    }

    .invoice-parties {
        grid-template-columns: 1fr;
        gap: 20px
    }
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%)
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl)
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-fast)
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible
    }

    .main-content {
        margin-left: 0
    }

    .navbar {
        left: 0
    }

    .menu-toggle {
        display: flex
    }

    .navbar-search {
        display: none
    }

    .page-content {
        padding: 16px
    }

    .stats-grid {
        grid-template-columns: 1fr
    }

    .stat-value {
        font-size: 24px
    }

    .grid-3 {
        grid-template-columns: 1fr
    }

    .auth-card {
        padding: 32px 24px
    }

    .invoice-preview {
        padding: 24px
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch
    }

    .notification-panel {
        width: 100%;
        right: -100%
    }

    .user-menu .user-name {
        display: none
    }

    .profile-header {
        flex-direction: column;
        text-align: center
    }

    .pos-cart {
        min-height: 400px
    }
}

@media(max-width:480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start
    }

    .otp-inputs input {
        width: 44px;
        height: 48px;
        font-size: 20px
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px
    }
}

/* ── Enhanced Dashboard Styles ── */
.dash-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px
}

.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px
}

.dash-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary)
}

.dash-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none
}

/* Business Operations */
.biz-ops-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

.biz-ops-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast)
}

.biz-ops-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px)
}

.biz-ops-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0
}

.biz-ops-icon.sale {
    background: #e3f2fd;
    color: #1565c0
}

.biz-ops-icon.purchase {
    background: #f3e5f5;
    color: #7b1fa2
}

.biz-ops-icon.expense {
    background: #fce4ec;
    color: #c62828
}

[data-theme="dark"] .biz-ops-icon.sale {
    background: rgba(21, 101, 192, .15)
}

[data-theme="dark"] .biz-ops-icon.purchase {
    background: rgba(123, 31, 162, .15)
}

[data-theme="dark"] .biz-ops-icon.expense {
    background: rgba(198, 40, 40, .15)
}

.biz-ops-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary)
}

.biz-ops-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px
}

/* Revenue Projections */
.rev-proj-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.rev-proj-card {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light)
}

.rev-proj-amount {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px
}

.rev-proj-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px
}

.rev-proj-change {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block
}

.rev-proj-change.up {
    background: #e8f5e9;
    color: #2e7d32
}

.rev-proj-change.down {
    background: #fce4ec;
    color: #c62828
}

[data-theme="dark"] .rev-proj-change.up {
    background: rgba(46, 125, 50, .15)
}

[data-theme="dark"] .rev-proj-change.down {
    background: rgba(198, 40, 40, .15)
}

/* Quick Access */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px
}

.quick-access-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer
}

.quick-access-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px)
}

.qa-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px
}

/* Revenue Inflow */
.rev-inflow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

.rev-inflow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light)
}

.rev-inflow-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0
}

.rev-inflow-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary)
}

.rev-inflow-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 1px
}

/* P&L Snapshot */
.pnl-snapshot {
    padding: 8px 0
}

.pnl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0
}

.pnl-label {
    font-size: 14px;
    color: var(--text-secondary)
}

.pnl-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary)
}

.pnl-row.income .pnl-value {
    color: var(--success)
}

.pnl-row.expense .pnl-value {
    color: var(--danger)
}

.pnl-row.net {
    padding: 14px 0
}

.pnl-row.net .pnl-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary)
}

.pnl-row.net .pnl-value {
    font-size: 20px;
    font-weight: 800
}

.pnl-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0
}

.pnl-bar-container {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-tertiary);
    margin: 12px 0 8px
}

.pnl-bar {
    height: 100%;
    transition: width 0.5s ease
}

.income-bar {
    background: var(--success)
}

.expense-bar {
    background: var(--danger)
}

.pnl-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 16px
}

.pnl-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary)
}

.pnl-legend-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block
}

.dot.income {
    background: var(--success)
}

.dot.expense {
    background: var(--danger)
}

.pnl-gst-summary {
    border-top: 1px solid var(--border-light);
    padding-top: 8px
}

.pnl-gst-summary .pnl-row {
    padding: 6px 0
}

.pnl-gst-summary .pnl-label {
    font-size: 13px
}

.pnl-gst-summary .pnl-value {
    font-size: 14px;
    font-weight: 600
}

/* Responsive Dashboard */
@media(max-width:1024px) {
    .biz-ops-grid {
        grid-template-columns: 1fr
    }

    .quick-access-grid {
        grid-template-columns: repeat(3, 1fr)
    }

    .rev-proj-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:768px) {
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .rev-inflow-grid {
        grid-template-columns: 1fr
    }

    .biz-ops-value {
        font-size: 18px
    }

    .rev-proj-amount {
        font-size: 18px
    }
}

/* Sidebar Sub-menus */
.nav-submenu {
    display: none;
    padding-left: 20px
}

.nav-submenu.open {
    display: block
}

.nav-item-parent {
    position: relative;
    cursor: pointer
}

.nav-item-parent::after {
    content: '›';
    position: absolute;
    right: 16px;
    font-size: 16px;
    transition: transform 0.2s;
    color: var(--text-tertiary)
}

.nav-item-parent.open::after {
    transform: rotate(90deg)
}

.nav-submenu .nav-item {
    font-size: 13px;
    padding: 8px 14px
}

@media print {

    .sidebar,
    .navbar,
    .no-print {
        display: none !important
    }

    .main-content {
        margin: 0
    }

    .page-content {
        padding: 0;
        margin: 0
    }

    body {
        background: #fff
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — All Pages
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* ── Navbar ── */
    .navbar {
        padding: 8px 12px !important;
        gap: 8px !important;
    }

    .navbar .nav-title {
        font-size: 15px !important;
        line-height: 1.2 !important;
    }

    .navbar .nav-subtitle {
        display: none !important;
    }

    .navbar .nav-actions {
        gap: 6px !important;
    }

    .navbar .nav-actions .nav-action-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }

    .menu-toggle {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
    }

    /* ── Page Header ── */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 0 !important;
        margin-bottom: 16px !important;
    }

    .page-header h1 {
        font-size: 22px !important;
    }

    .page-header p {
        font-size: 13px !important;
        margin: 0 !important;
    }

    .page-header .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* ── Page Content ── */
    .page-content {
        padding: 12px !important;
    }

    /* ── Stat Cards Grid ── */
    .stats-grid,
    .summary-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 14px 12px !important;
    }

    .stat-card .stat-value,
    .stat-card .stat-num {
        font-size: 18px !important;
    }

    .stat-card .stat-label {
        font-size: 11px !important;
    }

    /* ── Tables — Horizontal Scroll ── */
    .card:has(table),
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table {
        min-width: 600px !important;
        font-size: 13px !important;
    }

    th,
    td {
        padding: 10px 8px !important;
        white-space: nowrap !important;
    }

    /* ── Toolbar ── */
    .toolbar {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .toolbar input,
    .toolbar select,
    .toolbar .btn {
        width: 100% !important;
    }

    /* ── Forms ── */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* ── Modals ── */
    .modal-content {
        width: 95% !important;
        max-width: 95vw !important;
        margin: 16px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    /* ── Cards ── */
    .card {
        padding: 14px !important;
        border-radius: 12px !important;
    }

    /* ── Dashboard Sections ── */
    .dash-section {
        padding: 12px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    .dash-section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .dash-section-title {
        font-size: 14px !important;
    }

    .dash-filter {
        width: 100% !important;
        font-size: 12px !important;
    }

    /* Business Ops — vertical cards */
    .biz-ops-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px !important;
    }

    .biz-ops-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 10px 6px !important;
        gap: 6px !important;
    }

    .biz-ops-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        margin: 0 auto !important;
    }

    .biz-ops-value {
        font-size: 14px !important;
        font-weight: 700 !important;
    }

    .biz-ops-label {
        font-size: 10px !important;
    }

    /* Revenue Projections */
    .rev-proj-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .rev-proj-card {
        padding: 12px 10px !important;
    }

    .rev-proj-amount {
        font-size: 18px !important;
    }

    .rev-proj-label {
        font-size: 11px !important;
    }

    .rev-proj-change {
        font-size: 10px !important;
        padding: 3px 8px !important;
    }

    /* Quick Actions */
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .quick-action-card {
        padding: 12px 6px !important;
    }

    .quick-action-card .qa-icon {
        font-size: 20px !important;
    }

    .quick-action-card .qa-label {
        font-size: 10px !important;
    }

    /* Revenue Inflow */
    .inflow-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .inflow-card {
        padding: 10px !important;
    }

    .inflow-value {
        font-size: 16px !important;
    }

    .inflow-label {
        font-size: 10px !important;
    }

    /* Revenue Management */
    .rev-mgmt-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    /* P&L Grid */
    .pnl-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 6px !important;
    }

    .pnl-card {
        padding: 8px 4px !important;
    }

    .pnl-card .pnl-value {
        font-size: 13px !important;
    }

    .pnl-card .pnl-label {
        font-size: 9px !important;
    }

    /* Revenue Chart */
    .dash-section canvas {
        max-height: 200px !important;
    }

    /* Recent Invoices & Top Customers tables */
    .dash-section table {
        min-width: 500px !important;
        font-size: 12px !important;
    }

    .dash-section .card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* ── POS Billing Layout ── */
    .pos-layout {
        flex-direction: column !important;
        height: auto !important;
    }

    .pos-products {
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
    }

    .pos-cart {
        width: 100% !important;
        position: sticky !important;
        bottom: 0 !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        border-radius: 16px 16px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        z-index: 10 !important;
        background: var(--bg-card) !important;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .product-card {
        padding: 12px 8px !important;
    }

    .product-name {
        font-size: 12px !important;
    }

    /* ── Stat Cards (purchases, vendors etc.) ── */
    .stats-grid,
    .summary-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .stat-card {
        padding: 12px 10px !important;
    }

    .stat-card .stat-value {
        font-size: 18px !important;
    }

    .stat-card .stat-label {
        font-size: 10px !important;
    }

    /* ── Tables — Horizontal Scroll ── */
    .card:has(table),
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table {
        min-width: 550px !important;
        font-size: 12px !important;
    }

    th,
    td {
        padding: 8px 6px !important;
        white-space: nowrap !important;
    }

    /* ── Filter Tabs ── */
    .tab-filters {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .tab-filters .tab-btn {
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
        flex-shrink: 0 !important;
    }

    /* ── Toolbar ── */
    .toolbar {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .toolbar input,
    .toolbar select,
    .toolbar .btn {
        width: 100% !important;
    }

    /* ── Forms ── */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* ── Modals ── */
    .modal-content {
        width: 95% !important;
        max-width: 95vw !important;
        margin: 16px auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
    }

    /* ── Cards ── */
    .card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    /* ── Page Header ── */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 14px !important;
    }

    .page-header h1 {
        font-size: 20px !important;
    }

    .page-header p {
        font-size: 12px !important;
    }

    .page-header .btn {
        width: 100% !important;
    }

    /* ── Buttons ── */
    .btn-sm {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* ── Account page ── */
    .account-group-accounts {
        overflow-x: auto !important;
    }

    .purchase-items-grid {
        overflow-x: auto !important;
    }
}/* --- INVOICE TEMPLATES --- */
.template-modern { background: #fafafa; border: none; box-shadow: var(--shadow-xl); font-family: 'Inter', sans-serif; position: relative; overflow: hidden; padding: 0; }
.template-modern::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 12px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.template-modern .invoice-header-section { border-bottom: none; background: #fff; padding: 40px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.template-modern .invoice-parties { padding: 0 40px; margin-bottom: 30px; }
.template-modern .table-container { padding: 0 40px; }
.template-modern .table th { background: var(--primary-50); color: var(--primary-dark); font-size: 13px; text-transform: uppercase; border: none; border-radius: 6px; }
.template-modern .invoice-totals { padding: 20px 40px; background: #fff; border-top: 1px solid #e2e8f0; }
.template-modern .invoice-footer-section { padding: 30px 40px; background: var(--bg-tertiary); margin-top: 0; text-align: center; }

.template-minimal { border: none; box-shadow: none; font-family: 'Inter', sans-serif; color: #111; padding: 0; max-width: 800px; }
.template-minimal .invoice-header-section { flex-direction: column; border-bottom: 4px solid #111; padding-bottom: 30px; }
.template-minimal .invoice-meta { text-align: left; margin-top: 30px; display: flex; gap: 40px; }
.template-minimal .invoice-company .company-name { color: #111; font-size: 32px; letter-spacing: -1px; }
.template-minimal .invoice-meta .invoice-number { font-size: 20px; }
.template-minimal .table th { background: transparent; color: #111; border-top: 2px solid #111; border-bottom: 2px solid #111; border-radius: 0; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.template-minimal .table td { border-bottom: 1px solid #e2e8f0; padding: 16px 12px; }
.template-minimal .invoice-totals table { font-weight: 500; }
.template-minimal .total-row td { border-top: 2px solid #111; border-bottom: 4px double #111; color: #111; }
