/* Bootstrap 5 Theme Specs */
:root {
    --primary: #4F46E5;        /* Indigo */
    --primary-dark: #3730A3;
    --success: #16A34A;        /* Green */
    --warning: #F59E0B;        /* Amber */
    --danger: #DC2626;         /* Red */
    --light-bg: #F3F4F6;       /* Gray-100 */
    --text-default: #1F2937;   /* Gray-800 #1F2937*/
    --text-muted: #6B7280;     /* Gray-500 */
    --nav-bg: #e9e9e9;
}

/* Utility Classes */
.primary-bg { background: var(--primary) !important; }
.primary-dark-bg { background: var(--primary-dark) !important; }
.success-bg { background: var(--success) !important; }
.warning-bg { background: var(--warning) !important; }
.danger-bg { background: var(--danger) !important; }
.light-bg { background: var(--light-bg) !important; }

.text-default { color: var(--text-default) !important; }
.text-muted { color: var(--text-muted) !important; }

.rounded-xl {
    border-radius: 1rem !important;
}

/* ========== SKELETON LOADERS ========== */
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #e8e8e8 0%,
        #f0f0f0 50%,
        #e8e8e8 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.skeleton-title {
    height: 1.25rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-text.skeleton-sm {
    height: 0.75rem;
    width: 40%;
}

.skeleton-badge {
    height: 1.25rem;
    width: 4rem;
    border-radius: 4px;
}

.skeleton-card {
    height: 180px;
    border-radius: 8px;
}

.skeleton-table-row td {
    padding: 0.75rem !important;
    vertical-align: middle !important;
}

.skeleton-table-row .skeleton {
    height: 1rem;
}

.skeleton-page-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.skeleton-ready .skeleton-page-content {
    opacity: 1;
    pointer-events: auto;
}

body.skeleton-ready .skeleton-page-placeholder {
    display: none !important;
}

.navbar-light-custom {
    background-color: var(--nav-bg) !important;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
}

/* Card Styles */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #E5E7EB;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.primary-bg:hover {
    background: var(--primary-dark) !important;
}

.success-bg:hover {
    background: #15803D !important;
}

.warning-bg:hover {
    background: #D97706 !important;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls .btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.375rem;
}

/* Navbar Styles */
.navbar-brand {
    letter-spacing: -0.025em;
}

.navbar-tenant-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* Order Items Styles */
#order-items {
    min-height: 200px;
}

.border {
    border-color: #E5E7EB !important;
}

.border-start {
    border-left: 1px solid #E5E7EB !important;
}

/* Custom Scrollbar */
.overflow-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.overflow-auto::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== MOBILE RESPONSIVE FIXES ========== */

/* General mobile fixes */
@media (max-width: 768px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
        background: #454242 !important;
    }
    
    /* Main container */
    .d-flex.flex-column.vh-100.bg-custom.m-3.border.rounded-4.custom-border {
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        height: 100vh !important;
        min-height: 100vh;
        overflow: hidden;
    }
    
    /* Navbar fixes for mobile */
    .navbar {
        padding: 0.5rem 0 !important;
    }
    
    .navbar .container-fluid {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0.5rem 1rem !important;
    }
    
    .navbar-brand {
        text-align: center;
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1.5rem !important;
    }
    
    /* Navigation links */
    .navbar .d-flex.gap-4 {
        width: 100%;
        justify-content: center !important;
        gap: 1rem !important;
        margin: 0.5rem 0;
        flex-wrap: wrap;
    }
    
    .top-nav-link {
        font-size: 14px !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* User info and logout */
    .navbar .d-flex.align-items-center {
        width: 100%;
        justify-content: center !important;
        margin-top: 0.5rem;
    }
    
    /* Menu section layout */
    #menu-section .layout-container {
        flex-direction: column !important;
        height: calc(100vh - 150px) !important;
        overflow: auto;
    }
    
    #menu-section main {
        flex: 0 0 60% !important;
        width: 100% !important;
        overflow-y: auto;
        padding: 1rem !important;
    }
    
    #menu-section aside {
        flex: 0 0 40% !important;
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #ddd;
        max-height: 40vh !important;
        position: relative;
    }
    
    /* Menu cards grid */
    .menu-card {
        margin-bottom: 1rem;
    }
    
    .col-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Category bar */
    .category-bar {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem !important;
        gap: 0.75rem !important;
    }
    
    .category-link {
        font-size: 14px !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Orders, Tables, Payments sections */
    .content-section {
        padding: 1rem !important;
        overflow-y: auto;
        height: calc(100vh - 150px) !important;
    }
    
    .content-section .row.g-4 {
        margin-bottom: 0;
    }
    
    .content-section .row.g-4 > div {
        margin-bottom: 1rem;
    }
    
    /* Cards in other sections */
    .col-md-6, .col-lg-4, .col-lg-3, .col-md-3 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Table responsive */
    .table-responsive {
        font-size: 0.8rem;
        margin-bottom: 2rem !important;
    }
    
    /* Add bottom margin to last elements */
    .content-section > .p-4:last-child {
        padding-bottom: 3rem !important;
    }
    
    .table-responsive:last-child {
        margin-bottom: 3rem !important;
    }
    
    .row.mt-4:last-child {
        margin-bottom: 3rem !important;
    }
    
    /* Quantity controls mobile */
    .quantity-controls {
        transform: scale(0.9);
    }
}

