:root{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --text:#0f172a;
  --muted:rgba(15,23,42,.62);
  --line:rgba(15,23,42,.10);
  --shadow:0 14px 30px rgba(15,23,42,.06);
  --radius:16px;

  --accent:#2563eb;
}

*{ box-sizing:border-box; }

.hidden {
  display: none !important;
}

body.admin-body{
  margin:.5rem;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f3f4f6; /* antes f6f7fb */
  color: var(--text);
}

/* =======================
   LAYOUT
   ======================= */


/* =======================
   MAIN
   ======================= */
.admin-main{
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 8px 3px 26px;
}

/* container */
.admin-container{
  max-width: 1080px;
  margin: 0 auto;
  min-width: 0;
}

/* =========================
   HEADER / TOP (tu header actual)
========================= */

.app-header{
  position: sticky;
  top: 0;
  z-index: 1100;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 72px;
  padding-left: 8px;
  padding-right: calc(8px + env(safe-area-inset-right));

  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: #fff;
}

.app-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.app-logo{
  height:100%;
  max-height:56px;
  width:auto;
  aspect-ratio:1 / 1;

  display:flex;
  align-items:center;
  justify-content:center;

  overflow:hidden;
  flex-shrink:0;
}

.app-logo img{
  height:100%;
  width:auto;
  object-fit:contain;
  display:block;
}

.app-title{ min-width:0; }

.app-kicker{
  font-size:10px;
  letter-spacing:.14em;
  opacity:.9;
}

.app-name{
  font-size:16px;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.app-exit{
  color:#fff;
  text-decoration:none;
  font-weight:800;
  font-size:14px;
}

/* =======================
   CONTEXTO (si aún lo usas)
   ======================= */
.context-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 6px 0 14px;
}

.context-card{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px;
  display:flex;
  align-items:center;
  gap: 12px;
}

.context-ic{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(15,23,42,.04);
  border: 1px solid var(--line);
  font-size: 18px;
}

.context-main{
  font-weight: 950;
  font-size: 18px;
}

.context-sub{
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

/* =======================
   KPI
   ======================= */
.kpi-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 7px;
}

.kpi-card{
  background: #ffffff;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: var(--radius);
  box-shadow:
    0 8px 18px rgba(15,23,42,.04),
    inset 0 0 0 1px rgba(255,255,255,.6);
  padding: 2px 2px;
}

.kpi-label{
  color: var(--muted);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-left: 5px;
}

.kpi-value{
  margin-top: 6px;
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 5px;
}

.kpi-value-sm{ font-size: clamp(14px, 4vw, 18px); }

.kpi-sub{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
  margin-left: 5px;
}

/* =========================
   KPI TIEMPOS (COCINA / ATENCIÓN)
========================= */
.kpi-grid-times{
  grid-template-columns: 1fr 1fr;
  margin-bottom: 7px;
}

.kpi-card-time{
  padding: 12px 14px;
}

.kpi-card-time .kpi-label{
  font-size: 11px;
  letter-spacing: .08em;
}

.kpi-card-time .kpi-value{
  margin-top: 6px;
  font-size: clamp(16px, 4vw, 22px);
}

.kpi-card-time .kpi-sub{
  font-size: 11px;
}

/* =======================
   PANELS
   ======================= */
.panel{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1px 14px 1px;
  margin-bottom: 14px;
  overflow: hidden;
}

.panel-head{ padding: 6px 6px 10px; }

.panel-title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.panel-sub{
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
}

.admin-table td:nth-child(1){ word-break: break-word; }

.admin-table th,
.admin-table td{
  padding: 12px 10px;
  border-bottom: 1px solid rgba(15,23,42,.10);
  vertical-align: top;
}

.admin-table th{
  text-align:left;
  color: rgba(15,23,42,.78);
  font-weight: 950;
}

