/**
 * Kafe POS - Premium Light UI Design System
 * Modern, aydınlık, canlı renkli kafe tasarımı
 */

/* ============================================
   CSS VARIABLES — BRIGHT LIGHT THEME
   ============================================ */
:root {
    /* Primary — Warm Orange-Coral */
    --primary-50: #fff7ed;
    --primary-100: #ffedd5;
    --primary-200: #fed7aa;
    --primary-300: #fdba74;
    --primary-400: #fb923c;
    --primary-500: #f97316;
    --primary-600: #ea580c;
    --primary-700: #c2410c;
    --primary-800: #9a3412;
    --primary-900: #7c2d12;

    /* Accent — Rich Purple */
    --accent-400: #a78bfa;
    --accent-500: #8b5cf6;
    --accent-600: #7c3aed;

    /* Success — Emerald */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;

    /* Warning — Amber */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    /* Danger — Rose */
    --danger-50: #fff1f2;
    --danger-100: #ffe4e6;
    --danger-500: #f43f5e;
    --danger-600: #e11d48;

    /* Info — Sky Blue */
    --info-50: #f0f9ff;
    --info-100: #e0f2fe;
    --info-500: #0ea5e9;
    --info-600: #0284c7;

    /* Teal */
    --teal-500: #14b8a6;
    --teal-600: #0d9488;

    /* ===== LIGHT BACKGROUNDS ===== */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-active: #e2e8f0;
    --bg-page: #f8fafc;

    /* ===== TEXT ===== */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-muted: #cbd5e1;

    /* ===== BORDERS ===== */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --glass-border: rgba(0,0,0,0.06);

    /* ===== SHADOWS ===== */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-colored: 0 4px 14px -2px rgba(249,115,22,0.25);
    --shadow-success: 0 4px 14px -2px rgba(16,185,129,0.25);
    --shadow-danger: 0 4px 14px -2px rgba(244,63,94,0.25);
    --shadow-info: 0 4px 14px -2px rgba(14,165,233,0.25);

    /* ===== SPACING ===== */
    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
    --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
    --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;

    /* ===== RADIUS ===== */
    --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem;
    --radius-xl: 1rem; --radius-2xl: 1.25rem; --radius-3xl: 1.5rem;
    --radius-full: 9999px;

    /* ===== TYPOGRAPHY ===== */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
    --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem;
    --text-3xl: 1.875rem; --text-4xl: 2.25rem;
    --font-normal: 400; --font-medium: 500; --font-semibold: 600; --font-bold: 700; --font-extrabold: 800;

    /* ===== TRANSITIONS ===== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ===== Z-INDEX ===== */
    --z-dropdown: 1000; --z-sticky: 1020; --z-fixed: 1030;
    --z-modal-backdrop: 1040; --z-modal: 1050; --z-popover: 1060;
    --z-tooltip: 1070; --z-toast: 1080;

    /* ===== COMPAT ALIASES ===== */
    --primary: var(--primary-500); --success: var(--success-500);
    --warning: var(--warning-500); --danger: var(--danger-500);
    --info: var(--info-500);
    --primary-rgb: 249,115,22;
    --glass-bg: rgba(255,255,255,0.85);
    --glass-blur: 12px;

    /* Backward compat */
    --primary-300: #fdba74;
    --primary-400: #fb923c;
    --secondary-500: #8b5cf6;
    --secondary-600: #7c3aed;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --cyan-400: #22d3ee;
    --cyan-500: #06b6d4;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
}

/* ============================================
   KEYFRAMES
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes gradientShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes borderPulse { 0%,100% { border-color: var(--danger-500); } 50% { border-color: var(--danger-600); box-shadow: 0 0 12px rgba(244,63,94,0.2); } }
@keyframes urgentPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(244,63,94,0.3); } 50% { box-shadow: 0 0 16px 4px rgba(244,63,94,0.2); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; width: 100% !important; max-width: 100vw !important; overflow-x: hidden; }

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-page);
    min-height: 100vh;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-600); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-700); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ============================================
   SIDEBAR — Premium Light
   ============================================ */