/* Small phones */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .top-nav-link {
        font-size: 12px !important;
        padding: 0.2rem 0.4rem !important;
    }
    
    .category-link {
        font-size: 12px !important;
    }
    
    .menu-title {
        font-size: 15px !important;
    }
    
    .menu-price {
        font-size: 13px !important;
    }
    
    .menu-add-btn {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Tablets and larger phones */
@media (min-width: 769px) and (max-width: 1024px) {
    #menu-section .layout-container {
        height: calc(100vh - 120px) !important;
    }
    
    #menu-section main {
        flex: 0 0 70% !important;
    }
    
    #menu-section aside {
        flex: 0 0 30% !important;
    }
    
    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .col-lg-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* Disabled State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Typography */
.fw-semibold {
    font-weight: 600;
}

.fs-6 {
    font-size: 1rem !important;
}

.fs-7 {
    font-size: 0.875rem !important;
}

/* MINE FROM HERE */
.custom-border {
    border-width: 15px !important;
    border-color: #454242 !important; 
    background-color: var(--nav-bg) !important;
    overflow: hidden;
    background-clip: padding-box;
}

.custom-border main {
    background-color: var(--light-bg) !important;
}

.btn-outline-light {
    color: var(--text-default)!important; 
    border-color: var(--text-default) !important; 
}

.btn-outline-light:hover {
    background-color: var(--nav-bg) !important; /* filled chocolate on hover */
    color: var(--text-default) !important; /*white text on hover */
}

.menu-card {
    border-radius: 18px;
    border: 1px solid #eee;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.15s ease-in-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.menu-card:hover {
    transform: translateY(-4px);
}

.menu-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.menu-card .p-3 {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem !important;
}

.content-sections {
    flex: 1;
    overflow: hidden;
    background-color: var(--light-bg);
}

/* Kitchen: scrollable orders container */
.kitchen-orders-scroll {
    -webkit-overflow-scrolling: touch;
}

/* Menu section specific fixes */
#menu-section {
    height: 100%;
    overflow: hidden;
}

#menu-section > .layout-container {
    height: 100% !important;
}

.menu-title {
    font-size: 17px;
    font-weight: 600;
}

.menu-price {
    font-size: 15px;
    color: #444;
}

.menu-add-btn {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #ccc;
    line-height: 0 !important;
    padding: 0 !important;
    background: #fff;
    font-family: Arial, sans-serif !important;
    position: relative;
    top: 0;
    cursor: pointer;
    user-select: none;
}

.menu-add-btn:hover {
    background: #eee;
}

.custom-border > nav.navbar {
    margin-top: 0 !important;
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
}

.custom-border > nav.navbar.border {
    border-top: none !important;
}

/* Layout */
.d-flex.flex-column.vh-100.bg-custom.m-3.border.rounded-4.custom-border {
    height: 100vh !important;
    max-height: 100vh;
    overflow: hidden;
}

.layout-container {
    display: flex;
    height: calc(100vh - 80px) !important;
    overflow: hidden;
}

