:root{
  --bg:#f5f5f4;
  --card:#ffffff;
  --text:#252422;
  --muted:#6b6863;
  --brand:#eb5e28;
  --brand-dark:#252422;
  --brand-mid:#403d38;
  --brand-soft:#ccc6ba;
  --brand-bg:#fffdf1;
  --line:#dedbd5;
  --done:#d7efe0;
  --done-border:#acd5bb;
  --pending:#fff1c8;
  --pending-border:#ead68d;
  --shadow:0 8px 24px rgba(37,36,34,.07);
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  -webkit-text-size-adjust:100%;
}

body{
  min-height:100vh;
}

button,
input{
  font:inherit;
}

button,
a{
  -webkit-tap-highlight-color:transparent;
}

.app{
  min-height:100vh;
  padding-bottom:calc(96px + env(safe-area-inset-bottom));
}

.hidden{
  display:none !important;
}

/* HEADER */

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:
    calc(9px + env(safe-area-inset-top))
    14px
    9px;
  background:rgba(255,253,241,.96);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(37,36,34,.08);
}

.brandBlock{
  display:flex;
  align-items:center;
  gap:9px;
}

.topbarActions{
  display:flex;
  align-items:center;
  gap:8px;
}

.networkBadge{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:0 9px;
  border-radius:999px;
  background:#f2f0ec;
  color:#706d67;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}

.brandLogo{
  display:block;
  width:96px;
  height:41px;
  object-fit:contain;
  object-position:left center;
}

.brandText{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:1px;
}


.brandSubtitle{
  font-size:20px;
  line-height:1.1;
  font-weight:700;
  color:var(--muted);
  white-space:nowrap;
}

.iconBtn{
  width:42px;
  height:42px;
  padding:0;
  border:none;
  border-radius:14px;
  background:#fff;
  color:var(--brand);
  box-shadow:0 4px 16px rgba(37,36,34,.08);
  font-size:24px;
  font-weight:800;
  cursor:pointer;
}

/* MAIN */

.content{
  width:100%;
  max-width:760px;
  margin:0 auto;
  padding:12px 12px;
}

.screen{
  width:100%;
}

/* SYNC */

.syncCard{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 13px;
  margin-bottom:11px;
  background:var(--card);
  border:1px solid rgba(37,36,34,.05);
  border-radius:17px;
  box-shadow:var(--shadow);
}

.syncTitle{
  font-size:14px;
  font-weight:900;
}

.syncStatus{
  margin-top:2px;
  font-size:11px;
  color:var(--muted);
}

.syncStatus.online{
  color:#16804a;
}

.syncStatus.offline{
  color:#9b6a00;
}

.syncStatus.updating{
  color:#2563eb;
}

.syncStatus.stale{
  color:#b45309;
}

.syncStatus.error{
  color:#b42318;
}

.ordersCount{
  min-width:66px;
  padding:6px 9px;
  text-align:center;
  border-radius:11px;
  background:var(--brand-bg);
  color:var(--brand-dark);
  font-size:14px;
  font-weight:900;
}

/* SOURCE DATABASE WARNING */

.staleDbWarning{
  margin-bottom:11px;
  padding:10px 12px;
  border:1px solid #f3c77f;
  border-radius:14px;
  background:#fff7e8;
  color:#9a5b00;
  font-size:12px;
  line-height:1.35;
  font-weight:850;
}

/* SEARCH */

.searchSection{
  margin-bottom:11px;
}

.searchWrap{
  position:relative;
  display:flex;
  align-items:center;
  background:#fff;
  border:1px solid rgba(37,36,34,.06);
  border-radius:17px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.searchIcon{
  position:absolute;
  left:13px;
  top:50%;
  transform:translateY(-50%);
  font-size:22px;
  color:var(--brand);
  pointer-events:none;
}

#searchInput{
  width:100%;
  height:52px;
  border:none;
  outline:none;
  padding:0 50px 0 43px;
  background:transparent;
  color:var(--text);
  font-size:16px;
}

#searchInput::placeholder{
  color:#9c9892;
}

