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

:root {
  --bg: #14171A;
  --surface: #1E2226;
  --surface2: #262B30;
  --border: #2A2F33;
  --border2: #33383D;
  --gold: #D9A441;
  --sage: #6B9080;
  --rust: #C1543C;
  --slate: #5B7C99;
  --text: #ECEFF1;
  --text-dim: #8B939A;
  --text-dimmer: #6B7176;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
}

h1, h2, .heading { font-family: 'Space Grotesk', sans-serif; }

button { font-family: 'Space Grotesk', sans-serif; cursor: pointer; border: none; }
input, select { font-family: 'IBM Plex Mono', monospace; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- Login ---- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
}
.login-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.login-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 24px; }

/* ---- Header ---- */
header.app-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.app-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin: 0; }
.app-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ---- Buttons ---- */
.btn { border-radius: 6px; padding: 10px 16px; font-size: 13px; font-weight: 700; }
.btn-primary { background: var(--gold); color: #14171A; }
.btn-sage { background: var(--sage); color: #14171A; }
.btn-slate { background: var(--slate); color: #14171A; }
.btn-ghost { background: transparent; border: 1px solid var(--border2); color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); overflow-x: auto; margin: 24px 0; }
.tab-btn {
  background: none; padding-bottom: 12px; font-size: 13px; font-weight: 600;
  color: var(--text-dimmer); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--gold); }

/* ---- Cards / forms ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-dim); }
.field input, .field select {
  background: var(--bg); border: 1px solid var(--border2); border-radius: 6px;
  padding: 9px 11px; font-size: 13px; color: var(--text); width: 100%;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }
@media (max-width: 720px) { .grid-2, .field-row { grid-template-columns: 1fr; } }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { text-align: left; color: var(--text-dim); font-size: 11px; text-transform: uppercase; padding: 12px 14px; border-bottom: 1px solid var(--border); }
tbody td { padding: 12px 14px; border-bottom: 1px solid #22262A; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.text-right { text-align: right; }
.empty-msg { text-align: center; color: var(--text-dimmer); padding: 40px; font-size: 13px; }

/* ---- Ticket-style rows ---- */
.ticket-row { background: #1A1D20; border: 1px dashed var(--border2); border-radius: 6px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; }

/* ---- Misc ---- */
.alert-box { background: rgba(193,84,60,0.1); border: 1px solid rgba(193,84,60,0.35); border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; display: flex; gap: 8px; }
.alert-box b { color: var(--rust); }
.pill { padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; font-weight: 700; }
.error-text { color: var(--rust); font-size: 12px; margin-top: 6px; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border2); padding: 10px 18px;
  border-radius: 10px; font-size: 13px; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 998; padding: 16px;
}
.modal-box { background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; padding: 20px; width: 100%; max-width: 400px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.close-x { background: none; color: var(--text-dim); font-size: 18px; line-height: 1; }
.link-btn { background: none; color: var(--text-dim); font-size: 12px; text-decoration: underline; padding: 0; }
.link-btn:hover { color: var(--text); }
.recipe-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.recipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .recipe-grid { grid-template-columns: 1fr; } }
.insumo-row { display: flex; gap: 8px; margin-bottom: 8px; }
.qty-input { width: 90px; flex-shrink: 0; }
.spinner { text-align: center; padding: 60px; color: var(--text-dim); }
.small-x { background: none; color: var(--text-dimmer); padding: 0 6px; }
.small-x:hover { color: var(--rust); }