.admin-table td.num,
.admin-table th.num{
  text-align:right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-table tbody tr:hover{
  background: rgba(15,23,42,.03);
}

.admin-table .muted{ color: var(--muted); }

.tfoot-label{
  text-align:right;
  color: rgba(15,23,42,.65);
  font-weight: 950;
  letter-spacing: .06em;
}

.tfoot-value{ font-weight: 950; }

/* Tabla con scroll */
.table-wrap{
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 420px;
  padding: 0 6px 6px;
}

.table-wrap::-webkit-scrollbar { width: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(15,23,42,.25); border-radius: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

/* =======================
   CHARTS
   ======================= */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.chart-box{ padding: 10px 6px 6px; }
.chart-box.donut {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-box.donut canvas {
    max-height: 240px !important;
    max-width: 240px !important;
}

.chart-box {
  position: relative;
  width: 100%;
  min-height: 260px;
}

.chart-box canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.admin-foot{
  margin-top: 8px;
  color: rgba(15,23,42,.45);
  font-weight: 800;
  font-size: 12px;
  padding: 8px 2px 0;
}

/* =======================
   RESPONSIVE
   ======================= */
@media (min-width: 860px){
  .kpi-grid{ grid-template-columns: repeat(4, 1fr); }
  .context-row{ grid-template-columns: 1fr 1fr; }
  .charts-grid{ grid-template-columns: 1.4fr .9fr; }
}

@media (max-width: 420px){
  .admin-main{ padding: 8px 3px 26px; }
  .context-row{ grid-template-columns: 1fr; }
  .kpi-grid{ grid-template-columns: 1fr 1fr; }
}

/* =======================
   FIX SAFARI iOS
   ======================= */
@supports (-webkit-touch-callout: none) {

  html, body {
    height: auto;
    overflow-x: hidden;
  }

  .admin-main {
    min-height: 100vh;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  .role-switch-btn {
    bottom: calc(var(--footer-h) + 16px);
  }
}

/* ===============================
   MODAL BASE
   =============================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.55);
}

.modal-panel {
  position: relative;
  margin: auto;
  background: #fff;
  border-radius: 14px;
  max-width: 420px;
  width: 92%;
}

/* ===============================
   MODAL – CIERRE DE JORNADA
   =============================== */

.modal-panel {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15,23,42,.25);
  padding: 16px 16px 14px;
  animation: modalIn .18s ease-out;
}

@keyframes modalIn {
  from {
    transform: translateY(12px) scale(.97);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.modal-header strong {
  font-size: 16px;
  font-weight: 900;
}

.modal-close {
  appearance: none;
  border: none;
  background: rgba(15,23,42,.08);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.modal-section {
  margin-top: 8px;
  font-size: 14px;
}

.modal-section ul {
  margin: 10px 0;
  padding-left: 18px;
}

.modal-section li {
  margin: 4px 0;
  font-weight: 800;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.btn-secondary {
  background: #e5e7eb;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 900;
  cursor: pointer;
}

.btn-danger:disabled {
  opacity: .7;
  cursor: default;
}

.shift-context{
  display:flex;
  align-items:center;
  gap:10px;
  background:#f8fafc;
  border-radius:14px;
  padding:8px 16px;
  margin-bottom:16px;
  flex-direction: column;   /* ⬅️ clave */
}

.shift-context-label{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:180px;
  align-items:center;
}

.shift-title{
  font-weight:900;
  font-size:14px;
  color:#0f172a;
}

.shift-help{
  font-size:12px;
  color:rgba(15,23,42,.6);
}

/* Estado de jornada */
.shift-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
}

.shift-indicator.open {
  background: #e8f5e9;
  color: #1b5e20;
}

.shift-indicator.closed {
  background: #f1f5f9;
  color: #334155;
}

.shift-indicator .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.shift-indicator.open .dot {
  background: #22c55e;
}

.shift-indicator.closed .dot {
  background: #64748b;
}

/* Selector */

.shift-selector{
  flex:1;
  max-width: 360px;   /* ⬅️ evita que “escape” */
  width:100%;
}

.shift-selector select {
  width:100%;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
}

.shift-blocked {
  background: #fff3cd;
  color:#dc2626;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  margin-left:auto;
}

.kpi-card-wide {
  grid-column: span 2;
}

.kpi-kitchen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.kpi-kitchen-risk {
  margin-top: 10px;
  font-weight: 800;
}

.kitchen-box {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  transition: background .15s ease;
  min-width: 0;     /* ⬅️ crítico en grids */
}

.kitchen-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  text-align: center;

  line-height: 1.2;

  /* 🔑 CLAVE */
  white-space: normal;           /* permite saltos */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;         /* máximo 2 líneas */
  -webkit-box-orient: vertical;

  min-height: 34px;          /* 👈 clave */
}

.kitchen-value {
  margin-top: 6px;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Estados */
.kitchen-box.active {
  background: #fff7ed; /* naranja suave */
}

.kitchen-box.danger {
  background: #fee2e2; /* rojo suave */
}

/* =======================
   PANEL HEAD – CATEGORÍAS
======================= */
.admin-categories-page .panel-head{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  margin-bottom:16px;
  padding-bottom: 6px;
}

.btn-primary{
  background:var(--accent);
  color:#fff;
  border:none;
  border-radius:10px;
  padding:6px 12px;
  font-weight:800;
  cursor:pointer;
}

.admin-table input[type="text"]{
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid #e2e8f0;
  font-weight:700;
}

.admin-table input[type="number"]{
  width:70px;
  padding:8px;
  border-radius:8px;
  border:1px solid #e2e8f0;
  text-align:center;
  font-weight:700;
}

.admin-table input[type="checkbox"]{
  width:20px;
  height:20px;
}

/* SOLO categorías */
.admin-categories-page .panel {
  margin-top: 14px;
}

/* ===========================
   CATEGORÍAS – REFINAMIENTO
=========================== */

.admin-categories-page .panel {
  padding: 18px 18px 14px;
}

/* Título del panel */
.admin-categories-page .panel-title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
}

/* Botón nueva categoría */
.admin-categories-page .btn-primary{
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 9px;
  height: auto;
}

/* Tabla */
.admin-categories-page .admin-table {
  font-size: 14px;
}

/* Header tabla */
.admin-categories-page .admin-table th {
  font-size: 13px;
  font-weight: 700;
  color: rgba(15,23,42,.65);
  padding: 10px 8px;
}

/* Celdas */
.admin-categories-page .admin-table td {
  padding: 8px 8px;
}

/* Inputs */
.admin-categories-page .admin-table input[type="text"],
.admin-categories-page .admin-table input[type="number"] {
  width: 100%;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

/* Inputs: focus */
.admin-categories-page .admin-table input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}

/* Checkbox más discreto */
.admin-categories-page
.admin-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Líneas más suaves */
.admin-categories-page .admin-table tr {
  border-bottom: 1px solid rgba(15,23,42,.08);
}

/* Hover muy sutil */
.admin-categories-page .admin-table tbody tr:hover {
  background: rgba(15,23,42,.025);
}

/* =======================
   FIX HEADER + PANEL
======================= */
.admin-categories-page .app-header {
  margin-bottom: 18px;
}

/* =======================
   CATEGORÍAS – DENSIDAD
======================= */
.admin-categories-page .admin-table th,
.admin-categories-page .admin-table td{
  padding: 6px 6px;
}

.admin-categories-page .admin-table input[type="text"],
.admin-categories-page .admin-table input[type="number"]{
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}

.admin-categories-page .admin-table input[type="number"]{
  width: 64px;
}

.admin-categories-page .admin-table input[type="checkbox"]{
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  margin: 0 auto;
  display: block;
}

/* ===========================
   CATEGORÍAS – ANCHOS DE COLUMNA
=========================== */

/* Nombre: más espacio */
.admin-categories-page .admin-table th:nth-child(1),
.admin-categories-page .admin-table td:nth-child(1){
  width: auto;              /* ocupa todo lo posible */
}

/* Orden: angosto */
.admin-categories-page .admin-table th:nth-child(2),
.admin-categories-page .admin-table td:nth-child(2){
  width: 64px;
  text-align: center;
}

/* Activa: centrado real */
.admin-categories-page .admin-table th:nth-child(3),
.admin-categories-page .admin-table td:nth-child(3){
  width: 56px;
  text-align: center;
  vertical-align: middle;
} 

.admin-categories-page .admin-table .cat-name{
  width: 100%;
  min-width: 190px;
}

.admin-categories-page .admin-table .cat-order{
  width: 52px;
  padding: 6px 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.admin-categories-page .admin-table tbody tr:hover{
  background: rgba(15,23,42,.02);
}

/* ===========================
   CATEGORÍAS – DISTRIBUCIÓN FINAL DE COLUMNAS
=========================== */

.admin-categories-page .admin-table{
  width:100%;
  border-collapse: collapse;
  table-layout: fixed;   /* ✅ CLAVE */
}

/* Nombre → domina pero no rompe */
.admin-categories-page .admin-table th:nth-child(1),
.admin-categories-page .admin-table td:nth-child(1){
  width: auto;
}

/* Orden → compacto */
.admin-categories-page .admin-table th:nth-child(2),
.admin-categories-page .admin-table td:nth-child(2){
  width: 64px;
  text-align: center;
}

/* ACTIVA → mínimo */
.admin-categories-page .admin-table th:nth-child(3),
.admin-categories-page .admin-table td:nth-child(3){
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.panel-head-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.panel-kpi-highlight {
  text-align: right;
}

.panel-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: .08em;
}

.panel-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.panel-kpi-sub {
  font-size: 12px;
  color: #64748b;
}

.shift-context-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1px;
}

/* IZQUIERDA: selector */
.shift-left {
  flex: 1 1 auto;
  max-width: 420px;
}

/* asegura que el select no crezca infinito */
.shift-left select,
.shift-selector select {
  width: 100%;
  max-width: 100%;
}

/* DERECHA: mesas */
.shift-right {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

/* Métrica compacta */
.shift-metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  margin-bottom: 2px;
}

.shift-metric-value {
  font-size: 18px;   /* 👈 clave: más chico */
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.shift-metric-sub {
  font-size: 11px;
  color: #64748b;
}

/* 📱 Mobile: apilar pero SIN gigantismo */
@media (max-width: 640px) {
  .shift-context-split {
    flex-direction: column;
    align-items: stretch;
  }

  .shift-right {
    text-align: left;
  }
}

.shift-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shift-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1; /* gris por defecto */
}

.shift-dot.open {
  background: #22c55e; /* verde */
}

/* =======================
   HEADER – SALIR
======================= */

.app-header{
  position: sticky;
  top: 0;
  z-index: 1100;
}

/* bloque derecho */
.app-header-right{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* texto usuario */
.app-user-info{
  text-align: right;
  line-height: 1.2;
}

.app-user-main{
  font-weight: 900;
  font-size: 14px;
}

.app-user-sub{
  font-size: 12px;
  opacity: .85;
}

/* Botón salir */
.app-exit{
  flex-shrink: 0;

  width: 34px;
  height: 34px;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(255,255,255,.15);
  backdrop-filter: blur(6px);

  color: #fff;
  font-size: 16px;
  text-decoration: none;
}

.app-exit:hover{
  background: rgba(255,255,255,.25);
  transform: translateY(-1px);
}

/* ===============================
   CONTEXTO DE NEGOCIO
   =============================== */

/* FOODTRUCK */
body.business-foodtruck .kpi-mesas {
  display: none !important;
}

/* RESTAURANT */
body.business-restaurant .kpi-orders-delivery,
body.business-restaurant .kpi-orders-customer {
  display: none !important;
}


/* ===============================
   MODAL (FIX iOS + SCROLL INTERNO)
   =============================== */

.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 16px; /* evita tocar bordes en mobile */
}

.modal.is-open{ display:flex; }

.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(15,23,42,.55);
}

/* Panel: NO full height; con max-height + overflow hidden */
.modal-panel{
  position: relative;
  width: min(420px, 92vw);

  /* clave: altura acotada + scroll interno */
  max-height: min(86vh, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15,23,42,.25);
  padding: 16px 16px 14px;
  animation: modalIn .18s ease-out;
}

/* el que scrollea */
.modal-section{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  /* para que el contenido no quede pegado al footer */
  padding-bottom: 12px;
  padding-right: 6px;
  overscroll-behavior: contain;
}

/* header/footer siempre visibles */
.modal-header,
.modal-footer{
  flex: 0 0 auto;
}

.modal-footer{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15,23,42,.08);
  background: #fff;

  /* safe area iOS */
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* Mobile: sigue siendo modal centrado (no full screen),
   pero con buen alto para scrollear */
@media (max-width: 640px){
  .modal{ padding: 10px; }

  .modal-panel{
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top));
    border-radius: 18px;
  }
}

.admin-header{
  margin-bottom: 14px;
}

.mh-burger{
  border:0;
  background:#f1f5f9;
  border-radius:10px;
  width:36px;
  height:36px;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  color:#0f172a;
}

.mh-burger:hover{
  background:#e5e7eb;
}

.admin-main-full{
  width: 100%;
  margin-left: 0 !important;
}

/* ===========================
   HEADER MESTTO (ADMIN)
=========================== */

.mestto-header{
  position: sticky;
  top: 0;
  z-index: 1100;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(15,23,42,.04);
  border-radius: 10px;
}

.mestto-header::before{
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #2563eb, #16a34a);
}

.mh-left{
  display: flex;
  align-items: center;
  gap: 10px;
}

.mh-restaurant-logo{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mh-restaurant-logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mh-restaurant-name{
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.mh-right{
  display: flex;
  align-items: center;
  gap: 12px;
}

.mh-mestto-logo img{
  height: 24px;
}

.mh-exit{
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

.mh-exit:hover{
  background: #f1f5f9;
}

/* hamburguesa */
.mh-burger{
  border:0;
  background:#f1f5f9;
  border-radius:10px;
  width:36px;
  height:36px;
  font-size:18px;
  font-weight:900;
  cursor:pointer;
  color:#0f172a;
}

.mh-burger:hover{
  background:#e5e7eb;
}
.mh-restaurant-logo--qr{
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
}

.mh-restaurant-sub{
  font-size: 12px;
  color: #64748b;
}

.mh-time{
  text-align:right;
  font-size:12px;
  color:#475569;
}

.mh-mestto-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:76px;
  height:36px;
  padding:0 14px;
  border-radius:999px;
  background:linear-gradient(135deg, #2563eb, #16a34a);
  color:#fff;
  font-weight:900;
  letter-spacing:.02em;
}

.qr-nav{
  display:flex;
  gap:10px;
  align-items:center;
  margin:12px 0 16px;
  flex-wrap:wrap;
}

.qr-nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:110px;
  height:40px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid #dbe3ef;
  background:#fff;
  color:#0f172a;
  text-decoration:none;
  font-weight:800;
}

.qr-nav-link.is-active{
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color:#fff;
  border-color:transparent;
}

.qr-page-grid{
  display:grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap:16px;
}

.qr-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.qr-field{ margin-bottom:14px; }
.qr-field--full{ grid-column:1 / -1; }
.qr-label{
  display:block;
  margin-bottom:7px;
  font-size:13px;
  font-weight:800;
  color:#0f172a;
}

.qr-input,
.qr-select,
.qr-textarea,
.qr-file{
  width:100%;
  border:1px solid #dbe3ef;
  background:#fff;
  border-radius:12px;
  padding:12px 14px;
  font-size:14px;
  color:#0f172a;
}

.qr-textarea{ min-height:96px; resize:vertical; }
.qr-file{ padding:10px 12px; }

.qr-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:4px;
}

.btn-primary-qr,
.btn-secondary-qr{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:44px;
  padding:0 18px;
  border-radius:12px;
  border:none;
  cursor:pointer;
  text-decoration:none;
  font-weight:900;
}

.btn-primary-qr{
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color:#fff;
}

.btn-secondary-qr{
  background:#eef2ff;
  color:#1e3a8a;
}

.qr-help{
  font-size:12px;
  color:#64748b;
  margin-top:6px;
}

.qr-error,
.qr-success{
  border-radius:14px;
  padding:12px 14px;
  margin-bottom:14px;
  font-weight:700;
  font-size:14px;
}

.qr-error{ background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.qr-success{ background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }

.qr-preview-wrap{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.qr-preview-box{
  min-height:520px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:18px;
  padding:20px;
}

.qr-preview-box img{
  width:100%;
  max-width:420px;
  height:auto;
  background:#fff;
  padding:14px;
  border-radius:18px;
  border:1px solid #e5e7eb;
}

.qr-empty{
  color:#64748b;
  text-align:center;
  font-weight:700;
}

.qr-meta{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}

.qr-meta-card{
  border:1px solid rgba(15,23,42,.08);
  border-radius:14px;
  padding:12px 14px;
  background:#fff;
}

.qr-meta-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#64748b;
  font-weight:800;
}

.qr-meta-value{
  margin-top:6px;
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  word-break:break-word;
}

.table-wrap--wide{ max-height:none; overflow:auto; }

@media (max-width: 980px){
  .qr-page-grid{ grid-template-columns:1fr; }
}

@media (max-width: 640px){
  .qr-form-grid{ grid-template-columns:1fr; }
  .mh-right{ gap:8px; }
  .mh-mestto-brand{ min-width:auto; padding:0 12px; }
}

.chart-box {
    position: relative;
    height: 320px;
}

.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-box:not(.donut) {
    height: 300px;
}