.app-container { display: flex; flex-direction: row; min-height: 100vh; width: 100% !important; max-width: 100vw !important; }

.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    z-index: var(--z-fixed); flex-shrink: 0;
    transition: transform var(--transition-normal);
    box-shadow: 2px 0 8px rgba(0,0,0,0.03);
}

.sidebar-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo { display: flex; align-items: center; gap: var(--space-3); }

.sidebar-logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: white;
    box-shadow: var(--shadow-colored);
}

.sidebar-logo-text {
    font-size: var(--text-xl); font-weight: var(--font-extrabold);
    background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
    background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-3) 0; }
.nav-section { margin-bottom: var(--space-3); }

.nav-section-title {
    padding: var(--space-2) var(--space-5);
    font-size: 0.7rem; font-weight: var(--font-bold);
    color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.1em;
}

.nav-link {
    display: flex; align-items: center; gap: var(--space-3);
    padding: 0.6rem var(--space-5); margin: 0 var(--space-3);
    color: var(--text-secondary); border-radius: var(--radius-lg);
    transition: all var(--transition-fast); position: relative;
    font-weight: var(--font-medium); font-size: var(--text-sm);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active {
    color: var(--primary-600); background: var(--primary-50);
    font-weight: var(--font-semibold);
}
.nav-link.active::before {
    content: ''; position: absolute; left: -0.75rem; top: 50%; transform: translateY(-50%);
    width: 4px; height: 60%; background: var(--primary-500);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.nav-link i { width: 20px; text-align: center; font-size: 0.95rem; }

.nav-link-badge {
    margin-left: auto; background: var(--danger-500); color: white;
    font-size: 0.65rem; font-weight: var(--font-bold);
    padding: 0.15rem 0.45rem; border-radius: var(--radius-full); min-width: 18px; text-align: center;
}

.sidebar-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-color); background: var(--bg-tertiary);
}
.user-info { display: flex; align-items: center; gap: var(--space-3); }
.user-avatar {
    width: 38px; height: 38px; border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-400), var(--accent-500));
    display: flex; align-items: center; justify-content: center;
    font-weight: var(--font-bold); color: white; font-size: var(--text-sm);
}
.user-details { flex: 1; }
.user-role { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1 1 auto; margin-left: 0; padding: var(--space-6) var(--space-8);
    min-height: 100vh; width: calc(100% - 270px) !important; max-width: 100% !important; min-width: 0;
}
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-4);
}
.page-title { font-size: var(--text-2xl); font-weight: var(--font-extrabold); color: var(--text-primary); }
.page-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

/* ============================================
   CARDS — Clean & Elevated
   ============================================ */
.card {
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl); overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--bg-tertiary);
}
.card-title { font-size: var(--text-base); font-weight: var(--font-semibold); }
.card-body { padding: var(--space-5); }
.card-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-color); background: var(--bg-tertiary);
}
.card-glass { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); }

