/* ═══════════════════════════════════════════════════════════════════
   P4N POS — Design System
   Dark Glassmorphism Theme with Electric Accents
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────── */
:root {
  /* Colors — HSL Palette */
  --primary: hsl(250, 80%, 60%);
  --primary-light: hsl(250, 80%, 72%);
  --primary-dark: hsl(250, 80%, 45%);
  --primary-glow: hsla(250, 80%, 60%, 0.4);

  --accent: hsl(170, 80%, 50%);
  --accent-light: hsl(170, 80%, 65%);
  --accent-glow: hsla(170, 80%, 50%, 0.3);

  --success: hsl(150, 70%, 45%);
  --success-light: hsl(150, 70%, 55%);
  --success-glow: hsla(150, 70%, 45%, 0.3);

  --warning: hsl(35, 90%, 55%);
  --warning-light: hsl(35, 90%, 65%);
  --warning-glow: hsla(35, 90%, 55%, 0.3);

  --danger: hsl(0, 75%, 55%);
  --danger-light: hsl(0, 75%, 65%);
  --danger-glow: hsla(0, 75%, 55%, 0.3);

  /* Surfaces */
  --bg-primary: hsl(230, 25%, 8%);
  --bg-secondary: hsl(230, 25%, 12%);
  --bg-tertiary: hsl(230, 25%, 16%);
  --surface: hsla(230, 25%, 18%, 0.6);
  --surface-hover: hsla(230, 25%, 22%, 0.7);
  --surface-active: hsla(230, 25%, 25%, 0.8);
  --surface-glass: hsla(230, 25%, 15%, 0.5);

  /* Text */
  --text-primary: hsl(220, 20%, 95%);
  --text-secondary: hsl(220, 15%, 70%);
  --text-muted: hsl(220, 10%, 50%);
  --text-inverse: hsl(230, 25%, 8%);

  /* Borders */
  --border: hsla(220, 20%, 30%, 0.3);
  --border-light: hsla(220, 20%, 40%, 0.2);
  --border-focus: var(--primary);

  /* Shadows */
  --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.2);
  --shadow-md: 0 4px 16px hsla(0, 0%, 0%, 0.3);
  --shadow-lg: 0 8px 32px hsla(0, 0%, 0%, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Glassmorphism */
  --glass-blur: blur(20px);
  --glass-bg: hsla(230, 25%, 15%, 0.5);
  --glass-border: 1px solid hsla(220, 20%, 40%, 0.15);
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, hsla(250, 80%, 40%, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, hsla(170, 80%, 40%, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, hsla(250, 60%, 30%, 0.1) 0%, transparent 50%);
  z-index: -1;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: hsla(220, 20%, 40%, 0.3);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: hsla(220, 20%, 50%, 0.4);
}

/* ── Typography ────────────────────────────────────────────────── */
h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

/* ── Layout Components ─────────────────────────────────────────── */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Top Navigation Bar ────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: var(--glass-bg);
  border-bottom: var(--glass-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: var(--glass-border);
  font-size: 0.85rem;
  font-weight: 500;
}

.user-badge .role-icon {
  font-size: 1rem;
}

.role-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
}

.role-tag.admin {
  background: var(--warning);
  color: var(--text-inverse);
}

.role-tag.waiter {
  background: var(--primary);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsla(0, 0%, 100%, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), hsl(170, 80%, 40%));
  color: var(--text-inverse);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), hsl(150, 70%, 35%));
  color: white;
  box-shadow: 0 4px 15px var(--success-glow);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), hsl(35, 90%, 45%));
  color: var(--text-inverse);
  box-shadow: 0 4px 15px var(--warning-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), hsl(0, 75%, 45%));
  color: white;
  box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-icon {
  padding: 8px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
}

.btn-icon.lg {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
}

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--surface-hover);
  border-color: hsla(220, 20%, 50%, 0.2);
}

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

/* ── Table Grid (Masalar) ──────────────────────────────────────── */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  padding: 16px 0;
}

.table-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  text-decoration: none;
  color: var(--text-primary);
}

