@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Georgian:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Theme colors: High-end Cyber-Security Navy & Teal/Gold accents */
    --bg-main: #0b0f19;
    --bg-gradient: radial-gradient(circle at 50% 0%, #151e33 0%, #0b0f19 100%);
    --panel-bg: rgba(20, 27, 45, 0.7);
    --panel-bg-solid: #141b2d;
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-glow: rgba(6, 182, 212, 0.15);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #64748b;
    
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --accent-gold: #fbbf24;
    --accent-gold-hover: #f59e0b;
    
    --success: #10b981;
    --success-hover: #34d399;
    --success-light: rgba(16, 185, 129, 0.1);
    
    --danger: #ef4444;
    --danger-hover: #f87171;
    --danger-light: rgba(239, 68, 68, 0.1);
    
    /* White Printed Paper colors (WYSIWYG layout) */
    --paper-bg: #ffffff;
    --paper-text: #0f172a;
    --paper-text-muted: #475569;
    --paper-text-light: #64748b;
    --paper-border: #e2e8f0;
    --paper-accent: #1e293b;
    --paper-highlight: #f8fafc;
    
    /* Utility */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font sizes & family */
    --font-family: 'Outfit', 'Noto Sans Georgian', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Premium Visual Themes Overrides */
body.theme-obsidian {
    --bg-main: #090d16;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1c2230 0%, #090d16 100%);
    --panel-bg: rgba(26, 32, 46, 0.7);
    --panel-bg-solid: #161c2a;
    --panel-border: rgba(255, 255, 255, 0.06);
    --panel-border-glow: rgba(251, 191, 36, 0.15);
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --accent-glow: rgba(251, 191, 36, 0.3);
}

body.theme-space {
    --bg-main: #020617;
    --bg-gradient: radial-gradient(circle at 50% 0%, #0b132b 0%, #020617 100%);
    --panel-bg: rgba(11, 19, 43, 0.65);
    --panel-bg-solid: #0b132b;
    --panel-border: rgba(255, 255, 255, 0.05);
    --panel-border-glow: rgba(139, 92, 246, 0.15);
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.3);
}

body.theme-sunset {
    --bg-main: #0f0920;
    --bg-gradient: radial-gradient(circle at 50% 0%, #2e1065 0%, #0f0920 100%);
    --panel-bg: rgba(30, 11, 54, 0.65);
    --panel-bg-solid: #1e0b36;
    --panel-border: rgba(255, 255, 255, 0.06);
    --panel-border-glow: rgba(236, 72, 153, 0.15);
    --accent: #ec4899;
    --accent-hover: #f472b6;
    --accent-glow: rgba(236, 72, 153, 0.3);
}

body.theme-aurora {
    --bg-main: #022c22;
    --bg-gradient: radial-gradient(circle at 50% 0%, #064e3b 0%, #022c22 100%);
    --panel-bg: rgba(6, 40, 31, 0.65);
    --panel-bg-solid: #042f24;
    --panel-border: rgba(255, 255, 255, 0.06);
    --panel-border-glow: rgba(16, 185, 129, 0.15);
    --accent: #10b981;
    --accent-hover: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Base Layout Structure */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.brand-info h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item button {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    text-align: left;
}

.nav-item button i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.nav-item button:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active button {
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: var(--shadow-glow);
}

.nav-item.active button i {
    transform: scale(1.1);
    color: var(--accent);
}

.sidebar-footer {
    padding: 1rem 0.5rem 0 0.5rem;
    border-top: 1px solid var(--panel-border);
    font-size: 0.75rem;
    color: var(--text-dark);
    text-align: center;
}

/* Main Dashboard Canvas */
.main-canvas {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: calc(100vw - 280px);
}

/* Header Component */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.header-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.header-title p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Stats Row Component */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: var(--shadow-premium);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-icon.yellow {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

/* Workspace Panels (Split View) */
.workspace-split {
    display: grid;
    grid-template-columns: 1fr 650px;
    gap: 2rem;
    flex: 1;
    align-items: start;
}

.workspace-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.workspace-panel.sticky-aside {
    position: sticky;
    top: 2rem;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    overflow: visible;
}

/* Form Styles & Inputs */
.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-dark);
    font-size: 0.95rem;
    pointer-events: none;
}

.form-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-wrapper .form-input {
    padding-left: 38px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.7);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.form-input::placeholder {
    color: var(--text-dark);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-actions-inline {
    display: flex;
    gap: 8px;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #0b0f19;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--panel-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: var(--danger-light);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-hover);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: #0b0f19;
}

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* Dynamic Invoice Items Table */
.items-table-container {
    margin-top: 1rem;
    overflow: visible;
}

@media (max-width: 991px) {
    .items-table-container {
        overflow-x: auto;
    }
}

.items-form-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.items-form-table th {
    text-align: left;
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    border-bottom: 1px solid var(--panel-border);
}

.items-form-table td {
    padding: 8px 6px;
    vertical-align: middle;
}

.row-action-cell {
    width: 44px;
    text-align: center;
}

/* Calculations Display Card */
.calc-summary-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.calc-row.total-row {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    border-top: 1px solid var(--panel-border);
    padding-top: 10px;
    margin-top: 5px;
}

.calc-row.total-row .val-accent {
    color: var(--accent);
}

.vat-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.vat-checkbox-wrapper input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* WYSIWYG Live A4 Invoice Sheet Layout */
.invoice-sheet-wrapper {
    background: var(--paper-bg);
    width: 100%;
    max-width: 610px;
    min-height: 840px;
    color: var(--paper-text);
    padding: 40px;
    border-radius: var(--radius-sm);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    font-size: 12px;
    position: relative;
    border: 1px solid var(--paper-border);
    transition: var(--transition);
}

/* Quick Action Bar under invoice sheet */
.preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1.25rem;
    width: 100%;
    max-width: 610px;
}

/* Elegant Invoice Typography System */
.invoice-brand-block {
    display: flex;
    justify-content: space-between;
    align-items: start;
    border-bottom: 2px solid var(--paper-accent);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.invoice-logo-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invoice-logo-img {
    height: 52px;
    object-fit: contain;
}

.invoice-brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--paper-accent);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 1px;
}

.invoice-brand-subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--paper-text-muted);
    text-align: right;
    margin-top: 4px;
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.invoice-party-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.party-label {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.5px;
    color: var(--paper-text-light);
    border-bottom: 1px solid var(--paper-border);
    padding-bottom: 3px;
    margin-bottom: 4px;
}

.party-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--paper-accent);
}