/* Stat card */
.stat-card { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5); }
.stat-icon {
    width: 52px; height: 52px; border-radius: var(--radius-xl);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.stat-icon.primary { background: var(--primary-100); color: var(--primary-600); }
.stat-icon.success { background: var(--success-100); color: var(--success-600); }
.stat-icon.warning { background: var(--warning-100); color: var(--warning-600); }
.stat-icon.danger { background: var(--danger-100); color: var(--danger-600); }
.stat-content { flex: 1; }
.stat-value { font-size: var(--text-2xl); font-weight: var(--font-extrabold); }
.stat-label { font-size: var(--text-sm); color: var(--text-secondary); }
.stat-change { font-size: var(--text-xs); margin-top: 2px; }
.stat-change.up { color: var(--success-600); }
.stat-change.down { color: var(--danger-500); }

/* ============================================
   BUTTONS — Vibrant & Rounded
   ============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: var(--space-2); padding: 0.6rem 1.25rem;
    font-size: var(--text-sm); font-weight: var(--font-semibold);
    border-radius: var(--radius-xl); border: none; cursor: pointer;
    transition: all var(--transition-normal); white-space: nowrap;
    text-decoration: none; position: relative;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white; box-shadow: var(--shadow-colored);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px -4px rgba(249,115,22,0.4); transform: translateY(-1px); }

.btn-secondary {
    background: #fff; color: var(--text-primary);
    border: 1px solid var(--border-color); box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-tertiary); border-color: #cbd5e1; }

.btn-success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white; box-shadow: var(--shadow-success);
}
.btn-success:hover:not(:disabled) { box-shadow: 0 6px 20px -4px rgba(16,185,129,0.4); transform: translateY(-1px); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    color: white; box-shadow: 0 4px 14px -2px rgba(245,158,11,0.3);
}
.btn-warning:hover:not(:disabled) { transform: translateY(-1px); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
    color: white; box-shadow: var(--shadow-danger);
}
.btn-danger:hover:not(:disabled) { box-shadow: 0 6px 20px -4px rgba(244,63,94,0.4); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: var(--text-xs); border-radius: var(--radius-lg); }
.btn-lg { padding: 0.85rem 2rem; font-size: var(--text-lg); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-xl) 0 0 var(--radius-xl); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }

/* ============================================
   FORMS — Clean Modern Inputs
   ============================================ */
.form-group { margin-bottom: 1.25rem; }
.form-label, label {
    display: block; font-size: var(--text-sm); font-weight: var(--font-medium);
    color: var(--text-secondary); margin-bottom: 0.4rem;
}
.form-control, .form-input, .form-select, .form-textarea,
input[type="text"], input[type="number"], input[type="password"], input[type="email"],
select, textarea {
    width: 100%; padding: 0.65rem 0.9rem;
    font-size: var(--text-base); color: var(--text-primary);
    background: #fff; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl); transition: all var(--transition-fast);
}
.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus,
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
.form-control::placeholder, input::placeholder { color: var(--text-muted); }
.form-control-lg { padding: 0.85rem 1.1rem; font-size: var(--text-lg); }
textarea.form-control, textarea { min-height: 100px; resize: vertical; }
select.form-control, select, .form-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem;
}
input[type="checkbox"] {
    width: auto !important; display: inline-block; accent-color: var(--primary-500);
    cursor: pointer; vertical-align: middle; margin-right: 0.5rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media(max-width: 768px) { .form-row { grid-template-columns: 1fr; } }
.form-text { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 0.25rem; }
.form-error { color: var(--danger-500); }
.search-input { position: relative; }
.search-input i { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input .form-control { padding-left: 2.5rem; }

/* ============================================
   TABLES
   ============================================ */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--border-color); }
.table th {
    font-size: var(--text-xs); font-weight: var(--font-bold); color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.05em; background: var(--bg-tertiary);
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--primary-50); }

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex; align-items: center; gap: var(--space-1);
    padding: 0.2rem 0.6rem; font-size: var(--text-xs); font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
}
.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.badge-success { background: var(--success-100); color: var(--success-600); }
.badge-warning { background: var(--warning-100); color: var(--warning-600); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }
.badge-info { background: var(--info-100); color: var(--info-600); }

/* ============================================
   MODALS — Light & Clean
   ============================================ */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,0.4);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: all var(--transition-normal); display: none;
}
.modal-backdrop.active { opacity: 1; visibility: visible; pointer-events: auto; display: flex; align-items: center; justify-content: center; }

.modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-3xl); box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    width: 90%; max-width: 500px; max-height: 90vh; overflow: hidden;
    opacity: 0; visibility: hidden;
    transition: all var(--transition-normal);
}
.modal.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-backdrop.active .modal { transform: scale(1); }

