/* ==========================================================================
   KUS Finans — tasarım sistemi
   Yeşil / beyaz, sade ve modern.
   ========================================================================== */

:root {
  --g900: #072A1C;
  --g800: #0B3D2E;
  --g700: #0F4C3A;
  --g600: #146B4F;
  --g500: #1B7F5E;
  --g400: #22996F;
  --g300: #4FB894;
  --g100: #E3F2EB;
  --g50:  #F1F8F5;

  --bg:    #F4F7F5;
  --card:  #FFFFFF;
  --ink:   #0D1F18;
  --ink2:  #3B534A;
  --muted: #7B9089;
  --line:  #E4ECE8;
  --line2: #EFF4F1;

  --danger:    #D6453F;
  --danger-bg: #FDECEB;
  --warn:      #C8871A;
  --warn-bg:   #FDF3E2;
  --info:      #2A6F97;
  --info-bg:   #EAF2F7;
  --gold:      #C79A2E;

  --r:    16px;
  --r-sm: 10px;
  --r-xs: 8px;

  --sh:   0 1px 2px rgba(12, 40, 30, .04), 0 6px 20px rgba(12, 40, 30, .05);
  --sh-l: 0 12px 40px rgba(12, 40, 30, .14);

  --side-w: 248px;
  --top-h:  64px;

  --f: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI",
       Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --fm: "SF Mono", "Segoe UI Mono", "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
input, select, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CBD8D2; border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #AFC2BA; }

.num { font-variant-numeric: tabular-nums; }
.only-sm { display: none; }
.only-lg { display: inline-flex; }

/* Profil fotoğrafı — her yerde daire, kırpılmış */
.pfp { border-radius: 50%; object-fit: cover; display: block; flex: none;
       background: var(--g100); border: 1px solid var(--line); }
.who-btn .pfp { width: 62px; height: 62px; border: 2px solid var(--g100); }
.avatar .pfp { width: 100%; height: 100%; border: 0; }
.avatar { overflow: hidden; padding: 0; }
.pfp.ini { display: grid; place-items: center; color: #fff; font-weight: 800;
           border: 0; letter-spacing: 0; line-height: 1; }
.who-btn .pfp.ini { font-size: 26px !important; }

/* Kırpma penceresi kaydırıcısı */
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 4px;
  background: var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--g600); cursor: pointer; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%;
  background: var(--g600); cursor: pointer; border: 3px solid #fff; }
