:root {
    --primary: #3498db;
    --secondary: #2c3e50;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #17a2b8;
    --light: #ecf0f1;
    --dark: #34495e;
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Fullscreen mode */
body.fullscreen {
    overflow: hidden;
}

body.fullscreen .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
}

body.fullscreen .main-content {
    margin-left: 0;
    width: 100%;
}

body.fullscreen .header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

body.fullscreen .content {
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    background: var(--primary);
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--light);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary);
}

.sidebar-menu i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
}

/* Header Styles */
.header {
    height: var(--header-height);
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left h1 {
    font-size: 1.5rem;
    color: var(--secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 10px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
}

/* Content Area Styles */
.content {
    padding: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.2rem;
    color: var(--secondary);
}

.card-body {
    padding: 20px;
}

/* Dashboard Styles */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
    color: white;
}

.stat-info h4 {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 5px;
}

.stat-info h2 {
    font-size: 1.8rem;
    color: var(--secondary);
}

.icon-sales {
    background: var(--success);
}

.icon-products {
    background: var(--primary);
}

.icon-customers {
    background: var(--warning);
}

.icon-revenue {
    background: var(--danger);
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--secondary);
}

table tr:hover {
    background: #f8f9fa;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--secondary);
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--danger);
}

.btn-warning {
    background: var(--warning);
}

.btn-info {
    background: var(--info);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* Sales System Styles */
.sales-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 120px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.product-price {
    color: var(--success);
    font-weight: 600;
}

.cart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--secondary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Barcode Scanner Styles */
.scanner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

#barcode-scanner {
    width: 100%;
    max-width: 500px;
    height: 300px;
    border: 2px dashed #ddd;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sales-container {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .header-right {
        gap: 10px;
    }
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 30px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--secondary);
    margin-bottom: 10px;
}

.login-header p {
    color: #777;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #777;
}

/* Role Badges */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.badge-employee {
    background: rgba(52, 152, 219, 0.2);
    color: var(--primary);
}

.badge-success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
}

/* QR Code Display */
.qr-display {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.qr-code {
    width: 200px;
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
}

.qr-code canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Barcode Display */
.barcode-display {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.barcode {
    width: 300px;
    height: 100px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
}

.barcode svg {
    max-width: 100%;
    height: auto;
}

/* Alert Styles */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Payment Methods */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.payment-method {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(52, 152, 219, 0.1);
}

.payment-method i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--primary);
}

/* Scanner Animation */
.scanner-animation {
    position: relative;
    overflow: hidden;
}

.scanner-line {
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--primary);
    top: 50%;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        top: 10%;
    }

    50% {
        top: 90%;
    }

    100% {
        top: 10%;
    }
}

/* Receipt Styles */
.receipt {
    background: white;
    width: 100%;
    max-width: 300px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    border: 1px solid #ddd;
    margin: 0 auto;
    text-align: center;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 10px;
}

.receipt-items {
    margin-bottom: 15px;
    text-align: left;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.receipt-total {
    border-top: 1px dashed #ddd;
    padding-top: 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.8rem;
    color: #777;
}

/* Fullscreen Button */
.fullscreen-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--secondary);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .receipt,
    .receipt * {
        visibility: visible;
    }

    .receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: none;
    }
}

/* Profile Picture Upload */
.profile-pic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.profile-pic-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--primary);
}

.profile-pic-preview i {
    font-size: 3rem;
    color: #ccc;
}

.profile-pic-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-pic-upload input {
    display: none;
}

/* Settings Styles */
.settings-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.settings-group {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.settings-group h3 {
    margin-bottom: 15px;
    color: var(--secondary);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Sidebar Toggle in Fullscreen */
.sidebar-toggle-fullscreen {
    display: none;
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1001;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.fullscreen .sidebar-toggle-fullscreen {
    display: flex;
}

body.fullscreen .sidebar.active {
    transform: translateX(0);
    z-index: 1002;
}

/* Overlay for sidebar in fullscreen */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

body.fullscreen .sidebar-overlay.active {
    display: block;
}
