/* Estimio UI — clean, brown accent */
[hidden] { display: none !important; }
:root{
  --bg: #f6f4f1;
  --card: #ffffff;
  --text: #1f1a16;
  --muted: #6f645c;
  --line: rgba(31,26,22,0.10);

  --accent: #8a5a3c;        /* Estimio brown */
  --accent-2: #b07a55;
  --accent-weak: rgba(138,90,60,0.12);

  --danger: #b3261e;
  --ok: #2e7d32;

  --r: 16px;
  --shadow: 0 10px 26px rgba(0,0,0,0.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

/* app shell */
.app-wrapper{ min-height:100dvh; }
.page-content{
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 14px 96px; /* bottom nav space */
}

/* header */
header{
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(246,244,241,0.88);
  border-bottom: 1px solid var(--line);
}
.header-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 14px;
  max-width: 980px;
  margin: 0 auto;
}

#salute{ color: var(--muted); font-weight: 700; }
#salute strong{ color: var(--text); }

.icon-btn{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.icon-btn:active{ transform: translateY(1px); }
.icon-btn svg{ width: 22px; height: 22px; fill: var(--accent); }

/* typography helpers */
.section-title{
  margin: 14px 0 8px;
  font-weight: 900;
  letter-spacing: .2px;
}
.small{ font-size: 12px; color: var(--muted); line-height: 1.35; }
.req{ color: var(--danger); font-weight: 900; }

/* cards */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 640px){
  .row{ grid-template-columns: 1fr; }
}

/* inputs */
label{ display:block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.input{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.9);
  color: var(--text);
  outline: none;
}
.input:focus{
  border-color: rgba(138,90,60,0.55);
  box-shadow: 0 0 0 4px var(--accent-weak);
}

select.input{ appearance:none; }

/* buttons */
.btn-primary,
button.btn-primary{
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(138,90,60,0.22);
}
.btn-primary:active{ transform: translateY(1px); }

.btn-ghost,
button.btn-ghost{
  background: rgba(255,255,255,0.8);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 800;
  cursor: pointer;
}

button.green {
  color: #2e7d32;
  border-color: #2e7d32;
}

button:disabled{ opacity: .55; cursor: not-allowed; }

.toolbar{ display:flex; gap: 10px; align-items:center; }
.toolbar .input{ flex: 1; }

/* status pills (used in modals/buttons) */
.status{
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 900;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
}
.status.missed{ color: white; background-color: var(--danger); border-color: rgba(179,38,30,0.25); }
.status.done{ color: var(--ok); border-color: rgba(46,125,50,0.25); }

/* quote cards / lists */
#quotesList, #productsBox, #groupsBox{
  display:grid;
  gap: 10px;
}

.quote-card,
.product-card,
.group-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  box-shadow: var(--shadow);
}

.quote-card:hover,
.product-card:hover,
.group-card:hover{ border-color: rgba(138,90,60,0.32); }

/* modals */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.44);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 1000;
}

.modal{
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  padding: 14px 14px 12px;
}

.modal h4{
  margin: 6px 0 6px;
  font-size: 18px;
  font-weight: 1000;
}