.party-detail {
    color: var(--paper-text-muted);
    line-height: 1.4;
}

.party-detail strong {
    color: var(--paper-text);
}

.meta-info-card {
    background: var(--paper-highlight);
    border: 1px solid var(--paper-border);
    padding: 12px;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.meta-group {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--paper-text-light);
}

.meta-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--paper-accent);
}

/* Beautiful PDF Invoice Items Grid */
.invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.invoice-items-table th {
    background: var(--paper-accent);
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 9px;
    padding: 8px 10px;
    letter-spacing: 0.5px;
}

.invoice-items-table th:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.invoice-items-table th:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    text-align: right;
}

.invoice-items-table td {
    padding: 10px;
    border-bottom: 1px solid var(--paper-border);
    color: var(--paper-text);
}

.invoice-items-table td:last-child {
    text-align: right;
    font-weight: 700;
}

.invoice-items-table tr:last-child td {
    border-bottom: 2px solid var(--paper-accent);
}

/* Totals Summary block on paper */
.invoice-totals-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 35px;
}

.invoice-totals-block {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.totals-line {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--paper-text-muted);
}

.totals-line strong {
    color: var(--paper-text);
}

.totals-line.grand-total {
    border-top: 1.5px solid var(--paper-accent);
    padding-top: 6px;
    margin-top: 4px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--paper-accent);
}

/* Signatures & Bank section */
.invoice-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 30px;
    align-items: end;
}

.bank-details-card {
    border-top: 1.5px dashed var(--paper-border);
    padding-top: 15px;
}