.pos { color: var(--g500); }
.neg { color: var(--danger); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ==========================  GİRİŞ EKRANLARI  ============================= */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 600px at 15% -10%, #1B7F5E 0%, transparent 55%),
    radial-gradient(900px 700px at 110% 110%, #5FA88A 0%, transparent 60%),
    linear-gradient(160deg, #0B3D2E 0%, #145840 55%, #2E7A5C 100%);
}

.gate-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 30px 70px rgba(4, 30, 20, .35);
  text-align: center;
  animation: pop .45s cubic-bezier(.2, .9, .3, 1);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.gate-logo { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.gate-card h1 { font-size: 30px; margin-bottom: 6px; }
.gate-sub { color: var(--muted); margin-bottom: 26px; font-size: 14px; }

.gate-card .field { text-align: left; }

.who-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.who-btn {
  background: var(--g50);
  border: 1.5px solid var(--g100);
  border-radius: var(--r);
  padding: 18px 12px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  justify-items: center;
  transition: .16s;
}
.who-btn:hover { border-color: var(--g400); background: #fff; transform: translateY(-2px); box-shadow: var(--sh); }
.who-btn .e { font-size: 28px; }
.who-btn .n { font-weight: 700; color: var(--g700); font-size: 15px; }
.who-btn .r { font-size: 11px; color: var(--muted); }

.gate-back {
  margin-top: 20px;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.gate-back:hover { color: var(--g600); }

/* ==============================  KABUK  ================================== */

.shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100dvh;
}

/* --- Kenar çubuğu --- */
.side {
  background: linear-gradient(175deg, var(--g700) 0%, var(--g800) 45%, var(--g900) 100%);
  color: #CFE7DC;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
}
.brand-icon { font-size: 24px; }
.brand-name { color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-tag {
  font-size: 10px;
  color: #8FBFAB;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
}

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-color: transparent; }

.nav-sec {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #6E9E8B;
  font-weight: 700;
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: #BFDDD0;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: .14s;
  border: 0;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item .ic { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.on { background: #fff; color: var(--g700); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.nav-item.on .ic { filter: none; }

.side-foot {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 11px;
  color: #7BAB98;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: #46D399; display: inline-block; }
.dot-off  { width: 7px; height: 7px; border-radius: 50%; background: #C88; display: inline-block; }

/* --- Üst çubuk --- */
.main { min-width: 0; display: flex; flex-direction: column; }

.top {
  height: var(--top-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Üst çubuktaki menü düğmesi kaldırıldı; alt menüdeki "Menü" kullanılıyor. */
.burger {
  display: none;
  background: none;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-xs);
}

.top-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.top-spacer { flex: 1; }

.ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #FBF3DC, #F6E9C8);
  border: 1px solid #EAD9A8;
  color: #7A5C10;
  border-radius: 999px;
  padding: 6px 13px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.ticker .chg { font-weight: 800; }
.ticker:hover { filter: brightness(.98); }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  position: relative;
  transition: .14s;
}
.icon-btn:hover { border-color: var(--g300); background: var(--g50); }
.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: .14s;
}
.user-chip:hover { border-color: var(--g300); background: var(--g50); }
.avatar {
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--g100);
  display: grid;
  place-items: center;
  font-size: 15px;
}
.role-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .06em;
  background: var(--g600);
  color: #fff;
  border-radius: 5px;
  padding: 2px 5px;
  text-transform: uppercase;
}

/* --- İçerik --- */
.content { padding: 24px 22px 90px; max-width: 1360px; width: 100%; }

.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h2 { font-size: 25px; letter-spacing: -.03em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head .grow { flex: 1; }

/* ==============================  KARTLAR  ================================ */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh);
}
.card-pad { padding: 18px 20px; }

.card-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line2);
}
.card-h h3 { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink2); font-weight: 800; }
.card-h .grow { flex: 1; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }

/* --- KPI --- */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--g400);
  opacity: .0;
  transition: .2s;
}
.kpi:hover::after { opacity: 1; }
.kpi .l {
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi .v { font-size: 25px; font-weight: 800; letter-spacing: -.035em; margin: 7px 0 3px; color: var(--g700); }
.kpi .v.sm { font-size: 21px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.danger .v { color: var(--danger); }
.kpi.gold .v { color: var(--gold); }

.mini-bar { height: 5px; border-radius: 4px; background: var(--line2); overflow: hidden; margin-top: 10px; }
.mini-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--g500); transition: width .5s cubic-bezier(.2,.9,.3,1); }
.mini-bar > i.warn { background: var(--warn); }
.mini-bar > i.danger { background: var(--danger); }

