@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --primary: #FF2E93;
    --primary-hover: #e0006f;
    --secondary: #00D2FF;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --text-main: #1a1c23;
    --text-muted: #6e7687;
    --success: #10b981;
    --warning: #f59e0b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body {
    background: var(--bg); color: var(--text-main);
    height: 100vh; overflow: hidden; /* Lock body scrolling to fit tablet strictly */
    display: flex; flex-direction: column;
}

.container {
    max-width: 100%; width: 100%; height: 100vh;
    padding: 10px; margin: 0 auto;
    display: flex; flex-direction: column;
}

/* Header & Nav */
.header {
    background: var(--card-bg); border-radius: 8px; padding: 10px 15px;
    margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center;
    border: 1px solid var(--border);
}
.header h1 { font-size: 18px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 10px; }
.order-badge { background: var(--text-main); color: white; padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 14px; }
.top-nav-buttons { display: flex; gap: 8px; margin-bottom: 10px; }
.btn-nav { flex: 1; padding: 8px; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-nav-new { background: var(--secondary); color: var(--text-main); }
.btn-nav-active { background: var(--warning); color: white; }
.btn-nav-closed { background: var(--success); color: white; }

input[type="text"], input[type="number"] {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; width: 100%; margin-bottom: 10px;
}
input:focus { border-color: var(--secondary); outline: none; }

/* Grid Candy List */
.candy-list {
    flex: 1; overflow-y: auto; display: grid; gap: 4px;
    grid-template-columns: 1fr 1fr;
    align-content: flex-start; padding-right: 2px; margin-bottom: 5px;
}

/* Scrollbar styling for a cleaner look */
.candy-list::-webkit-scrollbar { width: 3px; }
.candy-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.candy-item {
    background: var(--card-bg); border: 1px solid var(--border); padding: 12px 15px;
    border-radius: 10px; display: flex; justify-content: space-between; align-items: center;
}
.candy-info { flex: 1; line-height: 1.3; }
.candy-name { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.candy-rate { font-size: 16px; color: var(--text-muted); }

.qty-controls {
    display: flex; align-items: center; gap: 8px; margin: 0 8px;
}
.qty-btn {
    width: 44px; height: 44px; border: none; border-radius: 8px;
    background: var(--border); color: var(--text-main); font-size: 24px; font-weight: bold; cursor: pointer;
}
.qty-btn:active { background: #cbd5e1; }
.qty-val { font-size: 22px; font-weight: 700; width: 30px; text-align: center; }
.item-amount { font-size: 20px; font-weight: 700; color: var(--text-main); width: 70px; text-align: right; }

/* Fixed Footer Checkout */
.checkout-panel {
    background: var(--card-bg); border-top: 1px solid var(--border); padding: 8px 10px;
    border-radius: 8px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 15px; /* Added margin to push it slightly up from the bottom */
}
.totals {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 16px; font-weight: 800;
}
.actions { display: flex; gap: 6px; }
.btn {
    flex: 1; padding: 10px; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 700; cursor: pointer; color: white;
}
.btn-place { background: var(--text-main); }
.btn-upi { background: var(--primary); }
.btn-cash { background: var(--success); }

/* Utility */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-content { background: var(--card-bg); padding: 15px; border-radius: 8px; width: 90%; max-width: 400px; max-height: 80vh; overflow-y: auto; border: 1px solid var(--border); }
.active-order-row { padding: 10px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.active-order-row:hover { background: var(--bg); }

/* Admin and Reports */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); }
.summary-cards { display: flex; gap: 10px; margin-bottom: 10px; }
.card { flex: 1; background: var(--card-bg); padding: 15px; border-radius: 8px; border: 1px solid var(--border); text-align: center; }
.card h3 { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.card .val { font-size: 20px; font-weight: 700; }

@media screen and (min-width: 768px) {
    .actions { flex-direction: row; }
}
