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

/* ═══════════════════════════════════════════
   BARFLOW — DESIGN SYSTEM v2.0
   Sistema para Bar e Restaurante
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brand ── */
  --brand:        #2563EB;
  --brand-light:  #3B82F6;
  --brand-dark:   #1D4ED8;
  --brand-bg:     #EFF6FF;
  --brand-accent: #38BDF8;

  /* ── Surfaces (light mode) ── */
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFC;
  --surface-3:    #F1F5F9;
  --border:       #E2E8F0;
  --border-light: #F1F5F9;

  /* ── Text ── */
  --text-1:  #0F172A;
  --text-2:  #334155;
  --text-3:  #64748B;
  --text-4:  #94A3B8;

  /* ── Semantic colors ── */
  --green:    #22C55E;
  --green-bg: #DCFCE7;
  --yellow:   #F59E0B;
  --yellow-bg:#FEF3C7;
  --red:      #EF4444;
  --red-bg:   #FEE2E2;
  --blue:     #2563EB;
  --blue-bg:  #DBEAFE;
  --cyan:     #38BDF8;
  --cyan-bg:  #E0F2FE;

  /* ── Layout ── */
  --sidebar-w: 210px;
  --header-h:  56px;

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-sm: 0 2px 8px rgba(15,23,42,.08);
  --shadow:    0 4px 20px rgba(15,23,42,.10);
  --shadow-lg: 0 8px 32px rgba(15,23,42,.14);

  /* ── Typography ── */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text-1);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 16px; height: 36px;
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: none;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  white-space: nowrap; text-decoration: none; letter-spacing: -.01em;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 12px rgba(37,99,235,.35); transform: translateY(-1px); }
.btn-primary:active { transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--text-4); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 24px; font-size: 14px; border-radius: var(--radius); }
.btn-icon { padding: 0; width: 36px; justify-content: center; }
.btn-danger { background: var(--red); color: #fff; box-shadow: 0 1px 3px rgba(239,68,68,.3); }
.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 1px 3px rgba(34,197,94,.3); }
.btn-success:hover { background: #16A34A; transform: translateY(-1px); }

/* ══════════════════════════════════
   BADGES
══════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.badge-green  { background: var(--green-bg);  color: #15803D; }
.badge-yellow { background: var(--yellow-bg); color: #B45309; }
.badge-red    { background: var(--red-bg);    color: #B91C1C; }
.badge-blue   { background: var(--blue-bg);   color: var(--brand); }
.badge-gray   { background: var(--surface-3); color: var(--text-3); }
.badge-brand  { background: var(--brand-bg);  color: var(--brand); }
.badge-cyan   { background: var(--cyan-bg);   color: #0369A1; }

/* ══════════════════════════════════
   CARD
══════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

/* ══════════════════════════════════
   INPUTS
══════════════════════════════════ */
.input-wrap { position: relative; }
.input-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-4); font-size: 13px; pointer-events: none; }
.input {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px;
  color: var(--text-1); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input-icon { padding-left: 34px; }
select.input { cursor: pointer; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }

/* ══════════════════════════════════
   CHIPS
══════════════════════════════════ */
.chip { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 500; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: all .15s; white-space: nowrap; }
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.chip:hover:not(.active) { border-color: var(--brand); color: var(--brand); background: var(--brand-bg); }

/* ══════════════════════════════════
   APP SHELL
══════════════════════════════════ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }
.app-sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.app-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.app-header { height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 12px; flex-shrink: 0; }
.app-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ══════════════════════════════════
   SIDEBAR — BarFlow branded
══════════════════════════════════ */
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border-light); min-height: 57px; }
.sidebar-logo-img { height: 28px; width: auto; object-fit: contain; flex-shrink: 0; }
.sidebar-logo-fallback { width: 28px; height: 28px; background: var(--brand); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo-fallback span { color: #fff; font-size: 11px; font-weight: 800; letter-spacing: -.5px; }
.sidebar-module { font-size: 11px; font-weight: 500; color: var(--text-4); margin-top: 1px; }
.sidebar-nav { padding: 8px 8px; flex: 1; }
.sidebar-section { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-4); padding: 14px 8px 5px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; text-decoration: none; transition: all .12s; }
.nav-item:hover { background: var(--surface-2); color: var(--text-1); }
.nav-item.active { background: var(--brand-bg); color: var(--brand); }
.nav-item.active i { color: var(--brand); }
.nav-item i { width: 16px; text-align: center; font-size: 13.5px; color: var(--text-4); transition: color .12s; }
.nav-badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.sidebar-footer { padding: 10px 8px; border-top: 1px solid var(--border-light); }

/* ══════════════════════════════════
   HEADER
══════════════════════════════════ */
.header-title { font-size: 15px; font-weight: 700; color: var(--text-1); letter-spacing: -.3px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-plan { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--blue-bg); color: var(--brand); font-size: 11.5px; font-weight: 600; border: 1px solid #BFDBFE; }

/* ══════════════════════════════════
   TABLE
══════════════════════════════════ */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--text-3); padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--border-light); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--brand-bg); }
tr.selected td { background: var(--brand-bg); }

