* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
        
    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: #f5f7fa;
        color: #333;
    }
        
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
        
.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
        
    .navbar h1 {
        font-size: 1.5rem;
        font-weight: 600;
    }

    .nav-links {
        display: flex;
        gap: 2rem;
        align-items: center;
    }

    .nav-links a {
        color: white;
        text-decoration: none;
        font-weight: 500;
        transition: opacity 0.3s;
    }

    .nav-links a:hover {
        opacity: 0.8;
    }

    .user-info {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .container {
        max-width: 1400px;
        margin: 2rem auto;
        padding: 0 2rem;
    }

    .messages {
        margin-bottom: 1rem;
    }

    .alert {
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    .alert-success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .alert-error {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

    .btn {
        padding: 0.6rem 1.5rem;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.3s;
        text-decoration: none;
        display: inline-block;
    }

    .btn-primary {
        background: #667eea;
        color: white;
    }

    .btn-primary:hover {
        background: #5568d3;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }

    .btn-success {
        background: #28a745;
        color: white;
    }

    .btn-danger {
        background: #dc3545;
        color: white;
    }

    .btn-warning {
        background: #ffc107;
        color: #333;
    }

    .card {
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .card-header {
        border-bottom: 2px solid #f0f0f0;
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }

    .card-header h2 {
        font-size: 1.5rem;
        color: #333;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        background: white;
    }

    th, td {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid #eee;
    }

    th {
        background: #f8f9fa;
        font-weight: 600;
        color: #555;
    }

    tr:hover {
        background: #f8f9fa;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: #555;
    }

    .form-control {
        width: 100%;
        padding: 0.75rem;
        border: 2px solid #e0e0e0;
        border-radius: 6px;
        font-size: 1rem;
        transition: border-color 0.3s;
    }

    .form-control:focus {
        outline: none;
        border-color: #667eea;
    }

    .badge {
        padding: 0.3rem 0.8rem;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 500;
    }

    .badge-success {
        background: #d4edda;
        color: #155724;
    }

    .badge-warning {
        background: #fff3cd;
        color: #856404;
    }

    .badge-danger {
        background: #f8d7da;
        color: #721c24;
    }

    @media print {
        .navbar, .btn, .no-print {
            display: none !important;
        }
    }
    /* LOGIN SECTION */
    .login-container {
    max-width: 450px;
    margin: 5rem auto;
    }

    .login-card {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    }

    .login-header {
    text-align: center;
    margin-bottom: 2rem;
    }

    .login-header h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    }


/* INDEX FILE SYLING */
    .pos-container {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 1.5rem;
    }
    
    .search-section {
        margin-bottom: 1.5rem;
    }
    
    .search-box {
        position: relative;
    }
    
    .search-box input {
        font-size: 1.1rem;
        padding: 1rem;
    }
    
    .search-results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 2px solid #667eea;
        border-top: none;
        max-height: 300px;
        overflow-y: auto;
        z-index: 100;
        display: none;
    }
    
    .search-result-item {
        padding: 1rem;
        border-bottom: 1px solid #eee;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .search-result-item:hover {
        background: #f8f9fa;
    }
    
    .search-result-item img {
        width: 50px;
        height: 50px;
        object-fit: cover;
        border-radius: 6px;
    }
    
    .cart-table img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
    }
    
    .cart-summary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 1.5rem;
        border-radius: 12px;
        margin-top: 1rem;
    }
    
    .summary-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
    
    .summary-row.total {
        font-size: 1.5rem;
        font-weight: bold;
        border-top: 2px solid rgba(255,255,255,0.3);
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .quantity-control {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .quantity-control button {
        width: 30px;
        height: 30px;
        border: none;
        background: #667eea;
        color: white;
        border-radius: 4px;
        cursor: pointer;
    }
    
    .quantity-control input {
        width: 60px;
        text-align: center;
        padding: 0.3rem;
    }
.profit-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.profit-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.profit-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.profit-item h4 {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.profit-item .amount {
    font-size: 2rem;
    font-weight: bold;
    color: #10b981;
}

.profit-item .sub {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

.profit-margin-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.margin-high {
    background: #d1fae5;
    color: #065f46;
}

.margin-medium {
    background: #fef3c7;
    color: #92400e;
}

.margin-low {
    background: #fee2e2;
    color: #b91c1c;
}

@media (max-width: 1100px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }   
    
    .nav-grid-container {
        min-width: unset;
        width: 100%;
    }
    
    .nav-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .user-info {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .navbar-brand img.nav-logo {
        height: 50px;
        max-width: 120px;
        padding: 4px 8px;
    }
    
    .business-name-main {
        font-size: 1rem;
    }
    
    .business-name-sub {
        font-size: 0.7rem;
    }
    
    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        gap: 4px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 1rem;
    }
    
    /* Responsive tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    /* Responsive stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .value {
        font-size: 1.5rem;
    }
    
    /* Responsive date filter */
    .filter-options {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
    
    .date-input-group {
        min-width: 100%;
    }
    
    /* Responsive modal */
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    /* Responsive buttons */
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-row {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .search-container {
        padding: 0.75rem;
    }
    
    .search-input {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}

/* ============ UNIVERSAL RESPONSIVE CSS ============ */
/* Add this to your style.css file */

/* Tablets and smaller desktops */
@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr !important;
    }
    
    .supplier-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    }
    
    .form-grid, .form-grid-3 {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* General */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1rem !important; }
    
    .container { padding: 0 8px !important; }
    .card { padding: 1rem !important; }
    
    /* Tables - make scrollable */
    .table-container, 
    div[style*="overflow-x: auto"],
    [style*="overflow-x: auto"] {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table { font-size: 0.8rem !important; }
    table th, table td { padding: 0.5rem !important; white-space: nowrap; }
    
    /* Stats grids */
    .stats-grid,
    .customer-stats,
    .supplier-stats,
    .stats-cards,
    .quick-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .stat-card { padding: 1rem !important; }
    .stat-card .value, .stat-value { font-size: 1.3rem !important; }
    .stat-card h3, .stat-label { font-size: 0.7rem !important; }
    
    /* Forms */
    .form-grid, .form-grid-3, .grid-2, .customer-form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .form-section { padding: 1rem !important; }
    .form-control { font-size: 0.9rem !important; padding: 0.6rem !important; }
    
    /* Buttons */
    .btn { padding: 0.5rem 1rem !important; font-size: 0.85rem !important; }
    .btn-sm { padding: 0.3rem 0.6rem !important; font-size: 0.75rem !important; }
    
    /* Search containers */
    .search-container { 
        padding: 0.75rem !important; 
        flex-direction: column !important; 
    }
    .search-input { 
        font-size: 0.9rem !important; 
        padding: 0.6rem !important; 
        border-radius: 25px !important;
    }
    
    /* Date filters */
    .date-filters { flex-direction: column !important; }
    .filter-options { flex-direction: column !important; }
    .filter-btn { width: 100% !important; text-align: center !important; }
    .date-input-group { min-width: 100% !important; }
    
    /* Action buttons */
    .action-buttons { 
        flex-direction: column !important; 
        gap: 0.25rem !important; 
    }
    
    /* Modals */
    .modal-content,
    .global-modal-content,
    .custom-modal-content { 
        width: 95% !important; 
        padding: 1rem !important; 
        margin: 10px !important;
    }
    
    /* Page headers */
    .page-header,
    .header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    /* Supplier cards */
    .supplier-grid { grid-template-columns: 1fr !important; }
    .supplier-card { padding: 1rem !important; }
    .supplier-stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
    
    /* Customer table specific */
    .customer-table th { display: none; }
    .customer-table td { 
        display: block; 
        text-align: right; 
        padding: 0.4rem !important;
    }
    .customer-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #666;
    }
    .customer-info { justify-content: flex-end; }
    
    /* POS page */
    .pos-container { grid-template-columns: 1fr !important; }
    .cart-table th, .cart-table td { padding: 0.5rem !important; }
    .quantity-control button { width: 25px !important; height: 25px !important; }
    .quantity-control input { width: 45px !important; }
    
    /* Payment options */
    .payment-type-options,
    .payment-methods { 
        flex-direction: column !important; 
        gap: 0.5rem !important;
    }
    
    .payment-type-option,
    .payment-method-option {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
    }
    
    /* Receipt */
    .receipt-container { padding: 1rem !important; }
    .receipt-info { grid-template-columns: 1fr !important; gap: 1rem !important; }
    .receipt-header h1 { font-size: 1.5rem !important; }
    
    /* Dashboard */
    .revenue-card { padding: 1.5rem !important; }
    .revenue-card .amount { font-size: 1.8rem !important; }
    
    /* Profit section */
    .profit-section > div:first-child {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Refund request */
    .info-note { font-size: 0.85rem !important; padding: 0.75rem !important; }
    .recent-sales-grid,
    .all-sales-grid { grid-template-columns: 1fr !important; }
    .sale-card { padding: 0.75rem !important; }
    .sale-info { grid-template-columns: 1fr !important; }
    
    /* Saved carts */
    .carts-grid { grid-template-columns: 1fr !important; }
    
    /* Staff table */
    .staff-table th:nth-child(3),
    .staff-table td:nth-child(3),
    .staff-table th:nth-child(4),
    .staff-table td:nth-child(4) { display: none; }
    
    /* Login page */
    .login-header-wrapper { margin: -10px -10px 15px -10px !important; }
    .login-header-content { 
        flex-direction: column !important; 
        gap: 1rem !important; 
        padding: 15px !important;
    }
    .login-header-logo { 
        height: 70px !important; 
        max-width: 200px !important; 
    }
    .login-header-text h1 { font-size: 1.8rem !important; }
    .login-header-text h2 { font-size: 1.3rem !important; }
    .login-section { padding: 1.5rem !important; }
    .btn-login { font-size: 1rem !important; padding: 1rem !important; }
    .login-footer-wrapper { padding: 1.5rem 0 !important; margin: 15px -10px -10px -10px !important; }
    .footer-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
    .footer-contact { grid-template-columns: 1fr !important; }
    .footer-slogan { font-size: 1.2rem !important; }
    .footer-address p { font-size: 1rem !important; }
    
    /* Hide some columns on mobile */
    .hide-mobile { display: none !important; }
}

/* Small phones */
@media (max-width: 480px) {
    .stats-grid,
    .customer-stats,
    .supplier-stats,
    .stats-cards,
    .quick-stats {
        grid-template-columns: 1fr !important;
    }
    
    .stat-item { padding: 0.75rem !important; }
    .stat-item-value { font-size: 1rem !important; }
    
    .btn { 
        padding: 0.4rem 0.8rem !important; 
        font-size: 0.8rem !important; 
        border-radius: 15px !important;
    }
    
    body { padding: 5px !important; }
    
    .card { 
        padding: 0.75rem !important; 
        border-radius: 8px !important; 
    }
    
    input, select, textarea, .form-control {
        font-size: 16px !important; /* Prevent iOS zoom */
    }
    
    .receipt-table th, 
    .receipt-table td { 
        padding: 0.3rem !important; 
        font-size: 0.7rem !important; 
    }
    
    .cart-summary { padding: 1rem !important; }
    .summary-row { font-size: 0.9rem !important; }
    .summary-row.total { font-size: 1.1rem !important; }
}