/* --- Bildirim --- */
.notif {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--g50);
  border: 1px solid var(--g100);
  cursor: pointer;
  transition: .14s;
}
.notif:hover { transform: translateX(2px); }
.notif .ic { font-size: 17px; line-height: 1.2; }
.notif .t { font-weight: 700; font-size: 13.5px; }
.notif .x { color: var(--ink2); font-size: 12.5px; margin-top: 1px; }
.notif.warn   { background: var(--warn-bg);   border-color: #F2DFB8; }
.notif.danger { background: var(--danger-bg); border-color: #F5C9C6; }
.notif.info   { background: var(--info-bg);   border-color: #CFE2EC; }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .e { font-size: 34px; display: block; margin-bottom: 8px; opacity: .75; }

/* ==============================  TABLO  ================================== */

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #FAFCFB;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #FAFCFB; }
table.tbl td.r, table.tbl th.r { text-align: right; white-space: nowrap; }
table.tbl tfoot td { font-weight: 800; background: var(--g50); border-top: 1px solid var(--line); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--g100);
  color: var(--g700);
  white-space: nowrap;
}
.chip.grey   { background: #EEF2F0; color: var(--ink2); }
.chip.warn   { background: var(--warn-bg); color: var(--warn); }
.chip.danger { background: var(--danger-bg); color: var(--danger); }
.chip.gold   { background: #FBF3DC; color: #7A5C10; }

/* =============================  FORMLAR  ================================= */

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink2);
  margin-bottom: 6px;
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.inp {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  outline: none;
  transition: .14s;
  font-size: 14.5px;
}
.inp:focus { border-color: var(--g400); box-shadow: 0 0 0 3.5px rgba(34, 153, 111, .13); }
.inp:disabled { background: #F6F8F7; color: var(--muted); }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237B9089' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
textarea.inp { resize: vertical; min-height: 74px; }

.inp-money { font-size: 21px; font-weight: 800; letter-spacing: -.02em; padding: 14px 13px; }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 17px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  background: var(--g600);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: .14s;
  white-space: nowrap;
}
.btn:hover { background: var(--g700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink2); }
.btn.ghost:hover { border-color: var(--g300); background: var(--g50); color: var(--g700); }
.btn.soft { background: var(--g100); color: var(--g700); }
.btn.soft:hover { background: #D5EADF; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #B93A34; }
.btn.icon { padding: 7px 9px; }

.seg {
  display: inline-flex;
  background: #EEF3F0;
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink2);
  cursor: pointer;
  white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--g700); box-shadow: 0 1px 3px rgba(0,0,0,.09); }

.switch,
.field > label.switch { display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none; margin-bottom: 0; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch:focus-within .track { box-shadow: 0 0 0 3.5px rgba(34, 153, 111, .18); }
.switch .track {
  width: 40px; height: 23px;
  border-radius: 999px;
  background: #D5DEDA;
  position: relative;
  transition: .18s;
  flex: none;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--g500); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* =============================  MODAL  =================================== */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 30, 22, .48);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 18px;
  animation: fade .16s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.modal {
  background: #fff;
  border-radius: 20px;
  width: min(540px, 100%);
  max-height: 90dvh;
  overflow: auto;
  box-shadow: var(--sh-l);
  animation: pop .22s cubic-bezier(.2,.9,.3,1);
}
.modal.wide { width: min(880px, 100%); }
.modal-h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line2);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-radius: 20px 20px 0 0;
}
.modal-h h3 { font-size: 17px; flex: 1; }
.modal-b { padding: 20px 22px; }
.modal-f {
  padding: 14px 22px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line2);
  position: sticky;
  bottom: 0;
  background: #fff;
}

/* =============================  TOAST  =================================== */

.toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--g800);
  color: #fff;
  padding: 12px 17px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--sh-l);
  animation: slide .22s cubic-bezier(.2,.9,.3,1);
  max-width: 380px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warn); }
@keyframes slide { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }

/* ============================  GRAFİKLER  ================================ */

