/* ============================================================
   许昌学院餐厅管理系统 —— 全站统一样式
   主色：深绿 #157347 ｜ 辅助：橙 #d97706 ｜ 红 #dc3545 ｜ 灰 #6c757d
   ============================================================ */
:root {
  --green: #157347;
  --green-dark: #11603a;
  --green-soft: #eef7f2;
  --orange: #d97706;
  --orange-dark: #b45309;
  --orange-soft: #fff5e6;
  --red: #dc3545;
  --red-soft: #fdeeee;
  --gray-text: #6c757d;
  --gray-line: #e6e8eb;
  --gray-bg: #f6f7f8;
  --radius: 6px;
  --control-h: 38px;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #23282d;
  background: #f7f8f9;
}

/* ===== 导航栏 ===== */
.navbar {
  background-color: var(--green) !important;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.85);
  border-bottom: 2px solid transparent;
  padding-bottom: 0.35rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.navbar .nav-link:hover {
  color: #fff;
}

.navbar .nav-link.active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: #a7f3c8;
}

.navbar-text {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ===== 通用页面结构 ===== */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.page-title {
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
}

.page-sub {
  color: var(--gray-text);
  font-size: 0.88rem;
  margin: 0.35rem 0 0;
}

.panel {
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.panel-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #eef0f2;
}

.line-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.65rem;
  border: 1px solid #eef0f2;
}

.line-name {
  font-weight: 600;
}

.line-meta {
  color: #8a9199;
  font-size: 0.78rem;
}

.payable {
  color: var(--red);
  font-weight: 700;
  font-size: 1.15rem;
}

