/* ============================================================
   PÃO DOURADO — Design System (Padaria · Sistema de Gestão)
   Desktop (PDV + gestão) + App do dono (mobile)
   Fonts: Fraunces (display, quente) + Inter (UI/dados)
   Paleta: crosta/marrom + trigo/dourado + creme + terracota
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ---------- Crosta (marrom escuro — sidebar/superfícies) ---------- */
  --crust-900: #241509;
  --crust-800: #33200F;
  --crust-700: #432C16;
  --crust-600: #5C3F22;
  --crust-500: #785631;

  /* ---------- Trigo / dourado (ação, marca) ---------- */
  --gold-100: #FBF1DC;
  --gold-200: #F5E2BD;
  --gold-300: #EBCB8E;
  --gold-400: #DCAB52;
  --gold-500: #C8841E;  /* ação primária */
  --gold-600: #A66A15;
  --gold-700: #855210;

  /* ---------- Creme / farinha (fundos) ---------- */
  --cream-50:  #FCF8F1;
  --cream-100: #F8F1E5;
  --cream-200: #F0E5D1;
  --cream-300: #E6D6BC;

  /* ---------- Terracota (alerta / destaque quente) ---------- */
  --terra-300: #EDA98C;
  --terra-400: #DE7B57;
  --terra-500: #C9533B;
  --terra-600: #A83C28;

  /* ---------- Apoio ---------- */
  --butter:    #F2C14E;
  --green-400: #6FBF73;
  --green-500: #4FA15B;
  --green-600: #3E8049;
  --berry-500: #B5476B;
  --sky-500:   #3E8FB0;
  --plum-500:  #8A6BB0;
  --red-500:   #D64545;

  /* ---------- Ink (marrom-cinza quente, texto) ---------- */
  --ink-900: #2E2117;
  --ink-800: #3D2E20;
  --ink-700: #51402F;
  --ink-600: #6B5844;
  --ink-500: #8B7660;
  --ink-400: #AE9B85;
  --ink-300: #CDBDA6;
  --ink-200: #E4D8C5;
  --ink-100: #EFE7D8;
  --ink-50:  #F8F2E8;
  --white:   #FFFFFF;

  /* ---------- Surfaces ---------- */
  --bg-canvas: #F8F1E5;
  --surface:   #FFFFFF;

  /* ---------- Shadows ---------- */
  --shadow-xs: 0 1px 2px rgba(46,33,23,0.05);
  --shadow-sm: 0 2px 8px rgba(46,33,23,0.07);
  --shadow-md: 0 8px 24px rgba(46,33,23,0.09);
  --shadow-lg: 0 20px 50px rgba(46,33,23,0.14);
  --shadow-gold: 0 12px 30px rgba(200,132,30,0.32);

  /* ---------- Radius ---------- */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-2xl: 26px; --r-pill: 999px;

  /* ---------- Type ---------- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --duration: 200ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html, body { font-family: var(--font-body); color: var(--ink-900); background: var(--bg-canvas); font-size: 14px; line-height: 1.45; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }
input, textarea, select { font-family: inherit; outline: none; }

/* ============================================================
   DESKTOP SHELL (1280 x 800)  — prefixo bk-
   ============================================================ */
.bk-app { width: 1280px; height: 800px; display: flex; overflow: hidden; background: var(--bg-canvas); position: relative; }

/* --- Sidebar --- */
.bk-side { width: 248px; flex-shrink: 0; background: linear-gradient(180deg, #33200F 0%, #241509 100%); display: flex; flex-direction: column; position: relative; z-index: 2; }
.bk-brand { display: flex; align-items: center; gap: 11px; padding: 22px 22px 18px; }
.bk-brand .logo { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(200,132,30,0.4); flex-shrink: 0; }
.bk-brand .nm { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--cream-50); letter-spacing: -0.01em; line-height: 1; }
.bk-brand .sub { font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-400); margin-top: 4px; }