.layout-container main {
    flex: 0 0 75%; /* main gets 70% */
    overflow-y: auto;
    max-height: 100%;
    padding-bottom: 20px; /* Add some bottom padding */
}

#menu-section main {
    width: 100%;
    flex: 0 0 75%;
    overflow-y: auto;
}

#menu-section aside {
    flex: 0 0 25%;
    border-left: 1px solid #ddd;
    background: #fff;
    overflow-y: auto;
}

.layout-container aside {
    flex: 0 0 25%; /* aside gets 30% */
    border-left: 1px solid #ddd;
    background: #fff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.layout-container aside .flex-grow-1 {
    flex: 1;
    min-height: 0; /* Important for flex scrolling */
    overflow-y: auto;
}

.layout-container aside .border-top {
    flex-shrink: 0; /* Prevent buttons from being pushed out */
    margin-top: auto; /* Push to bottom */
}

.col-12 {
    height: auto !important;
}

.row.g-3 {
    margin-bottom: 20px;
}

.top-nav-link {
    font-size: 16px;
    color: #444;
    font-weight: 500;
}

.top-nav-link:hover {
    color: #000;
}

.logout-btn {
    border-color: #5a3e36 !important;
    color: #5a3e36 !important;
}

.category-bar {
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.category-link {
    font-size: 18px;
    color: #666;
    text-decoration: none;
    padding-bottom: 6px;
    white-space: nowrap;
}

.category-link:hover {
    color: #111;
}

.active-category {
    color: #000;
    border-bottom: 3px solid #000;
    font-weight: 600;
}

/* Category blocks: uniform reduced spacing between Burgers, Sides, Drinks */
/* Match category bar’s bottom margin (mb-3 = 1rem) so spacing between categories equals space above Burgers */
#menu-section main > .row.g-3 {
    --bs-gutter-y: 0.125rem;
    padding-top: 1rem;
}

.category-block {
    margin-bottom: 0;
}

.category-header {
    margin-bottom: 0.25rem;
}

.category-subheader {
    font-size: 0.9rem;
    font-weight: 600;
}

/* categories transitions */
.category-section {
    transition: all 0.3s ease;
    overflow: hidden;
}

.hidden-category {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transform: fade-in;
    transform-origin: center;
}

/* end category transitions */

/* ========== MENU BROWSER (waiter POS) ========== */
.menu-browser-page {
  width: 100%;
  padding-bottom: 1.5rem;
}

.menu-browser-sticky-shell {
  position: sticky;
  top: 0;
  z-index: 25;
  margin: 0 0 0.75rem;
  --menu-browser-toolbar-h: 220px;
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
  transition:
    transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.35s ease,
    margin-bottom 0.4s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0.4s;
  will-change: transform, opacity, margin-bottom;
}

.menu-browser-sticky-shell.is-hidden {
  transform: translate3d(0, calc(-1 * var(--menu-browser-toolbar-h)), 0);
  opacity: 0;
  margin-bottom: calc(-1 * var(--menu-browser-toolbar-h));
  visibility: hidden;
  pointer-events: none;
}

