/* ==========================================
   MUTFAK PANELİ CSS
   Waiter CSS'den türetilmiş, yeşil/teal tema
   ========================================== */

:root {
    --primary: #1abc9c;
    --primary-dark: #16a085;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --muted: #95a5a6;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --bg: #f0f5f3;
    --white: #fff;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
}

/* Masa Arama Filtresi */
.filter-search {
    position: relative;
    width: 180px;
}
.filter-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.85rem;
}
.filter-search input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--white);
    transition: border-color .2s;
}
.filter-search input:focus {
    outline: none;
    border-color: var(--primary);
}
.kitchen-table-search {
    margin-left: 12px;
}

* { 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: 22px; margin-bottom: 4px; color: var(--dark); }
.login-box .subtitle { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box .form-group { margin-bottom: 16px; text-align: left; }
.login-box label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #555; }
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 15px;
    transition: border-color .2s;
}
.login-box input:focus { border-color: var(--primary); outline: none; }
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6cb; }

/* ===== LAYOUT ===== */
.kitchen-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 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.sidebar-header h2 { font-size: 15px; font-weight: 600; }
.sidebar-header small { font-size: 11px; opacity: .6; }
.sidebar-menu { padding: 12px 0; }
.sidebar-menu-title {
    padding: 8px 20px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .4;
    font-weight: 600;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
    position: relative;
}
.sidebar-menu a:hover { background: rgba(255,255,255,.05); color: #fff; }
.sidebar-menu a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.sidebar-menu .badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== TOPBAR ===== */
.kitchen-topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 18px; font-weight: 600; }
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark);
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.pending-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(241, 196, 15, .15);
    color: #f39c12;
    animation: pulse-soft 2s infinite;
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}
.kitchen-user { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.kitchen-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);
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== CONTENT ===== */
.content-area { padding: 20px 24px; flex: 1; }
.kitchen-footer-powered {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--muted);
}
.kitchen-footer-powered a { color: var(--primary); text-decoration: none; }

/* ===== CONTROLS ===== */
.kitchen-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}
.auto-refresh-toggle input { cursor: pointer; }
.order-count-info { font-size: 14px; color: var(--muted); font-weight: 500; }

/* Sort buttons */
.controls-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sort-buttons { display: flex; gap: 4px; }
.btn-sort {
    width: 36px; height: 36px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}
.btn-sort:hover { border-color: #e67e22; color: #e67e22; }
.btn-sort.active { background: #e67e22; color: #fff; border-color: #e67e22; }

/* ===== ORDER SECTIONS ===== */
.order-section { margin-bottom: 24px; }
.order-section-header {
    padding: 12px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.order-section-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-count {
    background: rgba(255,255,255,.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.section-warning { background: var(--warning); color: #fff; }
.section-preparing { background: var(--primary); color: #fff; }
.section-ready { background: var(--success); color: #fff; }

/* ===== ORDERS GRID ===== */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 16px;
    background: rgba(255,255,255,.5);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ===== ORDER CARD ===== */
.order-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.kitchen-card[data-status="pending"] { border-left: 4px solid var(--warning); }
.kitchen-card[data-status="confirmed"] { border-left: 4px solid var(--info); }
.kitchen-card[data-status="preparing"] { border-left: 4px solid var(--primary); }
.kitchen-card[data-status="ready"] { border-left: 4px solid var(--success); }

.order-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.order-info { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.order-number { font-weight: 700; font-size: 16px; color: var(--dark); }
.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.status-warning { background: rgba(243,156,18,.15); color: #f39c12; }
.status-info { background: rgba(52,152,219,.15); color: #3498db; }
.status-primary { background: rgba(26,188,156,.15); color: #1abc9c; }
.status-success { background: rgba(39,174,96,.15); color: #27ae60; }
.status-danger { background: rgba(231,76,60,.15); color: #e74c3c; }
.status-muted { background: rgba(149,165,166,.15); color: #95a5a6; }

.order-meta-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #888; }
.wait-time { font-weight: 600; }
.wait-ok { color: var(--success); }
.wait-warning { color: var(--warning); }
.wait-critical { color: var(--danger); animation: pulse-soft 1.5s infinite; }

.order-card-body { padding: 12px 16px; }
.order-items-list { list-style: none; }
.order-items-list li {
    padding: 6px 0;
    display: flex;
    flex-wrap: wrap;          /* not satırı (width:100%) kendi satırına insin, ismi sıkıştırmasın */
    align-items: flex-start;
    gap: 8px;
    border-bottom: 1px solid #f8f8f8;
    font-size: 14px;
}
.order-items-list li:last-child { border-bottom: none; }
.kitchen-items li { font-size: 16px; padding: 8px 0; }
.qty {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}
.name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.item-note {
    width: 100%;
    font-size: 12px;
    color: var(--warning);
    padding-left: 36px;
    margin-top: 2px;
}
.order-note {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff8e1;
    border-radius: 6px;
    font-size: 13px;
    color: #795548;
}
.order-total { margin-top: 8px; text-align: right; font-size: 15px; }

.order-card-actions {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    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: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-kitchen-status {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
    font-size: 15px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all .2s;
}
.btn-kitchen-status:hover { background: var(--primary-dark); transform: scale(1.02); }

/* ===== HISTORY ===== */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}
.date-form input[type="date"] {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}
.history-card { opacity: .85; }
.history-card .order-card-header { background: #f8f9fa; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 16px; }

/* ===== NOTIFICATION ANIMATION ===== */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; }
    .orders-grid { grid-template-columns: 1fr; padding: 12px; }
    .kitchen-items li { font-size: 14px; }
    .btn-kitchen-status { font-size: 13px; padding: 10px 12px; }
}
