@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Dark Theme variables (default) */
  --bg-app: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-glass: rgba(15, 23, 42, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #ffa633;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #ff9000;
  --primary-hover: #e68200;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Outfit', sans-serif;
  --table-empty: #10b981;
  --table-occupied: #f59e0b;
  --grid-color: rgba(255, 255, 255, 0.015);
}

body.light-theme {
  /* Light Theme variables */
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(241, 245, 249, 0.4);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #e68200;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #e68200;
  --primary-hover: #cc7400;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.1);
  --table-empty: #10b981;
  --table-occupied: #d97706;
  --grid-color: rgba(0, 0, 0, 0.015);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font);
  outline: none;
}

html, body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: var(--transition);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Full Screen Login */
#login-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  animation: popIn 0.4s ease-out;
}

.login-logo {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffa633 0%, #ff5500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Top Fixed Navbar */
.top-navbar {
  height: 60px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.navbar-logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 256px; /* Align to the 280px sidebar (280px - 24px navbar padding) */
  flex-shrink: 0;
}

.navbar-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}

.user-dropdown-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  transition: var(--transition);
}

.user-dropdown-btn:hover {
  background-color: var(--border-color);
}

.user-dropdown-btn .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
  font-weight: 700;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.user-dropdown-btn .user-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.user-dropdown-btn i {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  z-index: 1010;
  animation: popIn 0.15s ease-out;
}

.dropdown-item {
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--primary);
  color: white;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
}

/* Main Dashboard Layout */
#app-layout {
  display: flex;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  margin-top: 60px;
  overflow: hidden;
}

/* Sidebar styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  position: fixed;
  top: 60px;
  bottom: 0;
  left: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: none; /* Hidden on desktop to avoid duplicate logo with navbar */
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 14px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-item:hover, .sidebar-item.active {
  background-color: var(--primary);
  color: #ffffff;
}

.sidebar-item i {
  font-size: 1.25rem;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-info-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-details {
  display: flex;
  flex-direction: column;
}

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

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

/* Header & Main Area */
.main-content {
  flex: 1;
  min-height: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: 280px; /* Offset for fixed sidebar */
}

.main-header {
  display: none;
}

.navbar-divider {
  color: var(--text-muted);
  opacity: 0.3;
  margin: 0 1.25rem;
  font-weight: 300;
  user-select: none;
}

#navbar-screen-title {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-main);
  animation: fadeIn 0.3s ease-out;
}

.header-title h1 {
  font-size: 2rem;
  font-weight: 700;
}

.header-title p {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-selector {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.lang-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn img {
  width: 24px;
  height: 16px;
  border-radius: 4px;
  display: block;
  object-fit: cover;
}

.lang-btn:hover {
  opacity: 0.9;
}

.lang-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 144, 0, 0.6);
}

.theme-toggle {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background-color: var(--border-color);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  top: 60px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1004;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.sidebar-overlay.active {
  display: block;
}

/* Screens */
.app-screen {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.app-screen.active {
  display: block;
}

/* Table Floor Plan Dashboard */
.floor-plan-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  min-height: 60vh;
  position: relative;
  overflow: auto;
  padding: 20px;
  box-shadow: var(--shadow);
  /* Grid pattern background */
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
}

.table-element {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s, background-color 0.2s;
  border: 2px solid transparent;
  user-select: none;
  touch-action: none;
  padding: 0.5rem;
  gap: 0.15rem;
}

.table-element:hover {
  transform: translateY(-2px);
  z-index: 99;
}

.table-element.empty:hover {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.15);
  background: rgba(16, 185, 129, 0.15);
}

.table-element.occupied:hover {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.15);
}

.table-element:active {
  cursor: grabbing;
  transform: translateY(0) scale(1.02);
  z-index: 100;
}

.table-element.empty {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--table-empty);
}

.table-element.occupied {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--table-occupied);
}