.bank-title {
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    color: var(--paper-text-light);
    margin-bottom: 6px;
}

.bank-line {
    font-size: 10px;
    color: var(--paper-text-muted);
    margin-bottom: 2px;
}

.bank-line strong {
    color: var(--paper-text);
}

.signature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 1px solid var(--paper-border);
    padding-top: 10px;
    position: relative;
    min-height: 80px;
    justify-content: flex-end;
}

.signature-img-container {
    position: absolute;
    bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    width: 100%;
    pointer-events: none;
}

#preview-signature-img {
    max-height: 52px;
    max-width: 120px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.signature-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--paper-text-light);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.signature-name {
    font-weight: 700;
    color: var(--paper-accent);
}

/* Client Management & History Interfaces */
.control-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-input-group {
    max-width: 320px;
    flex: 1;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.client-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: var(--transition);
}

.client-card:hover {
    transform: translateY(-2px);
    border-color: rgba(6, 182, 212, 0.2);
    box-shadow: var(--shadow-premium);
}

.client-info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.client-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.client-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.client-detail-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.client-detail-item i {
    color: var(--accent);
    font-size: 0.85rem;
    width: 14px;
}

.client-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    margin-top: 4px;
}

.empty-state {
    grid-column: span 100%;
    text-align: center;
    padding: 3rem;
    background: rgba(15, 23, 42, 0.2);
    border: 1.5px dashed var(--panel-border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-dark);
}

/* History List / Table Styles */
.history-table-wrapper {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.history-table th {
    background: rgba(15, 23, 42, 0.6);
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--panel-border);
}

.history-table td {
    padding: 14px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--panel-border);
    color: var(--text-main);
    vertical-align: middle;
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-gel {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
}

.badge-usd {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
}

.badge-eur {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Responsive Tab Control System */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dialog Modals CSS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--panel-bg-solid);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.25rem;
}

/* Beautiful Notifications Popups */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: var(--panel-bg-solid);
    border-left: 4px solid var(--accent);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.danger {
    border-left-color: var(--danger);
}

/* Mobile Screen Compatibility Rules */
@media screen and (max-width: 1200px) {
    .workspace-split {
        grid-template-columns: 1fr;
    }
    .workspace-panel.sticky-aside {
        position: relative;
        top: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .invoice-sheet-wrapper {
        max-width: 100%;
    }
    .preview-controls {
        max-width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .sidebar {
        width: 100vw;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        padding: 1.25rem;
    }
    .sidebar-footer {
        display: none;
    }
    .brand-section {
        margin-bottom: 1rem;
    }
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    .nav-item button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .main-canvas {
        margin-left: 0;
        max-width: 100vw;
        padding: 1.25rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full-width {
        grid-column: span 1;
    }
    .invoice-sheet-wrapper {
        padding: 20px;
    }
    .invoice-brand-title {
        font-size: 1.7rem;
    }
    .invoice-details-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .invoice-bottom-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
    .toast {
        min-width: calc(100vw - 2rem);
    }
}

/* Premium Dashboard UI styling */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dashboard-card.clickable {
    cursor: pointer;
}

.dashboard-card.clickable:hover {
    transform: translateY(-5px);
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.dashboard-card.clickable::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: var(--transition);
}

.dashboard-card.clickable:hover::before {
    opacity: 1;
}

.dash-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: var(--transition);
}

.dash-card-icon.blue {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent);
}

.dash-card-icon.yellow {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
}

.dash-card-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.dash-card-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-hover);
}

.dash-card-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.dash-card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dash-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dash-card-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 4px 0 2px 0;
    line-height: 1.2;
}

.dash-card-footer {
    font-size: 0.72rem;
    color: var(--text-dark);
    font-weight: 500;
}

.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media screen and (max-width: 1200px) {
    .dashboard-split {
        grid-template-columns: 1fr !important;
    }
}