.clearSearchBtn{
  position:absolute;
  right:7px;
  top:50%;
  transform:translateY(-50%);
  width:36px;
  height:36px;
  padding:0;
  border:none;
  border-radius:11px;
  background:#f2f0ec;
  color:#706d67;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

/* EMPTY */

.emptyState{
  margin-top:24px;
  padding:24px 16px;
  text-align:center;
  background:#fff;
  border:1px solid rgba(37,36,34,.05);
  border-radius:19px;
  box-shadow:var(--shadow);
}

.emptyIcon{
  font-size:32px;
}

.emptyTitle{
  margin-top:8px;
  font-size:18px;
  font-weight:900;
}

.emptyText{
  max-width:320px;
  margin:5px auto 0;
  font-size:14px;
  line-height:1.4;
  color:var(--muted);
}

/* RESULTS */

.resultsSection{
  margin-top:4px;
}

.resultsHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:7px;
  padding:0 2px;
  font-size:14px;
  font-weight:900;
}

.resultsCount{
  color:var(--muted);
  font-weight:700;
  font-size:12px;
  text-align:right;
  white-space:nowrap;
}

.resultsList{
  display:flex;
  flex-direction:column;
  gap:8px;
}

/* ORDER CARD */

.orderCard{
  position:relative;
  padding:10px 11px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 4px 14px rgba(37,36,34,.045);
  cursor:pointer;
}

.orderCard.pending{
  background:var(--pending);
  border-color:var(--pending-border);
}

.orderCard.done{
  background:var(--done);
  border-color:var(--done-border);
}

.orderTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}

.orderNumber{
  font-size:13px;
  line-height:1.15;
  font-weight:900;
  color:var(--brand-dark);
  white-space:nowrap;
}

.orderDate{
  flex:0 0 auto;
  font-size:15px;
  line-height:1.15;
  color:#77736d;
  text-align:right;
  white-space:nowrap;
}

.orderTitle{
  margin-top:3px;
  font-size:13px;
  line-height:1.3;
  font-weight:800;
  color:var(--brand-dark);
  white-space:pre-line;
}

.orderMeta{
  margin-top:6px;
  display:flex;
  flex-direction:column;
  gap:3px;
}

.orderMetaRow{
  display:flex;
  gap:6px;
  font-size:12px;
  line-height:1.3;
  color:#47433f;
}

.orderMetaIcon{
  flex:0 0 17px;
  color:#6b6863;
}

.takeDeliveryPreview{
  display:inline-flex;
  flex-direction:row;
  align-items:center;
  gap:5px;
  flex-wrap:wrap;
}

.takeDeliverySeparator{
  color:#8a857e;
}

.deliveryInline{
  white-space:nowrap;
}

.searchHit{
  background:#ffe48a;
  color:inherit;
  padding:0 1px;
  border-radius:3px;
}

.orderBottom{
  display:flex;
  justify-content:flex-end;
  margin-top:6px;
}

.orderStatus{
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:900;
  white-space:nowrap;
}

.doneBadge{
  background:rgba(255,255,255,.68);
  color:#316b48;
  border:1px solid rgba(49,107,72,.18);
}

.pendingBadge{
  background:rgba(255,253,241,.78);
  color:#8c6500;
  border:1px solid rgba(140,101,0,.14);
}

/* FAVORITES */

.favoritesHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:4px 2px 12px;
  font-size:24px;
  font-weight:900;
  color:var(--brand-dark);
}

/* SETTINGS */

.settingsHeader{
  margin:4px 2px 12px;
  font-size:24px;
  font-weight:900;
  color:var(--brand-dark);
}

.settingsCard{
  margin-bottom:10px;
  padding:14px;
  background:#fff;
  border:1px solid rgba(37,36,34,.07);
  border-radius:17px;
  box-shadow:var(--shadow);
}