.table-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.table-price {
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

body.light-theme .table-price {
  color: #0f172a;
}

.table-duration {
  font-size: 12px;
  font-weight: 600;
  margin-top: 0.15rem;
  white-space: nowrap;
  color: #94a3b8;
  opacity: 0.95;
}

body.light-theme .table-duration {
  color: #64748b;
  opacity: 0.95;
}

/* Quick Sale Grid Screen & Shop Layout */
.shop-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

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

  /* Hide barcode on tablet/mobile */
  .barcode-scan-wrapper,
  .qty-multiplier-wrapper {
    display: none !important;
  }

  /* Floating Cart Toggle Button */
  .mobile-cart-toggle {
    display: flex !important;
  }

  /* Cart panel becomes a bottom sheet - hidden by default */
  .cart-panel {
    position: fixed !important;
    top: auto !important;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto !important;
    max-height: 70dvh;
    min-height: 0;
    padding: 0.75rem 1rem 1rem;
    border-radius: 24px 24px 0 0;
    z-index: 1010;
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
  }

  .cart-panel.mobile-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .cart-panel .cart-items {
    flex: none !important;
    height: auto !important;
    max-height: 35dvh !important;
    margin: 0.5rem 0 !important;
    overflow-y: auto;
  }

  .cart-panel .cart-total-section {
    margin-top: 0.75rem !important;
  }

  .mobile-cart-handle {
    display: block !important;
  }
}

.products-catalog {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quicksale-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quicksale-filters .category-tabs {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0.25rem;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.category-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition);
}

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

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.45rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  box-shadow: var(--shadow);
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.product-image-container {
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover img {
  transform: scale(1.1);
}

.product-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.product-card-name {
  font-weight: 600;
  font-size: 0.8rem;
}

.product-card-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

/* Cart Panel (Sıcak Satış Sepeti) */
.cart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.5rem;
  height: calc(100vh - 140px);
  height: calc(100dvh - 140px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
}

.cart-header {
  font-weight: 700;
  font-size: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-glass);
  padding: 0.65rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.cart-item-name {
  font-weight: 500;
}

.cart-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.15rem;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--text-main);
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}

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

.cart-item-price {
  font-weight: 600;
  text-align: right;
  min-width: 60px;
}

.cart-total-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 700;
}

.payment-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Mobile Cart Toggle FAB – hidden on desktop */
.mobile-cart-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255, 144, 0, 0.45);
  z-index: 1009;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-cart-toggle:active {
  transform: scale(0.92);
}

.mobile-cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

/* Mobile Cart Handle – hidden on desktop */
.mobile-cart-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  opacity: 0.4;
  border-radius: 4px;
  margin: 0 auto 0.75rem;
}

/* Mobile cart overlay */
.mobile-cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1008;
}