.menu-browser-sticky,
.menu-quick-picks {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.menu-browser-sticky {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.menu-search-row {
  position: relative;
  margin-bottom: 0.65rem;
}

.menu-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.menu-search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 1.1rem;
  color: #64748b;
  pointer-events: none;
  z-index: 1;
}

.menu-search-input {
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 0.65rem 2.5rem 0.65rem 2.35rem;
  font-size: 1rem;
  min-height: 48px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.menu-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.menu-search-clear {
  position: absolute;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.menu-search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
}

.menu-suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.menu-suggest-item:hover,
.menu-suggest-item:focus {
  background: #f1f5f9;
}

.menu-cat-scroll,
.menu-alpha-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
}

.menu-cat-scroll {
  margin-bottom: 0.5rem;
}

.menu-cat-pill {
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.menu-cat-pill:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.menu-cat-pill.active-category {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  font-weight: 600;
}

.menu-alpha-btn {
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 0 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.menu-alpha-btn-all {
  min-width: 44px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.menu-alpha-btn.active-alpha,
.menu-alpha-btn.active-alpha-all {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.menu-alpha-btn.disabled-alpha:not(.active-alpha) {
  opacity: 0.35;
  pointer-events: none;
}

.menu-toolbar-hint {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.menu-hint-em {
  font-weight: 700;
  color: #2563eb;
}

.menu-filter-status {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  min-height: 1.25rem;
}

.menu-quick-picks {
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
}

.menu-quick-block + .menu-quick-block {
  margin-top: 0.5rem;
}

.menu-quick-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.menu-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.menu-quick-chip {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  min-height: 36px;
}

.menu-quick-chip:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.menu-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
  animation: menuGridFade 0.2s ease;
}

@keyframes menuGridFade {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.menu-card-compact {
  margin-bottom: 0;
  border-radius: 14px;
  cursor: default;
}

.menu-card-compact img {
  height: 110px;
}

.menu-card-body {
  padding: 0.75rem !important;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.35rem;
}

.menu-card-compact .menu-add-btn {
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
  border-color: #0f172a;
}

.menu-card-compact .menu-add-btn:active {
  transform: scale(0.94);
}

.menu-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #fff;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
}

.menu-empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .menu-items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .menu-card-compact img {
    height: 96px;
  }

  .menu-title {
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .menu-alpha-btn {
    min-width: 34px;
    min-height: 34px;
  }
}

@media (min-width: 1200px) {
  .menu-items-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}

.bg-custom {
    background-color:  #454242 !important;
}

.cart-wrapper {
    overflow: hidden; /* ensures borders align cleanly */
}

/* Optional: adjust border color */
.cart-item {
    border-color: #e5e7eb; /* light grey like Tailwind/Apple UI */
}

/* Order Items Container */
#order-items {
    background-color: var(--light-bg);
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
}

.order-item {
    transition: background-color 0.2s ease;
}

.order-item:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Bottom border dividers */
.order-item.border-bottom {
    border-bottom: 1px solid #D1D5DB !important;
}

/* Remove border from last item */
.order-item:last-child {
    border-bottom: none !important;
}

/* Quantity controls styling */
.quantity-controls {
    background-color: white;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    padding: 2px;
    display: inline-flex;
    align-items: center;
}

.quantity-controls .btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.375rem;
    border: none;
    color: var(--text-default);
}

.quantity-controls .btn:hover {
    background-color: var(--light-bg);
}

.quantity-controls span {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: var(--text-default);
}

/* MENUS ENHANCEMENTS */
/* Navigation Active State */
.top-nav-link.active-section {
    color: #000 !important;
    font-weight: 600;
    border-bottom: 3px solid #000;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active-section {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Table Cards */
.table-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem !important;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.table-number {
    padding: 15px 0;
}

.table-number .display-6 {
    font-size: 3.5rem;
    color: var(--text-default);
}

.table-actions .btn {
    border-radius: 8px;
    font-weight: 500;
}

/* Payment Cards */
.card {
    border: none;
    border-radius: 12px;
    margin-bottom: 1.5rem !important;
}

.card-body {
    padding: 1.5rem;
}

/* Statistics Cards */
.card .display-6 {
    font-size: 2.5rem;
}

/* Table Styling */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem !important;
}

.table thead th {
    background-color: var(--light-bg);
    border-bottom: 2px solid #E5E7EB;
    font-weight: 600;
    color: var(--text-default);
}

.table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

.table td, .table th {
    padding: 1rem;
    vertical-align: middle;
}

/* Badge Styles */
.badge {
    padding: 0.5em 1em;
    font-weight: 500;
    border-radius: 20px;
}

/* Waiter: compact nav notification badges (do not cover link text) */
.discounts-nav-wrap,
.orders-nav-wrap {
    padding-right: 0.65rem !important;
}
.discounts-nav-badge,
.orders-nav-badge {
    position: absolute;
    top: 0.05rem;
    right: -0.15rem;
    left: auto;
    transform: none;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.12rem 0.32rem;
    min-width: 0.85rem;
    height: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    pointer-events: none;
}

/* Button Groups */
.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Quick Actions */
.d-grid .btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem !important;
}

.d-grid .btn i {
    font-size: 1.1em;
}

/* Status Colors */
.bg-occupied { background-color: #FEE2E2 !important; color: #991B1B !important; }
.bg-available { background-color: #D1FAE5 !important; color: #065F46 !important; }
.bg-reserved { background-color: #FEF3C7 !important; color: #92400E !important; }

/* Section heights */
#orders-section,
#tables-section,
#payments-section {
    height: calc(100vh - 80px);
    overflow-y: auto;
    background-color: var(--light-bg);
}

#menu-section .layout-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Add bottom padding/margin to prevent overlapping */
.content-section .p-4 {
    padding-bottom: 3rem !important;
}

.row:last-child {
    margin-bottom: 3rem !important;
}

.table-responsive:last-child {
    margin-bottom: 3rem !important;
}

/* Mobile menu cards - force single column */
@media (max-width: 768px) {
    .menu-card {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .row.g-3 > .col-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure no horizontal overflow */
    .container-fluid, .p-4, .content-section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Prevent text overflow on small screens */
@media (max-width: 480px) {
    .menu-title, .fw-semibold, .text-default {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .btn {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
}

/* FOR POPUP MODAL*/
.grid-template-3 {
  grid-template-columns: repeat(3, 1fr);
}

#itemMetaModal .btn {
  padding: 14px;
  font-size: 1.1rem;
}

#itemMetaModal.item-meta-table-mode .modal-body {
  padding: 0.75rem 1rem;
}

#itemMetaModal.item-meta-table-mode .modal-header,
#itemMetaModal.item-meta-table-mode .modal-footer {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

#itemMetaModal.item-meta-table-mode #meta-table-section {
  max-width: 260px;
  margin: 0 auto;
}

#itemMetaModal.item-meta-table-mode .table-keypad-grid {
  gap: 0.35rem;
}

#itemMetaModal.item-meta-table-mode #meta-table-section .btn {
  padding: 10px 8px;
  font-size: 1rem;
}

#itemMetaModal.item-meta-table-mode #meta-table-section .d-flex.gap-2 {
  gap: 0.35rem !important;
}

#itemMetaModal.item-meta-table-mode #table-no {
  margin-bottom: 0.5rem !important;
}
.grid-template-10 {
  grid-template-columns: repeat(10, 1fr);
}
.grid-template-9 {
  grid-template-columns: repeat(9, 1fr);
}

.grid-template-7 {
  grid-template-columns: repeat(7, 1fr);
}

#alpha-keyboard .btn {
  padding: 10px;
  font-size: 0.95rem;
}