.modal-actions{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.code-pill{
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed rgba(138,90,60,0.45);
  background: var(--accent-weak);
  text-align:center;
  font-weight: 1000;
  letter-spacing: .5px;
  color: var(--text);
}

/*
.bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 74px;
  padding: 10px 12px;
  display:flex;
  justify-content: space-around;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 999;

   padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
  transform: translateZ(0);         
  will-change: transform;
}
.bottom-nav.hide-nav{ display:none; }

.bottom-nav .nav-indicator{
  display:none;
}
.bottom-nav .nav-tab,
.bottom-nav .nav-fab{
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
}

.bottom-nav .nav-tab.active{ color: var(--accent); }

.bottom-nav .nav-fab{
  width: 70px;
  height: 56px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.plus-circle{
  width: 70px;
  height: 52px;
  border-radius: 999px;

  background:#fff;
  color: var(--accent);

  display:flex;
  align-items:center;
  justify-content:center;

  font-size: 32px;
  font-weight: 1000;

  box-shadow: 0 8px 18px rgba(138,90,60,0.35);
}
.bottom-nav .nav-fab.active .plus-circle{


    background: var(--accent);
  color: #fff;
}


hr{ border:0; border-top:1px solid var(--line); margin: 10px 0; }


body{ overflow-x:hidden; }

.bottom-nav .nav-tab{
  padding: 10px 16px;
  border-radius: 14px;
  transition: background .18s ease, color .18s ease;
}

.bottom-nav .nav-tab.active{
  background: var(--accent);
  color: #fff;
}
*/

/* ===== Layout alap: a BODY ne scrollozzon, csak a content ===== */
html, body{
  height: auto;
  overflow-y: auto;     /* visszaadjuk a görgetést */
  overflow-x: hidden;
  overscroll-behavior-y: none; /* ne rugózzon nagyon */
}

.page-content{
  overflow: visible;    /* ne ő scrollozzon */
  height: auto;
  padding-bottom: calc(72px + 18px + env(safe-area-inset-bottom)); /* hely a navnak */
}

/* ===== FIX, SYMMETRIC BOTTOM NAV (CSS only) ===== */
.bottom-nav{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: 72px;

  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;

  padding: 10px;
  border-radius: 24px;

  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);

  z-index: 9999;

  /* NEM mozoghat */
  transform: none !important;
}

/* gombok: teljes szimmetria */
.bottom-nav .nav-tab{
  flex: 1;
  min-width: 0;

  border: 0;
  background: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  height: 100%;
  border-radius: 18px;

  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1;

  color: #6b7280;
  -webkit-tap-highlight-color: transparent;

  transition: background 160ms ease, color 160ms ease, transform 80ms ease;
}

.bottom-nav .nav-tab:active{
  transform: scale(0.98);
}

/* active pill (router nélkül) */
.bottom-nav .nav-tab.active{
  color: #fff;
  background: linear-gradient(135deg, rgba(120,72,40,0.95), rgba(80,50,30,0.92)); /* barnás */
  box-shadow: 0 10px 22px rgba(80,50,30,0.18);
}

/* középső + gomb (ha kell) */
.bottom-nav .nav-fab{
  flex: 0 0 64px;     /* fix szélesség */
  border-radius: 20px;
  font-size: 28px;
  font-weight: 900;

  color: #fff;
  background: linear-gradient(135deg, rgba(120,72,40,0.98), rgba(80,50,30,0.95));
  box-shadow: 0 14px 28px rgba(80,50,30,0.22);
}
.bottom-nav .nav-fab:active{
  transform: scale(0.97);
}  

/*NAV VÉGE*/

