/* =========================================
   1. Google Fonts & Global Variables
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Premium Dark Green Brand Colors */
    --primary: #0F5132;        
    --primary-hover: #0a3622;  
    --primary-light: #E8F5E9;  
    
    /* Layout Colors */
    --bg-main: #F3F4F6;
    --surface: #FFFFFF;
    
    /* Text Colors */
    --text-main: #111827;
    --text-muted: #6B7280;
    
    /* Borders & Status Colors */
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
}

/* =========================================
   2. Base Reset
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Google Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.metric { font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.metric.positive { color: var(--success); }
.metric.negative { color: var(--danger); }
.mt-10 { margin-top: 6px; }

/* =========================================
   3. Sidebar - Sleek & Flat Structure
========================================= */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.sidebar::-webkit-scrollbar { display: none; }

.logo-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 0 10px;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(15, 81, 50, 0.2);
}

.logo_name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.nav-list { list-style: none; }
.nav-list li { margin-bottom: 8px; }

.nav-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-list a:hover, .nav-list a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-list a i { font-size: 1.25rem; }

/* =========================================
   4. Main Content Area & Topbar
========================================= */
.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 32px 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.date-filter select {
    border: none;
    outline: none;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(15, 81, 50, 0.2);
}

.btn-primary:hover { 
    background: var(--primary-hover); 
    transform: translateY(-2px);
}

/* Notification Box & Dropdown */
.notification-box {
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.notification-box:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

.notify-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.notification-dropdown {
    position: absolute;
    top: 55px;
    right: -10px;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none; 
    flex-direction: column;
    z-index: 1000;
    cursor: default;
}

.notification-dropdown.show {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notify-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.notify-header h4 { font-size: 1rem; color: var(--text-main); }
.mark-read { font-size: 0.8rem; color: var(--primary); cursor: pointer; }
.mark-read:hover { text-decoration: underline; }

.notify-body {
    max-height: 280px; 
    overflow-y: auto;
}

/* Custom Scrollbar for Notification Dropdown */
.notify-body::-webkit-scrollbar { width: 5px; }
.notify-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.notify-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    transition: 0.2s;
}

.notify-item:hover { background: var(--bg-main); }
.notify-item.unread { background: rgba(15, 81, 50, 0.04); }

.notify-item .notify-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notify-item .notify-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.notify-item .notify-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.notify-content p { font-size: 0.85rem; margin-bottom: 3px; }
.notify-content small { font-size: 0.75rem; color: var(--text-muted); }

.admin-profile img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* =========================================
   5. Bento Grid Stats (Rectangular Shape)
========================================= */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.bento-card {
    background: var(--surface);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    padding: 16px 20px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.06);
}

/* Highlighted Profit Card */
.bento-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #146c43 100%);
    color: white;
    border: none;
    box-shadow: 0 10px 30px rgba(15, 81, 50, 0.25);
}

.bento-card.highlight .text-muted, 
.bento-card.highlight .card-header { color: rgba(255,255,255,0.85); }
.bento-card.highlight .icon-box { background: rgba(255, 255, 255, 0.2); color: white; }
.bento-card.highlight .card-body h2 { color: white; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px; 
    font-size: 0.9rem;
}

