/* UYSA ERP — açık tema, Kokpit görsel dili (CateringPro broşürü esinli).
   Beyaz kartlar, açık zemin, turuncu #F26B21 birincil, yumuşak gölge, yuvarlak köşe, mobil-öncelikli.
   Kendine yeten: Bootstrap grid'e bağımlı değil; sadece bootstrap-icons (dekoratif) CDN. */
:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --surface-3: #e9eff6;
  --line: rgba(16, 32, 51, 0.09);
  --line-2: rgba(16, 32, 51, 0.06);
  --text: #14233b;
  --muted: #6b7b8d;

  --primary: #f26b21;
  --primary-600: #d95c17;
  --primary-tint: #fdefe4;
  --primary-tint-2: #fbe4d4;

  --green: #16a34a;
  --green-tint: #e7f6ee;
  --blue: #2563eb;
  --blue-tint: #e8f0fe;
  --amber: #d97706;
  --amber-tint: #fdf1dd;
  --red: #e5484d;
  --red-tint: #fdeaea;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 6px 22px rgba(20, 40, 80, 0.07), 0 1px 2px rgba(20, 40, 80, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 40, 80, 0.05);
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%;
  background: var(--bg);
}
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(
      circle at 50% -8%,
      rgba(242, 107, 33, 0.1),
      transparent 30rem
    ),
    linear-gradient(180deg, #f2f6fa 0%, #eef3f8 100%);
  color: var(--text);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: 100%;
  max-width: 400px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 15px 104px;
  position: relative;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 18px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #f7913f);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(242, 107, 33, 0.32);
}
.brand-copy {
  min-width: 0;
}
.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  margin-bottom: 2px;
  font-size: 22px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h2 {
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 780;
}
h3 {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 750;
}

.icon-btn,
.chip,
.btn-action,
.tab-item {
  min-height: 44px;
}
.icon-btn {
  width: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.screen-stack {
  display: grid;
  gap: 13px;
}
.cardx {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-pad {
  padding: 16px;
}

/* Renkli istatistik kartları */
.stat-stack {
  display: grid;
  gap: 11px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.stat-card .ico {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: #fff;
}
.stat-card .txt {
  min-width: 0;
}
.stat-card .lbl {
  margin: 0 0 3px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}
.stat-card .val {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.stat-green {
  background: var(--green-tint);
}
.stat-green .ico {
  color: var(--green);
}
.stat-green .val {
  color: #12813b;
}
.stat-orange {
  background: var(--primary-tint);
}
.stat-orange .ico {
  color: var(--primary);
}
.stat-orange .val {
  color: var(--primary-600);
}
.stat-blue {
  background: var(--blue-tint);
}
.stat-blue .ico {
  color: var(--blue);
}
.stat-blue .val {
  color: #1d4ed8;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px -2px;
}
.section-head h2 {
  margin: 0;
}
.section-head .link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}

.btn-action {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font: inherit;
  cursor: pointer;
}
.btn-primaryx {
  background: linear-gradient(135deg, var(--primary), #f7913f);
  color: #fff;
  box-shadow: 0 8px 18px rgba(242, 107, 33, 0.3);
}
.btn-secondaryx {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-full {
  width: 100%;
}

.hint-card {
  padding: 13px 14px;
  border: 1px solid var(--primary-tint-2);
  border-radius: var(--radius);
  background: var(--primary-tint);
  color: #7a3e13;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.form-grid {
  display: grid;
  gap: 11px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.inputx,
.selectx {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 13px;
  font: inherit;
  width: 100%;
}
.inputx:focus,
.selectx:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

/* Modül grid'i (Stok, Reçete, Menü…) */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.mod-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  min-height: 104px;
}
.mod-card .mico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: var(--primary-tint);
  color: var(--primary);
}
.mod-card.i-green .mico {
  background: var(--green-tint);
  color: var(--green);
}
.mod-card.i-blue .mico {
  background: var(--blue-tint);
  color: var(--blue);
}
.mod-card.i-amber .mico {
  background: var(--amber-tint);
  color: var(--amber);
}
.mod-card .mt {
  font-weight: 780;
  font-size: 14px;
  line-height: 1.2;
}
.mod-card .md {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.3;
  margin-top: auto;
}
.mod-card.soon {
  opacity: 0.9;
}
.mod-card .soon-chip {
  position: absolute;
  top: 11px;
  right: 11px;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--amber-tint);
  color: var(--amber);
}

/* "Yakında" placeholder ekranı */
.soon-hero {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 34px 20px;
  text-align: center;
}
.soon-hero .big-ico {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: var(--primary-tint);
  color: var(--primary);
}
.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

/* Alt navigasyon + ortada turuncu (+) FAB */
.bottom-tabs {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 20;
  width: 100%;
  max-width: 400px;
  display: grid;
  grid-template-columns: 1fr 1fr 68px 1fr 1fr;
  align-items: end;
  gap: 2px;
  padding: 8px 8px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -6px 20px rgba(20, 40, 80, 0.06);
}
.tab-item {
  border-radius: 12px;
  display: grid;
  place-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 2px;
}
.tab-item i {
  font-size: 19px;
}
.tab-item.active {
  color: var(--primary);
}
.fab-slot {
  position: relative;
  display: grid;
  place-items: center;
}
.fab {
  position: absolute;
  bottom: 4px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #f7913f);
  color: #fff;
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(242, 107, 33, 0.42);
}
.fab i {
  font-size: 26px;
}
.fab-menu {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 25;
  width: min(92%, 372px);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
}
.fab-menu.open {
  display: grid;
  gap: 2px;
}
.fab-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  font-weight: 700;
}
.fab-menu a:active {
  background: var(--surface-2);
}
.fab-menu a i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 17px;
}
.fab-backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(16, 32, 51, 0.28);
  display: none;
}
.fab-backdrop.open {
  display: block;
}

