/* =====================================================
   CROUSTY TAC — Kitchen Screen (Chef KDS)
   - Matches customer page colors & Poppins font
   - Clean, touch-friendly availability toggles on mobile
   - Zero horizontal scroll, smooth vertical scroll
   - Layout & functionality 100% preserved
   ===================================================== */

/* Global reset and scrollbar removal */
html {
  overflow-x: hidden;
  max-width: 100vw;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

*::-webkit-scrollbar,
html::-webkit-scrollbar,
body.chef::-webkit-scrollbar,
.board::-webkit-scrollbar,
.column::-webkit-scrollbar,
.menu-avail-panel::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.chef {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* -----------------------------------------------------
   Chef Login Screen
   ----------------------------------------------------- */
.chef-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  box-sizing: border-box;
}

.chef-login .box {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 40px 32px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow);
  box-sizing: border-box;
}

.chef-login .brand {
  font-family: var(--font-display);
  color: var(--orange);
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 4px;
}

.chef-login p.sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 26px;
}

.chef-login select,
.chef-login input {
  width: 100%;
  padding: 13px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  text-align: center;
  box-sizing: border-box;
  font-family: inherit;
}

.chef-login select:focus,
.chef-login input:focus {
  border-color: var(--orange);
  outline: none;
}

.chef-login button {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}

.chef-login button:hover {
  background: var(--orange-deep);
}

.chef-login .error {
  color: #d93025;
  font-size: 13px;
  margin-bottom: 10px;
}

/* -----------------------------------------------------
/* -----------------------------------------------------
   Chef Top Bar (Company Name on Top Left)
   ----------------------------------------------------- */
.chef-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--white);
  border-bottom: 2px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 30;
  box-sizing: border-box;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chef-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chef-top .brand {
  font-family: var(--font-display);
  color: var(--orange);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
}

.staff-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kitchen-screen-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.chef-duty-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.duty-user-icon {
  font-size: 13px;
}

.duty-owner-name {
  font-weight: 700;
  color: var(--ink);
}

.duty-pill-divider {
  color: var(--line);
  margin: 0 2px;
}

.duty-chef-label {
  font-weight: 600;
  color: var(--muted);
}

.chef-select-inline {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-deep);
  cursor: pointer;
  padding: 0;
  outline: none;
}

.duty-chef-name {
  font-weight: 700;
  color: var(--orange-deep);
}

.chef-top .right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chef-clock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.top-icon-orange {
  color: var(--orange);
  flex-shrink: 0;
}

.chef-lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1.5px solid var(--line);
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
}

.chef-lang-switch {
  display: flex;
  gap: 2px;
}

.chef-lang-switch a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.chef-lang-switch a.active {
  background: var(--orange);
  color: #fff;
}

.chef-top-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

.top-pill-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.pin-login-btn {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.pin-login-btn:hover {
  border-color: var(--orange);
  color: var(--orange-deep);
}

.admin-panel-btn {
  background: #fff;
  border: 1.5px solid var(--line);
  color: #202124 !important;
}

.admin-panel-btn:hover {
  border-color: #202124;
  background: #f8f9fa;
}

.admin-avatar-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffedd5;
  color: var(--orange-deep);
}

.admin-panel-label {
  color: #202124 !important;
  font-weight: 700;
}

.admin-chevron {
  color: #5f6368;
}

.logout-btn {
  background: #fff;
  border: 1.5px solid #fecaca;
  color: #dc2626;
}

.logout-btn:hover {
  background: #fee2e2;
}

/* -----------------------------------------------------
   Main Chef Body
   ----------------------------------------------------- */
.chef-body {
  padding: 22px 26px 60px;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* -----------------------------------------------------
   Orders Board (3 Columns on Desktop, Stacked on Mobile)
   ----------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}

.column {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 200px;
  box-sizing: border-box;
  box-shadow: var(--shadow);
}

.column h2 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 4px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column h2 .badge {
  background: var(--orange-tint);
  color: var(--orange-deep);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 800;
  font-size: 12px;
}

.column.new-col { border-top: 4px solid #2563eb; }
.column.preparing-col { border-top: 4px solid var(--orange); }
.column.ready-col { border-top: 4px solid var(--green); }

/* Order Cards (Tiles) */
.order-card {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(32, 33, 36, 0.04);
}

.order-card:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 14px rgba(255, 91, 10, 0.12);
}

.order-card .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.order-card .table-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--orange-deep);
}

.order-card .order-code {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
  font-weight: 700;
}

.order-card .customer {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.order-card .dining-tag {
  color: var(--orange-deep);
  font-weight: 700;
}

.order-card .instructions-tag {
  background: var(--orange-tint);
  border-left: 3px solid var(--orange);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--orange-deep);
  font-weight: 600;
  margin-bottom: 8px;
}

.order-card .preparing-by-tag {
  font-size: 12px;
  color: var(--orange-deep);
  font-weight: 700;
  margin-bottom: 8px;
}

.order-card .order-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.order-card .order-meta-row b {
  color: var(--ink);
}

.order-card ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  font-size: 13px;
  color: var(--charcoal);
}

.order-card ul li {
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
}

.order-card ul li:last-child {
  border-bottom: none;
}

.order-card .time-ago {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.order-card .actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.order-card .actions button {
  flex: 1;
  min-height: 42px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  font-family: inherit;
}

.order-card .actions button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-preparing {
  background: var(--orange);
  color: #fff;
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
}
.btn-ready { background: var(--green); color: #fff; }
.btn-collected { background: #2563eb; color: #fff; }

.eta-input {
  flex: 1 1 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  min-height: 42px;
  text-align: center;
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--line) !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  box-sizing: border-box;
  font-family: inherit;
  padding: 0 8px;
}

.empty-col {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 36px 10px;
}

/* -----------------------------------------------------
   Menu Availability Panel & Responsive Toggles
   ----------------------------------------------------- */
.menu-avail-panel {
  margin-top: 30px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: var(--shadow);
}

.menu-avail-panel h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 16px;
}

.avail-cat-heading {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange-deep);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 20px 0 10px;
}

.avail-cat-heading:first-of-type {
  margin-top: 0;
}

.avail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.avail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  min-height: 52px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.avail-item:hover {
  border-color: var(--orange);
}

.avail-item .name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* Clean, Balanced Toggle Switch */
.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  display: inline-block;
  margin: 0;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.switch .slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2.5px;
  top: 2.5px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 4px rgba(32, 33, 36, 0.2);
}

.switch input:checked + .slider {
  background: var(--green);
  border-color: var(--green);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* -----------------------------------------------------
   Mobile Screen Responsiveness
   ----------------------------------------------------- */
@media (max-width: 980px) {
  .board {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .chef-top {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .chef-top .brand {
    font-size: 20px;
  }

  .chef-top .right {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }

  .chef-body {
    padding: 16px 12px 40px;
  }

  .column {
    padding: 12px;
  }

  .order-card {
    padding: 12px;
  }

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

  .order-card .actions button {
    flex: 1;
  }

  .menu-avail-panel {
    padding: 14px;
    margin-top: 22px;
  }

  .avail-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .avail-item {
    padding: 12px 14px;
    min-height: 50px;
  }

  .avail-item .name {
    font-size: 14px;
  }
}
