/* ==========================================
   GARSON PANELİ CSS
   ========================================== */

:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --muted: #95a5a6;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --bg: #f5f6fa;
    --white: #fff;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: #333;
    min-height: 100vh;
    font-size: 15px;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark), var(--primary-dark));
}
.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.login-box .logo-area .icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}
.login-box h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-box .subtitle { color: var(--muted); margin-bottom: 24px; font-size: 0.9rem; }
.login-box .form-group { margin-bottom: 16px; text-align: left; }
.login-box label { font-size: 0.85rem; font-weight: 500; display: block; margin-bottom: 4px; color: #555; }
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color .2s;
}
.login-box input:focus { border-color: var(--primary); outline: none; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.85rem; }
.alert-error { background: #fdebed; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #d5f5e3; color: var(--success); border: 1px solid #a9dfbf; }
.alert-info { background: #d6eaf8; color: var(--info); border: 1px solid #aed6f1; }

/* ===== LAYOUT ===== */
.waiter-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform .3s;
}
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-header h2 { font-size: 1rem; line-height: 1.2; }
.sidebar-header small { font-size: 0.7rem; opacity: .7; }

.sidebar-menu { padding: 12px 0; }
.sidebar-menu-title {
    padding: 16px 20px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .5;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all .2s;
}
.sidebar-menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-menu a.active { background: var(--primary); color: #fff; border-radius: 0; }
.sidebar-menu a i { width: 20px; text-align: center; }
.badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}
.badge-danger { background: var(--danger); animation: pulse-badge 1.5s infinite; }
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.waiter-topbar {
    background: var(--white);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 1.2rem; font-weight: 600; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #333; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.waiter-user { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.waiter-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.logout { color: var(--danger); font-size: 0.85rem; text-decoration: none; }
.logout:hover { text-decoration: underline; }

.content-area { padding: 24px; flex: 1; min-width: 0; overflow: hidden; }
.waiter-footer-powered {
    text-align: center;
    padding: 12px;
    font-size: 0.75rem;
    color: var(--muted);
}
.waiter-footer-powered a { color: var(--primary); text-decoration: none; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border: 1px solid #ddd; color: #555; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-xs { padding: 6px 10px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== ORDER CARDS (Dashboard) ===== */
.orders-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: inherit;
    transition: all .2s;
}
.filter-btn.active, .filter-btn:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.filter-count { font-weight: 600; }

/* Toolbar */
.orders-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.orders-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.orders-toolbar-right { font-size: 0.85rem; color: var(--muted); }
.view-toggle { display: flex; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.view-btn {
    padding: 7px 12px;
    border: none;
    background: var(--white);
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    transition: all .2s;
}
.view-btn.active { background: var(--primary); color: #fff; }
.view-btn + .view-btn { border-left: 1px solid #ddd; }
.table-filter-select {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--white);
    cursor: pointer;
}
.order-count-info { font-weight: 500; }

/* Section Headers */
.order-section { margin-bottom: 24px; }
.order-section-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
}
.order-section-header h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.section-new { background: #fff3cd; color: #856404; }
.section-ongoing { background: #d1ecf1; color: #0c5460; }
.section-count {
    background: rgba(0,0,0,.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Table Group */
.table-group { margin-bottom: 24px; }
.table-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
}
.table-group-header h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.table-group-header .btn-clear-table { white-space: nowrap; }

/* Masa grubu aç/kapa (collapse) — çok masada paneli toparlar */
.table-group-header { cursor: pointer; user-select: none; }
.table-group-chevron { flex-shrink: 0; opacity: .85; transition: transform .2s ease; }
.table-group.collapsed .table-group-header { margin-bottom: 0; }
.table-group.collapsed .table-group-chevron { transform: rotate(-180deg); }
.table-group.collapsed .orders-grid { display: none; }

/* Inline Detail */
.order-detail-inline {
    border-top: 1px solid #eee;
    padding: 16px;
    background: #fafafa;
}
.inline-detail-content {}
.inline-detail-section { margin-bottom: 12px; }
.inline-detail-section h4 { font-size: 0.85rem; margin-bottom: 6px; color: #555; }
.detail-meta-row { display: flex; gap: 16px; font-size: 0.83rem; color: #666; flex-wrap: wrap; }
.detail-meta-row span { display: flex; align-items: center; gap: 4px; }
.log-timeline-inline {}
.log-entry-inline {
    font-size: 0.82rem;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.log-entry-inline .log-time { color: var(--muted); font-weight: 500; }
.log-entry-inline .log-action { color: #333; }
.log-entry-inline .log-detail { color: var(--primary); font-size: 0.8rem; }
.detail-loading, .detail-error { text-align: center; padding: 20px; color: #999; }

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.order-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .2s;
}
.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.order-card[data-status="pending"] { border-left: 4px solid var(--warning); }
.order-card[data-status="confirmed"] { border-left: 4px solid var(--info); }
.order-card[data-status="preparing"] { border-left: 4px solid var(--primary); }
.order-card[data-status="ready"] { border-left: 4px solid var(--success); }
.order-card[data-status="delivered"] { border-left: 4px solid var(--muted); }

.order-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-info { display: flex; align-items: center; gap: 8px; }
.order-number { font-weight: 700; font-size: 1.1rem; }
.table-info { font-size: 0.88rem; color: #666; }
.table-info i { color: var(--primary); }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-warning { background: #fff3cd; color: #856404; }
.status-info { background: #d1ecf1; color: #0c5460; }
.status-primary { background: #fde3cd; color: #7d4e00; }
.status-success { background: #d4edda; color: #155724; }
.status-muted { background: #e2e6ea; color: #636c72; }
.status-danger { background: #f8d7da; color: #721c24; }
.status-pending { background: #fff3cd; color: #856404; }
.status-confirmed { background: #d1ecf1; color: #0c5460; }
.status-preparing { background: #fde3cd; color: #7d4e00; }
.status-ready { background: #d4edda; color: #155724; }
.status-delivered { background: #e2e6ea; color: #636c72; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.order-card-body { padding: 12px 16px; }
.order-items-list { list-style: none; }
.order-items-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed #eee;
}
.order-items-list li:last-child { border: none; }
.order-items-list .qty { font-weight: 700; color: var(--primary); min-width: 24px; }
.order-items-list .name { flex: 1; }
.order-items-list .price { color: #666; font-size: 0.82rem; }
.order-items-list .price s { opacity: 0.55; margin-right: 4px; }
.item-note { font-size: 0.75rem; color: var(--muted); padding-left: 32px; }

/* İkram/iptal/ödendi kalem rozetleri */
.order-items-list li.item-cancelled { opacity: 0.6; }
.item-flag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 5px;
    vertical-align: middle;
    white-space: nowrap;
}
.flag-cancel { background: #f8d7da; color: #721c24; }
.flag-comp   { background: #d1ecf1; color: #0c5460; }
.flag-paid   { background: #d4edda; color: #155724; }
.order-total s { opacity: 0.55; font-weight: 400; margin-right: 4px; }

/* Masa kartı para satırları */
.table-order-info .paid-info { color: #155724; font-size: 0.78rem; display: block; }
.table-order-info .void-info { color: #0c5460; font-size: 0.78rem; display: block; }

.order-note {
    background: #fffbe6;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.82rem;
    margin-top: 8px;
    color: #856404;
}
.order-meta {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--muted);
}
.order-meta i { margin-right: 3px; }
.order-total { margin-left: auto; color: var(--dark); }

.order-card-actions {
    padding: 10px 16px;
    border-top: 1px solid var(--light);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    grid-column: 1 / -1;
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; }

/* ===== DATA TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th, .data-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--light);
}
.data-table th { background: var(--dark); color: #fff; font-weight: 500; font-size: 0.8rem; }
.data-table tr:hover { background: #f8f9fa; }

.item-chip {
    display: inline-block;
    background: var(--light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px;
}

/* ===== ORDER DETAIL ===== */
.order-detail-page { max-width: 900px; }
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.detail-header-left { display: flex; align-items: center; gap: 16px; }
.detail-header-left h2 { font-size: 1.3rem; }
.detail-header-right { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.meta-item { font-size: 0.85rem; color: #666; }
.meta-item i { color: var(--primary); margin-right: 4px; }
.meta-item.total { font-size: 1.1rem; color: var(--dark); }

.detail-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.detail-section h3 { font-size: 1rem; margin-bottom: 14px; color: var(--dark); }

.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.qty-control { display: flex; align-items: center; gap: 4px; }
.btn-qty {
    width: 26px;
    height: 26px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-qty:hover { background: var(--light); }
.qty-val { font-weight: 600; min-width: 20px; text-align: center; }

.add-item-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--light);
}
.add-item-section h4 { margin-bottom: 10px; font-size: 0.9rem; }
.add-item-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-item-row select { flex: 1; min-width: 200px; padding: 8px; border: 1px solid #ddd; border-radius: var(--radius); font-size: 0.85rem; }
.add-item-row input { padding: 8px; border: 1px solid #ddd; border-radius: var(--radius); font-size: 0.85rem; }

/* Log timeline */
.log-timeline { }
.log-entry {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 0.82rem;
    align-items: flex-start;
}
.log-entry:last-child { border: none; }
.log-time { color: var(--muted); min-width: 60px; font-family: monospace; }
.log-action { font-weight: 600; min-width: 100px; }
.log-by { color: var(--primary); }
.log-details { color: #666; font-size: 0.78rem; margin-top: 2px; }

/* ===== HISTORY ===== */
.history-header { margin-bottom: 24px; }
.date-filter { margin-bottom: 16px; }
.date-filter input[type="date"] {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}
.summary-cards { display: flex; gap: 16px; }
.summary-card {
    background: var(--white);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.sc-value { font-size: 1.5rem; font-weight: 700; color: var(--dark); }
.sc-label { font-size: 0.78rem; color: var(--muted); }

/* ===== TABLES OVERVIEW ===== */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--success);
    transition: all .2s;
    overflow: hidden;
    word-break: break-word;
}
.table-card.occupied { border-left-color: var(--warning); }
.table-card.has-call { border-left-color: var(--danger); animation: pulse-card 2s infinite; }
.table-card.inactive { opacity: .5; border-left-color: var(--muted); }
@keyframes pulse-card { 0%,100%{box-shadow:var(--shadow)} 50%{box-shadow:0 0 16px rgba(231,76,60,.3)} }

.table-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.table-number { font-weight: 700; font-size: 1.1rem; }
.table-name { font-size: 0.85rem; color: var(--muted); }
.call-indicator { color: var(--danger); animation: pulse-badge 1s infinite; }

.table-card-body { min-height: 40px; }
.table-status { font-size: 0.82rem; font-weight: 500; }
.table-status.free { color: var(--success); }
.table-status.inactive { color: var(--muted); }
.table-order-info { font-size: 0.8rem; }
.table-order-info span { display: block; margin-bottom: 2px; }
.order-count { font-weight: 600; color: var(--warning); }
.last-order { color: var(--muted); font-size: 0.75rem; }

.table-card-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== CREATE ORDER (New Step-Based UI) ===== */
.order-step.hidden { display: none; }

/* Step 1: Table Selection */
.step-header { text-align: center; margin-bottom: 24px; }
.step-header h2 { font-size: 1.3rem; margin-bottom: 6px; }
.step-desc { color: var(--muted); font-size: 0.9rem; }

.waiter-table-search {
    position: relative;
    max-width: 260px;
    margin: 0 auto 16px;
}
.waiter-table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
}
.waiter-table-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color .2s;
}
.waiter-table-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.table-select-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
}
.table-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    aspect-ratio: 1;
    padding: 16px 8px;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    background: var(--white);
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.table-select-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.table-select-card:active { transform: scale(0.97); }
.table-card-icon { font-size: 1.6rem; color: var(--primary); margin-bottom: 2px; }
.table-card-num { font-weight: 700; font-size: 1.3rem; }
.table-card-name { font-size: 0.8rem; color: var(--muted); }
.table-card-badge {
    font-size: 0.65rem;
    background: var(--warning);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

/* Step 2: Menu Top Bar */
.menu-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.menu-table-info {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
}
.cart-toggle-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}
#cart-count-badge {
    background: var(--danger);
    color: #fff;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Category Filters */
.waiter-cat-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f0f0f0;
    margin-bottom: 4px;
    max-width: 100%;
}
.waiter-cat-filters::-webkit-scrollbar { height: 6px; }
.waiter-cat-filters::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.waiter-cat-filters::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.waiter-cat-filters::-webkit-scrollbar-thumb:hover { background: #aaa; }
.waiter-cat-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    border-radius: 24px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s;
    color: #666;
    flex-shrink: 0;
}
.waiter-cat-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Menu Search */
.waiter-menu-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 14px;
}
.waiter-menu-search i { color: var(--muted); }
.waiter-menu-search input {
    border: none;
    outline: none;
    flex: 1;
    font-family: inherit;
    font-size: 0.9rem;
    background: transparent;
}

/* Menu Items List */
.waiter-menu-cat-title {
    font-size: 0.88rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 12px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f0f0f0;
}
.waiter-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: background .15s;
}
.waiter-menu-item:active { background: #f5f5f5; }
.wmi-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.wmi-img img { width: 100%; height: 100%; object-fit: cover; }
.wmi-info { flex: 1; min-width: 0; }
.wmi-name { display: block; font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wmi-price { display: block; font-size: 0.88rem; color: var(--primary); font-weight: 600; margin-top: 2px; }
.wmi-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, background .15s;
    flex-shrink: 0;
}
.wmi-add-btn:active { transform: scale(0.9); }
.wmi-add-btn.added { background: var(--success); }

/* Cart Panel (Slide-up) */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 999;
    transition: opacity .3s;
}
.cart-overlay.hidden { display: none; }
.cart-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transition: transform .3s ease;
}
.cart-panel.hidden { transform: translateY(100%); pointer-events: none; }
.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.cart-panel-header h3 { font-size: 1rem; margin: 0; }
.cart-panel-close { border: none; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.cart-panel-body { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-empty { text-align: center; padding: 30px 0; color: var(--muted); font-size: 0.9rem; }

.waiter-cart-list-new { list-style: none; padding: 0; margin: 0; }
.waiter-cart-list-new li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.waiter-cart-list-new li:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info .ci-name { display: block; font-weight: 500; font-size: 0.9rem; }
.cart-item-info .ci-price { display: block; font-size: 0.78rem; color: var(--muted); }
.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.cart-qty-control button {
    width: 30px;
    height: 30px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.cart-qty-control button:active { background: #e0e0e0; }
.cart-qty-control .qty-val {
    width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}
.cart-item-remove {
    color: var(--danger);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
}

.cart-panel-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #eee;
    font-size: 1rem;
}
.cart-panel-footer { padding: 12px 20px 20px; }
.cart-panel-footer textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
}

/* Quick-add animation */
@keyframes addPulse {
    0% { box-shadow: 0 0 0 0 rgba(230,126,34,.4); }
    70% { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.wmi-add-btn.pulse { animation: addPulse .4s; }

/* ===== CALLS PANEL ===== */
.calls-panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    border: 2px solid var(--danger);
}
.calls-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
}
.calls-panel-header h3 { font-size: 0.95rem; }
.calls-panel-close { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; }
.calls-list { padding: 0; max-height: 300px; overflow-y: auto; }
.call-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light);
}
.call-item:last-child { border: none; }
.call-table { font-weight: 600; }
.call-time { font-size: 0.78rem; color: var(--muted); }
.call-actions { display: flex; gap: 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }
    .sidebar-overlay.show { display: block; }
    
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    
    .orders-grid { grid-template-columns: 1fr; }
    .table-select-grid-new { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .tables-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .summary-cards { flex-direction: column; }
    
    .detail-header { flex-direction: column; }
    .detail-header-right { flex-direction: column; gap: 8px; }
    
    .data-table { display: block; overflow-x: auto; }
}

/* ===== HIZLI SİPARİŞ (Quick Order) ===== */

/* Floating Action Button */
.fab-quick-order {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(230, 126, 34, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab-quick-order:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(230, 126, 34, 0.6);
}
.fab-quick-order:active {
    transform: scale(0.95);
}

/* Quick Order Overlay */
.qo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.qo-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Quick Order Modal */
.qo-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 95%;
    max-width: 720px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.qo-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
.qo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.qo-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.qo-header h2 i { color: #e67e22; }
.qo-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #95a5a6;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.qo-close-btn:hover {
    background: #f8f9fa;
    color: #e74c3c;
}

/* Body */
.qo-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Table select - compact modal */
.qo-modal-compact .qo-body { padding: 16px; }
.qo-modal-compact .qo-table-select { margin-bottom: 0; }
.qo-modal-compact .qo-table-grid {
    max-height: 50vh;
}
.qo-table-search {
    position: relative;
    margin-bottom: 14px;
}
.qo-table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 13px;
}
.qo-table-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color .2s;
}
.qo-table-search input:focus {
    outline: none;
    border-color: #e67e22;
}
.qo-table-card { text-decoration: none; }

/* Selected table badge (step 2 top bar) */
.qo-selected-table {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fef9e7;
    border: 2px solid #f39c12;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #2c3e50;
}
.qo-selected-table i { color: #e67e22; margin-right: 4px; }
.qo-change-table-btn {
    background: none;
    border: 1px solid #e67e22;
    color: #e67e22;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.qo-change-table-btn:hover { background: #e67e22; color: #fff; }

/* Full-height table grid in step 1 */
.qo-table-grid-full {
    max-height: 55vh;
}

.qo-table-select { margin-bottom: 16px; }
.qo-table-select label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #7f8c8d;
    margin-bottom: 6px;
}
.qo-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 4px;
}
.qo-table-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Poppins', sans-serif;
}
.qo-table-card i { font-size: 16px; color: #95a5a6; transition: color 0.2s; }
.qo-table-card span { font-size: 14px; font-weight: 600; color: #2c3e50; }
.qo-table-card small { font-size: 10px; color: #95a5a6; text-align: center; line-height: 1.2; }
.qo-table-card:hover { border-color: #e67e22; background: #fef9f3; }
.qo-table-card:hover i { color: #e67e22; }
.qo-table-card.selected {
    border-color: #e67e22;
    background: #e67e22;
    color: #fff;
}
.qo-table-card.selected i { color: #fff; }
.qo-table-card.selected span { color: #fff; }
.qo-table-card.selected small { color: rgba(255,255,255,0.8); }

/* Items header (spreadsheet-like) */
.qo-items-header {
    display: grid;
    grid-template-columns: 1fr 100px 1fr 36px;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ecf0f1;
    margin-bottom: 4px;
}

/* Each row */
.qo-row {
    display: grid;
    grid-template-columns: 1fr 100px 1fr 36px;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f6fa;
    align-items: center;
    animation: qoRowFadeIn 0.2s ease;
}
@keyframes qoRowFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Product cell with autocomplete */
.qo-cell-product { position: relative; }
.qo-cell-product input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.qo-cell-product input:focus {
    border-color: #e67e22;
    outline: none;
}
.qo-cell-product input.selected {
    background: #fef9e7;
    border-color: #f39c12;
    font-weight: 500;
}

/* Autocomplete dropdown */
.qo-ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}
.qo-ac-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    transition: background 0.15s;
    border-bottom: 1px solid #f8f9fa;
}
.qo-ac-item:last-child { border-bottom: none; }
.qo-ac-item:hover,
.qo-ac-item.highlighted { background: #fef9e7; }
.qo-ac-item-name {
    font-weight: 500;
    color: #2c3e50;
}
.qo-ac-item-cat {
    font-size: 11px;
    color: #95a5a6;
    margin-left: 6px;
}
.qo-ac-item-price {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
    white-space: nowrap;
}

/* Quantity cell */
.qo-cell-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.qo-cell-qty button {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #555;
}
.qo-cell-qty button:hover {
    background: #e67e22;
    color: #fff;
    border-color: #e67e22;
}
.qo-qty-val {
    width: 32px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

/* Notes cell */
.qo-cell-notes input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.qo-cell-notes input:focus {
    border-color: #3498db;
    outline: none;
}

/* Remove button */
.qo-row-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: #bdc3c7;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.qo-row-remove:hover {
    color: #e74c3c;
    background: #fdecea;
}

/* Add row button */
.qo-add-row-btn {
    margin-top: 8px;
    padding: 8px 16px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: none;
    color: #95a5a6;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    width: 100%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.qo-add-row-btn:hover {
    border-color: #e67e22;
    color: #e67e22;
    background: #fef9e7;
}

/* General note */
.qo-general-note { margin-top: 12px; }
.qo-general-note textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    resize: vertical;
    min-height: 50px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.qo-general-note textarea:focus {
    border-color: #e67e22;
    outline: none;
}

/* Footer */
.qo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
}
.qo-total {
    font-size: 15px;
    color: #7f8c8d;
}
.qo-total strong {
    color: #2c3e50;
    font-size: 18px;
    margin-left: 4px;
}
.qo-submit-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.qo-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}
.qo-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive quick order */
@media (max-width: 600px) {
    .fab-quick-order {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
    .qo-modal { width: 98%; max-height: 95vh; }
    .qo-items-header { display: none; }
    .qo-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 0;
        position: relative;
    }
    .qo-cell-qty { justify-content: flex-start; }
    .qo-row-remove {
        position: absolute;
        top: 8px;
        right: 0;
    }
    .qo-footer { flex-direction: column; gap: 10px; }
    .qo-submit-btn { width: 100%; justify-content: center; }
}

/* ===== ÖDEME MODAL (Garson - Masalar sayfası) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
}
.payment-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 201;
    box-shadow: var(--shadow-lg);
}
.payment-modal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.payment-modal .modal-header h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.payment-modal .modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}
.payment-modal .modal-body { padding: 20px 24px; }
.payment-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.payment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
}
.remaining-amount { font-weight: 700; color: var(--primary); font-size: 18px; }
.payment-modal .form-group { margin-bottom: 16px; }
.payment-modal .form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #555; }
.payment-modal .form-group select,
.payment-modal .form-group textarea,
.payment-modal .form-group input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}
.payment-modal .form-group select:focus,
.payment-modal .form-group textarea:focus,
.payment-modal .form-group input:focus { border-color: var(--primary); outline: none; }
.payment-modal .input-large { font-size: 20px !important; font-weight: 700; text-align: center; }
.payment-methods {
    display: flex;
    gap: 10px;
}
.method-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
    text-align: center;
}
.method-option input { display: none; }
.method-option.active,
.method-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(230, 126, 34, .05);
    color: var(--primary);
}