.settingsSectionTitle{
  margin-bottom:11px;
  font-size:13px;
  font-weight:900;
  color:var(--brand);
  text-transform:uppercase;
  letter-spacing:.4px;
}

.settingsRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:7px 0;
  font-size:14px;
}

.settingsRow strong{
  max-width:55%;
  text-align:right;
}

#settingsOrdersCount{
  max-width:72%;
}

.settingsStateOk{
  color:#16804a;
}

.settingsStateWarning{
  color:#b45309;
}

.yearsCheckOk{
  color:#16804a;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.yearsCheckError{
  color:#b42318;
  font-size:12px;
  font-weight:900;
}

.yearsCheckNeutral{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.settingsRowTitle{
  font-size:14px;
  font-weight:800;
}

.settingsRowHint{
  margin-top:3px;
  font-size:12px;
  line-height:1.35;
  color:var(--muted);
}

.settingsCheck{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:6px 0;
  font-size:14px;
}

.settingsCheck span{
  color:#16804a;
  font-weight:900;
}

.settingsPrimaryBtn,
.settingsDangerBtn{
  width:100%;
  min-height:44px;
  margin-top:11px;
  border:none;
  border-radius:13px;
  font-weight:900;
  cursor:pointer;
}

.settingsPrimaryBtn{
  background:var(--brand);
  color:#fff;
}


.settingsDangerBtn{
  background:#fff0ee;
  color:#b42318;
  border:1px solid #f1c7c2;
}

.settingsDangerHint{
  margin-bottom:4px;
}

.switch{
  position:relative;
  display:inline-block;
  width:48px;
  height:28px;
  flex:0 0 48px;
}

.switch input{
  opacity:0;
  width:0;
  height:0;
}

.slider{
  position:absolute;
  inset:0;
  cursor:pointer;
  background:#d6d3d1;
  border-radius:999px;
  transition:.2s;
}

.slider:before{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  left:3px;
  top:3px;
  background:#fff;
  border-radius:50%;
  box-shadow:0 2px 6px rgba(0,0,0,.15);
  transition:.2s;
}

.switch input:checked + .slider{
  background:var(--brand);
}

.switch input:checked + .slider:before{
  transform:translateX(20px);
}

/* BOTTOM NAV */

.bottomNav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:30;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  min-height:calc(72px + env(safe-area-inset-bottom));
  padding:
    7px
    8px
    calc(9px + env(safe-area-inset-bottom));
  background:rgba(255,253,241,.97);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border-top:1px solid rgba(37,36,34,.08);
}

.navItem{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border:none;
  background:transparent;
  color:#77736d;
  cursor:pointer;
  min-width:0;
  padding:0 2px;
}

.navItem.active{
  color:var(--brand);
}

.navIcon{
  font-size:22px;
  line-height:1;
}

.navText{
  font-size:10px;
  font-weight:900;
  line-height:1.15;
  white-space:nowrap;
}

/* MODAL */

.modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}

.modalBackdrop{
  position:absolute;
  inset:0;
  background:rgba(37,36,34,.42);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}

.modalSheet{
  position:relative;
  z-index:2;
  width:100%;
  max-width:760px;
  max-height:88vh;
  overflow-y:auto;
  padding:
    9px
    11px
    calc(20px + env(safe-area-inset-bottom));
  background:var(--brand-bg);
  border-radius:24px 24px 0 0;
  box-shadow:0 -15px 45px rgba(37,36,34,.20);
}

.modalHandle{
  width:42px;
  height:5px;
  margin:0 auto 11px;
  border-radius:999px;
  background:var(--brand-soft);
}

.modalHeader{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:8px;
  margin-bottom:11px;
}

.modalHeaderMain{
  min-width:0;
  padding-top:2px;
}

