/* Babs Kitchen – shared styles for cashier + admin (mobile first) */
:root {
  --brand: #198754;
  --brand-dark: #146c43;
  --bg: #f3f5f7;
}

body {
  background: var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Navbar ---------- */
.app-nav { background: var(--brand); }
.app-nav .navbar-brand { letter-spacing: 1px; }
.app-nav .nav-link {
  border-radius: 6px;
  padding: .55rem .8rem !important;
  color: rgba(255,255,255,.9);
}
.app-nav .nav-link:hover,
.app-nav .nav-link.active { background: var(--brand-dark); color: #fff; }
@media (max-width: 991.98px) {
  .app-nav .navbar-collapse { padding-top: .5rem; }
  .app-nav .nav-link { padding: .75rem .8rem !important; font-size: 1.05rem; }
  .app-nav .dropdown-menu { border: 0; background: rgba(255,255,255,.12); }
  .app-nav .dropdown-item { color: #fff; padding: .65rem 1.2rem; }
  .app-nav .dropdown-item:hover { background: var(--brand-dark); color: #fff; }
}

/* ---------- General ---------- */
.page-title { color: var(--brand); font-weight: 700; font-size: 1.4rem; margin-bottom: 1rem; }
@media (min-width: 768px) { .page-title { font-size: 1.75rem; } }
.card { border: 0; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card-header.bg-success { border-radius: 12px 12px 0 0 !important; }
.btn, .form-control, .form-select { min-height: 42px; }
.btn-sm { min-height: 34px; }
.stat-card .label { color: #6c757d; font-size: .85rem; }
.stat-card .value { color: var(--brand); font-weight: 700; font-size: 1.15rem; word-break: break-word; }
@media (min-width: 768px) { .stat-card .value { font-size: 1.35rem; } }
.form-narrow { max-width: 520px; margin: 0 auto; }

/* ---------- Tables ---------- */
.table thead th { background: var(--brand); color: #fff; border-color: var(--brand-dark); white-space: nowrap; }
.table td, .table th { vertical-align: middle; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.actions form { margin: 0; }

/* On phones, ".table-stack" tables turn into one card per row */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: .75rem;
    padding: .4rem .75rem;
  }
  .table-stack.table-bordered > :not(caption) > * > * { border-width: 0; }
  .table-stack td {
    border: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    padding: .45rem 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: right !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .table-stack td:last-child { border-bottom: 0 !important; }
  .table-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    text-align: left;
    flex: 0 0 auto;
  }
  .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { content: none; }
  .table-stack td.actions-cell { justify-content: flex-end; }
  .table-stack td.empty-row { justify-content: center; text-align: center !important; }
  .table-stack tfoot { display: block; }
  .table-stack tfoot tr, .table-stack tfoot td, .table-stack tfoot th { display: block; width: 100%; text-align: center !important; }
}

/* ---------- Point of sale ---------- */
.pos-line {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: .75rem;
  margin-bottom: .6rem;
}
.pos-head { display: none !important; font-weight: 600; color: #555; padding: 0 .75rem .25rem; }
.pos-line .small-label { font-size: .75rem; color: #6c757d; margin-bottom: 2px; }
@media (min-width: 768px) {
  .pos-line .small-label { display: none; }
  .pos-head { display: flex !important; }
}
.qty-group .btn { min-width: 42px; }
.qty-group input { text-align: center; }
.pos-total-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: #fff;
  border-top: 3px solid var(--brand);
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
  padding: .75rem;
  border-radius: 12px 12px 0 0;
  margin: 1rem -.75rem -1rem;
}
@media (min-width: 768px) { .pos-total-bar { margin: 1rem 0 0; border-radius: 12px; } }
.grand-total { font-size: 1.35rem; font-weight: 700; color: var(--brand); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-box { width: 100%; max-width: 380px; }

/* ---------- Print ---------- */
@media print {
  .app-nav, .no-print, .pagination, .btn, form { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .table-stack thead { display: table-header-group !important; }
  .table-stack { display: table !important; }
  .table-stack tbody { display: table-row-group !important; }
  .table-stack tr { display: table-row !important; }
  .table-stack td { display: table-cell !important; }
  .table-stack td::before { content: none !important; }
}