/* Standard UI Form controls & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-control {
  background-color: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  width: 100%;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
}

/* Modern Buttons */
.btn {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

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

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-secondary {
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

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

/* Sizing button group and toggled states */
.btn-group {
  display: flex;
  align-items: center;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2px;
  gap: 2px;
}

.btn-group .btn {
  border: none !important;
  border-radius: 10px !important;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-group .btn.active {
  background-color: var(--primary) !important;
  color: white !important;
}

.btn-group .btn:hover:not(.active) {
  background-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary.active {
  background-color: rgba(255, 144, 0, 0.15) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Hide table control labels on narrow mobile screens, showing only icons */
@media (max-width: 576px) {
  .table-controls .btn .btn-label {
    display: none !important;
  }
}

/* Modals Overlay Base */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 600px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  max-height: 95vh;
  max-height: 95dvh;
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
  background-color: rgba(255, 144, 0, 0.15);
  color: #ff9000;
  transform: rotate(90deg);
}

.modal-close:active {
  transform: scale(0.9) rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Custom Table Bill details view in Table Modal */
#table-details-modal .modal-content {
  height: 95vh;
  height: 95dvh;
}

#table-details-modal .modal-body {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  padding: 1rem 1.5rem;
}

.table-order-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  height: 100%;
}

.table-order-split > .table-order-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Desktop defaults for table modal classes */
.table-modal-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.table-modal-filters .category-tabs {
  flex: 1;
  min-width: 0;
  gap: 0.3rem;
  padding-bottom: 0.2rem;
  margin-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.table-modal-filters .category-tabs::-webkit-scrollbar {
  display: none;
}

.table-modal-filters .category-tab {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.table-modal-products-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 2px 2px;
}

/* Bill actions row (payment buttons inside bill panel) */
.table-bill-actions {
  display: none; /* Hidden on desktop – uses footer buttons */
}

/* Floating bill toggle – hidden on desktop */
.mobile-bill-toggle {
  display: none;
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(255, 144, 0, 0.45);
  z-index: 5;
  cursor: pointer;
  transition: transform 0.2s;
}

.mobile-bill-toggle:active {
  transform: scale(0.9);
}

.mobile-bill-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

/* Bill handle – hidden on desktop */
.mobile-bill-handle {
  display: none;
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  opacity: 0.4;
  border-radius: 4px;
  margin: 0 auto 0.6rem;
}

/* Bill overlay for mobile */
.mobile-bill-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1011;
}

@media (max-width: 768px) {
  /* Full-screen modal on mobile */
  #table-details-modal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  #table-details-modal {
    padding: 0;
  }

  /* Compact header */
  #table-details-modal .modal-header {
    padding: 0.6rem 0.85rem;
    gap: 0.5rem;
  }
  #table-details-modal .modal-title {
    font-size: 0.95rem;
  }
  #table-details-modal #table-modal-time-info {
    font-size: 0.75rem !important;
    padding: 0.15rem 0.4rem !important;
  }

  /* Modal body: relative for FAB positioning */
  #table-details-modal .modal-body {
    padding: 0.6rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }

  /* Grid becomes single column flex */
  .table-order-split {
    display: flex !important;
    grid-template-columns: unset;
    gap: 0;
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }

  /* Bill panel = bottom sheet */
  #table-panel-bill {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70dvh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px 24px 0 0;
    padding: 0.75rem 1rem 1rem;
    z-index: 1012;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 30px rgba(0,0,0,0.3);
    overflow-y: auto;
  }

  #table-panel-bill.mobile-open {
    transform: translateY(0);
  }

  .mobile-bill-handle {
    display: block !important;
  }

  #table-panel-bill .bill-items-list {
    height: auto;
    max-height: 35dvh;
    min-height: 80px;
  }

  /* Show bill action buttons on mobile (inside the sheet) */
  .table-bill-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }

  .table-bill-actions .btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.5rem;
  }

  /* Products panel always visible, fills space */
  #table-panel-products {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  /* Category tabs + search: single compact row */
  .table-modal-filters {
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
  }

  .table-modal-filters .category-tabs {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.1rem !important;
    gap: 0.3rem;
  }

  .table-modal-filters .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .table-modal-filters .category-tabs .category-tab,
  .table-modal-filters .category-tabs .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
  }

  .table-modal-filters .table-search-wrapper {
    max-width: 110px !important;
    min-width: 90px;
    flex-shrink: 0;
    width: auto;
  }
  .table-modal-filters .table-search-wrapper .form-control {
    height: 28px !important;
    font-size: 0.72rem !important;
  }

  /* Product scroll fills remaining space */
  .table-modal-products-scroll {
    max-height: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  /* Product grid: 3 columns – shared between table modal & quick sale */
  #table-panel-products .product-grid,
  .products-catalog .product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.4rem !important;
  }

  #table-panel-products .product-card,
  .products-catalog .product-card {
    padding: 0.3rem;
    gap: 0.2rem;
    border-radius: 10px;
  }

  #table-panel-products .product-card:hover,
  .products-catalog .product-card:hover {
    transform: none;
  }

  #table-panel-products .product-image-container,
  .products-catalog .product-image-container {
    aspect-ratio: 1/1;
    border-radius: 6px;
  }

  #table-panel-products .product-card-name,
  .products-catalog .product-card-name {
    font-size: 0.68rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #table-panel-products .product-card-price,
  .products-catalog .product-card-price {
    font-size: 0.72rem;
  }

  /* Show floating bill toggle */
  .mobile-bill-toggle {
    display: flex !important;
  }

  /* Footer: hide payment buttons, keep close only */
  .desktop-only-btn {
    display: none !important;
  }

  .table-modal-footer {
    display: none !important;
  }
}

.bill-items-list {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* Data Tables */
.card-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 0.75rem;
}

.table-search-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 360px;
  position: relative;
}

.table-search-wrapper .form-control,
.section-title-row select.form-control {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.table-search-wrapper .form-control:focus,
.section-title-row select.form-control:focus {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: var(--border-focus);
}

body.light-theme .table-search-wrapper .form-control,
body.light-theme .section-title-row select.form-control {
  background-color: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.18);
  color: #0f172a;
}