.bk-nav { flex: 1; overflow-y: auto; padding: 6px 14px 14px; scrollbar-width: none; }
.bk-nav::-webkit-scrollbar { display: none; }
.bk-nav-group { font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(245,226,189,0.4); padding: 16px 12px 8px; }
.bk-nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: rgba(248,242,232,0.66); font-size: 13.5px; font-weight: 500; margin-bottom: 2px; position: relative; transition: background var(--duration), color var(--duration); cursor: pointer; }
.bk-nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.85; }
.bk-nav-item:hover { background: rgba(255,255,255,0.06); color: var(--cream-50); }
.bk-nav-item.active { background: linear-gradient(135deg, rgba(200,132,30,0.95), rgba(166,106,21,0.95)); color: #fff; box-shadow: 0 8px 20px -6px rgba(200,132,30,0.5); }
.bk-nav-item.active svg { opacity: 1; }
.bk-nav-item .badge { margin-left: auto; background: var(--terra-500); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.bk-pdv-btn { margin: 6px 14px 4px; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 13px; background: linear-gradient(135deg, var(--gold-400), var(--gold-600)); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-gold); }

.bk-side-user { margin: 8px 14px 16px; padding: 11px 12px; border-radius: 13px; background: rgba(255,255,255,0.06); display: flex; align-items: center; gap: 10px; }
.bk-side-user .av { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--gold-400), var(--crust-600)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.bk-side-user .nm { font-size: 12.5px; font-weight: 700; color: var(--cream-50); line-height: 1.2; }
.bk-side-user .rl { font-size: 10.5px; color: rgba(245,226,189,0.5); }

/* --- Main --- */
.bk-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bk-top { height: 70px; flex-shrink: 0; background: rgba(252,248,241,0.86); backdrop-filter: blur(16px); border-bottom: 1px solid var(--ink-100); display: flex; align-items: center; gap: 18px; padding: 0 30px; z-index: 3; }
.bk-top h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-900); }
.bk-top .sub { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.bk-search { flex: 1; max-width: 360px; display: flex; align-items: center; gap: 9px; background: var(--white); border: 1px solid var(--ink-200); border-radius: 12px; padding: 10px 14px; color: var(--ink-400); font-size: 13px; }
.bk-top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bk-iconbtn { width: 42px; height: 42px; border-radius: 12px; background: var(--white); border: 1px solid var(--ink-200); display: flex; align-items: center; justify-content: center; color: var(--ink-600); position: relative; cursor: pointer; }
.bk-iconbtn .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--terra-500); border: 2px solid #fff; }

.bk-content { flex: 1; overflow-y: auto; padding: 26px 30px 36px; scrollbar-width: thin; }
.bk-content::-webkit-scrollbar { width: 8px; }
.bk-content::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 8px; }

/* --- Cards / stats --- */
.bk-card { background: var(--surface); border: 1px solid var(--ink-100); border-radius: var(--r-xl); box-shadow: var(--shadow-xs); }
.bk-card-pad { padding: 20px 22px; }
.bk-stat { background: var(--surface); border: 1px solid var(--ink-100); border-radius: var(--r-xl); padding: 18px 20px; box-shadow: var(--shadow-xs); }
.bk-stat .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.bk-stat .val { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink-900); line-height: 1; }
.bk-stat .lbl { font-size: 12.5px; color: var(--ink-500); font-weight: 600; margin-top: 4px; }
.bk-sec-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-900); }
.bk-overline { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); }

