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

:root {
    --primary: #6F4E37;
    --primary-dark: #4A3428;
    --primary-light: #8B6B55;
    --secondary: #D4A574;
    --accent: #C9A961;
    --success: #27ae60;
    --success-dark: #219a52;
    --warning: #f39c12;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --info: #3498db;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e9ecef;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}

body {
    font-family: 'Kantumruy Pro', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-logo h1 {
    color: var(--primary);
    font-size: 32px;
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-light);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Kantumruy Pro', sans-serif;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 12px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Kantumruy Pro', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-demo {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 13px;
}

.login-demo i {
    margin-right: 5px;
}

/* App Screen */
.app-screen {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header i {
    font-size: 32px;
}

.sidebar-header span {
    font-size: 22px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: var(--accent);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 14px;
}

.user-info i {
    font-size: 24px;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 25px;
}

.page {
    animation: slideUp 0.3s ease;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.page-header h1 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-action:hover {
    background: var(--primary-dark);
}

.btn-action-primary {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-action-primary:hover {
    background: var(--success-dark);
}

.date-filter,
.period-select,
.filter-select {
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-date-range.hidden {
    display: none;
}

.custom-date-range span {
    color: var(--text-light);
    font-size: 14px;
}

.report-period-title {
    background: var(--card-bg);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    color: var(--text);
}

.report-period-title i {
    color: var(--primary);
    font-size: 20px;
}

/* POS Container */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 130px);
}

.products-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 20px;
}

.search-bar i {
    color: var(--text-light);
    font-size: 18px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    outline: none;
}

.categories {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 18px;
    background: var(--bg);
    color: var(--text);
    border: 2px solid transparent;
    border-radius: 25px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.category-btn:hover {
    background: var(--primary-light);
    color: white;
}

.category-btn.active {
    background: var(--primary);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
}

.product-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.product-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.product-card .product-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 10px;
}

.product-card .product-icon i {
    font-size: 50px;
    color: var(--primary);
}

.product-card h3 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.product-card .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

.product-card .sale-price {
    color: var(--danger);
    font-weight: 700;
    font-size: 14px;
    margin-top: 5px;
}

.product-card .original-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 12px;
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card .stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: var(--success);
    color: white;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

/* Cart Section */
.cart-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.cart-header h2 {
    color: var(--primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#cartCount {
    font-size: 14px;
    color: var(--text-light);
}

.btn-clear {
    padding: 8px 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clear:hover {
    background: var(--danger-dark);
}

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

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-cart i {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 10px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-icon i {
    color: white;
    font-size: 24px;
}

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

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text);
}

.cart-item-price {
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: var(--primary-dark);
}

.cart-item-qty {
    font-weight: 600;
    min-width: 25px;
    text-align: center;
    font-size: 14px;
}

.cart-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--danger);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.cart-item-remove:hover {
    background: var(--danger-dark);
}

.cart-summary {
    border-top: 2px solid var(--border);
    padding-top: 15px;
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.discount-row,
.sale-row {
    color: var(--danger);
}

.discount-input,
.sale-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount-input label,
.sale-input label {
    font-size: 13px;
    color: var(--text-light);
}

.discount-input input,
.sale-input input {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: right;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
}

.discount-amount {
    font-weight: 600;
}

.summary-row.total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--border);
}

.cart-actions {
    margin-top: auto;
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Kantumruy Pro', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-checkout:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* Items Management */
.items-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.search-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg);
    border-radius: 10px;
}

.search-box i {
    color: var(--text-light);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    outline: none;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.item-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.item-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.item-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg);
}

.item-card-icon {
    width: 100%;
    height: 160px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-card-icon i {
    color: white;
    font-size: 64px;
}

.item-card-body {
    padding: 15px;
}

.item-card-body h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text);
}

.item-card-body .category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 15px;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.item-card-body .price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.item-card-body .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
}

.item-card-body .sale-price {
    color: var(--danger);
    font-weight: 700;
    font-size: 16px;
}

.item-card-body .original-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 13px;
}

.item-card-actions {
    display: flex;
    gap: 8px;
}

.item-card-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-edit-item {
    background: var(--warning);
    color: white;
}

.btn-edit-item:hover {
    background: #e67e22;
}

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

.btn-delete-item:hover {
    background: var(--danger-dark);
}

/* Orders Table */
.orders-table-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    background: var(--primary);
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.orders-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.orders-table tr:hover {
    background: var(--bg);
}

.btn-view-order {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.btn-view-order:hover {
    background: var(--primary-dark);
}

/* Reports */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reports-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.report-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--primary);
}

.report-card.primary { border-left-color: var(--primary); }
.report-card.success { border-left-color: var(--success); }
.report-card.warning { border-left-color: var(--warning); }
.report-card.info { border-left-color: var(--info); }