.modal-header {
    padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title, .modal-header h3 { font-size: var(--text-lg); font-weight: var(--font-bold); margin: 0; }
.modal-close {
    width: 32px; height: 32px; border: none; background: var(--bg-tertiary);
    color: var(--text-secondary); border-radius: var(--radius-full); cursor: pointer;
    transition: all var(--transition-fast); display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--danger-50); color: var(--danger-500); }
.modal-body { padding: var(--space-5) var(--space-6); overflow-y: auto; max-height: 60vh; }
.modal-footer {
    padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3);
    background: var(--bg-tertiary);
}
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; }

/* Modal overlay pattern */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,0.4);
    z-index: 1100; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none; transition: all var(--transition-normal);
    backdrop-filter: blur(4px);
}
.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-overlay .modal {
    position: relative; top: auto; left: auto; transform: scale(0.95);
    opacity: 1; visibility: visible; margin: 0; max-height: 90vh;
    display: flex; flex-direction: column; width: 90%; max-width: 500px;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-overlay .modal, .modal-overlay .modal * { pointer-events: auto; }
.modal-overlay .modal-body, .modal-overlay .modal-footer { position: relative; z-index: 10; }
.modal-overlay .form-input, .modal-overlay .form-select, .modal-overlay input,
.modal-overlay select, .modal-overlay textarea, .modal-overlay button {
    position: relative; z-index: 20; pointer-events: auto !important;
}

/* Emergency input fix */
.modal-overlay.active { pointer-events: auto !important; }
.modal.active .modal-body input, .modal.active .modal-body select,
.modal.active .modal-body textarea, .modal.active .form-input {
    pointer-events: auto !important; user-select: text !important;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
    position: fixed; top: var(--space-4); right: var(--space-4);
    z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-3);
}
.toast {
    display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4);
    background: #fff; border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl); box-shadow: var(--shadow-lg);
    min-width: 300px; max-width: 420px; animation: slideIn 0.3s ease;
}
.toast-icon { width: 28px; height: 28px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.toast-success .toast-icon { background: var(--success-100); color: var(--success-600); }
.toast-error .toast-icon { background: var(--danger-100); color: var(--danger-600); }
.toast-warning .toast-icon { background: var(--warning-100); color: var(--warning-600); }
.toast-info .toast-icon { background: var(--info-100); color: var(--info-600); }
.toast-content { flex: 1; }
.toast-title { font-weight: var(--font-semibold); margin-bottom: 2px; }
.toast-message { font-size: var(--text-sm); color: var(--text-secondary); }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: var(--space-1); }

/* ============================================
   TABLE GRID (Masa Kartları) — Premium
   ============================================ */
/* ============================================
   TABLE GRID (Masa Kartları) — SHOWY PREMIUM (WITH CHAIRS)
   ============================================ */
.tables-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-6);
    padding: var(--space-4);
}

.table-card {
    position: relative; 
    min-height: 140px;
    background: linear-gradient(145deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.92) 100%);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--radius-3xl); /* Squircle table shape */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Removed overflow: hidden so chairs and aura can spill outside */
    box-shadow: 0 10px 30px rgba(0,0,0,0.03), inset 0 2px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    z-index: 1;
    --chair-color: #cbd5e1; /* Default chair color */
}

/* Glowing Orb Aura Effect (::before) */
.table-card::before {
    content: ''; position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(14,165,233,0.1) 0%, transparent 60%);
    border-radius: 50%; opacity: 0.6; transition: all 0.5s ease; z-index: -2;
    pointer-events: none;
}

