:root {
  --dot-green: #1f7a4d;
  --dot-green-dark: #155c39;
  --sidebar-width: 250px;
}

html {
  font-size: 14px;
}

/* Badge colour helpers from Bootstrap 5.2+ (the bundled Bootstrap is 5.1, which lacks them). */
.text-bg-primary { color: #fff !important; background-color: #0d6efd !important; }
.text-bg-secondary { color: #fff !important; background-color: #6c757d !important; }
.text-bg-success { color: #fff !important; background-color: #198754 !important; }
.text-bg-danger { color: #fff !important; background-color: #dc3545 !important; }
.text-bg-warning { color: #000 !important; background-color: #ffc107 !important; }
.text-bg-info { color: #000 !important; background-color: #0dcaf0 !important; }
.text-bg-light { color: #000 !important; background-color: #f8f9fa !important; }
.text-bg-dark { color: #fff !important; background-color: #212529 !important; }

@media (min-width: 768px) {
  html {
    font-size: 15px;
  }
}

body {
  background: #f4f6f8;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(31, 122, 77, .5);
}

.btn-primary {
  --bs-btn-bg: var(--dot-green);
  --bs-btn-border-color: var(--dot-green);
  --bs-btn-hover-bg: var(--dot-green-dark);
  --bs-btn-hover-border-color: var(--dot-green-dark);
  --bs-btn-active-bg: var(--dot-green-dark);
  --bs-btn-active-border-color: var(--dot-green-dark);
}

/* ---------- Shell ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: #12261c;
  color: #cfe3d7;
}

@media (min-width: 992px) {
  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
  }
}

.admin-sidebar.offcanvas-lg {
  --bs-offcanvas-width: var(--sidebar-width);
  --bs-offcanvas-bg: #12261c;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 1.1rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-sidebar .nav {
  padding: .75rem .5rem 1.5rem;
  width: 100%;
}

.admin-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #cfe3d7;
  border-radius: .4rem;
  padding: .5rem .75rem;
}

.admin-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.admin-sidebar .nav-link.active {
  background: var(--dot-green);
  color: #fff;
}

.admin-sidebar .nav-link.disabled {
  color: #6f8a7b;
}

.nav-section {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .08em;
  color: #6f8a7b;
  padding: 1rem .75rem .35rem;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border-bottom: 1px solid #e3e7eb;
  padding: .75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-content {
  padding: 1.5rem;
}

@media (max-width: 575.98px) {
  .admin-topbar, .admin-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ---------- Components ---------- */
.card {
  border-color: #e3e7eb;
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: #e7f3ec;
  color: var(--dot-green);
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.table > :not(caption) > * > * {
  vertical-align: middle;
}

.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
  font-weight: 600;
  white-space: nowrap;
}

.form-section-title {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6c757d;
  font-weight: 600;
  margin: 1.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid #e3e7eb;
}

.form-section-title:first-child {
  margin-top: 0;
}

/* FSSAI veg / non-veg / egg marks */
.food-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid;
  border-radius: 2px;
  position: relative;
  vertical-align: -2px;
}

.food-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
}

.food-mark-veg { border-color: #1a8f3c; }
.food-mark-veg::after { background: #1a8f3c; }
.food-mark-nonveg { border-color: #8b3a1a; }
.food-mark-nonveg::after { background: #8b3a1a; }
.food-mark-egg { border-color: #d4a017; }
.food-mark-egg::after { background: #d4a017; }

/* Tiffin weekly menu grid */
.tiffin-grid select[multiple] {
  min-height: 110px;
  font-size: .85rem;
}

/* ---------- Daily sales chart (single series, magnitude) ---------- */
.daily-chart {
  --chart-height: 220px;
  padding-left: 4.5rem; /* room for the y-axis labels */
}

.chart-plot {
  position: relative;
  height: var(--chart-height);
  border-bottom: 1px solid #adb5bd; /* baseline */
}

.chart-gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #e3e7eb; /* recessive grid */
}

.chart-axis-label {
  position: absolute;
  right: 100%;
  margin-right: .5rem;
  transform: translateY(-50%);
  font-size: .75rem;
  color: #6c757d;
  white-space: nowrap;
}

.chart-bars,
.chart-x-labels {
  display: grid;
  grid-template-columns: repeat(var(--bar-count), minmax(0, 1fr));
  column-gap: 2px; /* surface gap between adjacent bars */
}

.chart-bars {
  position: absolute;
  inset: 0;
  align-items: end;
}

.chart-bar-slot {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  outline: none;
  cursor: default;
}

.chart-bar {
  width: min(100%, 28px);
  min-height: 0;
  background: var(--dot-green);
  border-radius: 4px 4px 0 0; /* rounded data end, square on the baseline */
}

.chart-bar-slot:hover .chart-bar,
.chart-bar-slot:focus-visible .chart-bar {
  background: var(--dot-green-dark);
}

.chart-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #212529;
  color: #fff;
  font-size: .75rem;
  padding: .25rem .5rem;
  border-radius: .25rem;
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

.chart-bar-slot:hover .chart-tip,
.chart-bar-slot:focus-visible .chart-tip {
  display: block;
}

.chart-bar-slot:focus-visible {
  box-shadow: 0 0 0 2px rgba(31, 122, 77, .5);
  border-radius: 4px;
}

.chart-x-labels span {
  font-size: .7rem;
  color: #6c757d;
  text-align: center;
  white-space: nowrap;
  padding-top: .25rem;
}

/* ---------- Auth ---------- */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #12261c 0%, #1f7a4d 100%);
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e7f3ec;
  color: var(--dot-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: .5rem;
}