/* ===== 按钮统一规范 ===== */
.btn-main,
.btn-sub,
.btn-warn,
.btn-dang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 0.95rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-main {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.btn-main:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.btn-sub {
  background: #fff;
  border-color: var(--green);
  color: var(--green);
}

.btn-sub:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.btn-warn {
  background: #fff;
  border-color: var(--orange);
  color: var(--orange-dark);
}

.btn-warn:hover {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.btn-dang {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
}

.btn-dang:hover {
  background: var(--red-soft);
  color: var(--red);
}

.btn-main:disabled,
.btn-sub:disabled,
.btn-warn:disabled,
.btn-dang:disabled,
.btn-main.disabled {
  background: #f1f2f4 !important;
  border-color: #e3e5e8 !important;
  color: #a4aab0 !important;
  cursor: not-allowed;
}

.btn-lg-main {
  height: 42px;
  font-size: 0.95rem;
  width: 100%;
}

/* ===== 表格统一规范 ===== */
.table {
  margin-bottom: 0;
}

.table > thead th {
  background: var(--gray-bg);
  font-weight: 700;
  color: #3f474e;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--gray-line);
  white-space: nowrap;
}

.table > tbody > tr > td {
  vertical-align: middle;
  height: 54px;
  font-size: 0.9rem;
}

.table > tbody > tr:hover {
  background: #fafbfc;
}

.table .text-end {
  white-space: nowrap;
}

/* ===== 状态标签统一规范 ===== */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-success { background: #e7f6ee; color: var(--green); }
.pill-info    { background: #e8f1fb; color: #1c5fa8; }
.pill-warn    { background: var(--orange-soft); color: var(--orange-dark); }
.pill-danger  { background: var(--red-soft); color: #b02a37; }
.pill-muted   { background: #f1f2f4; color: var(--gray-text); }

/* ===== 输入控件统一规范 ===== */
.form-control,
.form-select {
  height: var(--control-h);
  border-radius: var(--radius);
  border-color: #dcdfe3;
  font-size: 0.9rem;
}

textarea.form-control {
  height: auto;
  padding: 0.55rem 0.75rem;
  line-height: 1.6;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 115, 71, 0.12);
}

.form-label {
  font-size: 0.85rem;
  color: #5d656d;
  margin-bottom: 0.35rem;
}

.form-text {
  color: #9aa1a8;
  font-size: 0.78rem;
}

/* ===== 选项卡（状态 Tab） ===== */
.status-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 1rem;
  border-radius: var(--radius);
  background: #f1f2f4;
  color: #4b5259;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tab-link:hover {
  background: #e8eaec;
  color: #23282d;
}

.tab-link.active {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

/* ===== KPI 数据卡片 ===== */
.kpi-card {
  height: 100%;
  background: #fff;
  border: 1px solid #eceef1;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  padding: 1rem 1.1rem;
}

.kpi-label {
  color: #8a9199;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  color: #23282d;
}

.kpi-value.sales { color: var(--green); }
.kpi-value.warn { color: var(--orange-dark); }
.kpi-value.danger { color: var(--red); }
.kpi-value.muted { color: var(--gray-text); }

/* ===== 菜品图片 ===== */
.dish-thumb {
  height: 150px;
  width: 100%;
  object-fit: cover;
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  background: #f2f3f5;
}

.dish-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: #a8adb3;
  font-size: 0.85rem;
  background: repeating-linear-gradient(45deg, #f5f6f7, #f5f6f7 10px, #eef0f2 10px, #eef0f2 20px);
}

.dish-thumb-sm {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eef0f2;
}

.dish-thumb-xs {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.5rem;
}

/* ===== 菜单页 ===== */
.menu-head {
  margin: 0.25rem 0 1.5rem;
}

.menu-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.4rem;
}

.menu-subtitle {
  color: var(--gray-text);
  margin: 0;
  font-size: 0.9rem;
}

.alert-soft {
  background: #f4f8f5;
  border: 1px solid #e2ece6;
  color: #3f5148;
  border-radius: 6px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
}

.alert-soft .btn-close {
  position: static;
  padding: 0.5rem;
  margin: -0.25rem -0.25rem -0.25rem 0.5rem;
  font-size: 0.7rem;
  flex: none;
}

.filter-card {
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
}

.filter-control {
  height: var(--control-h);
}

.filter-input {
  width: 280px;
}

.filter-btn {
  height: var(--control-h);
  min-width: 76px;
}

.dish-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #ecedef;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.dish-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.09);
}

.dish-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f3f5;
}

.dish-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dish-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #a8adb3;
  font-size: 0.82rem;
  background: repeating-linear-gradient(45deg, #f5f6f7, #f5f6f7 10px, #eef0f2 10px, #eef0f2 20px);
}

.promo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.dish-body {
  padding: 0.85rem 0.95rem 0.95rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.dish-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.dish-name {
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  color: #1f2429;
}

.dish-tag {
  flex: none;
  font-size: 0.7rem;
  color: #7b838b;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 0.1rem 0.5rem;
}

.dish-desc {
  color: #8a9199;
  font-size: 0.82rem;
  margin: 0 0 0.5rem;
  min-height: 1.25rem;
}

.dish-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.price-now {
  color: var(--red);
  font-weight: 700;
  font-size: 1.05rem;
}

.price-old {
  color: #a2a8ae;
  font-size: 0.8rem;
  text-decoration: line-through;
}

.stock-text {
  color: #8a9199;
  font-size: 0.78rem;
}

.stock-low {
  color: var(--orange);
  font-weight: 700;
}

.stock-out {
  color: #b6bcc2;
}

.promo-line {
  color: #6b4a12;
  background: #fdf6e8;
  border: 1px solid #f3e6cd;
  border-radius: 5px;
  font-size: 0.76rem;
  padding: 0.22rem 0.5rem;
  margin: 0 0 0.6rem;
}

.dish-action {
  position: relative;
  margin-top: auto;
}

.qty-input {
  width: 66px;
}

/* 加购浮层（仅数量增减） */
.qty-pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 18px;
  padding: 0.28rem 0.45rem;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.14);
}

.qty-pop[hidden] {
  display: none;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #d7dbe0;
  background: #fff;
  color: #3f474e;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
}

.qty-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.qty-val {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ===== 购物车 ===== */
.cart-wrap {
  max-width: 1120px;
  margin: 0 auto;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dcdfe3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.qty-stepper button {
  width: 32px;
  height: 34px;
  border: none;
  background: #f7f8f9;
  color: #3f474e;
  font-size: 1rem;
  line-height: 1;
}

.qty-stepper button:hover {
  background: var(--green-soft);
  color: var(--green);
}

.qty-stepper input {
  width: 52px;
  height: 34px;
  border: none;
  border-left: 1px solid #eceef1;
  border-right: 1px solid #eceef1;
  text-align: center;
  font-size: 0.9rem;
  -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-summary {
  text-align: right;
}

.cart-summary .row-line {
  font-size: 0.88rem;
  color: var(--gray-text);
  margin-bottom: 0.2rem;
}

.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-top: 1px solid var(--gray-line);
  padding: 0.9rem 1.1rem;
}

.promo-row td {
  background: #fdfaf3;
  font-size: 0.82rem;
  color: #7a5a1e;
  height: auto !important;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.promo-chip {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  border-radius: 4px;
  padding: 0 0.32rem;
  margin-right: 0.35rem;
}

/* ===== 结算页 ===== */
.dining-switch,
.pick-switch {
  display: flex;
  gap: 0.6rem;
}

.dining-option input,
.pick-option input {
  display: none;
}

.dining-option span,
.pick-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 1.3rem;
  border-radius: var(--radius);
  background: #f1f2f4;
  color: #4b5259;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dining-option input:checked + span,
.pick-option input:checked + span {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.order-lines {
  margin: 0;
}

.order-lines li {
  padding: 0.55rem 0;
  border-bottom: 1px dashed #eef0f2;
  font-size: 0.9rem;
}

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

.line-promo {
  font-size: 0.76rem;
  color: #7a5a1e;
  margin-top: 0.2rem;
}

.amount-box {
  background: #fafbfc;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
}

.amount-box > div {
  margin-bottom: 0.3rem;
}

.amount-final {
  border-top: 1px solid var(--gray-line);
  padding-top: 0.5rem;
  margin-top: 0.4rem;
  font-weight: 600;
}

/* ===== 促销管理 ===== */
.dish-picker {
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #eef0f2;
  border-radius: 6px;
  padding: 0.4rem;
}

.dish-pick {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.3rem;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
}

.dish-pick:hover {
  background: #f7f8f9;
}

.dish-pick em {
  margin-left: auto;
  font-style: normal;
  color: #8a9199;
  font-size: 0.78rem;
}

.rule-chip {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #cdeedd;
  border-radius: 10px;
  padding: 0.05rem 0.5rem;
}

.rule-note {
  background: var(--gray-bg);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  color: var(--gray-text);
  font-size: 0.8rem;
  line-height: 1.7;
}

/* ===== 统计报表 ===== */
.range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.range-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.range-form input[type="date"] {
  height: 34px;
  border: 1px solid #dcdfe3;
  border-radius: var(--radius);
  padding: 0 0.5rem;
  font-size: 0.85rem;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #eef0f2;
}

.chart-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
}

.chart-body {
  padding: 0.85rem 0.6rem 0.4rem;
}

.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  overflow: hidden;
}

.seg-toggle button {
  height: 30px;
  padding: 0 0.8rem;
  border: none;
  background: #fff;
  color: var(--green);
  font-size: 0.8rem;
}

.seg-toggle button.active {
  background: var(--green);
  color: #fff;
}

/* ===== 登录页（唯一允许视觉强化的页面） ===== */
.login-body {
  margin: 0;
  background: #10201a;
}

.login-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2rem 1rem;
}

.login-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(1px) saturate(0.92) brightness(0.95);
  transform: scale(1.05);
}

.login-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 22, 16, 0.72) 0%, rgba(8, 22, 16, 0.62) 45%, rgba(8, 22, 16, 0.78) 100%),
    radial-gradient(900px 520px at 50% 38%, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.42));
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 12px;
  padding: 2.1rem 1.9rem 1.7rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.6rem;
}

.login-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 0.35rem;
  color: #17251d;
}

.login-sub {
  color: #8a9199;
  font-size: 0.84rem;
  margin: 0;
  letter-spacing: 0.06em;
}

.login-input {
  height: 44px;
  border: 1px solid #dfe3e7;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 115, 71, 0.14);
}

.login-btn {
  height: 44px;
  width: 100%;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.22em;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  transition: background-color 0.15s ease;
}

.login-btn:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.login-hint {
  background: #f6f8f7;
  border: 1px dashed #dfe7e2;
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-size: 0.78rem;
  color: #5f6b64;
}

.login-hint span {
  display: block;
  color: #8a9199;
  margin-bottom: 0.15rem;
}

.login-link {
  color: var(--green);
  text-decoration: none;
}

.login-footer {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  margin: 1.6rem 0 0;
}

@media (max-width: 991.98px) {
  .login-title { font-size: 1.3rem; }
  .filter-input { width: 100%; }
}