.icon-box {
    width: 36px; 
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-box.danger-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.icon-box.warning-icon { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.card-body h2 { 
    font-size: 1.6rem; 
    font-weight: 700; 
    margin-bottom: 4px; 
    letter-spacing: -0.5px; 
    color: var(--text-main);
}

/* Buttons & Inputs in Cards */
.input-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.sleek-input {
    border: none;
    padding: 8px 12px;
    width: 100%;
    outline: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-icon {
    background: var(--primary-light);
    border: none;
    padding: 0 12px;
    cursor: pointer;
    color: var(--primary);
    transition: 0.2s;
    font-size: 1.1rem;
}
.btn-icon:hover { background: #d1e7dd; }

.btn-outline-small {
    background: transparent;
    border: 1.5px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.3s;
}
.btn-outline-small:hover { 
    border-color: var(--primary); 
    color: var(--primary); 
    background: var(--primary-light);
}

/* =========================================
   6. Charts & Data Tables Grid
========================================= */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 24px;
}

/* Remove default margin from h3 inside header */
.card-header.border-bottom h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.card-header.border-bottom {
    padding-bottom: 12px; 
    margin-bottom: 0; 
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

/* Fixed container to prevent chart recursive growth */
.chart-wrapper {
    position: relative;
    height: 320px; 
    width: 100%;
    margin-top: 20px;
}

/* TABLE CARD FIXES */
.table-card {
    justify-content: flex-start; /* Prevents pushing the table down */
}

.table-card .table-responsive { 
    overflow-x: auto; 
    margin-top: 16px; /* Adds a nice normal gap below the header */
}

.sleek-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.sleek-table th, .sleek-table td {
    padding: 16px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
}

.sleek-table th { 
    padding-top: 12px; 
    color: var(--text-muted); 
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sleek-table tbody tr { transition: 0.2s; }
.sleek-table tbody tr:hover { background: #f9fafb; }
.sleek-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* =========================================
   7. Responsive Design
========================================= */
@media screen and (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
    .sidebar { transform: translateX(-100%); z-index: 1000; }
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    .topbar { flex-direction: column; gap: 15px; }
    .date-filter { width: 100%; justify-content: space-between; }
}


/* =========================================
   8. User Management specific styles
========================================= */
.user-table th { padding-top: 16px; }

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.user-info h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.role-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.role-badge.admin { background: rgba(15, 81, 50, 0.1); color: var(--primary); }
.role-badge.staff { background: var(--bg-main); color: var(--text-muted); border: 1px solid var(--border); }

.action-btns {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: var(--surface);
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
    color: var(--text-muted);
}

.btn-action.edit:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.btn-action.delete:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: var(--danger); }

/* =========================================
   9. Modal (Popup) Styles
========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.6); /* Dark semi-transparent background */
    backdrop-filter: blur(4px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--surface);
    width: 100%;
    max-width: 550px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    animation: slideUpModal 0.3s ease-out forwards;
}

@keyframes slideUpModal {
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.25rem; color: var(--text-main); }

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.close-modal:hover { color: var(--danger); }

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-control {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.row-group {
    display: flex;
    gap: 16px;
}

.half-width {
    width: 50%;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-main);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* =========================================
   7. Responsive Design & Mobile Menu
========================================= */
.mobile-menu-toggle {
    display: none;
    font-size: 2rem;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
}

.mobile-menu-toggle:hover { color: var(--primary); }

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media screen and (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 768px) {
    /* Show Toggle Icon */
    .mobile-menu-toggle { display: block; }

    /* Hide Sidebar Default */
    .sidebar { 
        transform: translateX(-100%); 
        z-index: 1000; 
        transition: transform 0.3s ease-in-out;
    }

    /* Show Sidebar when active */
    .sidebar.show { transform: translateX(0); }

    /* Adjust Main Content */
    .main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: 20px; 
    }

    /* Adjust Topbar for Mobile */
    .topbar { 
        flex-direction: column; 
        gap: 15px; 
        align-items: flex-start;
    }
    
    .topbar-actions { 
        width: 100%; 
        justify-content: space-between; 
        flex-wrap: wrap;
    }

    .date-filter { width: 100%; justify-content: space-between; margin-bottom: 10px; }
}


/* =========================================
   10. Contacts & Tabs Styling
========================================= */
.custom-tabs {
    display: flex;
    gap: 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 1.2rem;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* WhatsApp and Call Button Styling */
.btn-action.whatsapp {
    color: #25D366; /* WhatsApp Brand Color */
}
.btn-action.whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25D366;
}

.btn-action.call {
    color: var(--primary);
}
.btn-action.call:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}


/* =========================================
   11. Products Page Styling
========================================= */
.product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    width: 45px;
    height: 45px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.product-info h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.fifo-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 5px;
    vertical-align: middle;
}


/* =========================================
   12. Purchases (FIFO) Page Styling
========================================= */
.batch-left {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.progress-bar-bg {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

/* =========================================
   14. New Premium POS Layout (App View)
========================================= */

.npos-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.npos-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.npos-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* NEW: 4 Column Grid for top section */
.npos-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.npos-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

/* Custom Extra Options Box */
.extra-options-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFAFA;
}

.extra-options-box .icons {
    display: flex;
    gap: 12px;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.extra-options-box .icons i:hover { color: var(--primary); }

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Switch Toggle CSS */
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(14px); }

/* Split Area */
.npos-split-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 500px;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
}

/* Left Cart Panel */
.npos-cart-panel {
    display: flex;
    flex-direction: column;
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 10px;
    background: #FAFAFA;
}
.cart-items-container::-webkit-scrollbar { width: 5px; }
.cart-items-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.empty-state {
    color: #ef4444; 
    font-size: 0.9rem;
    text-align: center;
    margin-top: 20px;
}

/* Cart Item Row */
.npos-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.npos-cart-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-right: 10px;
}

.npos-cart-item .info { flex: 1; }
.npos-cart-item .info h4 { font-size: 0.85rem; margin-bottom: 2px; }
.npos-cart-item .info .sku { font-size: 0.75rem; color: #0d9488; } 

.npos-cart-item .qty-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.npos-cart-item .qty-box button {
    background: #F3F4F6;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-weight: bold;
}
.npos-cart-item .qty-box span { padding: 0 10px; font-size: 0.85rem; font-weight: 600; }
.npos-cart-item .price { font-weight: 700; width: 70px; text-align: right; margin-right: 10px; }
.npos-cart-item .remove-btn { color: #ef4444; cursor: pointer; font-size: 1.2rem; }

/* Right Product Panel */
.npos-product-panel {
    display: flex;
    flex-direction: column;
    background: #FAFAFA; 
}

.product-search-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-star {
    background: #fef08a; 
    border: 1px solid #fde047;
    color: #ca8a04;
    border-radius: 8px;
    width: 40px;
    font-size: 1.2rem;
    cursor: pointer;
}

.product-list-container {
    flex: 1;
    overflow-y: auto;
}
.product-list-container::-webkit-scrollbar { width: 5px; }
.product-list-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.npos-product-item {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}

.npos-product-item:hover { border-color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

.npos-product-item img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    border: 1px solid #e2e8f0;
}

.prod-details { flex: 1; }
.prod-details h4 { font-size: 0.85rem; color: var(--text-main); margin-bottom: 3px; }
.prod-details .sku { font-size: 0.75rem; color: #0d9488; font-weight: 600; display: block; margin-bottom: 5px;}
.price-stock { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }
.star-icon { position: absolute; right: 15px; top: 15px; color: #cbd5e1; font-size: 1.2rem; }
.text-danger { color: #ef4444 !important; }

/* Calculations Section */
.calc-inputs-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.calc-group label { font-size: 0.8rem; color: var(--text-main); font-weight: 600; margin-bottom: 5px; }
.readonly-input { background: #F9FAFB; font-weight: 600; color: var(--text-main); cursor: not-allowed; }

.grand-total-label { color: #ec4899 !important; }
.grand-total-input { color: #ec4899 !important; font-weight: 700; background: #fdf2f8 !important; border-color: #fbcfe8 !important;}

/* Using Brand Color for Button */
.btn-create-order {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.btn-create-order:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Responsive Grid Adjustments */
@media screen and (max-width: 1024px) {
    .npos-grid-4, .npos-grid-3, .npos-split-area, .calc-inputs-row { grid-template-columns: 1fr; }
    .npos-split-area { height: auto; }
    .npos-cart-panel, .npos-product-panel { height: 400px; }
}

/* Quantity Input Box Styling */
.npos-cart-item .qty-box input.manual-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    -moz-appearance: textfield; /* Firefox e default arrow hide korar jonno */
}

/* Chrome, Safari, Edge e default arrow hide korar jonno */
.npos-cart-item .qty-box input.manual-qty-input::-webkit-outer-spin-button,
.npos-cart-item .qty-box input.manual-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* =========================================
   15. Stock Management Styling
========================================= */

/* Stock Health Progress Bar */
.stock-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
}

.stock-progress-bg {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.stock-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease;
}

.fill-good { background-color: var(--success); }
.fill-warning { background-color: #F59E0B; } /* Warning Orange */
.fill-danger { background-color: var(--danger); }

/* Readonly Input Styling for Modal */
.readonly-input {
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 600;
    cursor: not-allowed;
}

/* Info Alert Box */
.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid transparent;
}
.alert-box i {
    font-size: 1.2rem;
    margin-top: 2px;
}


/* =========================================
   16. Expenses & Ad Cost Styling
========================================= */

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.platform-badge i {
    font-size: 1rem;
}

/* Specific Platform Colors */
.platform-badge.fb {
    background-color: #E8F0FE;
    color: #1877F2; /* Facebook Blue */
    border: 1px solid #BFDBFE;
}

.platform-badge.google {
    background-color: #FEF2F2;
    color: #EA4335; /* Google Red */
    border: 1px solid #FECACA;
}



/* =========================================
   17. Payment Accounts Styling
========================================= */

.account-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.account-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.account-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.acc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.acc-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.acc-actions button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.acc-actions button:hover {
    color: var(--primary);
}

.acc-details {
    margin-bottom: 20px;
}

.acc-name {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.acc-number {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 10px;
}

.acc-balance {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.acc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px dashed var(--border);
    padding-top: 15px;
}

.acc-footer small {
    color: var(--text-muted);
    font-weight: 500;
}

/* =========================================
   18. Wealth Summary Card (Premium Header) - UPDATED
========================================= */

.wealth-summary-card {
    /* Updated gradient using your exact Dark Green brand colors */
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: 16px;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 25px;
    /* Updated shadow to match Dark Green (RGB of #0F5132) */
    box-shadow: 0 10px 30px rgba(15, 81, 50, 0.25);
}

.wealth-left .wealth-title { 
    font-size: 1.1rem; 
    opacity: 0.9; 
    margin-bottom: 8px; 
    font-weight: 500; 
}

.wealth-left .wealth-amount { 
    font-size: 2.8rem; 
    font-weight: 800; 
    margin: 0 0 8px 0; 
    letter-spacing: -1px; 
}

.wealth-left .wealth-subtitle { 
    font-size: 0.85rem; 
    opacity: 0.8; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

/* Glassmorphism Effect for Right Box */
.wealth-right { 
    background: rgba(255, 255, 255, 0.1); 
    padding: 20px 25px; 
    border-radius: 12px; 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2); 
}

.wealth-right .cash-flow-title { 
    font-size: 0.95rem; 
    font-weight: 600; 
    margin-bottom: 15px; 
    opacity: 0.9; 
    border-bottom: 1px solid rgba(255,255,255,0.2); 
    padding-bottom: 8px;
}

.cash-flow-stats { 
    display: flex; 
    gap: 30px; 
}

.stat-box { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.stat-box i { 
    font-size: 1.8rem; 
    padding: 12px; 
    border-radius: 10px; 
}

/* Updated Cash In Icon Colors */
.stat-box.in i { 
    background: rgba(16, 185, 129, 0.2); 
    color: #34d399; 
}

/* Updated Cash Out Icon Colors */
.stat-box.out i { 
    background: rgba(239, 68, 68, 0.2); 
    color: #fca5a5; 
}

.stat-box span { 
    font-size: 0.8rem; 
    opacity: 0.8; 
    display: block; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-box h4 { 
    font-size: 1.25rem; 
    margin: 2px 0 0 0; 
    font-weight: 700; 
}

@media screen and (max-width: 900px) {
    .wealth-summary-card { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 20px; 
        padding: 20px;
    }
    .wealth-right { 
        width: 100%; 
    }
}

/* =========================================
   19. Courier RFC & Logistics Styling
========================================= */

.tracking-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-main);
    border: 1px dashed var(--border);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: monospace;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 5px;
    cursor: pointer;
    transition: 0.2s;
}

.tracking-badge:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.tracking-badge i {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tracking-badge:hover i {
    color: var(--primary);
}

/* Badge specific adjustments for icons */
.badge i {
    margin-right: 4px;
    font-size: 0.9rem;
}


/* =========================================
   20. Reports & Analytics Styling
========================================= */

.analytics-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2:1 Ratio for Bar vs Doughnut Chart */
    gap: 24px;
}

.chart-card {
    padding: 20px;
}

/* Printing Optimization for Export PDF */
@media print {
    body * {
        visibility: hidden;
    }
    .main-content, .main-content * {
        visibility: visible;
    }
    .main-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .sidebar, .topbar-actions, .mobile-menu-toggle {
        display: none !important;
    }
    .bento-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

/* Responsive Charts Layout */
@media screen and (max-width: 1024px) {
    .analytics-layout {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   21. Notification Templates Styling
========================================= */

.template-layout {
    display: grid;
    grid-template-columns: 1fr 2.2fr; /* Ratio for Sidebar vs Editor */
    gap: 24px;
    align-items: flex-start;
}

/* Template List Card */
.template-list-card {
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}
.template-list::-webkit-scrollbar { width: 4px; }
.template-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.template-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    background: var(--surface);
}

.template-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.template-item.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.temp-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 12px;
}

.temp-icon.sms { background: #E0F2FE; color: #0284C7; }
.temp-icon.email { background: #F3E8FF; color: #9333EA; }
.temp-icon.alert { background: #FEE2E2; color: #DC2626; }

.temp-info { flex: 1; }
.temp-info h4 { font-size: 0.95rem; color: var(--text-main); margin-bottom: 2px; }
.temp-info small { font-size: 0.75rem; font-weight: 500; }

/* Small Toggle Switch */
.switch-small { position: relative; display: inline-block; width: 28px; height: 16px; margin-left: 10px; }
.switch-small input { opacity: 0; width: 0; height: 0; }
.slider-small { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 16px; }
.slider-small:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider-small { background-color: var(--success); }
input:checked + .slider-small:before { transform: translateX(12px); }

/* Editor Area */
.template-editor-card {
    padding: 25px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.editor-header h3 { font-size: 1.2rem; color: var(--text-main); margin: 0; }

.dynamic-tags-box {
    margin-top: 10px;
    padding: 12px;
    background: #FAFAFA;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 5px;
}

.insert-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: monospace;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: 0.2s;
}

.insert-tag:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .template-layout { grid-template-columns: 1fr; }
    .template-list { max-height: 250px; }
}

/* =========================================
   22. Settings Layout Styling
========================================= */

.settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

/* Settings Navigation Menu */
.settings-nav-card {
    padding: 15px 0;
}

.settings-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-nav-item {
    padding: 15px 20px;
    margin: 0 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.settings-nav-item i {
    font-size: 1.3rem;
}

.settings-nav-item:hover {
    background: var(--bg-main);
    color: var(--text-main);
}

.settings-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Settings Content Panes */
.settings-content-card {
    padding: 30px;
    min-height: 500px;
}

.settings-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-pane.active {
    display: block;
}

.pane-title {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

/* API Integration Box */
.api-box {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    background: #FAFAFA;
}

.api-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 15px;
}

.api-header h4 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    color: var(--text-main);
}

/* Preferences List */
.pref-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pref-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pref-item h4 {
    font-size: 0.95rem;
    margin: 0 0 2px 0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media screen and (max-width: 900px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { display: flex; overflow-x: auto; padding-bottom: 10px; }
    .settings-nav-item { white-space: nowrap; }
}


/* =========================================
   23. Customer Statistics & Segments
========================================= */

.segment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.segment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.segment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(15, 81, 50, 0.08);
    border-color: var(--primary);
}

.seg-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.seg-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 5px;
}

.seg-info h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.2;
}

.seg-count {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.segment-card small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Specific Tag Badges for Table */
.seg-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.seg-badge i { font-size: 0.9rem; }

.tag-new-active { background: #E0F2FE; color: #0284C7; border: 1px solid #BAE6FD; }
.tag-active { background: #CCFBF1; color: #0D9488; border: 1px solid #99F6E4; }
.tag-potential { background: #D1FAE5; color: #059669; border: 1px solid #A7F3D0; }
.tag-regular { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(15,81,50,0.2); }
.tag-super-regular { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.tag-returning { background: #F3E8FF; color: #9333EA; border: 1px solid #E9D5FF; }
.tag-irregular { background: #FFEDD5; color: #EA580C; border: 1px solid #FED7AA; }
.tag-disinterested { background: #F3F4F6; color: #4B5563; border: 1px solid #E5E7EB; }
.tag-dead { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.tag-closed { background: #E5E7EB; color: #374151; border: 1px solid #D1D5DB; }

/* =========================================
   24. Order Management & Action Column Styling
========================================= */

.order-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.order-tabs::-webkit-scrollbar { display: none; }

.order-tab {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.order-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(15, 81, 50, 0.2);
}

.badge-count {
    background: #EF4444;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.contact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.quick-contact {
    background: transparent;
    border: 1px solid var(--border);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.quick-contact.call { color: var(--primary); }
.quick-contact.call:hover { background: var(--primary-light); border-color: var(--primary); }
.quick-contact.wa { color: #25D366; } 
.quick-contact.wa:hover { background: #DCF8C6; border-color: #25D366; }

.workflow-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.workflow-badge i { font-size: 1rem; }
.workflow-badge.pending { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.workflow-badge.confirmed { background: #E0F2FE; color: #0284C7; border: 1px solid #BAE6FD; }
.workflow-badge.ready { background: #F3E8FF; color: #9333EA; border: 1px solid #E9D5FF; }

/* -------------------------------------
   ACTION COLUMN BUTTON STACK (Fixed Width)
-------------------------------------- */
.order-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
    gap: 8px;
}

.btn-main-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; /* Center icon and text */
    gap: 6px;
    box-shadow: 0 4px 12px rgba(15, 81, 50, 0.3);
    transition: 0.2s;
    white-space: nowrap; /* Prevents text from breaking */
    min-width: 140px; /* Minimum width to maintain shape */
}

.btn-main-action:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.sub-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-square {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-icon-square:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-icon-square.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #FEE2E2;
}

.sleek-table tbody td {
    vertical-align: middle;
}
.sleek-table tbody td:last-child {
    vertical-align: top;
}