/* ==========================================================================
   MODÜLLER — sekmeli modül gezgini: üstte sekmeler, altta açıklama + arayüz önizlemesi
   ========================================================================== */

.mods {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- Sekmeler ---------- */
.mods__nav {
  display: flex;
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.mods__nav::-webkit-scrollbar { display: none; }

.mods__tab {
  position: relative;
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding-inline: 14px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  scroll-snap-align: start;
  transition: color .2s, background-color .2s, box-shadow .2s;
}
.mods__tab .i { width: 18px; height: 18px; }
.mods__tab:hover { color: var(--ink); background: rgb(11 26 51 / .03); }
.mods__tab[aria-selected="true"] {
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 6px 16px -8px rgb(7 19 40 / .6);
}

/* Otomatik geçişin ilerleme çizgisi */
.mods__progress {
  position: absolute;
  left: 12px; right: 12px; bottom: 5px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
}
.mods__progress i {
  display: block;
  height: 100%;
  background: #ff6b72;
  transform: scaleX(0);
  transform-origin: left;
}
.mods__tab[aria-selected="true"] .mods__progress i { transform: scaleX(var(--progress, 0)); }
.mods.is-static .mods__progress { display: none; }

/* ---------- Paneller ---------- */
/* Paneller aynı hücrede üst üste durur; kap en uzun panelin yüksekliğini alır */
.mods__panels { display: grid; }
.js .mod-panel { grid-area: 1 / 1; }
.js .mod-panel:not(.is-active) { visibility: hidden; opacity: 0; pointer-events: none; }
.mod-panel.is-active { animation: case-in .6s var(--ease-out); }

.mod-panel {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  padding: clamp(24px, 3.5vw, 48px);
}

.mod-panel__copy { display: grid; gap: 18px; align-content: start; }
.mod-panel__copy h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -.03em; }
.mod-panel__copy > p { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.65; }
.mod-panel__copy .check-list li { font-size: 15px; }
.mod-panel__copy .link-arrow { margin-top: 6px; }

.mod-panel__visual {
  padding: clamp(14px, 2.5vw, 32px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(rgb(11 31 69 / .12) 1px, transparent 1.2px) 0 0 / 18px 18px,
    var(--bg-alt);
}

/* Önizleme penceresi */
.mod-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.mod-window__body { display: grid; gap: 14px; padding: 16px; }
.mod-window__body .mock__rows { padding: 0; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- Firmalarım ---------- */
.firms { display: grid; gap: 12px; }

.firms__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.firms__stats > div {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.firms__stats span {
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.firms__stats b { font-size: 1.5rem; font-weight: 500; }
.firms__stats .is-warn { background: var(--amber-100); border-color: transparent; }
.firms__stats .is-warn span { color: var(--amber-600); }

.firms__filters { display: flex; flex-wrap: wrap; gap: 6px; }

.firms__table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.firms__table li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}
.firms__table li + li { border-top: 1px solid var(--line); }
.firms__name { display: grid; min-width: 0; }
.firms__name small { font-weight: 400; font-size: 12px; color: var(--muted); }

.firms__flags { display: flex; gap: 4px; }
.firms__flags i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}
.firms__flags .ok { background: var(--green-500); }
.firms__flags .bad { background: var(--red-500); }

.firms__tags { display: flex; gap: 4px; }
.firms__tags em {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--navy-50);
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--navy-700);
}

/* ---------- e-Tebligat: son gelenler ---------- */
.feed { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.feed li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
}
.feed li + li { border-top: 1px solid var(--line); }
.feed li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--line-2);
}
.feed li.is-new::before { background: var(--red-500); box-shadow: 0 0 0 3px var(--red-100); }
.feed__main { display: grid; min-width: 0; line-height: 1.35; }
.feed__main b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__main small { font-size: 12px; color: var(--muted); }
.feed time { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

.mod-panel.is-active .feed li { animation: row-in .6s var(--ease-out) backwards; }
.mod-panel.is-active .feed li:nth-child(2) { animation-delay: .1s; }
.mod-panel.is-active .feed li:nth-child(3) { animation-delay: .2s; }

/* ---------- e-Tebligat sayaçları ---------- */
.tebligat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tebligat > div {
  position: relative;
  display: grid;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.tebligat b { font-size: 1.625rem; font-weight: 500; line-height: 1.1; }
.tebligat span { font-size: 12px; color: var(--muted); }
.tebligat > div::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--bar, var(--navy-700));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease-out) .3s;
}
.tebligat > div:nth-child(1) { --bar: var(--green-500); }
.tebligat > div:nth-child(2) { --bar: var(--navy-700); }
.tebligat > div:nth-child(3) { --bar: var(--amber-500); }
.tebligat > div:nth-child(4) { --bar: var(--red-500); }
.tebligat > div:nth-child(4) b { color: var(--red-600); }
.mod-panel.is-active .tebligat > div::after { transform: scaleX(1); }

/* ---------- Beyanname grafiği ---------- */
.bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Son satır açıklama (legend); çubuklar kalan yüksekliğin tamamını kullanır */
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 12px;
  height: 172px;
  padding: 12px 12px 0;
  border-radius: 12px;
  background:
    repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 30px),
    var(--surface-2);
}
.bars__group {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  height: 100%;
  padding-bottom: 22px;
}
.bars__group span {
  width: 16px;
  height: calc(var(--h) * 100%);
  border-radius: 4px 4px 1px 1px;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 1s var(--ease-out);
}
.bars__group span.ok { background: var(--green-500); }
.bars__group span.warn { background: var(--amber-500); transition-delay: .12s; }
.bars__group:nth-child(2) span { transition-delay: .18s; }
.bars__group:nth-child(3) span { transition-delay: .3s; }
.mod-panel.is-active .bars__group span { transform: none; }