/* 4 Aesthetic Chairs (::after) using Gradients */
.table-card::after {
    content: ''; position: absolute;
    /* Grow exactly large enough to show the chairs outside the table boundaries */
    top: -14px; bottom: -14px; left: -14px; right: -14px;
    z-index: -1; pointer-events: none;
    
    background-image: 
        radial-gradient(ellipse at center, var(--chair-color) 60%, transparent 62%), /* Top */
        radial-gradient(ellipse at center, var(--chair-color) 60%, transparent 62%), /* Bottom */
        radial-gradient(ellipse at center, var(--chair-color) 60%, transparent 62%), /* Left */
        radial-gradient(ellipse at center, var(--chair-color) 60%, transparent 62%); /* Right */
    background-position: center top, center bottom, left center, right center;
    background-size: 50px 24px, 50px 24px, 24px 50px, 24px 50px;
    background-repeat: no-repeat;
    transition: all 0.4s ease;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.06));
}

.table-card:hover { 
    transform: translateY(-8px) scale(1.02); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), inset 0 2px 0 rgba(255, 255, 255, 1);
}
.table-card:hover::before { opacity: 0.9; }
.table-card:hover::after { transform: scale(1.05); filter: drop-shadow(0 8px 12px rgba(0,0,0,0.1)); }