/* PRINT ONLY REDIRECTION AND FORMATTING (CRITICAL ACTION RULES) */
@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html, body, .app-container {
        background: #ffffff !important;
        background-image: none !important;
        color: #000000 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
        box-shadow: none !important;
    }

    .no-print,
    .sidebar,
    .main-canvas > .dashboard-header,
    .main-canvas > .stats-row,
    .workspace-panel:not(.sticky-aside),
    .preview-controls,
    .modal-overlay,
    .toast-container {
        display: none !important;
    }

    .tab-content:not(#tab-create) {
        display: none !important;
    }
    
    #tab-create {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-canvas {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }
    
    .workspace-split {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .workspace-panel.sticky-aside {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        position: static !important;
        box-shadow: none !important;
        background: #ffffff !important;
    }
    
    .invoice-sheet-wrapper {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 20mm 15mm !important;
        margin: 0 !important;
        min-height: 0 !important;
        color: #000000 !important;
        background: #ffffff !important;
        display: block !important;
    }
    
    .invoice-brand-block {
        padding-bottom: 10px !important;
        margin-bottom: 15px !important;
    }
    
    .invoice-brand-title {
        color: #000000 !important;
        font-size: 2rem !important;
    }
    
    .invoice-details-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        margin-bottom: 15px !important;
        gap: 20px !important;
    }
    
    .invoice-items-table {
        margin-bottom: 15px !important;
    }
    
    .invoice-items-table th {
        background: #000000 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 5px 8px !important;
    }
    
    .invoice-items-table td {
        padding: 6px 8px !important; /* Compressed cell height */
    }
    
    .invoice-totals-wrapper {
        margin-bottom: 20px !important;
    }
    
    .invoice-bottom-grid {
        gap: 20px !important;
    }
    
    .totals-line.grand-total {
        border-top: 1.5px solid #000000 !important;
        color: #000000 !important;
    }
    
    .bank-details-card {
        border-top: 1px dashed #cccccc !important;
        padding-top: 10px !important;
    }
    
    .signature-block {
        padding-top: 8px !important;
    }
    
    /* Correct standard webkit settings to support graphics on printing page */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ==========================================
 * 16. SLEEK AUTH OVERLAY SYSTEM
 * ========================================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 0%, #151e33 0%, #080b12 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    overflow-y: auto;
}

.auth-overlay.active {
    display: flex;
}

.auth-card {
    background: rgba(20, 27, 45, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 460px;
    padding: 2.5rem;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8), var(--shadow-glow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    border-color: rgba(6, 182, 212, 0.2);
}

/* Glowing border decoration */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, var(--accent) 0%, transparent 40%, transparent 60%, var(--accent-gold) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.5;
}

.auth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.auth-view {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.4s ease-out;
}

.auth-view.active {
    display: flex;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    background: linear-gradient(135deg, var(--text-main) 40%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.auth-switch-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.auth-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    transition: var(--transition);
}

.auth-link:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* User Profile Badge Styles */
.badge-admin {
    background: rgba(251, 191, 36, 0.15) !important;
    color: var(--accent-gold) !important;
    border: 1px solid rgba(251, 191, 36, 0.25) !important;
}

.badge-user {
    background: rgba(6, 182, 212, 0.15) !important;
    color: var(--accent) !important;
    border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

/* Disabled styling overlay */
.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-muted) !important;
}