body.light-theme .table-search-wrapper .form-control:focus,
body.light-theme .section-title-row select.form-control:focus {
  background-color: #ffffff;
  border-color: var(--border-focus);
}

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

table.data-table th {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.15);
}

body.light-theme table.data-table th {
  background-color: rgba(0, 0, 0, 0.03);
}

table.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tr {
  transition: var(--transition);
}

table.data-table tr:hover td {
  background-color: rgba(255, 144, 0, 0.04);
}

table.data-table tr.tx-row {
  cursor: pointer;
}

/* Make buttons inside data-table extremely neat, tidy and compact */
table.data-table .btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
  gap: 0.35rem;
}

table.data-table .btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Stock low level tags */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10000;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
  border-left: 5px solid var(--primary);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-danger {
  border-left-color: var(--danger);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

/* Animations */
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ledger Balance Blocks */
.kasa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.kasa-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: 3px solid var(--primary); /* Bottom orange accent line */
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.kasa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.15);
}

.kasa-card-title {
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kasa-val {
  font-size: 2.1rem;
  font-weight: 500; /* Clean weight matching Outfit font in screenshot */
  line-height: 1.2;
}

/* Precise color styling for card values */
.kasa-val.text-success {
  color: #10b981 !important; /* Emerald green */
}

.kasa-val.text-credit {
  color: var(--primary) !important; /* Warm orange */
}

.kasa-val.text-expense {
  color: #ef4444 !important; /* Vivid red */
}

.kasa-val.text-balance {
  color: var(--text-main) !important;
}

.kasa-card-filter {
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: auto;
  transition: var(--transition);
  opacity: 0.9;
}

.kasa-card-filter:hover {
  text-decoration: underline;
  opacity: 1;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  #app-layout {
    flex-direction: column;
    height: calc(100dvh - 60px);
    overflow: hidden;
    margin-top: 60px;
  }

  .mobile-menu-btn {
    display: flex;
    margin-right: 0.75rem;
  }

  #navbar-screen-title {
    display: none;
  }

  .user-dropdown-btn .user-name,
  .user-dropdown-btn i {
    display: none;
  }

  .navbar-logo-area {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: -280px;
    bottom: 0;
    width: 280px;
    z-index: 1005;
    background-color: var(--bg-sidebar);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
  }

  .sidebar-menu {
    flex-direction: column;
    overflow-x: visible;
    padding-bottom: 0;
    gap: 0.5rem;
  }

  .sidebar-item {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 14px;
  }

  .sidebar-footer {
    display: flex;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }

  .main-content {
    margin-left: 0;
    padding: 0.75rem;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  #quicksale-screen.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100dvh - 60px - 1.5rem);
  }

  .shop-layout {
    grid-template-columns: 1fr;
    gap: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
  }

  /* Products fill the screen */
  .products-catalog {
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  #quicksale-products {
    flex: 1;
    align-content: start;
  }

  .quicksale-filters {
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .quicksale-filters .category-tabs {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
    gap: 0.3rem;
  }
  .quicksale-filters .category-tabs::-webkit-scrollbar {
    display: none;
  }
  .quicksale-filters .category-tab {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    flex-shrink: 0;
  }

  .quicksale-filters .table-search-wrapper {
    max-width: 120px !important;
    min-width: 100px;
    flex-shrink: 0;
  }
  .quicksale-filters .table-search-wrapper .form-control {
    height: 30px !important;
    font-size: 0.75rem !important;
    padding-left: 1.8rem !important;
  }
  .quicksale-filters .table-search-wrapper i {
    font-size: 0.7rem !important;
    left: 0.55rem !important;
  }

  /* Quick sale product cards – must match table modal exactly */
  #quicksale-products {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.4rem !important;
  }

  #quicksale-products .product-card {
    padding: 0.3rem !important;
    gap: 0.2rem !important;
    border-radius: 10px !important;
  }

  #quicksale-products .product-card:hover {
    transform: none !important;
  }

  #quicksale-products .product-image-container {
    aspect-ratio: 1/1 !important;
    border-radius: 6px !important;
  }

  #quicksale-products .product-card-name {
    font-size: 0.68rem !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #quicksale-products .product-card-price {
    font-size: 0.72rem !important;
  }

  /* Cart panel and toggle already handled by 992px breakpoint */

  .cart-items {
    flex: none !important;
    height: auto !important;
    max-height: 35dvh !important;
    overflow-y: auto;
    margin: 0.5rem 0;
  }

  .cart-header {
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
  }

  .cart-total-row {
    font-size: 1.1rem;
  }

  .payment-buttons {
    gap: 0.5rem;
  }
  .payment-buttons .btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.5rem;
  }

  .floor-plan-container {
    height: auto !important;
    min-height: 50vh;
    overflow: visible !important;
    padding: 1rem !important;
    background-size: none !important;
    background-image: none !important;
  }

  #floor-plan {
    display: grid !important;
    gap: 1rem !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    justify-content: center !important;
  }

  #floor-plan.large {
    grid-template-columns: repeat(auto-fill, 140px) !important;
  }
  #floor-plan.medium {
    grid-template-columns: repeat(auto-fill, 110px) !important;
  }
  #floor-plan.small {
    grid-template-columns: repeat(auto-fill, 80px) !important;
  }

  .table-element {
    position: static !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transform: none !important;
    box-shadow: var(--shadow) !important;
  }

  #floor-plan.large .table-element {
    width: 140px !important;
    height: 140px !important;
  }
  #floor-plan.medium .table-element {
    width: 110px !important;
    height: 110px !important;
  }
  #floor-plan.small .table-element {
    width: 80px !important;
    height: 105px !important;
  }

  .table-element:active {
    transform: scale(0.96) !important;
  }

  .table-search-wrapper {
    max-width: none;
    flex: 1;
    min-width: 0;
  }

  #add-table-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .navbar-logo-area {
    width: auto;
  }

  .navbar-logo-area span {
    display: none;
  }

  .navbar-divider {
    display: none;
  }

  /* Hide barcode input on mobile */
  .barcode-scan-wrapper,
  .qty-multiplier-wrapper {
    display: none !important;
  }

  /* Table modal barcode also hidden */
  .table-modal-filters .barcode-scan-wrapper,
  .table-modal-filters .qty-multiplier-wrapper {
    display: none !important;
  }
}