.table-cell:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.table-cell .table-number {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.table-cell .table-total {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.table-cell .table-items {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Empty table */
.table-cell.empty {
  border-color: var(--border);
  opacity: 0.6;
}

.table-cell.empty:hover {
  opacity: 1;
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Occupied table */
.table-cell.occupied {
  border-color: var(--success);
  background: linear-gradient(135deg, hsla(150, 70%, 45%, 0.15), var(--surface));
  opacity: 1;
  box-shadow: 0 0 12px var(--success-glow);
  animation: occupiedPulse 3s ease-in-out infinite;
}

.table-cell.occupied .table-total {
  opacity: 1;
}

.table-cell.occupied:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.15);
}

.table-cell.billing {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.5), inset 0 0 10px rgba(245, 158, 11, 0.2);
  animation: pulse-billing 2s infinite alternate;
}

.table-cell.billing .table-total {
  opacity: 1;
  color: var(--warning);
}

.table-cell.billing:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6), inset 0 0 10px rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.15);
}

@keyframes pulse-billing {
  from {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4), inset 0 0 5px rgba(245, 158, 11, 0.1);
  }

  to {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.8), inset 0 0 15px rgba(245, 158, 11, 0.3);
  }
}


@keyframes occupiedPulse {

  0%,
  100% {
    box-shadow: 0 0 12px var(--success-glow);
  }

  50% {
    box-shadow: 0 0 20px var(--success-glow);
  }
}

/* ── Login Page ────────────────────────────────────────────────── */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-logo {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin-bottom: 24px;
}

.user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.user-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