.bars__group small {
  position: absolute;
  bottom: 4px;
  font-size: 10.5px;
  color: var(--muted);
}

.bars__legend {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-block: 8px 10px;
  margin-inline: -12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--muted);
}
.bars__legend span { display: inline-flex; align-items: center; gap: 6px; }
.bars__legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.bars__legend .ok::before { background: var(--green-500); }
.bars__legend .warn::before { background: var(--amber-500); }

/* ---------- Anahtar–değer listesi (SGK) ---------- */
.kv { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 14px;
  font-size: 13px;
}
.kv > div + div { border-top: 1px solid var(--line); }
.kv dt { color: var(--ink-2); }
.kv dd { margin-left: auto; font-size: 14px; }
.kv dd.is-warn { color: var(--amber-600); }

/* ---------- Ödeme ---------- */
.pay { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.pay__total { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: var(--muted); }
.pay__total b { font-size: 1.75rem; font-weight: 500; color: var(--ink); }
.pay__bar { height: 8px; border-radius: 999px; background: var(--navy-50); overflow: hidden; }
.pay__bar i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy-800), var(--navy-700));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s var(--ease-out) .2s;
}
.mod-panel.is-active .pay__bar i { transform: none; }
.pay__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- Personel mesai çizelgesi ---------- */
.shifts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 22px;
  gap: 8px 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 14px 0 / calc((100% - 28px) / 5) 100% no-repeat,
    var(--surface-2);
}
.shifts span {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
}
.shifts i {
  grid-column: calc(var(--s) + 1) / calc(var(--e) + 1);
  border-radius: 6px;
  background: var(--navy-100);
  box-shadow: inset 3px 0 0 var(--navy-700);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .9s var(--ease-out);
}
.shifts i.b { background: var(--green-100); box-shadow: inset 3px 0 0 var(--green-500); transition-delay: .12s; }
.shifts i.c { background: var(--red-50); box-shadow: inset 3px 0 0 var(--red-500); transition-delay: .24s; }
.mod-panel.is-active .shifts i { transform: none; }

/* ---------- Kullanıcılar ---------- */
.users { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.users li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
}
.users li + li { border-top: 1px solid var(--line); }
.users .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.users em {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- Destek sohbeti ---------- */
.chat { display: grid; gap: 8px; }
.chat p { max-width: 85%; padding: 10px 14px; font-size: 13px; line-height: 1.45; }
.chat__q {
  justify-self: end;
  border-radius: 14px 14px 4px 14px;
  background: var(--navy-900);
  color: #fff;
}
.chat__a {
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
@keyframes bubble { from { opacity: 0; transform: translateY(6px); } }

/* ---------- e-Defter takip tablosu ---------- */
.edf {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}
.edf__head,
.edf__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 112px 64px 112px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.edf__head {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.edf__row { border-top: 1px solid var(--line); }
.edf__row b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edf__row > span:not(.pill) { color: var(--ink-2); }
.edf__yes, .edf__no { font-weight: 600; }
.edf__yes { color: var(--green-600) !important; }
.edf__no { color: var(--red-600) !important; }
.edf__row .pill { justify-self: start; }

.mod-panel.is-active .edf__row { animation: row-in .5s var(--ease-out) backwards; }
.mod-panel.is-active .edf__row:nth-child(3) { animation-delay: .08s; }
.mod-panel.is-active .edf__row:nth-child(4) { animation-delay: .16s; }
.mod-panel.is-active .edf__row:nth-child(5) { animation-delay: .24s; }
.mod-panel.is-active .edf__row:nth-child(6) { animation-delay: .32s; }

.edf__note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.edf__note .i { color: var(--navy-700); }

/* Uzun sohbet: baloncuklar sırayla gelir */
.mod-panel.is-active .chat p { animation: bubble .5s var(--ease-out) backwards; }
.mod-panel.is-active .chat p:nth-child(2) { animation-delay: .4s; }
.mod-panel.is-active .chat p:nth-child(3) { animation-delay: .9s; }
.mod-panel.is-active .chat p:nth-child(4) { animation-delay: 1.3s; }

/* ---------- Duyarlı ---------- */
@media (max-width: 1100px) {
  .mods__tab { flex: none; }
}

@media (max-width: 860px) {
  .mod-panel { grid-template-columns: minmax(0, 1fr); }
  .mod-panel__visual { order: -1; }
}

@media (max-width: 640px) {
  .mods { border-radius: var(--radius-lg); margin-inline: calc(var(--gutter) * -.5); }
  .mods__nav { padding: 10px; }
  .mods__tab { height: 42px; padding-inline: 12px; font-size: 14px; }
  .mod-panel { padding: 16px 16px 24px; gap: 22px; }
  .mod-panel__visual { padding: 10px; margin-inline: -4px; }
  .mod-window__body { padding: 12px; }
  .firms__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .firms__table li { grid-template-columns: minmax(0, 1fr) auto; }
  .firms__tags { display: none; }
  /* Dar ekranda yazılım ve dönem sütunları gizlenir */
  .edf__head, .edf__row { grid-template-columns: minmax(0, 1fr) 52px 112px; }
  .edf__head span:nth-child(2), .edf__row > :nth-child(2),
  .edf__head span:nth-child(4), .edf__row > :nth-child(4) { display: none; }
}