/* Context Menu Style */
.context-menu {
  position: absolute;
  z-index: 1000;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  min-width: 220px;
  display: none;
  flex-direction: column;
}

.context-menu-item {
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.context-menu-item:hover {
  background-color: var(--primary);
  color: white;
}

.context-menu-item i {
  width: 16px;
  text-align: center;
}

/* Submenu */
.context-menu-item.has-submenu::after {
  content: "\f0da"; /* FontAwesome angle-right */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: auto;
  font-size: 0.8rem;
}

.context-submenu {
  position: absolute;
  left: 98%;
  top: 0;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0;
  min-width: 180px;
  display: none;
  flex-direction: column;
  margin-left: 2px;
}

.context-menu-item.has-submenu:hover .context-submenu {
  display: flex;
}

/* Icon Sizes */
.table-element.large {
  width: 140px;
  height: 140px;
}

.table-element.large .table-name {
  font-size: 1.2rem;
}

.table-element.large .table-price {
  font-size: 0.95rem;
}

.table-element.medium {
  width: 110px;
  height: 110px;
}

.table-element.small {
  width: 80px;
  height: 105px;
}

.table-element.small .table-name {
  font-size: 0.75rem;
}

.table-element.small .table-price {
  font-size: 0.7rem;
}

.table-element.small .table-duration {
  font-size: 9px;
}

.table-element.small i {
  font-size: 0.85rem;
}

/* Search highlighting dims */
.table-element.search-dimmed {
  opacity: 0.15;
  filter: blur(1px);
  pointer-events: none;
}

/* Drag ghost clone for billing operations */
.dragging-ghost {
  position: absolute !important;
  pointer-events: none !important;
  opacity: 0.8 !important;
  z-index: 9999 !important;
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  transition: none !important;
}

.table-element.drag-target-hover {
  outline: 3px dashed var(--primary);
  outline-offset: 4px;
  transform: scale(1.05);
}

/* Live clock top navbar style */
.navbar-datetime {
  background-color: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

@media (max-width: 992px) {
  .navbar-datetime {
    display: none; /* Hide on smaller screen */
  }
}

/* Drag and Drop Sortable Rows Style */
.recipe-row.dragging {
  opacity: 0.4;
  background: var(--border-color) !important;
}

.recipe-row.drag-over-above td {
  border-top: 2px solid var(--primary) !important;
}

.recipe-row.drag-over-below td {
  border-bottom: 2px solid var(--primary) !important;
}

.recipe-row .drag-handle {
  cursor: grab;
  color: var(--text-muted);
  transition: color 0.2s;
}

.recipe-row .drag-handle:hover {
  color: var(--primary);
}

/* Notification modal custom button adjustments */
#notification-modal .modal-footer {
  gap: 1.25rem;
}

#notification-modal .btn {
  min-width: 140px;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* System Log Styles */
.table-hoverable tbody tr {
  cursor: pointer;
}

.table-hoverable tbody tr:hover td {
  background-color: rgba(255, 144, 0, 0.08) !important;
}

#log-details-body pre {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-top: 0.5rem;
}