/* Available Status */
.table-card.available {
    background: linear-gradient(145deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid rgba(16,185,129,0.3);
    box-shadow: 0 10px 25px rgba(16,185,129,0.08), inset 0 2px 0 rgba(255,255,255,0.7);
    --chair-color: #a7f3d0;
}
.table-card.available::before { background: radial-gradient(circle at center, rgba(16,185,129,0.15) 0%, transparent 60%); }
.table-card.available:hover { box-shadow: 0 20px 40px rgba(16,185,129,0.15), inset 0 2px 0 rgba(255,255,255,0.9); }

/* Occupied Status */
.table-card.occupied { 
    background: linear-gradient(145deg, #fff1f2 0%, #ffe4e6 100%);
    border: 1px solid rgba(244,63,94,0.3);
    box-shadow: 0 12px 30px rgba(244,63,94,0.15), inset 0 2px 0 rgba(255, 255, 255, 0.7);
    --chair-color: #fecdd3; /* Soft red chairs */
}
.table-card.occupied::before { background: radial-gradient(circle at center, rgba(244,63,94,0.2) 0%, transparent 60%); }
.table-card.occupied:hover { box-shadow: 0 20px 45px rgba(244,63,94,0.25), inset 0 2px 0 rgba(255, 255, 255, 0.9); }

/* Selected / Active Status (Used in Cashier mostly) */
.table-card.selected {
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 100%);
    border: 2px solid var(--primary-500);
    box-shadow: 0 0 0 4px rgba(249,115,22,0.15), 0 15px 35px rgba(249,115,22,0.25); 
    transform: translateY(-4px) scale(1.02);
    --chair-color: #fed7aa; /* Orange chairs */
}
.table-card.selected::before { background: radial-gradient(circle at center, rgba(249,115,22,0.25) 0%, transparent 60%); }
.table-card.selected:hover::after { transform: scale(1.08); }

/* Reservated Status */
.table-card.reserved, .table-card.has-reservation {
    border-color: var(--warning-400); background: linear-gradient(145deg, #fffbeb, #fef3c7);
    --chair-color: #fde68a;
}
.table-card.reserved::before, .table-card.has-reservation::before {
    background: radial-gradient(circle at center, rgba(245,158,11,0.2) 0%, transparent 60%);
}

.table-reservation {
    position: absolute; top: 10px; left: 10px;
    background: var(--warning-500); color: white;
    padding: 3px 10px; border-radius: var(--radius-lg);
    font-size: 0.70rem; font-weight: var(--font-extrabold); z-index: 10;
    box-shadow: 0 4px 10px rgba(245,158,11,0.3); letter-spacing: 0.5px;
}

.table-time {
    position: absolute; top: 10px; right: 10px;
    font-size: var(--text-xs); padding: 4px 10px; border-radius: var(--radius-full);
    background: #fff; color: var(--text-primary); font-weight: 800;
    z-index: 10; box-shadow: 0 2px 10px rgba(0,0,0,0.06); border: 1px solid var(--border-color);
}
.table-time.warning { background: linear-gradient(135deg, var(--danger-500), var(--danger-600)); color: white; border:none; box-shadow: 0 4px 15px rgba(244,63,94,0.4); animation: urgentPulse 2s infinite; }

/* Large Gradient Text Elements */
.table-number { 
    font-size: 3rem; font-weight: 900; line-height: 1; z-index: 2; margin-bottom: 4px;
    background: linear-gradient(135deg, #0f172a, #475569);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}
.table-card.available .table-number { background: linear-gradient(135deg, #065f46, #10b981); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.table-card.occupied .table-number { background: linear-gradient(135deg, #9f1239, #e11d48); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.table-card.selected .table-number { background: linear-gradient(135deg, #9a3412, #ea580c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.table-info { font-size: var(--text-sm); color: var(--text-secondary); z-index: 2; font-weight: 600; text-align: center; margin-top: 4px;}
.table-amount { 
    font-size: var(--text-lg); font-weight: 900; color: #334155; margin-top: var(--space-2); z-index: 2; 
    background: rgba(255,255,255,0.9); padding: 4px 14px; border-radius: var(--radius-full);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid rgba(255,255,255,0.5);
}
.table-card.occupied .table-amount { color: #e11d48; }

/* ============================================
   ORDER ITEMS
   ============================================ */
.order-list { display: flex; flex-direction: column; gap: var(--space-2); }
.order-item {
    display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
    background: var(--bg-tertiary); border-radius: var(--radius-xl);
    border: 1px solid var(--border-color); transition: all var(--transition-fast);
}
.order-item:hover { background: var(--primary-50); border-color: var(--primary-200); }
.order-item-qty {
    width: 32px; height: 32px; background: var(--primary-500); color: white;
    border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
    font-weight: var(--font-bold); flex-shrink: 0; font-size: var(--text-sm);
}
.order-item-info { flex: 1; min-width: 0; }
.order-item-name { font-weight: var(--font-medium); }
.order-item-note { font-size: var(--text-xs); color: var(--warning-600); margin-top: 2px; }
.order-item-price { font-weight: var(--font-bold); color: var(--primary-600); }
.order-item-actions { display: flex; gap: var(--space-1); }

/* ============================================
   NUMPAD
   ============================================ */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); max-width: 280px; }
.numpad-btn {
    height: 60px; font-size: var(--text-xl); font-weight: var(--font-bold);
    background: #fff; border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl); color: var(--text-primary); cursor: pointer;
    transition: all var(--transition-fast); box-shadow: var(--shadow-xs);
}
.numpad-btn:hover { background: var(--bg-tertiary); border-color: var(--primary-300); }
.numpad-btn:active { transform: scale(0.95); }
.numpad-btn.primary { background: var(--primary-500); border-color: var(--primary-600); color: white; }
.numpad-btn.danger { background: var(--danger-500); border-color: var(--danger-600); color: white; }
.numpad-btn.wide { grid-column: span 2; }
.numpad-display {
    grid-column: span 3; padding: var(--space-4); font-size: var(--text-3xl);
    font-weight: var(--font-extrabold); text-align: right;
    background: var(--bg-tertiary); border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl); font-family: var(--font-mono);
}

/* ============================================
   KITCHEN DISPLAY
   ============================================ */
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.kitchen-order {
    background: #fff; border: 2px solid var(--border-color);
    border-radius: var(--radius-2xl); overflow: hidden; box-shadow: var(--shadow-sm);
}
.kitchen-order.urgent { border-color: var(--danger-500); animation: urgentPulse 2s infinite; }
.kitchen-order-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-3) var(--space-4); background: var(--bg-tertiary);
}
.kitchen-order-table { font-size: var(--text-lg); font-weight: var(--font-bold); }
.kitchen-order-time { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
.kitchen-order-time.urgent { color: var(--danger-500); font-weight: var(--font-bold); }
.kitchen-order-items { padding: var(--space-4); }
.kitchen-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-light); }
.kitchen-item:last-child { border-bottom: none; }
.kitchen-item-qty { font-weight: var(--font-extrabold); color: var(--primary-600); min-width: 24px; }
.kitchen-item-name { flex: 1; }
.kitchen-item-note { font-size: var(--text-sm); color: var(--warning-600); display: block; }
.kitchen-order-actions { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border-color); display: flex; gap: var(--space-2); }