/* --- Buttons --- */
.bk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-body); font-weight: 600; font-size: 13.5px; padding: 11px 18px; border-radius: 11px; border: 1px solid transparent; transition: transform var(--duration), box-shadow var(--duration); }
.bk-btn-gold { background: linear-gradient(135deg, var(--gold-500), var(--gold-400)); color: #fff; box-shadow: var(--shadow-gold); }
.bk-btn-gold:hover { transform: translateY(-1px); }
.bk-btn-dark { background: var(--crust-800); color: var(--cream-50); }
.bk-btn-ghost { background: var(--white); border-color: var(--ink-200); color: var(--ink-800); }
.bk-btn-terra { background: linear-gradient(135deg, var(--terra-500), var(--terra-400)); color: #fff; }
.bk-btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 9px; }

/* --- Chips / badges / tags --- */
.bk-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--r-pill); padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--ink-700); white-space: nowrap; }
.bk-chip.on { background: var(--crust-800); color: #fff; border-color: var(--crust-800); }
.bk-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px; }
.bk-tag-gold { background: var(--gold-100); color: var(--gold-700); }
.bk-tag-green { background: #E8F6E9; color: var(--green-600); }
.bk-tag-terra { background: #FCEBE4; color: var(--terra-600); }
.bk-tag-amber { background: #FCEFCB; color: #97631C; }
.bk-tag-neutral { background: var(--ink-100); color: var(--ink-600); }
.bk-tag-sky { background: #E5F1F6; color: var(--sky-500); }

.bk-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* --- Table --- */
.bk-table { width: 100%; border-collapse: collapse; }
.bk-table thead th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-400); padding: 0 16px 12px; border-bottom: 1px solid var(--ink-100); }
.bk-table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--ink-100); font-size: 13px; color: var(--ink-800); vertical-align: middle; }
.bk-table tbody tr:last-child td { border-bottom: none; }
.bk-table tbody tr:hover { background: var(--cream-50); }
.bk-table .num { font-family: var(--font-display); font-weight: 600; font-feature-settings: 'tnum'; }

/* --- Inputs --- */
.bk-field { background: var(--white); border: 1.5px solid var(--ink-200); border-radius: 11px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; transition: border var(--duration); }
.bk-field:focus-within { border-color: var(--gold-500); }
.bk-field input { flex: 1; border: none; background: transparent; font-size: 14px; color: var(--ink-900); }
.bk-label { font-size: 12px; font-weight: 600; color: var(--ink-600); margin-bottom: 7px; display: block; }

/* --- Progress bar --- */
.bk-bar { height: 8px; background: var(--ink-100); border-radius: var(--r-pill); overflow: hidden; }
.bk-bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); }
.bk-bar > i.terra { background: linear-gradient(90deg, var(--terra-600), var(--terra-400)); }
.bk-bar > i.green { background: linear-gradient(90deg, var(--green-600), var(--green-400)); }

/* --- Segmented / tabs --- */
.bk-seg { display: inline-flex; background: var(--ink-100); border-radius: 11px; padding: 4px; gap: 2px; }
.bk-seg a { padding: 7px 15px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.bk-seg a.on { background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-xs); }

.bk-num { font-family: var(--font-display); font-weight: 600; font-feature-settings: 'tnum'; letter-spacing: -0.02em; }

/* ============================================================
   APP DO DONO (mobile 375 x 812) — shell de telefone
   ============================================================ */
.phone { width: 375px; height: 812px; position: relative; background: linear-gradient(180deg, #FCF8F1 0%, #F8F1E5 55%, #F0E5D1 100%); overflow: hidden; }
.atmosphere { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.5; }
.orb-gold { background: #EBCB8E; }
.orb-terra { background: #EDA98C; }
.orb-crust { background: #785631; opacity: 0.3; }

.status-bar { height: 50px; display: flex; justify-content: space-between; align-items: center; padding: 14px 28px 0; position: relative; z-index: 30; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; color: var(--ink-900); }
.status-bar svg { display: block; }
.status-bar .right { display: flex; gap: 6px; align-items: center; }

.screen-scroll { position: absolute; inset: 0; overflow-y: auto; z-index: 1; padding-bottom: 104px; scrollbar-width: none; }
.screen-scroll::-webkit-scrollbar { display: none; }
.screen-pad { padding: 0 20px; }

.app-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px 16px; position: relative; z-index: 20; }
.app-header .greet-small { font-size: 12px; font-weight: 500; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.02em; }
.app-header .greet-name { font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin-top: 4px; color: var(--ink-900); }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,0.8); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: 1px solid rgba(255,255,255,0.9); display: inline-flex; align-items: center; justify-content: center; position: relative; color: var(--ink-700); box-shadow: 0 4px 14px rgba(46,33,23,0.06); }
.icon-btn .dot { position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--terra-500); border: 2px solid #fff; }
.avatar-btn { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--gold-400), var(--crust-600)); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; border: 1px solid rgba(255,255,255,0.9); }