/* Fix modals with forms so they don't overflow the screen max-height and hide footer buttons */
.modal-content form {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 0;
  overflow: hidden;
}

/* Category Manager Item Row styling */
.category-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.category-item-row.dragging {
  opacity: 0.4;
  background: var(--border-color);
}

.category-item-row.drag-over-above {
  border-top: 2px solid var(--primary);
}

.category-item-row.drag-over-below {
  border-bottom: 2px solid var(--primary);
}

.category-drag-handle {
  cursor: grab;
  color: var(--text-muted);
}
.category-drag-handle:hover {
  color: var(--primary);
}

/* Collapsible/Expandable Search Bar */
.expandable-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  flex-shrink: 0;
}

.expandable-search-wrapper.expanded {
  width: 200px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
  padding: 0 0.5rem;
}

body.light-theme .expandable-search-wrapper {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .expandable-search-wrapper.expanded {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.expandable-search-wrapper .search-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
}

.expandable-search-wrapper .search-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .expandable-search-wrapper .search-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.expandable-search-wrapper.expanded .search-toggle-btn {
  color: var(--primary);
  pointer-events: none;
}

.expandable-search-wrapper .search-input-wrapper {
  display: flex;
  align-items: center;
  width: 0;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-grow: 1;
}

.expandable-search-wrapper.expanded .search-input-wrapper {
  width: calc(100% - 36px);
}

.expandable-search-wrapper .form-control {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-main) !important;
  padding: 0 0.5rem !important;
  height: 100% !important;
  width: 100% !important;
  font-size: 0.85rem !important;
}

body.light-theme .expandable-search-wrapper .form-control {
  color: #0f172a !important;
}

.expandable-search-wrapper .search-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
  margin-right: 0.2rem;
}

.expandable-search-wrapper .search-close-btn:hover {
  color: var(--danger);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .expandable-search-wrapper .search-close-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.expandable-search-wrapper.expanded .search-close-btn {
  display: flex;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .expandable-search-wrapper {
    width: 32px;
    height: 32px;
  }
  .expandable-search-wrapper .search-toggle-btn {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  .expandable-search-wrapper.expanded {
    width: 130px;
    padding: 0 0.25rem;
  }
  .expandable-search-wrapper.expanded .search-input-wrapper {
    width: calc(100% - 30px);
  }
  .expandable-search-wrapper .form-control {
    font-size: 0.75rem !important;
    padding: 0 0.25rem !important;
  }
  .expandable-search-wrapper .search-close-btn {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
  }
  
  /* Quicksale Mobile search overrides */
  .quicksale-filters .expandable-search-wrapper {
    margin-bottom: 0;
  }
  
  /* Table Modal Mobile search overrides */
  .table-modal-filters .expandable-search-wrapper {
    margin-bottom: 0;
  }
}

/* Barcode scan wrapper styling */
.barcode-scan-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.barcode-scan-wrapper .form-control {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  transition: all 0.2s;
}
.barcode-scan-wrapper .form-control:focus {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 144, 0, 0.2);
}
body.light-theme .barcode-scan-wrapper .form-control {
  background-color: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
  color: #0f172a;
}
body.light-theme .barcode-scan-wrapper .form-control:focus {
  background-color: #ffffff;
  border-color: var(--primary);
}





