/* frontend/css/main.css */
/* POS Sistemi - Ana Stil Dosyası */

:root {
  /* Palette: Koyu, profesyonel restoran teması */
  --bg-base:        #0f1117;
  --bg-surface:     #1a1d27;
  --bg-elevated:    #242836;
  --bg-hover:       #2d3244;
  
  --accent:         #f59e0b;       /* Amber - sıcak, iştah açıcı */
  --accent-dark:    #d97706;
  --accent-glow:    rgba(245,158,11,0.15);
  
  --success:        #10b981;
  --success-bg:     rgba(16,185,129,0.12);
  --warning:        #f59e0b;
  --warning-bg:     rgba(245,158,11,0.12);
  --danger:         #ef4444;
  --danger-bg:      rgba(239,68,68,0.12);
  --info:           #3b82f6;
  --info-bg:        rgba(59,130,246,0.12);
  
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;
  
  --border:         rgba(255,255,255,0.07);
  --border-focus:   rgba(245,158,11,0.5);
  
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  
  --shadow:         0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.6);
  
  --sidebar-width:  240px;
  --topbar-height:  56px;
  
  --font-main:      'Inter', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', monospace;
  
  --transition:     0.18s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 15px; }

body {
  font-family: var(--font-main);
  background: var(--bg-base);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.screen { position: fixed; inset: 0; z-index: 100; }

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition);
  z-index: 50;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.sidebar-close { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.1rem; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--accent-glow);
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 500;
}

.nav-menu { list-style: none; padding: 8px 0; flex: 1; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { 
  background: var(--accent-glow); 
  color: var(--accent); 
  border-left-color: var(--accent);
}

.nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-label { flex: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-status { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-secondary); }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.ws-dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.ws-dot.disconnected { background: var(--danger); }
.ws-dot.connecting { background: var(--warning); animation: pulse 1.5s infinite; }

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

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
}

.menu-toggle { display: none; }
.topbar-title { font-size: 1rem; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }

.badge-notifications {
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  color: var(--warning);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.view { display: none; min-height: 100%; padding: 20px; }
.view.active { display: flex; flex-direction: column; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen {
  background: radial-gradient(ellipse at top, #1a1d27 0%, #0f1117 70%);
  display: flex; align-items: center; justify-content: center;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 2.5rem; margin-bottom: 8px; }
.login-logo h1 { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.login-logo p { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

/* ============================================================
   TABLES GRID
   ============================================================ */
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

.section-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  flex: 1;
  align-content: start;
}

.table-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.table-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.table-card.occupied { border-color: var(--info); background: var(--info-bg); }
.table-card.available { border-color: var(--border); }
.table-card.reserved { border-color: var(--warning); background: var(--warning-bg); }
.table-card.selected-merge { border-color: var(--accent); background: var(--accent-glow); }

.table-number { font-size: 1.5rem; font-weight: 700; font-family: var(--font-mono); }
.table-name { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.table-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.table-status-dot.available { background: var(--success); }
.table-status-dot.occupied { background: var(--info); }
.table-status-dot.reserved { background: var(--warning); }

.table-bill-info { margin-top: 8px; }
.table-total { font-size: 0.875rem; font-weight: 600; color: var(--accent); font-family: var(--font-mono); }
.table-time { font-size: 0.7rem; color: var(--text-secondary); }
.table-capacity { font-size: 0.7rem; color: var(--text-muted); }

/* ============================================================
   BILL LAYOUT
   ============================================================ */
.bill-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.product-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.product-search input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-shrink: 0;
}
.category-tabs::-webkit-scrollbar { height: 3px; }
.category-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card:hover { border-color: var(--accent); background: var(--accent-glow); }
.product-card.out-of-stock { opacity: 0.4; cursor: not-allowed; }

.product-name { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.product-price { font-size: 0.9rem; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.product-stock { font-size: 0.68rem; color: var(--text-muted); }

/* Bill Panel */
.bill-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.bill-table-info h3 { font-size: 1rem; font-weight: 600; }
.bill-number { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }

.bill-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.bill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.bill-item:last-child { border-bottom: none; }
.bill-item:hover { background: var(--bg-elevated); }
.bill-item.cancelled { opacity: 0.4; text-decoration: line-through; }

.item-qty-control { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-display { font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; min-width: 24px; text-align: center; }

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

.item-price { font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; }
.item-cancel { color: var(--danger); background: none; border: none; cursor: pointer; padding: 4px; font-size: 0.85rem; opacity: 0.6; }
.item-cancel:hover { opacity: 1; }

.bill-footer {
  border-top: 1px solid var(--border);
  padding: 16px;
}

.bill-totals { margin-bottom: 12px; }
.total-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); padding: 3px 0; }
.total-grand { font-size: 1rem; font-weight: 700; color: var(--text-primary); border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

.bill-actions { display: flex; gap: 8px; }
.bill-actions .btn-large { flex: 1; }

/* ============================================================
   KITCHEN
   ============================================================ */
.kitchen-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  height: 100%;
  overflow: hidden;
}

.kitchen-column { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.column-header {
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.column-header.warning { background: var(--warning-bg); border: 1px solid var(--warning); }
.column-header.info { background: var(--info-bg); border: 1px solid var(--info); }
.column-header.success { background: var(--success-bg); border: 1px solid var(--success); }
.column-header h3 { font-size: 0.875rem; font-weight: 600; }
.column-count { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; }

.kitchen-cards { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.kitchen-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.kitchen-card:hover { border-color: var(--accent); }
.kitchen-card-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.kitchen-table { font-size: 0.8rem; font-weight: 600; }
.kitchen-time { font-size: 0.7rem; font-family: var(--font-mono); color: var(--text-muted); }
.kitchen-item-name { font-size: 0.875rem; font-weight: 500; }
.kitchen-item-qty { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.kitchen-item-note { font-size: 0.7rem; color: var(--text-secondary); }

/* ============================================================
   STOCK TABLE
   ============================================================ */
.stock-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.stock-table-wrapper { overflow-x: auto; flex: 1; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: var(--bg-elevated); }

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}
.stock-badge.ok { background: var(--success-bg); color: var(--success); }
.stock-badge.low { background: var(--warning-bg); color: var(--warning); }
.stock-badge.critical { background: var(--danger-bg); color: var(--danger); }
.stock-badge.out { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-main);
  transition: border-color var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--border-focus); }
input::placeholder { color: var(--text-muted); }
input:disabled { opacity: 0.5; cursor: not-allowed; }
select option { background: var(--bg-elevated); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-main);
  text-decoration: none;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--text-secondary); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); }
.btn-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-large { padding: 13px 24px; font-size: 0.9rem; }
.btn-full { width: 100%; }

/* Tab buttons */
.tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-main);
}
.tab:hover { background: var(--bg-elevated); color: var(--text-primary); }
.tab.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }

/* Payment method buttons */
.payment-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 20px; }

.payment-method-btn {
  padding: 12px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
  font-family: var(--font-main);
}
.payment-method-btn:hover { border-color: var(--accent); }
.payment-method-btn.active { border-color: var(--accent); background: var(--accent-glow); color: var(--accent); }