.glass { background: rgba(255,255,255,0.66); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); border: 1px solid rgba(255,255,255,0.85); border-radius: var(--r-2xl); }
.glass-strong { background: rgba(255,255,255,0.86); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); border: 1px solid rgba(255,255,255,0.95); border-radius: var(--r-2xl); }

.bottom-nav { position: absolute; bottom: 0; left: 0; right: 0; height: 92px; background: rgba(252,248,241,0.78); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%); border-top: 1px solid rgba(255,255,255,0.9); display: flex; justify-content: space-around; align-items: flex-start; padding: 12px 14px 30px; z-index: 25; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-400); font-size: 10.5px; font-weight: 600; position: relative; padding-top: 6px; }
.nav-item.active { color: var(--gold-600); }
.nav-item.active::before { content: ''; position: absolute; top: -12px; width: 28px; height: 3px; background: var(--gold-500); border-radius: 0 0 6px 6px; }
.nav-item.fab { background: linear-gradient(135deg, var(--gold-500), var(--gold-400)); width: 54px; height: 54px; border-radius: 50%; align-self: center; margin-top: -16px; box-shadow: var(--shadow-gold); border: 4px solid rgba(255,255,255,0.95); color: #fff; flex: 0 0 auto; padding: 0; justify-content: center; }
.nav-item.fab::before { display: none; }

/* shared buttons/chips/type for mobile */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 15px 22px; border-radius: var(--r-pill); border: none; }
.btn-primary { background: linear-gradient(135deg, var(--gold-500), var(--gold-400)); color: #fff; box-shadow: var(--shadow-gold); }
.btn-ghost { background: rgba(255,255,255,0.7); border: 1px solid var(--ink-200); color: var(--ink-900); }
.btn-block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--ink-200); border-radius: var(--r-pill); padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--ink-700); white-space: nowrap; }
.chip-active { background: var(--crust-800); color: #fff; border-color: var(--crust-800); }
.chip-gold { background: var(--gold-100); border-color: var(--gold-300); color: var(--gold-700); }
.bar { height: 8px; background: var(--ink-100); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); }

.t-display { font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 1.04; letter-spacing: -0.03em; color: var(--ink-900); }
.t-h2 { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; color: var(--ink-900); }
.t-overline { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); }
.t-num { font-family: var(--font-display); font-weight: 600; font-feature-settings: 'tnum'; letter-spacing: -0.02em; }

/* ============================================================
   MOBILE — comportamento fluido só para o app do dono (.phone)
   As telas desktop (.bk-app) permanecem fixas em 1280x800.
   ============================================================ */
@media (max-width: 820px) {
  html { width: 100%; height: 100dvh; overflow-x: hidden; overscroll-behavior-y: none; background: var(--bg-canvas); }
  body.phone-screen { width: 100vw !important; max-width: 100vw !important; height: 100dvh !important; min-height: 100dvh; overflow: hidden !important; position: relative !important; padding-top: env(safe-area-inset-top, 0) !important; }
  body.phone-screen .phone { width: 100vw; height: 100dvh; }
  body.phone-screen .bottom-nav { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0)) !important; height: calc(92px + env(safe-area-inset-bottom, 0)) !important; }
  body.phone-screen .screen-scroll { -webkit-overflow-scrolling: touch; }
}