.login-shell {
  min-height: 100vh;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  align-content: center;
}
.login-logo {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--primary), #f7913f);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(242, 107, 33, 0.34);
}

.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}
.flash.ok {
  background: var(--green-tint);
  border: 1px solid rgba(22, 163, 74, 0.28);
  color: #12813b;
}
.flash.err {
  background: var(--red-tint);
  border: 1px solid rgba(229, 72, 77, 0.32);
  color: #b42318;
}

.badge-soft {
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
}
.badge-orange {
  background: var(--primary-tint);
  color: var(--primary-600);
}

.d-flex {
  display: flex;
}
.align-items-center {
  align-items: center;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-3 {
  margin-top: 12px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 18px;
}
.text-muted {
  color: var(--muted);
}

/* ─────────────── Eleme ekranı ("tut/at" + birleştirme) ─────────────── */
.seg {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: 12px;
  border: 1px solid var(--line-2);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  font-size: 13px;
  padding: 9px 6px;
  border-radius: 9px;
  cursor: pointer;
  min-height: 40px;
}
.seg button.active {
  background: var(--surface);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

.progress-wrap {
  display: grid;
  gap: 8px;
}
.progress-nums {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 750;
}
.progress-nums .kept {
  color: var(--green);
}
.progress-nums .dropped {
  color: var(--red);
}
.progress-bar {
  height: 9px;
  border-radius: 999px;
  background: var(--red-tint);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #38c172);
  transition: width 0.25s ease;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.filters .full {
  grid-column: 1 / -1;
}
.filters .selectx,
.filters .inputx {
  min-height: 42px;
  padding: 8px 11px;
  font-size: 13px;
}

.bulk-bar {
  display: flex;
  gap: 8px;
}
.bulk-bar .btn-action {
  flex: 1;
  min-height: 42px;
  font-size: 13px;
}
.btn-dropx {
  background: var(--red-tint);
  color: #b42318;
  border: 1px solid rgba(229, 72, 77, 0.3);
}
.btn-keepx {
  background: var(--green-tint);
  color: #12813b;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.eleme-list {
  display: grid;
  gap: 8px;
}
.eleme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.eleme-row.dropped {
  opacity: 0.55;
  background: var(--surface-2);
}
.eleme-row .info {
  min-width: 0;
  flex: 1;
}
.eleme-row .nm {
  font-weight: 750;
  font-size: 13.5px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.eleme-row.dropped .nm {
  text-decoration: line-through;
}
.eleme-row .meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.eleme-row .meta .rc-yes {
  color: var(--green);
  font-weight: 700;
}
.eleme-row .meta .rc-no {
  color: var(--muted);
}
.eleme-row .acts {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.tapbtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.tapbtn.keep.on {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.tapbtn.drop.on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.merge-card {
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 9px;
}
.merge-card.done {
  opacity: 0.6;
}
.merge-pair {
  display: grid;
  gap: 6px;
}
.merge-side {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}
.merge-side .tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  flex: 0 0 auto;
}
.merge-side .nm {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.merge-side .gram {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 auto;
}
.merge-tokens {
  font-size: 11px;
  color: var(--muted);
}
.merge-acts {
  display: flex;
  gap: 8px;
}
.merge-acts .btn-action {
  flex: 1;
  min-height: 40px;
  font-size: 13px;
}
.merge-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  align-self: start;
}
.merge-badge.merged {
  background: var(--green-tint);
  color: #12813b;
}
.merge-badge.separate {
  background: var(--blue-tint);
  color: #1d4ed8;
}

.loadmore {
  margin-top: 4px;
}
.tiny-muted {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}

/* ─────────────── Müşteri & Sözleşme modülü (erp-010) ─────────────── */
.badge-green {
  background: var(--green-tint);
  color: var(--green);
}
.badge-blue {
  background: var(--blue-tint);
  color: var(--blue);
}
.badge-red {
  background: var(--red-tint);
  color: var(--red);
}
.badge-muted {
  background: var(--surface-3);
  color: var(--muted);
}

.cust-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  margin-bottom: 9px;
}
.cust-row.passive {
  opacity: 0.62;
}
.cust-row .avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  background: var(--primary-tint);
  color: var(--primary-600);
}
.cust-row .info {
  min-width: 0;
  flex: 1;
}
.cust-row .nm {
  font-weight: 800;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cust-row .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.cust-row .meta b {
  color: var(--text);
}

.sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  margin-bottom: 8px;
}
.sub-row .info {
  min-width: 0;
  flex: 1;
}
.sub-row .info .t {
  font-weight: 750;
  font-size: 14px;
}
.sub-row .info .s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.sub-row .amt {
  font-weight: 800;
  white-space: nowrap;
}
.sub-row .del {
  border: 0;
  background: var(--red-tint);
  color: var(--red);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 15px;
}
.price-row.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-tint);
}
.price-row .carry {
  font-size: 11px;
  color: var(--amber);
  font-weight: 700;
}

/* Alt sayfa formu (bottom sheet) */
.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 40;
}
.sheet-back.open {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 16px 15px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(20, 40, 80, 0.18);
  transform: translateY(100%);
  transition: transform 0.22s ease;
  max-height: 88vh;
  overflow-y: auto;
}
.sheet.open {
  transform: translateY(0);
}
.sheet h3 {
  margin: 2px 0 14px;
  font-size: 17px;
}
.sheet .row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.sheet-actions {
  display: flex;
  gap: 9px;
  margin-top: 15px;
}
.sheet-actions .btn-action {
  flex: 1;
}

.pane {
  display: none;
}
.pane.active {
  display: block;
}
.tabscroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  background: var(--surface-3);
  border-radius: 12px;
  border: 1px solid var(--line-2);
  margin-top: 13px;
  scrollbar-width: none;
}
.tabscroll::-webkit-scrollbar {
  display: none;
}
.tabscroll button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  font-size: 13px;
  padding: 9px 13px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 40px;
}
.tabscroll button.active {
  background: var(--surface);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 720px) {
  .app-shell,
  .login-shell {
    margin-inline: auto;
    max-width: 520px;
  }
  .bottom-tabs {
    left: 50%;
    transform: translateX(-50%);
    max-width: 520px;
  }
}