/* ============================================
   RESPONSIVE
   ============================================ */
.mobile-menu-btn, .mobile-sidebar { display: none !important; }

@media (max-width: 1024px) {
    .sidebar { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 1rem !important; padding-bottom: 80px !important; }
    .mobile-menu-btn {
        display: flex !important; align-items: center !important; justify-content: center !important;
        position: fixed !important; bottom: 20px !important; right: 20px !important;
        width: 56px !important; height: 56px !important; border-radius: 50% !important;
        background: linear-gradient(135deg, var(--primary-500), var(--primary-600)) !important;
        color: white !important; border: none !important; font-size: 1.25rem !important;
        cursor: pointer !important; z-index: 999999 !important;
        box-shadow: var(--shadow-colored) !important;
    }
    .mobile-sidebar {
        display: none; flex-direction: column;
        position: fixed; top: 0; left: 0; width: 280px; height: 100vh;
        background: #fff; z-index: 100000;
        transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: none; overflow-y: hidden;
    }
    .mobile-sidebar.active { display: flex !important; transform: translateX(0) !important; box-shadow: 10px 0 30px rgba(0,0,0,0.1); }
    .mobile-sidebar-content { flex: 1; display: flex; flex-direction: column; height: 100%; }
    .mobile-sidebar-header {
        padding: 1.25rem; display: flex; align-items: center; justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
    }
    .mobile-close-btn {
        width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-color);
        background: var(--bg-tertiary); color: var(--text-secondary); font-size: 1rem;
        display: flex; align-items: center; justify-content: center; cursor: pointer;
    }
    .mobile-sidebar .sidebar-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0; }
    .sidebar.open { transform: translateX(0) !important; box-shadow: 10px 0 30px rgba(0,0,0,0.1) !important; }
}

@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .tables-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--space-3); }
    .table-number { font-size: var(--text-2xl); }
    .stat-card { flex-direction: column; text-align: center; }
    .modal { width: 95%; max-height: 95vh; }
}

.sidebar-overlay {
    display: none; position: fixed !important; inset: 0 !important;
    background: rgba(15,23,42,0.3) !important; z-index: 99990 !important;
    backdrop-filter: blur(2px) !important; opacity: 0; transition: opacity 0.3s ease !important;
}
.sidebar-overlay.active { display: block !important; opacity: 1 !important; }

/* ============================================
   PRINT
   ============================================ */
@media print {
    .sidebar, .mobile-menu-btn, .btn, .toast-container { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    body { background: white; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; } .text-right { text-align: right; }
.text-primary { color: var(--primary-600); } .text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); } .text-danger { color: var(--danger-500); }
.text-muted { color: var(--text-muted); }
.d-flex { display: flex; } .d-grid { display: grid; } .d-none { display: none; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); } .mb-4 { margin-bottom: var(--space-4); }
.p-2 { padding: var(--space-2); } .p-4 { padding: var(--space-4); } .p-6 { padding: var(--space-6); }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius-md); } .rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.overflow-hidden { overflow: hidden; } .overflow-auto { overflow: auto; }
.relative { position: relative; } .absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }

.profit-positive { color: var(--success-600); }
.profit-negative { color: var(--danger-500); }
.status-badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: var(--font-bold); }
.status-pending { background: var(--warning-100); color: var(--warning-600); }
.status-preparing { background: var(--info-100); color: var(--info-600); }
.status-ready { background: var(--success-100); color: var(--success-600); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::selection { background: rgba(249,115,22,0.15); color: var(--text-primary); }