.modalOrderNum{
  display:block;
  margin:0;
  padding:0;
  font-size:19px;
  line-height:1.05;
  font-weight:600;
  color:var(--brand-dark);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.modalDate{
  display:block;
  margin-top:3px;
  font-size:13px;
  line-height:1.15;
  color:var(--muted);
}

.modalTopActions{
  display:flex;
  align-items:center;
  gap:5px;
}

.modalShareBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:35px;
  padding:0 10px;
  border:none;
  border-radius:11px;
  background:var(--brand);
  color:#fff;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

.modalFavoriteBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:35px;
  height:35px;
  padding:0;
  border:1px solid rgba(37,36,34,.10);
  border-radius:11px;
  background:#fff;
  color:#8a857e;
  font-size:23px;
  line-height:1;
  cursor:pointer;
}

.modalFavoriteBtn.active{
  color:#d89100;
  background:#fff7d6;
  border-color:#ead68d;
}

.modalCloseBtn{
  width:35px;
  height:35px;
  padding:0;
  border:none;
  border-radius:11px;
  background:#eeeae2;
  color:var(--brand-mid);
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

.modalBody{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.detailCard{
  padding:10px 11px;
  border:1px solid rgba(37,36,34,.10);
  border-radius:15px;
  background:#fff;
}

.detailLabel{
  font-size:10px;
  font-weight:900;
  color:var(--brand);
  text-transform:uppercase;
  letter-spacing:.4px;
}

.detailValue{
  margin-top:6px;
  font-size:14px;
  line-height:1.4;
  color:var(--brand-dark);
  white-space:pre-line;
  word-break:break-word;
}

.addressDirectLink{
  display:inline-block;
  margin-top:6px;
  color:var(--brand-dark);
  text-decoration:none;
  font-size:14px;
  line-height:1.4;
  font-weight:500;
  word-break:break-word;
}

.addressDirectLink:active{
  color:var(--brand);
}

.detailActions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:8px;
}

.detailAction{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 11px;
  border:none;
  border-radius:11px;
  background:var(--brand-dark);
  color:#fff;
  text-decoration:none;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}

.detailAction.secondary{
  background:#e8e4dd;
  color:var(--brand-dark);
}

/* PHONE */

.phoneList{
  margin-top:7px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.phoneDirectLink{
  display:block;
  width:fit-content;
  max-width:100%;
  color:var(--brand-dark);
  text-decoration:none;
  font-size:14px;
  line-height:1.25;
  font-weight:500;
  word-break:break-word;
}

.phoneDirectLink:active{
  color:var(--brand);
}

.phoneDirectRow{
  display:flex;
  align-items:center;
  gap:7px;
  width:fit-content;
  max-width:100%;
}

.phoneCopyIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  flex:0 0 26px;
  padding:0;
  border:none;
  border-radius:8px;
  background:#f0ede7;
  color:#77736d;
  font-size:16px;
  line-height:1;
  cursor:pointer;
}

.phoneCopyIcon:active{
  transform:scale(.94);
  color:var(--brand);
}

.phoneSearchIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  flex:0 0 26px;
  padding:0;
  border:none;
  border-radius:8px;
  background:#f0ede7;
  color:#77736d;
  font-size:17px;
  line-height:1;
  cursor:pointer;
}

.phoneSearchIcon:active{
  transform:scale(.94);
  color:var(--brand);
}

/* UPDATE BANNER */

.updateBanner{
  position:fixed;
  left:50%;
  bottom:82px;
  z-index:180;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:10px;
  width:min(92vw,420px);
  padding:10px 11px;
  border-radius:14px;
  background:var(--brand-dark);
  color:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  font-size:13px;
  font-weight:800;
}