.user-card.selected {
  border-color: var(--primary);
  background: hsla(250, 80%, 60%, 0.15);
  box-shadow: var(--shadow-glow);
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.user-card .user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-card .user-role-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* PIN Keypad */
.pin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(230, 25%, 5%, 0.85);
  backdrop-filter: blur(10px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.pin-overlay.active {
  display: flex;
}

.pin-modal {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 320px;
  max-width: 90vw;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.pin-header {
  text-align: center;
  margin-bottom: 24px;
}

.pin-header h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.pin-dots {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  transition: all var(--transition-fast);
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-key {
  aspect-ratio: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: none;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pin-key:hover {
  background: var(--surface-hover);
}

.pin-key:active {
  background: var(--primary);
  transform: scale(0.95);
}

.pin-key.action {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-ui);
}

.pin-key.backspace {
  color: var(--danger);
}

.pin-key.cancel {
  color: var(--text-muted);
}

.pin-error {
  text-align: center;
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 24px;
  margin-top: 12px;
}

/* ── Modal (Generic) ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(230, 25%, 5%, 0.85);
  backdrop-filter: blur(10px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ── Form Elements ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── Table Order Page ──────────────────────────────────────────── */
.table-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 0;
  min-height: calc(100vh - 65px);
}

@media (max-width: 768px) {
  .table-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* Menu panel */
.menu-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.category-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.category-tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.category-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.menu-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.menu-item-card {
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-item-card:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.menu-item-card:active {
  transform: scale(0.96);
  background: hsla(250, 80%, 60%, 0.15);
}

.menu-item-card .item-name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.menu-item-card .item-price {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Order panel */
.order-panel {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: calc(100vh - 90px);
}

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

.order-header h2 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  gap: 8px;
}

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

.order-item-info {
  flex: 1;
  min-width: 0;
}

.order-item-info .item-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.order-item-info .item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.order-item-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  white-space: nowrap;
}

.order-item .delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.order-item .delete-btn:hover {
  opacity: 1;
}

.order-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 40px;
  text-align: center;
}

.order-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.order-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.order-total .total-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.order-total .total-amount {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
}

.order-actions {
  display: flex;
  gap: 8px;
}

.order-actions .btn {
  flex: 1;
}

/* ── Admin Panel ───────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 65px);
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

.admin-sidebar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: var(--glass-border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 768px) {
  .admin-sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: var(--glass-border);
    padding: 8px 12px;
  }
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.admin-nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.admin-nav-item.active {
  background: hsla(250, 80%, 60%, 0.15);
  color: var(--primary-light);
  font-weight: 600;
}

.admin-content {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

/* ── Stats Cards ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ── Notification Bell ─────────────────────────────────────────── */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  transition: color var(--transition-fast);
}

.notification-bell:hover {
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* ── Notifications Panel ───────────────────────────────────────── */
.notifications-panel {
  display: none;
  position: fixed;
  top: 60px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
  animation: modalSlideIn 0.2s ease-out;
}

.notifications-panel.active {
  display: flex;
  flex-direction: column;
}

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

.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-item .notif-text {
  font-size: 0.85rem;
  line-height: 1.4;
}

.notification-item .notif-text strong {
  color: var(--accent);
}

.notification-item .notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Data Table ────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.data-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

/* ── Toast Notifications ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: var(--glass-border);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--primary);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ── Payment Modal ─────────────────────────────────────────────── */
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.payment-option {
  padding: 24px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.payment-option:hover {
  border-color: var(--primary);
  background: hsla(250, 80%, 60%, 0.1);
}

.payment-option.selected {
  border-color: var(--primary);
  background: hsla(250, 80%, 60%, 0.15);
  box-shadow: var(--shadow-glow);
}

.payment-option .pay-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.payment-option .pay-label {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── Quantity Selector ─────────────────────────────────────────── */
.qty-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

.qty-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 40px;
  text-align: center;
}

/* ── Status Indicators ─────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success-glow);
}

.status-dot.offline {
  background: var(--text-muted);
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .tables-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
  }

  .table-cell .table-number {
    font-size: 1.1rem;
  }

  .menu-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .topbar {
    padding: 10px 14px;
  }

  .topbar-logo {
    font-size: 1rem;
  }

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

@media (max-width: 360px) {
  .tables-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Utilities ─────────────────────────────────────────────────── */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.p-3 {
  padding: 12px;
}

.p-4 {
  padding: 16px;
}

.text-center {
  text-align: center;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ── Loading Spinner ───────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  transition: opacity var(--transition-slow);
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════
   Kasiyer Rol Tag + Dinamik Roller
   ═══════════════════════════════════════════════════════════════════ */

.role-tag.cashier {
  background: hsla(35, 90%, 55%, 0.2);
  color: hsl(35, 90%, 65%);
  border: 1px solid hsla(35, 90%, 55%, 0.3);
}

.role-tag.admin {
  background: hsla(250, 80%, 60%, 0.2);
  color: hsl(250, 80%, 72%);
  border: 1px solid hsla(250, 80%, 60%, 0.3);
}

.role-tag.waiter {
  background: hsla(150, 70%, 45%, 0.2);
  color: hsl(150, 70%, 55%);
  border: 1px solid hsla(150, 70%, 45%, 0.3);
}

.user-role-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   Canlı Sipariş Kartları
   ═══════════════════════════════════════════════════════════════════ */

.live-order-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: slideInUp 0.3s ease-out;
}

.live-order-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px var(--primary-glow);
}

.live-order-card.billing {
  border-left: 4px solid var(--warning);
}

.live-order-card.open {
  border-left: 4px solid var(--success);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.live-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: hsla(230, 25%, 12%, 0.6);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.live-order-table {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-order-table-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.live-order-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.live-order-badge.open {
  background: hsla(150, 70%, 45%, 0.2);
  color: hsl(150, 70%, 55%);
}

.live-order-badge.billing {
  background: hsla(35, 90%, 55%, 0.2);
  color: hsl(35, 90%, 65%);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.live-order-meta {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.live-order-items {
  padding: 12px 18px;
  max-height: 200px;
  overflow-y: auto;
}

.live-order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid hsla(220, 20%, 30%, 0.15);
  font-size: 0.9rem;
}

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

.live-item-qty {
  font-weight: 700;
  color: var(--primary-light);
  min-width: 32px;
}

.live-item-name {
  flex: 1;
  color: var(--text-primary);
}

.live-item-waiter {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.live-item-price {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 600;
}

.live-order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: hsla(230, 25%, 12%, 0.4);
  border-top: 1px solid var(--border);
}

.live-order-total {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

.live-order-actions {
  display: flex;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════
   Rol Yönetimi
   ═══════════════════════════════════════════════════════════════════ */

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

.perm-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 16px;
}

.perm-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  background: hsla(250, 80%, 60%, 0.15);
  color: hsl(250, 80%, 72%);
  border: 1px solid hsla(250, 80%, 60%, 0.2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ── Permission Grid (Rol Düzenleme Modal) ─────────────────────── */

.permissions-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.perm-category {
  background: hsla(230, 25%, 15%, 0.5);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--border);
}

.perm-category-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.perm-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.perm-toggle:hover {
  background: hsla(230, 25%, 22%, 0.5);
}

.perm-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.perm-toggle-info {
  display: flex;
  flex-direction: column;
}

.perm-toggle-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.perm-toggle-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── Status Dot ──────────────────────────────────────────────────── */

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success-glow);
}

.status-dot.offline {
  background: var(--text-muted);
}

/* ── Notification Improvements ───────────────────────────────────── */

#liveNotifsList .notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

#liveNotifsList .notification-item:hover {
  background: var(--surface-hover);
}

#liveNotifsList .notification-item:last-child {
  border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════
   P4N POS — Live Order Item Note & Animations
   ═══════════════════════════════════════════════════════════ */
.item-note {
  font-size: 0.85em;
  color: var(--warning);
  background: rgba(234, 179, 8, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 4px;
  line-height: 1.4;
  word-wrap: break-word;
}

.item-note.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  max-width: 250px;
}

.item-note.truncate.expanded {
  white-space: normal;
  max-width: none;
}

.item-note .read-more {
  color: var(--text-muted);
  font-size: 0.9em;
  text-decoration: underline;
  margin-left: 4px;
}

.item-note.expanded .read-more {
  display: none;
}

@keyframes flashGreen {
  0% {
    background-color: rgba(34, 197, 94, 0.4);
  }

  50% {
    background-color: rgba(34, 197, 94, 0.1);
  }

  100% {
    background-color: transparent;
  }
}

.live-order-item.flash-green {
  animation: flashGreen 2s ease-out;
  border-left: 3px solid var(--success);
}

/* ── PIN Change Step Dots ──────────────────────────────────────── */
.pin-step-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: all var(--transition-fast);
}

.pin-step-dot.active {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary-glow);
}

/* ── Order Item Status Badges ──────────────────────────────────── */
.item-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: none;
}

.item-status-badge.pending {
  background: linear-gradient(135deg, hsl(35, 95%, 55%), hsl(25, 95%, 50%));
  color: #0d0f17;
  border: 1px solid hsla(35, 100%, 70%, 0.6);
  box-shadow: 0 2px 8px hsla(35, 95%, 50%, 0.4);
}

.item-status-badge.confirmed {
  background: linear-gradient(135deg, hsl(250, 85%, 65%), hsl(240, 85%, 55%));
  color: #ffffff;
  border: 1px solid hsla(250, 100%, 75%, 0.6);
  box-shadow: 0 2px 8px hsla(250, 85%, 60%, 0.4);
}

.item-status-badge.ready {
  background: linear-gradient(135deg, hsl(150, 80%, 45%), hsl(140, 80%, 35%));
  color: #000000;
  border: 1px solid hsla(150, 100%, 70%, 0.6);
  box-shadow: 0 2px 8px hsla(150, 80%, 45%, 0.4);
}

/* ── Pending Order Blink Animation ─────────────────────────────── */
@keyframes pendingPulse {
  0% {
    border-left-color: var(--warning);
    opacity: 1;
  }

  50% {
    border-left-color: transparent;
    opacity: 0.7;
  }

  100% {
    border-left-color: var(--warning);
    opacity: 1;
  }
}

.live-order-item.pending-blink {
  border-left: 4px solid var(--warning);
  animation: pendingPulse 1.2s ease-in-out infinite;
  background: hsla(35, 90%, 55%, 0.05);
}

/* Pending card-level blink for unconfirmed orders */
@keyframes cardPendingGlow {
  0% {
    box-shadow: 0 0 0 0 hsla(35, 90%, 55%, 0.4);
  }

  50% {
    box-shadow: 0 0 15px 2px hsla(35, 90%, 55%, 0.2);
  }

  100% {
    box-shadow: 0 0 0 0 hsla(35, 90%, 55%, 0.4);
  }
}

.live-order-card.has-pending {
  animation: cardPendingGlow 1.5s ease-in-out infinite;
  border: 1px solid hsla(35, 90%, 55%, 0.4);
}

/* Order action buttons in live view */
.live-item-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.live-item-actions .btn {
  padding: 2px 8px;
  font-size: 0.75rem;
}