/* ============================================================
   MERCATO — Design System (Supermercado · Sistema de Gestão)
   Desktop (frente de caixa + gestão) + App do dono (mobile)
   Fonts: Outfit (display, fresco/geométrico) + Inter (UI/dados)
   Paleta: verde fresco + laranja energia + neutros frios
   ============================================================ */

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

:root {
  /* ---------- Verde fresco (marca / ação) ---------- */
  --green-50:  #ECFCF1;
  --green-100: #D2F5DE;
  --green-200: #A7E9BE;
  --green-300: #6FD897;
  --green-400: #38C26E;
  --green-500: #15A34A;   /* ação primária */
  --green-600: #0F8A3E;
  --green-700: #0C6E32;
  --green-800: #0B5728;
  --green-900: #0A4321;

  /* ---------- Laranja (energia / promoção / destaque) ---------- */
  --orange-300: #FDBA8C;
  --orange-400: #FB9B4C;
  --orange-500: #F97316;
  --orange-600: #EA6307;

  /* ---------- Apoio ---------- */
  --sun-400:  #FBBF24;   /* oferta / amarelo */
  --sun-500:  #F59E0B;
  --red-500:  #E5484D;   /* alerta / perdas */
  --red-600:  #C93B40;
  --sky-500:  #2E90D9;   /* info */
  --grape-500:#8B5CF6;   /* setor */
  --pink-500: #EC4899;

  /* ---------- Sidebar escura (verde-carvão) ---------- */
  --dark-900: #0A2A19;
  --dark-800: #0E3A24;
  --dark-700: #14492E;

  /* ---------- Ink (cinza frio levemente esverdeado) ---------- */
  --ink-900: #16201D;
  --ink-800: #1F2C28;
  --ink-700: #2E3C37;
  --ink-600: #46544E;
  --ink-500: #687670;
  --ink-400: #93A099;
  --ink-300: #BFC9C3;
  --ink-200: #DCE4DF;
  --ink-100: #EBF1ED;
  --ink-50:  #F4F8F5;
  --white:   #FFFFFF;

  --bg-canvas: #F2F7F3;
  --surface:   #FFFFFF;

  --shadow-xs: 0 1px 2px rgba(16,32,28,0.05);
  --shadow-sm: 0 2px 8px rgba(16,32,28,0.07);
  --shadow-md: 0 8px 24px rgba(16,32,28,0.09);
  --shadow-lg: 0 20px 50px rgba(16,32,28,0.14);
  --shadow-green: 0 12px 30px rgba(21,163,74,0.30);
  --shadow-orange: 0 12px 30px rgba(249,115,22,0.30);

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

  --font-display: 'Outfit', system-ui, -apple-system, sans-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; }

.bk-side { width: 248px; flex-shrink: 0; background: linear-gradient(180deg, #0E3A24 0%, #0A2A19 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(--green-400), var(--green-600)); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(21,163,74,0.4); flex-shrink: 0; }
.bk-brand .nm { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: #fff; 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(--green-300); 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(210,245,222,0.38); padding: 16px 12px 8px; }
.bk-nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: rgba(236,252,241,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: #fff; }
.bk-nav-item.active { background: linear-gradient(135deg, var(--green-500), var(--green-600)); color: #fff; box-shadow: 0 8px 20px -6px rgba(21,163,74,0.5); }
.bk-nav-item.active svg { opacity: 1; }
.bk-nav-item .badge { margin-left: auto; background: var(--orange-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(--orange-500), var(--orange-600)); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-orange); }

.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(--green-400), var(--dark-700)); 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: #fff; line-height: 1.2; }
.bk-side-user .rl { font-size: 10.5px; color: rgba(210,245,222,0.5); }

.bk-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bk-top { height: 70px; flex-shrink: 0; background: rgba(244,248,245,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: 700; 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(--orange-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; }

.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: 700; letter-spacing: -0.02em; 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: 700; letter-spacing: -0.01em; color: var(--ink-900); }
.bk-overline { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-500); }

.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-green { background: linear-gradient(135deg, var(--green-500), var(--green-400)); color: #fff; box-shadow: var(--shadow-green); }
.bk-btn-green:hover { transform: translateY(-1px); }
.bk-btn-orange { background: linear-gradient(135deg, var(--orange-500), var(--orange-400)); color: #fff; box-shadow: var(--shadow-orange); }
.bk-btn-dark { background: var(--dark-800); color: #fff; }
.bk-btn-ghost { background: var(--white); border-color: var(--ink-200); color: var(--ink-800); }
.bk-btn-red { background: linear-gradient(135deg, var(--red-500), var(--red-600)); color: #fff; }
.bk-btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 9px; }

.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(--dark-800); color: #fff; border-color: var(--dark-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-green { background: var(--green-50); color: var(--green-700); }
.bk-tag-orange { background: #FFF1E6; color: var(--orange-600); }
.bk-tag-red { background: #FDECEC; color: var(--red-600); }
.bk-tag-sun { background: #FEF3C7; color: #B45309; }
.bk-tag-neutral { background: var(--ink-100); color: var(--ink-600); }
.bk-tag-sky { background: #E5F1FB; color: var(--sky-500); }
.bk-tag-grape { background: #F1ECFE; color: var(--grape-500); }

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

.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(--ink-50); }
.bk-table .num { font-family: var(--font-display); font-weight: 700; font-feature-settings: 'tnum'; }

.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(--green-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; }

.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(--green-600), var(--green-400)); }
.bk-bar > i.orange { background: linear-gradient(90deg, var(--orange-600), var(--orange-400)); }
.bk-bar > i.red { background: linear-gradient(90deg, var(--red-600), var(--red-500)); }

.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: 700; font-feature-settings: 'tnum'; letter-spacing: -0.02em; }

/* ============================================================
   APP DO DONO (mobile 375 x 812)
   ============================================================ */
.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-green { background: #6FD897; }
.orb-orange { background: #FDBA8C; }
.orb-dark { background: #0E3A24; 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: 700; 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(16,32,28,0.06); }
.icon-btn .dot { position: absolute; top: 11px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange-500); border: 2px solid #fff; }
.avatar-btn { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--green-400), var(--dark-700)); 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(244,248,245,0.8); 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(--green-600); }
.nav-item.active::before { content: ''; position: absolute; top: -12px; width: 28px; height: 3px; background: var(--green-500); border-radius: 0 0 6px 6px; }
.nav-item.fab { background: linear-gradient(135deg, var(--green-500), var(--green-400)); width: 54px; height: 54px; border-radius: 50%; align-self: center; margin-top: -16px; box-shadow: var(--shadow-green); 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; }

.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(--green-500), var(--green-400)); color: #fff; box-shadow: var(--shadow-green); }
.btn-orange { background: linear-gradient(135deg, var(--orange-500), var(--orange-400)); color: #fff; box-shadow: var(--shadow-orange); }
.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(--dark-800); color: #fff; border-color: var(--dark-800); }
.chip-green { background: var(--green-50); border-color: var(--green-200); color: var(--green-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(--green-600), var(--green-400)); }

.t-display { font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.04; letter-spacing: -0.03em; color: var(--ink-900); }
.t-h2 { font-family: var(--font-display); font-weight: 700; 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: 700; font-feature-settings: 'tnum'; letter-spacing: -0.02em; }

/* ============================================================
   MOBILE — comportamento fluido só para o app do dono
   ============================================================ */
@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 .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; }
}