/* LOGIN PAGE STYLES */
.login-layout {
  display: flex;
  height: 100vh;
  background: #f7f7f7;
}

/* LEFT */
.login-left {
  flex: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.login-box {
  width: 320px;
  text-align: center;
  position: relative;
}

.app-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.pin-input {
  width: 100%;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 10px 16px;
  letter-spacing: 0.4em;
  border: 2px solid #ddd;
  border-radius: 12px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

/* NUM PAD */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.numpad button {
  padding: 16px;
  font-size: 1.2rem;
  border-radius: 12px;
  border: none;
  background: #f0f0f0;
  cursor: pointer;
}

.numpad button:active {
  background: #ddd;
}

.numpad .enter {
  background: #198754;
  color: #fff;
}

.numpad .clear {
  background: #dc3545;
  color: #fff;
}

/* Login toast notification */
.login-toast {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  margin-bottom: 12px;
  max-width: 320px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease,
              visibility 0.3s;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.login-toast.toast-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.login-toast.toast-error {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
}

.login-toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  font-size: 1rem;
}

/* RIGHT */
.login-right {
  flex: 3;
  padding: 30px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e0e0e0;
}

.config-card {
  margin-bottom: 16px;
}

.login-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 12px;
}

.login-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 92px;
  padding: 14px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.login-quick-action:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.login-quick-action:active {
  transform: scale(0.98);
}

.login-quick-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #4b5563;
}

.login-quick-action-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.login-quick-action--primary .login-quick-action-icon {
  background: #d1e7dd;
  color: #146c43;
}

.login-quick-action--danger .login-quick-action-icon {
  background: #f8d7da;
  color: #b02a37;
}

@media (max-width: 768px) {
  .login-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .login-left {
    flex: none;
    padding: 24px 16px;
  }

  .login-right {
    flex: none;
    display: flex;
    border-left: none;
    border-top: 1px solid #e0e0e0;
  }
}