.items .item-row{
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.9fr 0.9fr;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.items .item-row.header{
  font-size: 12px;
  font-weight: 900;
  opacity: 0.75;
  padding-top: 6px;
  padding-bottom: 6px;
}

@media (max-width: 520px){
  .items .item-row{
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
  }
}

.kv{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.kv:last-child{ border-bottom: 0; }
.kv .k{ font-weight: 800; opacity: .78; }
.kv .v{ font-weight: 1000; }

#sumTotal{ font-size: 20px; }

@media (max-width: 520px){
  #createQuoteBtn,
  #saveDraftBtn{ width: 100%; }
}

/* SCROLL FIX – flex + overflow (iOS/Chrome) */
html, body {
  height: 100%;
  overflow: hidden; /* maradhat így, a belső content scrolloz */
}

.app-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;   /* <- EZ A LÉNYEG */
}

.page-content {
  flex: 1 1 auto;
  min-height: 0;   /* <- EZ A LÉNYEG */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Procurement cards ===== */
#procList{
  display: grid;
  gap: 10px;
}

.proc-card{
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.proc-head,
.proc-details{
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.proc-details{
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 10px;
}

.proc-group{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(0,0,0,0.10);
}

.proc-group:first-of-type{
  margin-top: 10px;
}

.proc-group-title{
  text-align: center;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.2px;
  color: var(--muted);
  margin: 0 0 10px;
}

.proc-item-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.proc-item-row:last-child{
  border-bottom: 0;
}

.proc-item-main{
  min-width: 0;
}

.proc-item-name{
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proc-item-meta{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.proc-cost-input{
  width: 100%;
  min-width: 0;
}

@media (max-width: 520px){
  .proc-item-row{
    grid-template-columns: 1fr;
  }

  .proc-cost-input{
    width: 100%;
  }
}

.quote-actions-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-actions-grid > button{
  width: 100%;
  min-width: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.btn-icon-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

@media (max-width: 560px){
  .quote-actions-grid{
    grid-template-columns: 1fr;
  }
}

/* Products page empty-state stabil layout */
.app-wrapper,
.page-content{
  width: 100% !important;
  min-width: 0 !important;
}

#groupsBox,
#productsBox{
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: stretch !important;
  align-items: start !important;
}

#groupsBox > *,
#productsBox > *{
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  justify-self: stretch !important;
}

.empty-state-card{
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  display: block !important;
  padding: 12px !important;
}

.empty-state-card .muted{
  font-size: 14px;
  text-align: center;
}

.badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  border: 1px solid transparent;
}

.badge.accepted{
  color: #1f6f35;
  background: rgba(46,125,50,0.12);
  border-color: rgba(46,125,50,0.22);
}

.badge.sent{
  color: #b26a00;
  background: rgba(245,158,11,0.14);
  border-color: rgba(245,158,11,0.24);
}

.badge.draft{
  color: #6b7280;
  background: rgba(107,114,128,0.12);
  border-color: rgba(107,114,128,0.18);
}

.badge.rejected{
  color: #b3261e;
  background: rgba(179,38,30,0.10);
  border-color: rgba(179,38,30,0.18);
}

/* ===== Modulválasztó panel ===== */

.header-left{
  display:flex;
  align-items:center;
  gap:10px;
}

.module-menu-btn{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.72);
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,0.06);
  color:var(--accent);
  padding:0;
}

.module-menu-btn:active{
  transform:translateY(1px);
}

.module-menu-btn svg{
  width:22px;
  height:22px;
  stroke:var(--accent);
  stroke-width:2;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.module-menu-btn.show{
  display:flex;
}

.module-sheet{
  position:fixed;
  inset:0;
  z-index:1200;
  background:rgba(31,26,22,0.24);
  backdrop-filter:blur(6px);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}

.module-sheet.open{
  opacity:1;
  pointer-events:auto;
}

.module-sheet-panel{
  position:absolute;
  inset:0 auto 0 0;
  width:min(86vw,320px);
  background:#fff;
  border-right:1px solid var(--line);
  box-shadow:18px 0 50px rgba(0,0,0,0.12);
  transform:translateX(-100%);
  transition:transform .22s ease;
  padding:18px 16px 16px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.module-sheet.open .module-sheet-panel{
  transform:translateX(0);
}

.module-sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.module-sheet-title{
  font-size:18px;
  font-weight:900;
  letter-spacing:.2px;
  color:var(--text);
}

.module-sheet-close{
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(138,90,60,0.08);
  color:var(--accent);
  cursor:pointer;
  font-size:20px;
  line-height:1;
}

.module-sheet-close:active{
  transform:translateY(1px);
}

.module-sheet-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.module-link{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  border-radius:14px;
  padding:14px 14px;
  text-align:left;
  cursor:pointer;
  box-shadow:var(--shadow);
}

.module-link strong{
  display:block;
  font-size:15px;
  font-weight:900;
  margin-bottom:4px;
}

.module-link span{
  display:block;
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.module-link.active{
  border-color:rgba(138,90,60,0.26);
  background:var(--accent-weak);
}

@media (max-width: 640px){
  .module-sheet-panel{
    width:min(90vw,300px);
  }
}