/* ══════════════════════════════════
   TABS
══════════════════════════════════ */
.tab-bar { display: flex; align-items: center; border-bottom: 1px solid var(--border); gap: 0; }
.tab { padding: 11px 16px; font-size: 13px; font-weight: 500; color: var(--text-3); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: all .15s; white-space: nowrap; }
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; margin-left: 5px; }

/* ══════════════════════════════════
   STAT CARD
══════════════════════════════════ */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 5px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-1); letter-spacing: -.5px; }
.stat-sub { font-size: 11.5px; color: var(--text-4); margin-top: 3px; }

/* ══════════════════════════════════
   UTILITY
══════════════════════════════════ */
.flex{display:flex} .flex-col{display:flex;flex-direction:column}
.items-center{align-items:center} .justify-between{justify-content:space-between} .justify-end{justify-content:flex-end}
.gap-1{gap:4px} .gap-2{gap:8px} .gap-3{gap:12px} .gap-4{gap:16px} .gap-5{gap:20px}
.mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:12px} .mt-4{margin-top:16px} .mt-5{margin-top:20px}
.mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px} .mb-4{margin-bottom:16px}
.ml-auto{margin-left:auto} .mr-2{margin-right:8px}
.p-3{padding:12px} .p-4{padding:16px}
.text-sm{font-size:12.5px} .text-xs{font-size:11px}
.font-bold{font-weight:700} .font-semibold{font-weight:600} .font-medium{font-weight:500}
.text-muted{color:var(--text-3)} .text-brand{color:var(--brand)}
.text-green{color:var(--green)} .text-red{color:var(--red)} .text-yellow{color:var(--yellow)}
.mono{font-family:var(--mono)} .truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.w-full{width:100%} .h-full{height:100%}
.rounded{border-radius:var(--radius-sm)} .rounded-lg{border-radius:var(--radius-lg)}
.border{border:1px solid var(--border)}
.separator{height:1px;background:var(--border-light);margin:12px 0}
.ellipsis-btn{background:none;border:none;cursor:pointer;color:var(--text-3);padding:4px 6px;border-radius:4px;font-size:16px;line-height:1}
.ellipsis-btn:hover{background:var(--surface-3);color:var(--text-1)}

/* ══════════════════════════════════
   MODAL
══════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 90%; max-width: 480px; padding: 24px; transform: translateY(12px) scale(.98); transition: transform .2s cubic-bezier(.4,0,.2,1); border: 1px solid var(--border); }
.modal-overlay.open .modal { transform: none; }
.modal-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text-1); }

/* ══════════════════════════════════
   TOAST
══════════════════════════════════ */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text-1); color: #fff; padding: 12px 18px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 2000; transform: translateY(80px); opacity: 0; transition: all .25s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; gap: 8px; }
.toast.show { transform: none; opacity: 1; }
.toast.success { background: #15803D; }
.toast.error { background: #B91C1C; }

/* ══════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.form-group.full { grid-column: 1/-1; }