.chart { width: 100%; display: block; overflow: visible; }
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend .it { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .nm { flex: 1; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .vl { font-weight: 700; font-variant-numeric: tabular-nums; }

.spark { display: block; }

/* ==========================  İLERLEME SATIRI  ============================ */

.prog-row { padding: 13px 20px; border-bottom: 1px solid var(--line2); }
.prog-row:last-child { border-bottom: 0; }
.prog-top { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.prog-top .nm { font-weight: 700; flex: 1; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.prog-top .vl { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog-bar { height: 7px; background: var(--line2); border-radius: 5px; overflow: hidden; }
.prog-bar > i { display: block; height: 100%; background: var(--g500); border-radius: 5px; transition: width .55s cubic-bezier(.2,.9,.3,1); }
.prog-bar > i.warn { background: var(--warn); }
.prog-bar > i.danger { background: var(--danger); }

/* ==========================  ALT MENÜ (MOBİL)  =========================== */

body.typing .tabbar { display: none !important; }
/* Alt menü, tıklanmak istenen alanın üstüne binmesin */
input, select, textarea { scroll-margin-bottom: 140px; scroll-margin-top: 90px; }

.tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .in { display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar button {
  border: 0;
  background: none;
  padding: 9px 2px 8px;
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.tabbar button .ic { font-size: 19px; line-height: 1.05; }
.tabbar button.on { color: var(--g600); }

.fab { display: none; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 30, 22, .45);
  z-index: 39;
  animation: fade .16s;
}

/* =============================  RESPONSIVE  ============================== */

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2, .g3 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    left: 0; top: 0;
    width: 268px;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.2,.9,.3,1);
    box-shadow: var(--sh-l);
  }
  .side.open { transform: none; }
  .burger { display: grid; }
  .content { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .top { padding: 0 13px; gap: 8px; }
  .top-title { font-size: 15.5px; }
  .g2 { grid-template-columns: 1fr; }
  .tabbar { display: block; }
  .ticker { padding: 5px 10px; font-size: 11.5px; }
  .ticker .lbl { display: none; }
  .page-head h2 { font-size: 21px; }
  .modal { border-radius: 18px; }
  .toasts { left: 14px; right: 14px; bottom: 82px; }
  .toast { max-width: none; }
}

@media (max-width: 560px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 13px 14px; }
  .kpi .v { font-size: 20px; }
  .kpi .l { font-size: 9.5px; }

  /* Üst çubuk dar ekrana sığsın: başlık alt menüde zaten var. */
  .top-title, .role-tag, #btnExport, .ticker .pctv { display: none; }
  .user-chip .nm { display: none; }
  .user-chip { padding: 4px 5px; }
  .top { gap: 6px; padding: 0 10px; }
  .icon-btn { width: 34px; height: 34px; }
  #periodSel { max-width: 140px; font-size: 12px; padding: 7px 24px 7px 9px; }
  .ticker { padding: 5px 8px; font-size: 12px; gap: 5px; }

  /* Dar ekranda kişi sütunu yerine alt satırda gösterilir. */
  .only-sm { display: inline; }
  .only-lg { display: none !important; }
  .col-person { display: none; }

  /* Sayfa başlığındaki butonlar başlığın altına, sola hizalı gelsin. */
  .page-head .grow { display: none; }
  .page-head { gap: 10px; }
  .row { flex-direction: column; gap: 0; }
  .row.keep { flex-direction: row; gap: 12px; }
  table.tbl { font-size: 12.5px; }
  table.tbl th, table.tbl td { padding: 9px 10px; }
  .who-grid { grid-template-columns: 1fr 1fr; }
  .gate-card { padding: 32px 22px; }
}

@media print {
  .side, .top, .tabbar, .btn, .icon-btn { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* =====================  MOBİL: TABLOLAR KART GÖRÜNÜMÜ  ==================== */
/* Telefonda yatay kaydırma yerine her satır kendi kartı olur; hücreler
   sütun başlığıyla birlikte alt alta dizilir. */
@media (max-width: 620px) {
  .tbl-wrap { overflow-x: visible; }

  table.tbl.stack,
  table.tbl.stack tbody,
  table.tbl.stack tfoot,
  table.tbl.stack tr,
  table.tbl.stack td { display: block; width: 100%; }

  table.tbl.stack thead { display: none; }

  table.tbl.stack tbody tr {
    border-bottom: 1px solid var(--line);
    padding: 12px 0 14px;
  }
  table.tbl.stack tbody tr:last-child { border-bottom: 0; }
  table.tbl.stack tbody tr:hover { background: none; }

  table.tbl.stack td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    padding: 4px 16px;
    text-align: right;
    white-space: normal;
    min-height: 0;
  }
  table.tbl.stack td::before {
    content: attr(data-l);
    color: var(--muted);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-align: left;
    flex: 0 0 auto;
    max-width: 46%;
  }
  table.tbl.stack td:not([data-l])::before { content: none; }

  /* İlk hücre satırın başlığı gibi durur */
  table.tbl.stack td:first-child {
    justify-content: flex-start;
    text-align: left;
    font-size: 14.5px;
    padding-bottom: 8px;
  }
  table.tbl.stack td:first-child::before { content: none; }

  /* Boş hücreler ve işlem sütunu */
  table.tbl.stack td:empty { display: none; }
  table.tbl.stack td:not([data-l]) {
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
  }

  table.tbl.stack tfoot tr {
    background: var(--g50);
    border-top: 1px solid var(--line);
    padding: 10px 0;
  }
  table.tbl.stack tfoot td { font-weight: 800; }

  /* Kart başlıkları sığmayınca alt satıra insin */
  .card-h { flex-wrap: wrap; row-gap: 8px; padding: 13px 16px; }
  .card-h h3 { font-size: 11.5px; }
  .card-h .grow { flex-basis: 100%; height: 0; }
  .chip { font-size: 11px; padding: 3px 8px; }

  /* Dokunma hedefleri */
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .btn.icon { min-width: 38px; min-height: 38px; }
  .seg { flex-wrap: wrap; width: 100%; }
  .seg button { flex: 1; min-height: 38px; }
}

/* ======================  MOBİL: PENCERELER ALT SAYFA  ==================== */
@media (max-width: 620px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    animation: sheet .24s cubic-bezier(.2, .9, .3, 1);
  }
  .modal-h { border-radius: 20px 20px 0 0; padding: 16px 18px; }
  .modal-b { padding: 16px 18px; }
  .modal-f { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
}
@keyframes sheet {
  from { opacity: .6; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ===================  MOBİL: ORTADAKİ "EKLE" DÜĞMESİ  ==================== */
/* En sık kullanılan işlem olduğu için alt menüde diğerlerinden belirgin
   şekilde büyük, yükseltilmiş yuvarlak bir düğme olarak durur. */
.tabbar .in { align-items: end; }

.tabbar button.tab-ana {
  color: var(--g700);
  font-weight: 800;
  padding-top: 0;
}

.tabbar button.tab-ana .ic {
  width: 54px;
  height: 54px;
  margin: -24px auto 2px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--g500), var(--g700));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(15, 76, 58, .38);
  transition: transform .14s, box-shadow .14s;
}

.tabbar button.tab-ana:active .ic {
  transform: scale(.94);
  box-shadow: 0 3px 10px rgba(15, 76, 58, .32);
}

.tabbar button.tab-ana.on .ic {
  background: linear-gradient(140deg, var(--g400), var(--g600));
  box-shadow: 0 6px 20px rgba(15, 76, 58, .48);
}

/* Soldan sağa kaydırarak geri gitmeyi kapat.
   (overflow-x: hidden kullanılmıyor — sticky üst çubuğu ve kenar menüyü bozuyor.) */
html, body { overscroll-behavior-x: none; }
/* Çift dokunuşla ve parmakla yakınlaştırmayı kapat */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: pan-x pan-y; }

/* Çentik: içerik tam ekran uzanır, yalnızca üst çubuk kadar boşluk bırakılır. */
.top { padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
.gate { padding-top: calc(24px + env(safe-area-inset-top)); }
/* Kenar menü çentiğin altına girmesin ama araya fazla boşluk da koymasın */
.side { padding-top: env(safe-area-inset-top); }
.side .brand { padding-top: 12px; }
/* Menü bittikten sonra alt bilgi hemen gelsin */
.nav { flex: 0 1 auto; }
.side-foot { margin-top: 6px; }

/* Telefonda menünün sonu alt çubuğun altında kalmasın */
@media (max-width: 900px) {
  .side { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* Logo: site ve uygulama simgesi aynı */
img.brand-icon { width: 30px; height: 30px; border-radius: 8px; display: block; }
img.gate-logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 12px; display: block; }

/* --------------------- cihaz onayı bekleme ekranı ----------------------- */
.bekle-kutu {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 22px; padding: 13px 18px; border-radius: 999px;
  background: var(--warn-bg, #FFF7EA); color: var(--warn, #B26B00);
  font-size: 14px; font-weight: 600;
}
.bekle-nokta {
  width: 9px; height: 9px; border-radius: 50%; background: currentColor;
  animation: bekle-yanip 1.4s ease-in-out infinite;
}
@keyframes bekle-yanip { 0%, 100% { opacity: .25 } 50% { opacity: 1 } }