/* On-screen keyboard (Admin login) */
.osk-btn {
  font-size: 1.1rem;
  line-height: 1;
}
.osk-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
}
.osk-panel {
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.osk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}
.osk-title {
  font-weight: 600;
  color: var(--text-default);
}
.osk-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: #6b7280;
}
.osk-keys {
  padding: 10px;
  display: grid;
  gap: 8px;
}
.osk-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}
.osk-key {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px 8px;
  font-weight: 600;
  color: var(--text-default);
  user-select: none;
  touch-action: manipulation;
}
.osk-key:active {
  background: #e5e7eb;
}
.osk-key.wide { grid-column: span 2; }
.osk-key.xwide { grid-column: span 3; }
.osk-key.osk-caps-on {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e3a5f;
}

/* Waiter menu OSK — wider panel for touch POS */
.waiter-osk-wrap .waiter-osk-panel {
  max-width: min(920px, 100%);
}

body.waiter-osk-open #menu-section main {
  padding-bottom: min(42vh, 320px);
}

/* Reports: single rule between data table and pagination (no double line) */
#section-reports .table-responsive > .table tbody tr:last-child td {
  border-bottom: 0;
}
.report-table-pag-ctrl {
  border-top: 0;
  padding-top: 0.5rem;
}

.payments-recent-table-wrap > .table tbody tr:last-child td {
  border-bottom: 0;
}

/* ========== ADMIN DASHBOARD LAYOUT ========== */
.admin-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--light-bg);
}

.admin-topnav {
  flex-shrink: 0;
  background: #fff !important;
  padding: 0.75rem 1.5rem;
}

.admin-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.admin-sidenav {
  flex-shrink: 0;
  width: 220px;
  background: #fff;
  padding: 1rem 0;
}

.admin-sidenav .nav-link {
  color: var(--text-default);
  padding: 0.6rem 1.25rem;
  border-radius: 0;
  border-left: 3px solid transparent;
}

.admin-sidenav .nav-link:hover {
  background: var(--light-bg);
}

.admin-sidenav .nav-link.active {
  background: rgba(79, 70, 229, 0.08);
  border-left-color: var(--primary);
  font-weight: 600;
}

.admin-content {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
  background: var(--light-bg);
}

.admin-section {
  display: none;
}

.admin-section.active-section {
  display: block;
}

.admin-content .table {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.admin-content .card {
  border-radius: 8px;
}

/* Menu list: compact numbered pagination (first / prev / … / last) */
.menu-pagination-slot .menu-pagination-bar .pagination {
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}
.menu-pagination-slot .menu-pagination-bar .page-link {
  border-radius: 0.35rem;
  min-width: 2.25rem;
  text-align: center;
  padding: 0.28rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: #374151;
  background: #fff;
  border: 1px solid #dee2e6;
}
.menu-pagination-slot .menu-pagination-bar .page-item.disabled .page-link {
  color: #9ca3af;
  pointer-events: none;
  background: #f9fafb;
}
.menu-pagination-slot .menu-pagination-bar .page-item.active .page-link {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}
.menu-pagination-slot .menu-pagination-bar .page-link:hover:not(.active) {
  background: #f3f4f6;
  color: #111827;
  border-color: #dee2e6;
}
.menu-pagination-slot .menu-pagination-bar .page-item:not(.disabled):not(.active) .page-link:focus {
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.2);
}
.menu-pagination-slot .menu-pagination-bar .menu-page-ellipsis {
  border: none;
  background: transparent;
  color: #6b7280;
  min-width: auto;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

/* Print bill modal: compact for POS screens */
.print-bill-modal-dialog {
  max-width: 430px;
}
.print-bill-modal-dialog .modal-content {
  max-height: 80vh;
}
.print-bill-modal-dialog .modal-body {
  overflow-y: auto;
}
.print-bill-preview {
  height: 340px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}
@media (max-width: 480px) {
  .print-bill-modal-dialog {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
  .print-bill-preview {
    height: 280px;
  }
}

/* Admin: image upload / save loading */
.admin-upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(2px);
}
.admin-upload-overlay-panel {
    text-align: center;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 200px;
}
.admin-upload-overlay .spinner-border {
    width: 2.25rem;
    height: 2.25rem;
}
.btn.is-uploading {
    pointer-events: none;
    opacity: 0.9;
}