/* ============================================================
   MODALS
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }

.modal-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
.modal-card.large { max-width: 600px; }

@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.1rem; padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   ALERTS & TOAST
   ============================================================ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.825rem;
  font-weight: 500;
}
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger); color: var(--danger); }
.alert-success { background: var(--success-bg); border: 1px solid var(--success); color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning); color: var(--warning); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
  min-width: 240px;
  max-width: 380px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--info); }
.toast-icon { font-size: 1.1rem; }
.toast-message { flex: 1; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.loading-spinner { text-align: center; color: var(--text-muted); padding: 40px; }
.empty-state { text-align: center; color: var(--text-muted); padding: 30px; font-size: 0.875rem; }
.search-input { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; color: var(--text-primary); font-size: 0.875rem; min-width: 200px; }

.payment-amount-display { text-align: center; padding: 20px; background: var(--bg-elevated); border-radius: var(--radius-lg); margin-bottom: 20px; }
.payment-amount-display span { display: block; font-size: 0.8rem; color: var(--text-secondary); }
.payment-amount-display strong { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); font-family: var(--font-mono); margin-top: 4px; }

.change-display { text-align: center; padding: 12px; background: var(--success-bg); border: 1px solid var(--success); border-radius: var(--radius); color: var(--success); }

/* Reports */
.report-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.report-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.summary-label { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.summary-value { font-size: 1.4rem; font-weight: 700; font-family: var(--font-mono); color: var(--accent); margin-top: 4px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.settings-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.settings-card h3 { font-size: 0.925rem; font-weight: 600; }

/* ============================================================
   RESPONSIVE - TABLET & MOBILE
   ============================================================ */
@media (max-width: 1024px) {
  .bill-layout { grid-template-columns: 1fr 340px; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }
  
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 100;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-close { display: block; }
  
  .menu-toggle { display: flex; }
  
  .bill-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    overflow: auto;
  }
  
  .product-panel { max-height: 50vh; }
  .bill-panel { max-height: 50vh; }
  
  .kitchen-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .kitchen-column { min-height: 200px; }
  
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  
  .modal-card { max-width: 100%; margin: 10px; }
  
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .view { padding: 12px; }
  .table-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .table-card { padding: 10px; min-height: 90px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   KALİCİ BİLDİRİM SİSTEMİ
   ============================================================ */
.notif-item {
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: .85rem;
    font-weight: 600;
    animation: slideDown .3s ease;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,.2);
}
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

.notif-waiter { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.notif-qrorder { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
.notif-stock   { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }

.notif-icon { font-size: 1.2rem; flex-shrink: 0; }
.notif-text { flex: 1 }
.notif-time { font-size: .7rem; opacity: .8; white-space: nowrap; }
.notif-close {
    background: rgba(255,255,255,.25);
    border: none;
    color: #fff;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .8rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Bildirim çubuğu varken içerik aşağıya kayar */
.has-notif .app-shell .main-content { margin-top: 0; }

/* ============================================================
   MOBİL TAM UYUM
   ============================================================ */
@media (max-width: 768px) {
    /* Topbar sabit kal */
    .topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        background: var(--bg-surface);
    }

    /* View container scroll düzgün çalışsın */
    .view-container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: calc(100vh - var(--topbar-height));
    }

    /* View padding azalt */
    .view { padding: 12px; }

    /* Bill layout - mobilde tek kolon */
    .bill-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - var(--topbar-height));
        overflow: visible;
    }

    .product-panel {
        max-height: 45vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .product-grid { overflow-y: auto; flex: 1; }

    .bill-panel {
        position: sticky;
        bottom: 0;
        z-index: 30;
        background: var(--bg-surface);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,.4);
        max-height: 55vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .bill-items { overflow-y: auto; flex: 1; }

    /* Masa grid - daha küçük kartlar */
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .table-card { min-height: 80px; padding: 10px; }
    .table-number { font-size: 1.3rem; }

    /* Category tabs scroll */
    .category-tabs, .section-tabs {
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .category-tabs::-webkit-scrollbar,
    .section-tabs::-webkit-scrollbar { display: none; }

    /* Kitchen - tek kolon mobil */
    .kitchen-layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .kitchen-column { min-height: 180px; }

    /* Payment modal tam ekran */
    .modal { padding: 0; align-items: flex-end; }
    .modal-card {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        margin: 0;
    }

    /* Stock table yatay scroll */
    .stock-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 600px; }

    /* Report summary - 2 kolon */
    .report-summary { grid-template-columns: repeat(2, 1fr); }

    /* Settings grid tek kolon */
    .settings-tabs { overflow-x: auto; scrollbar-width: none; }
    .settings-tabs::-webkit-scrollbar { display: none; }

    /* Topbar actions bazı elementleri gizle */
    .topbar-time { display: none; }

    /* QR settings grid */
    #qrSettingsPanel > div:first-child {
        grid-template-columns: 1fr !important;
    }

    /* Product grid - 2 kolon */
    .product-grid { grid-template-columns: repeat(2, 1fr); }

    /* Bill actions stack */
    .bill-actions { flex-wrap: wrap; }
    .bill-actions .btn-large { flex: 1; min-width: 120px; }

    /* FAB garson/QR butonu */
    .cart-fab { bottom: 70px !important; }

    /* Bottom bar */
    .bbar { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
    :root { font-size: 14px; }

    .table-grid { grid-template-columns: repeat(3, 1fr); }

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

    .sidebar { width: 100%; max-width: 280px; }

    .modal-body { padding: 16px; }

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

    .report-summary { grid-template-columns: 1fr 1fr; }
    .summary-value { font-size: 1.1rem; }

    /* Topbar küçült */
    .topbar { padding: 0 12px; }
    .topbar-title { font-size: .875rem; }
}

/* Safe area (iPhone notch) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-bar, .bbar {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .modal-card { padding-bottom: env(safe-area-inset-bottom); }
}

/* ============================================================
   SPIN ANİMASYON (settings loaders)
   ============================================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}