/* Disable buttons or indicators */
.btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Tier Badges styling */
.badge-tier {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.tier-free {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

.tier-standard {
    background: rgba(6, 182, 212, 0.15) !important;
    color: var(--accent) !important;
    border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

.tier-premium {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #a78bfa !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
}

.tier-unlimited {
    background: rgba(16, 185, 129, 0.15) !important;
    color: var(--success) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

/* Admin Usage Limit Bars */
.usage-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.usage-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.usage-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.usage-normal {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.usage-warning {
    background: var(--accent-gold);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.usage-danger {
    background: var(--danger-hover);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Tier select inside tables */
.tier-select {
    width: 100%;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tier-select:hover {
    border-color: rgba(6, 182, 212, 0.4);
}

.tier-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

@keyframes pulseDanger {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ==========================================
 * WAREHOUSE (INVENTORY MANAGER) STYLES
 * ========================================== */

/* Category Tree Node Manager */
.category-node {
    margin-bottom: 4px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    border: 1px solid transparent;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.category-item.active {
    background: var(--accent-light);
    color: var(--accent);
    border-color: rgba(6, 182, 212, 0.15);
    font-weight: 600;
}

.category-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.category-item-content i {
    font-size: 1.05rem;
    color: var(--accent-gold);
}

.category-item.active .category-item-content i {
    color: var(--accent);
}

.category-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.category-item:hover .category-actions {
    opacity: 1;
}

.category-actions button {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.category-actions button:hover {
    color: var(--text-main);
}

.category-actions button.btn-cat-delete:hover {
    color: var(--danger-hover);
}

.category-sub-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 2px;
    border-left: 1px dashed rgba(255, 255, 255, 0.08);
}

/* Products Directory Styles */
.product-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-code-badge {
    font-family: monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Stock Status Badges */
.badge-qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge-qty-normal {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-hover);
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-qty-low {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.2);
}

.badge-qty-empty {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-hover);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Autocomplete Invoice items styles */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    background: var(--panel-bg-solid);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 999;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: var(--transition);
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.autocomplete-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-item-left img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.autocomplete-item-title {
    font-weight: 600;
    color: var(--text-main);
}

.autocomplete-item-code {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--accent);
}

.autocomplete-item-right {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.stock-indicator-hint {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.stock-indicator-hint.warning {
    color: var(--danger-hover);
    animation: pulseStockWarning 1s infinite alternate;
}

@keyframes pulseStockWarning {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Quick Theme Picker Header Button */
.btn-theme-quick {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 12px;
}

.btn-theme-quick:hover {
    color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.3);
    transform: rotate(30deg);
}

/* Theme Selector in Settings Tab */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.theme-card {
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid var(--panel-border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.theme-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.theme-card.active {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.theme-preview-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.theme-name-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}

/* POS Terminal Layout */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 1.5rem;
    height: calc(100vh - 120px);
    align-items: stretch;
}

.pos-products-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* Touch-optimized Category Navigation (Horizontal scrollable pills) */
.pos-categories-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.pos-categories-nav::-webkit-scrollbar {
    height: 4px;
}

.pos-category-btn {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.pos-category-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.pos-category-btn.active {
    background: var(--accent);
    color: #0b0f19;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* POS Products Touch Grid */
.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-auto-rows: max-content;
    gap: 0.85rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.pos-product-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    user-select: none;
}

.pos-product-card:hover:not(.disabled) {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.pos-product-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pos-product-img-wrapper {
    width: 100%;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.pos-product-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 6px;
}

.pos-product-fallback-img {
    font-size: 2rem;
    color: var(--text-dark);
}

.pos-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pos-product-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 32px;
    line-height: 1.2;
}

.pos-product-price-badge {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-top: 4px;
}

.pos-product-stock-tag {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    z-index: 5;
}

.pos-product-card.low-stock .pos-product-stock-tag {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.2);
}

.pos-product-card.disabled .pos-product-stock-tag {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-hover);
    border-color: rgba(239, 68, 68, 0.25);
}

/* POS Cart Panel (Right Side) */
.pos-cart-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
}

.pos-cart-header {
    padding: 15px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.pos-cart-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-clear-pos-cart {
    background: none;
    border: none;
    color: var(--danger-hover);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-clear-pos-cart:hover {
    text-decoration: underline;
}

.pos-cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Touch-optimized POS Cart Item Card */
.pos-cart-item {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pos-cart-item-info {
    flex: 1;
    overflow: hidden;
}

.pos-cart-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-cart-item-price {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Huge Touch controls for Qty */
.pos-cart-qty-control {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    overflow: hidden;
}

.pos-cart-qty-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pos-cart-qty-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.pos-cart-qty-val {
    width: 34px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    border: none;
    background: transparent;
}

.pos-cart-item-total {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    width: 65px;
    text-align: right;
}

.btn-remove-pos-item {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.05rem;
    transition: var(--transition);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-pos-item:hover {
    color: var(--danger-hover);
}

/* POS Cart Footer & Pay Actions */
.pos-cart-footer {
    padding: 15px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pos-summary-row.grand-total {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    border-top: 1px dashed var(--panel-border);
    padding-top: 8px;
    margin-top: 4px;
}

.pos-btn-checkout {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: var(--success);
    color: #0b0f19;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.pos-btn-checkout:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.pos-btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Touch POS Checkout Modal */
.checkout-payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-method-btn {
    background: rgba(15, 23, 42, 0.4);
    border: 2px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-family: var(--font-family);
    transition: var(--transition);
}

.payment-method-btn i {
    font-size: 2.2rem;
}

.payment-method-btn span {
    font-weight: 700;
    font-size: 0.95rem;
}

.payment-method-btn:hover {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.payment-method-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

/* Cash received pad (calculator) */
.cash-calc-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cash-received-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cash-received-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.cash-received-input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    color: var(--text-main);
    padding: 10px 12px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: monospace;
    text-align: right;
}

.cash-preset-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.cash-preset-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.cash-preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cash-change-display {
    border-top: 1px dashed var(--panel-border);
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.cash-change-val {
    font-size: 1.3rem;
    color: var(--accent-gold);
    font-family: monospace;
}

.cash-change-val.negative {
    color: var(--danger-hover);
}

/* thermal print-friendly receipt simulation */
.pos-receipt-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    color: #000;
    padding: 20px;
    border-radius: 4px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid #ddd;
}

.pos-receipt-print-area {
    width: 100%;
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
}

.receipt-brand {
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
}

.receipt-company-info {
    font-size: 0.72rem;
    margin-top: 4px;
}

.receipt-divider {
    border-top: 1px dashed #000;
    margin: 8px 0;
}

.receipt-meta {
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.receipt-meta-row {
    display: flex;
    justify-content: space-between;
}

.receipt-items {
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.receipt-item-row {
    display: flex;
    justify-content: space-between;
}

.receipt-total-line {
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.receipt-total-line.grand {
    font-size: 1rem;
    border-top: 1px solid #000;
    padding-top: 4px;
}

.receipt-footer {
    text-align: center;
    font-size: 0.7rem;
    margin-top: 15px;
}

/* Invoice Creator: Warehouse Autocomplete & Linked Badges */
.inv-desc-combo {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inv-desc-input-row {
    position: relative;
    display: flex;
    align-items: center;
}

.inv-desc-input-row .row-desc {
    padding-right: 36px;
}

.inv-warehouse-pick-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    height: 100%;
}

.inv-warehouse-pick-btn:hover {
    color: var(--accent);
}

.inv-product-linked-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.72rem;
    color: var(--text-main);
    width: fit-content;
    margin-top: 4px;
}

.inv-product-linked-badge i {
    color: var(--accent);
    font-size: 0.9rem;
}

.inv-stock-pill {
    font-weight: 700;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}

.inv-stock-pill.ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.inv-stock-pill.warn {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
}

.inv-stock-pill.empty {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-hover);
}

.inv-clear-link-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin-left: 2px;
    transition: var(--transition);
}

.inv-clear-link-btn:hover {
    color: var(--danger-hover);
}

.inv-autocomplete-dropdown {
    position: absolute;
    top: 105%;
    left: 0;
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    background: var(--panel-bg-solid);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inv-ac-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: var(--transition);
}

.inv-ac-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.inv-ac-thumb {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 8px;
    flex-shrink: 0;
}

.inv-ac-thumb-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    color: var(--text-dark);
}

.inv-ac-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    margin-right: 10px;
}

.inv-ac-name {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inv-ac-code {
    font-family: monospace;
    font-size: 0.68rem;
    color: var(--accent);
}

.inv-ac-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.inv-ac-price {
    font-weight: 700;
    color: var(--text-main);
}

.inv-ac-stock {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

.inv-ac-stock-ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.inv-ac-stock-low {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
}

.inv-ac-stock-empty {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-hover);
}


