/* Admin & POS General Styles */
:root {
    --bg-light: #f4f6f9;
    --sidebar-bg: #2C5E3B;
    /* ONE COFFEE dark green */
    --sidebar-color: #fff;
    --primary-color: #2C5E3B;
    --secondary-color: #6F4E37;
    /* Brown */
    --accent-color: #e67e22;
    --danger-color: #e74c3c;
    --text-color: #333;
    --border-color: #e0e0e0;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-light);
    color: var(--text-color);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Sidebar - Floating Auto-Hide */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: left 0.3s ease-in-out;
}

.sidebar.open {
    left: 0;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 998;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}

.sidebar-toggle-btn:hover {
    background: var(--secondary-color);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar-logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-logo img {
    max-height: 50px;
    width: auto;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-left: 4px solid var(--secondary-color);
}

/* Add custom POS layout overrides to split screen layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-light);
}

.pos-layout {
    flex-direction: row;
    /* Overrides column for POS screen */
}

/* POS Screen - Left Side */
.pos-products {
    flex: 2;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    padding: 10px 15px;
    border-radius: 20px;
    flex: 0.5;
}

.search-bar i {
    color: #888;
    margin-right: 10px;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}

.category-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.cat-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
}

.cat-btn.active,
.cat-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;
}

.pos-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.pos-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.pos-item:active {
    transform: scale(0.98);
}

.item-img {
    height: 90px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-light);
}

.item-details {
    padding: 12px;
}

.item-details h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-details .price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* POS Screen - Right Side Cart */
.pos-cart {
    flex: 1;
    min-width: 350px;
    max-width: 400px;
    background: #fff;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-size: 1.2rem;
}

.cart-header span {
    font-size: 0.9rem;
    color: #888;
}

.customer-input {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.customer-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart-msg {
    text-align: center;
    color: #999;
    margin-top: 50px;
    font-style: italic;
}

/* Individual Cart Item */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #666;
    font-size: 0.85rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--bg-light);
}

.item-qty {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.cart-item-subtotal {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
    color: var(--primary-color);
}

.cart-summary {
    padding: 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #555;
}

.summary-line.total {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 10px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.payment-methods {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.pay-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.pay-btn.active {
    border-color: var(--primary-color);
    background: rgba(44, 94, 59, 0.05);
    /* light green */
    color: var(--primary-color);
}

.pay-btn i {
    font-size: 1.2rem;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-checkout:hover {
    background: #224a2e;
}

.btn-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Dashboard Basic Container (For other admin pages) */
.page-container {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8rem;
    color: var(--text-color);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
}

.btn-primary:hover {
    background: #224a2e;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}

.data-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    border-collapse: collapse;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: #fdfdfd;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 20px;
}

.success-icon {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 15px;
}

/* Action Buttons Grid */
.action-btns {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
}

.btn-edit {
    background: #3498db;
}

.btn-del {
    background: #e74c3c;
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
    .pos-layout {
        flex-direction: column;
    }

    .pos-cart {
        min-width: 100%;
        max-width: 100%;
        border-left: none;
        border-top: 2px solid var(--border-color);
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .item-img {
        height: 80px;
    }

    .item-details {
        padding: 8px;
    }

    .item-details h4 {
        font-size: 0.85rem;
    }

    .item-details .price {
        font-size: 0.95rem;
    }

    /* Make the page container responsive */
    .page-container {
        padding: 15px;
    }

    .pos-products {
        padding: 15px;
    }

    /* Hide some info on topbar to fit search */
    .user-info {
        display: none;
    }

    /* Shrink table font size on mobile */
    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 5px;
    }

    .status-badge {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
}

/* Print Responsive Overrides */
@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .sidebar-toggle-btn,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
    }

    .page-header form,
    .page-header button {
        display: none !important;
    }

    .action-btns,
    table th:last-child,
    table td:last-child {
        display: none !important;
    }

    .status-badge {
        border: 1px solid #000;
        color: #000 !important;
        background: transparent !important;
    }

    .data-table {
        border: 1px solid #ddd;
    }

    .data-table th {
        background: #f8f9fa !important;
        color: #333 !important;
        border-bottom: 2px solid #ddd;
    }
}