/* ==========================================================
   main.css — RestoPOS · Variables, base, layout, utilidades
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* Paleta principal */
  --white:        #ffffff;
  --off-white:    #f7f8fa;
  --gray-50:      #f0f2f5;
  --gray-100:     #e4e7ed;
  --gray-200:     #cdd2db;
  --gray-400:     #8f97a4;
  --gray-600:     #5a6270;
  --gray-800:     #2c3140;
  --gray-900:     #1a1d26;

  /* Acento naranja fuego — hostelería real */
  --brand:        #ff5722;
  --brand-dark:   #d84315;
  --brand-light:  #fff3f0;
  --brand-mid:    #ffccbc;

  /* Estados */
  --green:        #00c853;
  --green-bg:     #e8f9f0;
  --green-border: #a5d6b0;
  --red:          #f44336;
  --red-bg:       #fdecea;
  --red-border:   #f5c6c3;
  --amber:        #ff9800;
  --amber-bg:     #fff8e1;
  --blue:         #1976d2;
  --blue-bg:      #e3f0ff;

  /* Layout */
  --sidebar-w:    220px;
  --sidebar-col:  64px;
  --topbar-h:     62px;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.08);
  --shadow:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.16);
  --transition:   0.18s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- LAYOUT ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-col); }

/* ---- TOPBAR ---- */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; flex-direction: column; gap: 1px; }
.page-title { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); }
.page-subtitle { font-size: 0.72rem; color: var(--gray-400); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Stats chips */
.stats-bar { display: flex; gap: 8px; }
.stat-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700; border: 1.5px solid;
}
.stat-chip.free   { border-color: var(--green-border); background: var(--green-bg); color: #00a844; }
.stat-chip.busy   { border-color: var(--red-border); background: var(--red-bg); color: var(--red); }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Clock */
.clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem; font-weight: 700;
  color: var(--gray-800);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  min-width: 88px; text-align: center;
}

/* ---- VIEWS ---- */
.view { display: none; padding: 24px; flex: 1; animation: fadeUp .2s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: none;
  font-family: 'Outfit', sans-serif; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
  letter-spacing: .01em;
}
.btn-brand    { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(255,87,34,.30); }
.btn-brand:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,87,34,.35); }
.btn-secondary { background: var(--white); color: var(--gray-800); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0,200,83,.25); }
.btn-success:hover { background: #00b347; transform: translateY(-1px); }
.btn-danger  { background: var(--red-bg); color: var(--red); border: 1.5px solid var(--red-border); }
.btn-danger:hover  { background: var(--red); color: #fff; }
.btn-ghost   { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); }
.btn-lg { padding: 14px 30px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 13px; font-size: 0.78rem; border-radius: 6px; }
.btn-xl { padding: 18px 0; font-size: 1.05rem; border-radius: var(--radius); width: 100%; }

/* ---- FORMS ---- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.78rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .05em; }
input[type="text"], input[type="number"], select, textarea {
  background: var(--white); border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); color: var(--gray-900);
  font-family: 'Outfit', sans-serif; font-size: 0.92rem; font-weight: 500;
  padding: 10px 13px; outline: none; transition: border-color var(--transition); width: 100%;
}
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,87,34,.12); }
select option { background: var(--white); }

.number-input-group {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--white);
}
.number-input-group input { border: none; text-align: center; border-radius: 0; box-shadow: none; flex: 1; }
.num-btn {
  background: var(--gray-50); border: none; color: var(--gray-600);
  width: 42px; font-size: 1.2rem; cursor: pointer;
  transition: background var(--transition); flex-shrink: 0;
  font-weight: 700;
}
.num-btn:hover { background: var(--gray-100); color: var(--gray-900); }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---- BADGE ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-green  { background: var(--green-bg); color: #00a844; border: 1px solid var(--green-border); }
.badge-red    { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-amber  { background: var(--amber-bg); color: #e65100; border: 1px solid #ffd180; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-brand  { background: var(--brand-light); color: var(--brand-dark); border: 1px solid var(--brand-mid); }

/* ---- SECTION TITLE ---- */
.section-title {
  font-size: 1.2rem; font-weight: 800; color: var(--gray-900); margin-bottom: 6px;
}
.section-sub { font-size: 0.82rem; color: var(--gray-400); font-weight: 500; }

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; gap: 10px; color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 3rem; opacity: .5; }
.empty-state p { font-size: 0.88rem; font-weight: 500; }