.report-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.report-card.primary .report-icon {
    background: rgba(111, 78, 55, 0.1);
    color: var(--primary);
}

.report-card.success .report-icon {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

.report-card.warning .report-icon {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

.report-card.info .report-icon {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info);
}

.report-info h4 {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.report-info h2 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
}

.reports-content {
    display: grid;
    gap: 20px;
}

.report-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.report-section h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-box {
    padding: 20px;
    background: var(--bg);
    border-radius: 10px;
    text-align: center;
}

.stat-box label {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.stat-box span {
    display: block;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

.top-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg);
    border-radius: 10px;
}

.top-product-rank {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.top-product-info {
    flex: 1;
}

.top-product-info h4 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 4px;
}

.top-product-info p {
    font-size: 13px;
    color: var(--text-light);
}

.top-product-sales {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

/* Users Table */
.users-table-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: var(--primary);
    color: white;
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.users-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.users-table tr:hover {
    background: var(--bg);
}

.role-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.role-badge.admin {
    background: rgba(111, 78, 55, 0.1);
    color: var(--primary);
}

.role-badge.manager {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info);
}

.role-badge.staff {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

/* Modal */
.modal-content {
    background: var(--card-bg);
    border-radius: 15px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-content.checkout-modal {
    max-width: 850px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    color: var(--primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 2px solid var(--border);
}

.btn-cancel {
    padding: 12px 25px;
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-save,
.btn-confirm {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save:hover,
.btn-confirm:hover {
    background: var(--primary-dark);
}

/* Image Upload */
.image-upload-group .image-upload {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.image-upload-group .image-upload:hover {
    border-color: var(--primary);
    background: rgba(111, 78, 55, 0.02);
}

.image-upload input[type="file"] {
    display: none;
}

.upload-placeholder {
    cursor: pointer;
    padding: 30px 20px;
}

.upload-placeholder i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-placeholder p {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 5px;
}

.upload-placeholder span {
    color: var(--text-light);
    font-size: 13px;
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid var(--border);
}

.image-preview .remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.image-preview .remove-image:hover {
    background: var(--danger-dark);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Status Toggle */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.status-toggle label {
    cursor: pointer;
    font-weight: 500;
}

/* Permissions */
.permissions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.permission-item span {
    font-size: 14px;
}

/* Checkout Content */
.checkout-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.receipt-section {
    background: var(--bg);
    padding: 20px;
    border-radius: 10px;
}

.receipt {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

.receipt-header h3 {
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 5px;
}

.receipt-header p {
    font-size: 12px;
    color: var(--text-light);
    margin: 3px 0;
}

.receipt-number,
.receipt-date,
.receipt-server {
    font-size: 12px;
    color: var(--text-light);
    margin: 5px 0;
}

.receipt-divider {
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        var(--border) 0,
        var(--border) 10px,
        transparent 10px,
        transparent 20px
    );
    margin: 15px 0;
}

.receipt-items {
    margin-bottom: 15px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.receipt-item-name {
    flex: 1;
}

.receipt-item-qty {
    color: var(--text-light);
    margin: 0 10px;
}

.receipt-item-price {
    font-weight: 600;
    color: var(--primary);
}

.receipt-totals {
    padding-top: 10px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.receipt-row.discount {
    color: var(--danger);
}

.receipt-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--border);
}

.payment-section {
    background: var(--bg);
    padding: 20px;
    border-radius: 10px;
}

.payment-section h4 {
    color: var(--text);
    font-size: 16px;
    margin-bottom: 15px;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.payment-method {
    padding: 15px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.payment-method i {
    font-size: 24px;
    color: var(--primary);
}

.payment-method span {
    font-size: 13px;
    color: var(--text);
}

.payment-method.active {
    border-color: var(--primary);
    background: rgba(111, 78, 55, 0.05);
}

.payment-method.active i {
    color: var(--primary);
}

.payment-form .form-group {
    margin-bottom: 15px;
}

.payment-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Kantumruy Pro', sans-serif;
}

.change-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 16px;
}

.change-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
}

.change-label i {
    color: var(--warning);
}

.change-display span:last-child {
    color: var(--success);
    font-weight: 700;
    font-size: 20px;
}

/* Order View */
.order-view {
    padding: 10px;
}

.order-view-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.order-info-item label {
    font-size: 12px;
    color: var(--text-light);
}

.order-info-item span {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.order-view-items {
    margin-bottom: 20px;
}

.order-view-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
}

.order-view-totals {
    padding-top: 15px;
    border-top: 2px solid var(--border);
}

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

.toast.hidden {
    display: none;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast i {
    font-size: 20px;
}

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

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .pos-container {
        grid-template-columns: 1fr;
    }

    .cart-section {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        width: 380px;
        z-index: 200;
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }

    .pos-container {
        height: auto;
    }

    .cart-section {
        position: relative;
        width: 100%;
        height: auto;
    }

    .checkout-content {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .reports-summary {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .receipt,
    .receipt * {
        visibility: visible;
    }

    .receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }
}

/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Large Devices (Desktops, 1200px and up) */
@media (min-width: 1200px) {
    .main-content {
        padding: 30px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Medium Devices (Tablets, 768px to 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
        padding: 20px;
    }

    .pos-container {
        grid-template-columns: 1fr 350px;
        gap: 15px;
    }

    .cart-section {
        width: 350px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .reports-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Devices (Tablets in portrait, 576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .pos-container {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
    }

    .cart-section {
        position: relative;
        width: 100%;
        height: auto;
        order: -1;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .checkout-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .checkout-modal {
        max-width: 95%;
    }

    .reports-summary {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra Small Devices (Phones, less than 576px) */
@media (max-width: 575px) {
    /* Login Screen */
    .login-screen {
        padding: 15px;
    }

    .login-container {
        padding: 25px 20px;
        max-width: 100%;
    }

    .login-logo i {
        font-size: 48px;
    }

    .login-logo h1 {
        font-size: 26px;
    }

    .login-logo p {
        font-size: 13px;
    }

    .btn-login {
        padding: 12px;
        font-size: 14px;
    }

    /* Sidebar - Convert to bottom nav or hamburger */
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        border-top: 2px solid rgba(255,255,255,0.2);
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px 0;
        overflow-x: auto;
    }

    .nav-item {
        flex-direction: column;
        padding: 8px 12px;
        font-size: 10px;
        gap: 4px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left: none;
        border-bottom-color: var(--accent);
        background: transparent;
    }

    .nav-item i {
        font-size: 20px;
    }

    .nav-item span {
        display: block;
        font-size: 9px;
    }

    .sidebar-footer {
        display: none;
    }

    /* Main Content */
    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-action,
    .btn-action-primary {
        padding: 8px 15px;
        font-size: 13px;
        flex: 1;
        justify-content: center;
    }

    .date-filter,
    .period-select,
    .filter-select {
        width: 100%;
        font-size: 13px;
    }

    /* POS Container */
    .pos-container {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
    }

    .products-section {
        padding: 15px;
        border-radius: 12px;
    }

    .search-bar {
        padding: 10px 12px;
        margin-bottom: 15px;
    }

    .search-bar input {
        font-size: 13px;
    }

    .categories {
        gap: 8px;
        margin-bottom: 15px;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .category-btn {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        border-radius: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card {
        padding: 12px;
        border-radius: 10px;
    }

    .product-card img,
    .product-card .product-icon {
        width: 70px;
        height: 70px;
    }

    .product-card .product-icon i {
        font-size: 35px;
    }

    .product-card h3 {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .product-card .price {
        font-size: 14px;
    }

    /* Cart Section */
    .cart-section {
        position: fixed;
        right: 0;
        top: 0;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        z-index: 500;
        border-radius: 0;
        padding: 15px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .cart-section.active {
        transform: translateX(0);
    }

    .cart-header h2 {
        font-size: 18px;
    }

    .cart-item {
        padding: 10px;
        gap: 10px;
    }

    .cart-item-image,
    .cart-item-icon {
        width: 50px;
        height: 50px;
    }

    .cart-item-info h4 {
        font-size: 13px;
    }

    .cart-item-price {
        font-size: 12px;
    }

    .qty-btn,
    .cart-item-remove {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .cart-item-qty {
        min-width: 20px;
        font-size: 13px;
    }

    .summary-row {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .summary-row.total {
        font-size: 18px;
        margin-top: 12px;
        padding-top: 12px;
    }

    .discount-input input,
    .sale-input input {
        width: 60px;
        font-size: 13px;
    }

    .btn-checkout {
        padding: 14px;
        font-size: 16px;
    }

    /* Items Management */
    .search-filter {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .search-box {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .item-card {
        border-radius: 10px;
    }

    .item-card-image,
    .item-card-icon {
        height: 120px;
    }

    .item-card-icon i {
        font-size: 48px;
    }

    .item-card-body {
        padding: 12px;
    }

    .item-card-body h3 {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .item-card-body .category-tag {
        font-size: 10px;
        padding: 3px 8px;
    }

    .item-card-body .price {
        font-size: 15px;
    }

    .item-card-actions button {
        padding: 8px;
        font-size: 12px;
    }

    /* Orders Table */
    .orders-table-container {
        padding: 15px;
        overflow-x: scroll;
    }

    .orders-table {
        min-width: 800px;
    }

    .orders-table th,
    .orders-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .btn-view-order {
        padding: 5px 10px;
        font-size: 11px;
    }

    /* Reports */
    .report-period-title {
        padding: 12px 15px;
        font-size: 14px;
    }

    .reports-summary {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .report-card {
        padding: 20px;
        gap: 15px;
    }

    .report-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .report-info h4 {
        font-size: 13px;
    }

    .report-info h2 {
        font-size: 22px;
    }

    .report-section {
        padding: 20px 15px;
    }

    .report-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-box {
        padding: 15px;
    }

    .stat-box label {
        font-size: 12px;
    }

    .stat-box span {
        font-size: 18px;
    }

    .top-products {
        gap: 10px;
    }

    .top-product-item {
        padding: 12px;
        gap: 12px;
    }

    .top-product-rank {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .top-product-info h4 {
        font-size: 13px;
    }

    .top-product-info p {
        font-size: 12px;
    }

    .top-product-sales {
        font-size: 16px;
    }

    /* Users Table */
    .users-table-container {
        padding: 15px;
        overflow-x: scroll;
    }

    .users-table {
        min-width: 700px;
    }

    .users-table th,
    .users-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .role-badge {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 95vh;
    }

    .modal-content.checkout-modal {
        max-width: 100%;
        max-height: 100vh;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        padding: 15px;
        flex-direction: column-reverse;
    }

    .btn-cancel,
    .btn-save,
    .btn-confirm {
        width: 100%;
        padding: 12px;
    }

    /* Checkout Modal */
    .checkout-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .receipt-section {
        padding: 15px;
    }

    .receipt {
        padding: 15px;
    }

    .receipt-header h3 {
        font-size: 18px;
    }

    .receipt-item {
        font-size: 12px;
    }

    .payment-section {
        padding: 15px;
    }

    .payment-section h4 {
        font-size: 14px;
    }

    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .payment-method {
        padding: 12px;
    }

    .payment-method i {
        font-size: 20px;
    }

    .payment-method span {
        font-size: 11px;
    }

    .change-display {
        font-size: 14px;
        padding: 12px;
    }

    .change-display span:last-child {
        font-size: 18px;
    }

    /* Order View Modal */
    .order-view-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .order-info-item {
        flex-direction: row;
        justify-content: space-between;
    }

    .order-info-item label {
        font-size: 11px;
    }

    .order-info-item span {
        font-size: 13px;
    }

    .order-view-item {
        padding: 8px;
        font-size: 12px;
    }

    /* Form Elements */
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 13px;
    }

    .permissions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .permission-item {
        padding: 10px;
        font-size: 13px;
    }

    .image-preview img {
        max-width: 150px;
        max-height: 150px;
    }

    /* Toast */
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 12px 18px;
        font-size: 13px;
    }

    .toast i {
        font-size: 18px;
    }

    /* Custom Scrollbar for mobile */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.1);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--primary-light);
        border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }
}

/* Very Small Devices (320px to 375px) */
@media (max-width: 375px) {
    .login-logo i {
        font-size: 40px;
    }

    .login-logo h1 {
        font-size: 22px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .nav-item {
        padding: 6px 8px;
        font-size: 9px;
    }

    .nav-item i {
        font-size: 18px;
    }
}

/* Landscape orientation on small devices */
@media (max-width: 767px) and (orientation: landscape) {
    .sidebar {
        width: 60px;
        height: 100vh;
        position: fixed;
        bottom: auto;
    }

    .sidebar-header span,
    .nav-item span,
    .user-info div {
        display: none;
    }

    .sidebar-header {
        display: flex;
        justify-content: center;
        padding: 15px 0;
    }

    .sidebar-nav {
        flex-direction: column;
        padding: 10px 0;
    }

    .nav-item {
        flex-direction: row;
        justify-content: center;
        padding: 12px 0;
    }

    .nav-item i {
        font-size: 20px;
    }

    .main-content {
        margin-left: 60px;
        margin-bottom: 0;
    }

    .cart-section {
        max-width: 280px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-action,
    .btn-action-primary,
    .btn-checkout,
    .btn-save,
    .btn-confirm,
    .btn-cancel,
    .category-btn,
    .payment-method {
        min-height: 44px;
    }

    .qty-btn,
    .cart-item-remove,
    .btn-view-order {
        min-width: 44px;
        min-height: 44px;
    }

    .nav-item {
        min-height: 48px;
    }

    input,
    select,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* High DPI / Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card,
    .item-card,
    .report-card {
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (optional - can be activated) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode support */
    /*
    :root {
        --bg: #1a1a1a;
        --card-bg: #2d2d2d;
        --text: #e0e0e0;
        --text-light: #a0a0a0;
        --border: #404040;
    }
    */
}