.updateBanner button{
  margin-left:auto;
  border:none;
  border-radius:10px;
  padding:8px 10px;
  background:var(--brand);
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

/* TOAST */

.toast{
  position:fixed;
  left:50%;
  bottom:88px;
  z-index:200;
  transform:translateX(-50%) translateY(20px);
  max-width:calc(100vw - 40px);
  padding:9px 13px;
  border-radius:12px;
  background:var(--brand-dark);
  color:#fff;
  font-size:13px;
  font-weight:800;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}

.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

@media (max-width:760px){

  .brandLogo{
    width:88px;
    height:38px;
  }


 .brandSubtitle{
    font-size:18px;
    font-weight:700;
    line-height:1.1;
  }

  .content{
    padding:11px 10px;
  }

  .settingsHeader{
    font-size:22px;
  }

}


.updateAvailableText{
  color:var(--brand);
}

/* STATISTICS 1.3.8 */

.statisticsHeader{
  margin:4px 2px 12px;
  font-size:24px;
  font-weight:900;
  color:var(--brand-dark);
}

.statsHeroCard,
.statsCard{
  margin-bottom:10px;
  background:#fff;
  border:1px solid rgba(37,36,34,.07);
  border-radius:17px;
  box-shadow:var(--shadow);
}

.statsHeroCard{
  padding:15px 14px 14px;
}

.statsPeriod{
  color:var(--brand);
  font-size:13px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.25px;
}

.statsTurnoverLabel{
  margin-top:13px;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.statsTurnoverValue{
  margin-top:2px;
  font-size:30px;
  line-height:1.05;
  font-weight:950;
  letter-spacing:-.7px;
  color:var(--brand-dark);
}

.statsMetricGrid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  margin-top:15px;
  border:1px solid var(--line);
  border-radius:13px;
  overflow:hidden;
}

.statsMetric{
  min-width:0;
  padding:11px 10px;
  background:#faf9f7;
}

.statsMetric:nth-child(odd){
  border-right:1px solid var(--line);
}

.statsMetric:nth-child(-n+2){
  border-bottom:1px solid var(--line);
}

.statsMetricValue{
  font-size:18px;
  line-height:1.15;
  font-weight:900;
  color:var(--brand-dark);
}

.statsMetricMoney{
  font-size:15px;
}

.statsMetricLabel{
  margin-top:3px;
  font-size:11px;
  color:var(--muted);
  font-weight:750;
}

.statsCard{
  padding:14px;
}

.statsCardTitle{
  margin-bottom:10px;
  font-size:14px;
  font-weight:900;
  color:var(--brand-dark);
}

.statsTableWrap{
  width:100%;
  overflow-x:auto;
  border-radius:11px;
}

.statsTable{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  background:#fff;
  font-size:12px;
}

.statsTable th,
.statsTable td{
  border:1px solid #bdb9b2;
  padding:9px 7px;
  vertical-align:middle;
}

.statsTable th{
  background:#dedbd5;
  color:var(--brand-dark);
  font-weight:900;
  text-align:left;
}

.statsTable th:nth-child(2),
.statsTable th:nth-child(3),
.statsNumberCell,
.statsMoneyCell{
  text-align:right;
}

.statsTable th:nth-child(1){
  width:34%;
}

.statsTable th:nth-child(2){
  width:25%;
}

.statsTable th:nth-child(3){
  width:41%;
}

.statsMoneyCell{
  font-weight:850;
  white-space:nowrap;
}

.statsNumberCell{
  font-weight:800;
}

.statsMonthsTable th:first-child{
  width:48%;
}

.statsMonthsTable th:last-child{
  width:52%;
}

.statsCurrentMonthRow td{
  background:#fff3d5;
  font-weight:900;
}

.statsCurrentBadge{
  display:inline-block;
  margin-left:4px;
  padding:2px 5px;
  border-radius:999px;
  background:#fff;
  border:1px solid #e5c876;
  color:#8c6500;
  font-size:9px;
  font-weight:900;
  white-space:nowrap;
}

@media (max-width:420px){
  .statsTurnoverValue{
    font-size:27px;
  }

  .statsTable{
    font-size:11px;
  }

  .statsTable th,
  .statsTable td{
    padding:8px 5px;
  }

  .navText{
    font-size:9px;
  }
}
