/* =====================================================
   KAFETERYA TAKİP SİSTEMİ - ANA STİL DOSYASI
   Tema: Sıcak kahve tonları, profesyonel & temiz
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --primary: #2D1B0E;
    --primary-light: #5C3D2E;
    --accent: #D4A76A;
    --accent-light: #E8C99B;
    --success: #2E7D4F;
    --success-light: #D4EDDA;
    --danger: #C0392B;
    --danger-light: #F8D7DA;
    --warning: #E67E22;
    --warning-light: #FFF3CD;
    --info: #2980B9;
    --info-light: #D1ECF1;
    --bg: #F5F0EB;
    --bg-card: #FFFFFF;
    --bg-sidebar: #2D1B0E;
    --text: #2D1B0E;
    --text-muted: #8B7D75;
    --border: #E0D6CC;
    --shadow: 0 2px 12px rgba(45,27,14,0.08);
    --shadow-lg: 0 8px 32px rgba(45,27,14,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

/* ---- LOGIN ---- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2D1B0E 0%, #5C3D2E 50%, #8B6E4E 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.login-card h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

/* ---- LAYOUT ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    color: #fff;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    padding: 0.5rem 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand i { font-size: 1.5rem; }

.sidebar-nav { flex: 1; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(212,167,106,0.15);
    color: var(--accent);
}

.sidebar-user {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.sidebar-user strong { color: var(--accent-light); }

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem;
}

/* ---- TOPBAR (mobile) ---- */
.topbar {
    display: none;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
}

.topbar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ---- PAGE HEADER ---- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.page-header p {
    color: var(--text-muted);
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

/* ---- CARDS ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 0.85rem 1.25rem;
}

/* ---- MASA GRID ---- */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.table-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.table-card.occupied {
    border-color: var(--danger);
    background: linear-gradient(135deg, #fff 85%, var(--danger-light));
}

.table-card.available {
    border-color: var(--success);
    background: linear-gradient(135deg, #fff 85%, var(--success-light));
}

.table-card .table-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.table-card.occupied .table-icon { color: var(--danger); }
.table-card.available .table-icon { color: var(--success); }

.table-card .table-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.table-card .table-amount {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.table-card .table-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.table-card.occupied .table-badge { background: var(--danger); }
.table-card.available .table-badge { background: var(--success); }

/* ---- ADİSYON PANELİ ---- */
.order-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 3rem);
    position: sticky;
    top: 1.5rem;
}

.order-panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-panel-header h5 {
    margin: 0;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
}

.order-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.order-item:hover { background: var(--bg); }

.order-item .item-info { flex: 1; }
.order-item .item-name { font-weight: 500; }
.order-item .item-meta { font-size: 0.8rem; color: var(--text-muted); }

.order-item .item-price {
    font-weight: 600;
    white-space: nowrap;
    margin: 0 0.75rem;
}

.order-item .item-actions { display: flex; gap: 0.25rem; }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending   { background: var(--warning-light); color: var(--warning); }
.status-preparing { background: var(--info-light); color: var(--info); }
.status-ready     { background: var(--success-light); color: var(--success); }
.status-delivered { background: #E8E8E8; color: #666; }

.order-panel-footer {
    border-top: 2px solid var(--primary);
    padding: 1rem 1.25rem;
}

.order-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-family: 'Playfair Display', serif;
}

/* ---- ÜRÜN SEÇİMİ ---- */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.category-tab {
    padding: 0.45rem 1rem;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

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

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(212,167,106,0.2);
    transform: translateY(-1px);
}

.product-card:active {
    transform: scale(0.97);
}

.product-card .p-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.product-card .p-price {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
}

/* ---- MUTFAK/BARİSTA ---- */
.kitchen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.kitchen-ticket {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.kitchen-ticket.is-new {
    animation: pulse 0.6s ease;
    border-color: var(--warning);
}

@keyframes pulse {
    0%, 100% { box-shadow: var(--shadow); }
    50% { box-shadow: 0 0 0 4px rgba(230,126,34,0.3); }
}

.ticket-header {
    background: var(--primary);
    color: #fff;
    padding: 0.65rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.ticket-header .table-label {
    font-weight: 700;
    font-size: 1rem;
}

.ticket-header .time-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.ticket-body { padding: 0.75rem 1rem; }

.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

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

.ticket-item .t-qty {
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.ticket-item .t-name {
    flex: 1;
    font-weight: 500;
}

.ticket-item .t-note {
    font-size: 0.8rem;
    color: var(--warning);
    font-style: italic;
}

.ticket-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

/* ---- ADMIN ---- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.stat-card .stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- BUTTONS ---- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

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

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
    font-weight: 600;
}

.btn-accent:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    color: var(--primary);
}

.btn-sm { font-size: 0.8rem; padding: 0.25rem 0.5rem; }

/* ---- TABLE ---- */
.table { font-size: 0.9rem; }
.table th {
    font-weight: 600;
    color: var(--primary);
    border-bottom-width: 2px;
}

/* ---- MODAL ---- */
.modal-header {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header .btn-close { filter: invert(1); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .topbar { display: flex; }
    .main-content { margin-left: 0; padding: 1rem; }
    .order-panel { height: auto; position: relative; top: 0; }
    .table-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .kitchen-grid { grid-template-columns: 1fr; }
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (max-width: 768px) {
    .sidebar.open ~ .sidebar-overlay { display: block; }
}

/* ---- MISC ---- */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Sound notification indicator */
.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    display: inline-block;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
