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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Header Styles */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 50px;
    height: 50px;
    margin-right: 1rem;
    object-fit: contain;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* Navigation Styles */
.sidebar {
    width: 250px;
    background-color: #34495e;
    color: white;
    padding: 1rem 0;
    flex-shrink: 0;
}

.nav-menu {
    list-style: none;
}

.nav-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 1.1rem;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background-color: #2c3e50;
}

/* Main Content Styles */
.main {
    flex: 1;
    padding: 2rem;
    background-color: #ecf0f1;
}

/* Form Styles */
.form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.touch-input {
    font-size: 1.2rem;
    padding: 1rem;
    min-height: 50px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    background-color: #fff;
}

.touch-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    min-height: 50px;
    font-weight: bold;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: auto;
}

/* Table Styles */
.table-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-form {
    padding: 2rem;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: bold;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Dashboard Styles */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: bold;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dashboard-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stock-warning {
    color: #e74c3c;
    font-weight: bold;
}

.low-stock-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.recent-sales li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.sale-amount {
    font-weight: bold;
    color: #27ae60;
}

.sale-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* POS Styles */
.pos-container {
    max-width: 1400px;
    margin: 0 auto;
}

.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.product-selection {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.product-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.product-no-image {
    width: 100%;
    height: 120px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.quantity-selector {
    margin: 0.5rem 0;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
}

.cart-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.cart-item-details {
    flex: 1;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-total {
    font-weight: bold;
    color: #2c3e50;
}

.cart-totals {
    border-top: 2px solid #ddd;
    padding-top: 1rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.total-row.grand-total {
    font-weight: bold;
    font-size: 1.2rem;
    border-top: 2px solid #ddd;
    margin-top: 0.5rem;
}

.total-row.change-amount {
    font-weight: bold;
    color: #27ae60;
}

.cart-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.cart-actions .btn {
    flex: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

/* Image Styles */
.item-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
}

.image-preview {
    margin-top: 0.5rem;
}

.image-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.logo-preview {
    margin-top: 1rem;
}

.logo-preview-img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.no-image {
    width: 50px;
    height: 50px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-badge.pending {
    background-color: #ffeaa7;
    color: #d35400;
}

.status-badge.completed {
    background-color: #d4edda;
    color: #155724;
}

/* Report Styles */
.report-filters {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.report-summary {
    margin-bottom: 1.5rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.summary-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.summary-card p {
    font-size: 2rem;
    font-weight: bold;
}

.report-details {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* GRN Styles */
.grn-items {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-top: 1.5rem;
}

.grn-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Virtual Keyboard */
.virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #f8f9fa;
    padding: 1rem;
    border-top: 1px solid #ddd;
    display: none;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.keyboard-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.keyboard-key {
    padding: 1rem;
    margin: 0.25rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s;
}

.keyboard-key:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.keyboard-key.enter {
    background-color: #3498db;
    color: white;
}

.keyboard-key.enter:hover {
    background-color: #2980b9;
}

.keyboard-key.clear {
    background-color: #e74c3c;
    color: white;
}

.keyboard-key.clear:hover {
    background-color: #c0392b;
}

.keyboard-key.hide {
    background-color: #95a5a6;
    color: white;
}

.keyboard-key.hide:hover {
    background-color: #7f8c8d;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .stats-grid,
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 1rem;
    }
    
    .stats-grid,
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .product-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .keyboard-key {
        min-width: 40px;
        padding: 0.75rem;
        font-size: 1rem;
    }
}