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

:root {
    --brown: #5D4037;
    --brown-light: #8D6E63;
    --cream: #FFF8E1;
    --orange: #FF8F00;
    --orange-light: #FFB300;
    --green: #43A047;
    --blue: #1E88E5;
    --yellow: #FDD835;
    --gray: #9E9E9E;
    --text: #3E2723;
    --bg: #EFEBE9;
    --card: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: var(--brown);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

header .back {
    color: var(--cream);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
}

header .back:hover {
    opacity: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Cards */
.card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    min-height: 44px;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary:hover {
    background: var(--orange-light);
}

.btn-success {
    background: var(--green);
    color: white;
}

.btn-blue {
    background: var(--blue);
    color: white;
}

.btn-gray {
    background: var(--gray);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    min-height: 36px;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: var(--yellow);
    color: #5D4037;
}

.badge-in_progress {
    background: var(--blue);
    color: white;
}

.badge-ready {
    background: var(--green);
    color: white;
}

.badge-paid {
    background: var(--gray);
    color: white;
}

/* Order cards */
.order-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    border-left: 4px solid var(--orange);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.order-table {
    font-size: 1.2rem;
    font-weight: 700;
}

.order-items {
    margin: 0.75rem 0;
}

.order-items li {
    padding: 0.3rem 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
}

.order-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.order-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brown);
    margin-top: 0.5rem;
}

/* Form elements */
input, select, textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #D7CCC8;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--orange);
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9rem;
}

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

/* Menu grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.menu-item {
    background: var(--card);
    border: 2px solid #D7CCC8;
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.1s;
    user-select: none;
}

.menu-item:hover {
    border-color: var(--orange);
}

.menu-item.selected {
    border-color: var(--orange);
    background: #FFF3E0;
}

.menu-item .name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.menu-item .price {
    color: var(--brown-light);
    font-size: 0.85rem;
}

/* Category headers */
.category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brown);
    margin: 1rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brown);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--brown-light);
    margin-top: 0.25rem;
}

/* Landing page */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.landing h1 {
    font-size: 2rem;
    color: var(--brown);
    margin-bottom: 0.5rem;
}

.landing p {
    color: var(--brown-light);
    margin-bottom: 2rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 600px;
    width: 100%;
}

.role-btn {
    background: var(--card);
    border: 2px solid #D7CCC8;
    border-radius: 14px;
    padding: 1.5rem 1rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.role-btn:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
}

.role-btn .icon {
    font-size: 2rem;
}

.role-btn .label {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--brown-light);
}

.empty .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Table styles for manager */
.table-wrap {
    overflow-x: auto;
}

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

th, td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #D7CCC8;
}

th {
    background: var(--cream);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

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

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

    header h1 {
        font-size: 1.1rem;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #D7CCC8;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--brown-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s;
}

.tab:hover {
    color: var(--brown);
}

.tab.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}

/* PIN Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--brown);
}

.pin-input-group {
    margin-bottom: 1rem;
}

.pin-input-group input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    border: 2px solid #D7CCC8;
    border-radius: 12px;
    background: var(--cream);
}

.pin-input-group input:focus {
    outline: none;
    border-color: var(--orange);
}

.pin-error {
    color: #E53935;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.pin-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

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

/* Subcategory title */
.subcategory-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brown-light);
    margin: 0.75rem 0 0.4rem;
    padding-left: 0.25rem;
    border-left: 3px solid var(--orange);
    padding-left: 0.5rem;
}

/* Quantity controls */
.qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--orange);
    background: white;
    color: var(--orange);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    padding: 0;
}

.qty-btn:hover {
    background: var(--orange);
    color: white;
}

.qty-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--orange);
    min-width: 24px;
    text-align: center;
}

/* Menu price editor */
.menu-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--card);
    border-radius: 8px;
    margin-bottom: 0.4rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.menu-price-name {
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}

.menu-price-input {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.menu-price-input input {
    width: 80px;
    padding: 0.4rem 0.5rem;
    text-align: right;
    font-weight: 600;
    border: 2px solid #D7CCC8;
    border-radius: 6px;
    font-size: 0.95rem;
}

.menu-price-input input:focus {
    border-color: var(--orange);
}

.currency-label {
    color: var(--brown-light);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Table status cards */
.tables-section {
    margin-bottom: 1rem;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.table-card {
    background: var(--card);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.table-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brown);
    margin-bottom: 0.25rem;
}

.table-status {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.table-orders {
    font-size: 0.8rem;
    color: var(--brown-light);
    margin-top: 0.3rem;
}

/* Table detail modal */
.table-detail-order {
    background: var(--cream);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.table-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.95rem;
}

.table-detail-total {
    font-weight: 700;
    color: var(--brown);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #D7CCC8;
    text-align: right;
}

/* Daily sales */
.sales-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sales-card {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.sales-card h3 {
    font-size: 0.9rem;
    color: var(--brown-light);
    margin-bottom: 0.75rem;
}

.sales-item-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #EFEBE9;
    font-size: 0.9rem;
}

.sales-item-row:last-child {
    border-bottom: none;
}

.sales-item-row .name {
    flex: 1;
}

.sales-item-row .qty {
    color: var(--brown-light);
    margin: 0 0.75rem;
    font-weight: 600;
}

.sales-item-row .rev {
    font-weight: 600;
    color: var(--brown);
}

/* Delete button */
.btn-danger {
    background: #E53935;
    color: white;
}

.btn-danger:hover {
    background: #C62828;
}

.btn-danger-outline {
    background: transparent;
    color: #E53935;
    border: 2px solid #E53935;
}

.btn-danger-outline:hover {
    background: #E53935;
    color: white;
}

/* Syrup chips */
.syrup-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: white;
    border: 2px solid #D7CCC8;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.syrup-chip input {
    display: none;
}

.syrup-chip:hover {
    border-color: var(--orange);
}

.syrup-chip.selected {
    border-color: var(--orange);
    background: #FFF3E0;
    color: var(--orange);
    font-weight: 600;
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    max-width: 350px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-left: 5px solid var(--brown);
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.75rem;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--brown);
    margin-bottom: 0.2rem;
}

.toast-body {
    font-size: 0.85rem;
    color: var(--brown-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--brown);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #E53935;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
