/* Renkler makronun paneliyle aynı (macro2/Tema.cs). */
:root {
  color-scheme: dark;
  --zemin: #141414;
  --yuzey: #1e1e20;
  --alan: #29292d;
  --kenar: #3a3a3e;
  --yazi: #e6e6e6;
  --soluk: #a0a0a4;
  --yesil: #3fc267;
  --turuncu: #f69314;
  --kirmizi: #f0525c;
  --mavi: #4fc3f7;
  --yaricap: 4px;
  --yazi-tipi: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--zemin);
  color: var(--yazi);
  font: 400 0.9375rem/1.45 var(--yazi-tipi);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }

:focus-visible { outline: 2px solid var(--mavi); outline-offset: 2px; }

button, input, textarea { font: inherit; color: inherit; }

button {
  min-height: 2.25rem;
  padding: 0 0.875rem;
  background: var(--yuzey);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: var(--alan); }
button:disabled { opacity: 0.55; cursor: default; }

.birincil { background: var(--yesil); border-color: var(--yesil); color: #0b1a0f; font-weight: 600; }
.birincil:hover { background: #55d07c; border-color: #55d07c; }
.tehlikeli { color: var(--kirmizi); border-color: color-mix(in srgb, var(--kirmizi) 45%, var(--kenar)); }

input, textarea {
  width: 100%;
  padding: 0.4375rem 0.625rem;
  background: var(--alan);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
}
textarea { display: block; resize: vertical; }
input::placeholder { color: var(--soluk); }

label, legend { display: block; margin: 0.875rem 0 0.25rem; color: var(--soluk); font-size: 0.8125rem; }

.mono { font-family: var(--mono); }
.ikon { width: 1rem; height: 1rem; display: block; }

.ikon-dugme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  flex: none;
  background: transparent;
  border-color: transparent;
  color: var(--soluk);
}
.ikon-dugme:hover { color: var(--yazi); }

/* Giriş */
.giris { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.giris-kart { width: min(22rem, 100%); }
.giris-kart h1 { margin-top: 0.75rem; font-size: 1.375rem; font-weight: 600; }
.giris-kart .birincil { width: 100%; margin-top: 1rem; }
.hata-yazi { margin-top: 0.5rem; color: var(--kirmizi); font-size: 0.875rem; }

/* Üst çubuk */
.ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 1.5rem;
  background: var(--yuzey);
  border-bottom: 1px solid var(--kenar);
}
.marka { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; font-weight: 600; }
.marka span { color: var(--soluk); font-weight: 400; }
.ust-dugmeler { display: flex; gap: 0.5rem; }

.govde { max-width: 90rem; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }

.kopuk {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--turuncu);
  border-radius: var(--yaricap);
  color: var(--turuncu);
}

/* Sayaçlar aynı zamanda süzgeç */
.filtreler {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 1px;
  background: var(--yuzey);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
  overflow: hidden;
}
.filtre {
  display: block;
  height: auto;
  padding: 0.625rem 0.875rem;
  background: var(--yuzey);
  border: 0;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--kenar); /* ayırıcı; alt satır dolmayınca boş hücre renklenmesin */
  text-align: left;
  white-space: normal;
}
.filtre b { display: block; font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.filtre span { color: var(--soluk); font-size: 0.8125rem; }
.filtre[aria-pressed="true"] { background: var(--alan); box-shadow: 0 0 0 1px var(--kenar), inset 0 -2px 0 var(--yazi); }
.filtre:focus-visible { outline-offset: -2px; }
.filtre.yesil b { color: var(--yesil); }
.filtre.turuncu b { color: var(--turuncu); }
.filtre.kirmizi b { color: var(--kirmizi); }

.arama { position: relative; margin: 1rem 0 0.5rem; }
.arama .ikon { position: absolute; left: 0.625rem; top: 50%; translate: 0 -50%; color: var(--soluk); pointer-events: none; }
.arama input { padding-left: 2.125rem; min-height: 2.25rem; }

/* Tablo */
/* Sabit düzen: uzun cihaz adı ya da müşteri adı sütunları itmesin, kalan genişlik müşteriye gider. */
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th:nth-child(1) { width: 14.25rem; }
th:nth-child(3) { width: 8.5rem; }
th:nth-child(4) { width: 10rem; }
th:nth-child(5) { width: 12rem; }
th:nth-child(6) { width: 7.5rem; }
th {
  padding: 0.5rem 0.75rem;
  color: var(--soluk);
  font-size: 0.8125rem;
  font-weight: 400;
  text-align: left;
  border-bottom: 1px solid var(--kenar);
}
td { padding: 0.5625rem 0.75rem; border-bottom: 1px solid var(--yuzey); vertical-align: top; overflow-wrap: anywhere; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--yuzey); }
.alt { color: var(--soluk); font-size: 0.8125rem; }
.soluk { color: var(--soluk); }

.anahtar-hucre { display: flex; align-items: center; gap: 0.125rem; margin: -0.3125rem 0; }
.anahtar {
  height: auto;
  min-height: 2.25rem;
  padding: 0 0.25rem;
  margin-left: -0.25rem;
  background: none;
  border: 0;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}
.anahtar:hover { background: none; text-decoration: underline; }
.anahtar-hucre .ikon-dugme { opacity: 0.6; }
tbody tr:hover .ikon-dugme, .anahtar-hucre .ikon-dugme:focus-visible { opacity: 1; }

.rozet { display: inline-flex; align-items: center; gap: 0.375rem; white-space: nowrap; }
.rozet::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--soluk); }
.rozet.aktif::before, .rozet.cevrimici::before { background: var(--yesil); }
.rozet.bitti::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--soluk); }
.rozet.yasakli::before { border-radius: 1px; background: var(--kirmizi); }
.rozet.yasakli { color: var(--kirmizi); }
.rozet.cevrimici { color: var(--yesil); }

.kalan { min-width: 7.5rem; }
.kalan.yakin { color: var(--turuncu); }
.cubuk { height: 4px; margin-top: 0.3125rem; background: var(--alan); border-radius: 2px; overflow: hidden; max-width: 9rem; }
.cubuk span { display: block; height: 100%; background: var(--yesil); }
.yakin .cubuk span { background: var(--turuncu); }
.soluk .cubuk span { background: var(--soluk); }

.ret { color: var(--turuncu); font-size: 0.8125rem; }

.bos { padding: 3.5rem 1rem; text-align: center; color: var(--soluk); }
.bos p { margin-bottom: 1rem; }

/* Pencereler */
dialog {
  padding: 0;
  background: var(--yuzey);
  color: var(--yazi);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
}
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
h2 { font-size: 1.0625rem; font-weight: 600; }

.pencere { width: min(30rem, calc(100vw - 2rem)); }
.pencere > form, .pencere > div { padding: 1.25rem; }
.pencere p { margin-top: 0.5rem; color: var(--soluk); }
.pencere p.ipucu { margin-top: 0.75rem; font-size: 0.8125rem; }
.dugmeler { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

.iki-sutun { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.sureler { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.sureler label { margin: 0; color: var(--yazi); font-size: 0.875rem; }
.sureler input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sureler span {
  display: block;
  padding: 0.3125rem 0.625rem;
  background: var(--alan);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
  cursor: pointer;
}
.sureler input:checked + span { background: var(--yazi); border-color: var(--yazi); color: var(--zemin); }
.sureler input:focus-visible + span { outline: 2px solid var(--mavi); outline-offset: 2px; }

.anahtar-listesi {
  margin-top: 0.75rem;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  background: var(--zemin);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  user-select: all;
}

/* Sağdan açılan ayrıntı */
.cekmece {
  width: min(30rem, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
}
.cekmece-ic { min-height: 100%; }
.cekmece-ust {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.25rem 0.75rem;
  background: var(--yuzey);
  border-bottom: 1px solid var(--kenar);
}
.cekmece-ust h2 { font-size: 1rem; overflow-wrap: anywhere; }
.cekmece-dugmeler { display: flex; margin: -0.25rem -0.5rem 0 0; }

.cekmece section { padding: 1rem 1.25rem; border-bottom: 1px solid var(--kenar); }
.cekmece section:last-child { border-bottom: 0; }
h3 { color: var(--soluk); font-size: 0.8125rem; font-weight: 400; }
.cekmece form label:first-of-type { margin-top: 0.5rem; }

.buyuk-sure { margin-top: 0.125rem; font-size: 1.5rem; font-weight: 600; }
.buyuk-sure.yakin { color: var(--turuncu); }
.buyuk-sure.yakin + .cubuk span { background: var(--turuncu); }
.buyuk-sure.soluk + .cubuk span { background: var(--soluk); }
.cekmece .cubuk { max-width: none; }

.tarihler { display: grid; grid-template-columns: auto 1fr; gap: 0.125rem 0.75rem; margin-top: 0.75rem; font-size: 0.875rem; }
.tarihler dt { color: var(--soluk); }

.sure-formu { margin-top: 0.875rem; }
.hizli-sure { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.sure-satiri { display: grid; grid-template-columns: 1fr auto; gap: 0 0.5rem; }
.sure-satiri label { grid-column: 1 / -1; }

.cihazlar li { padding: 0.5rem 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--alan); }
.cihazlar li:last-child { border-bottom: 0; padding-bottom: 0; }
.cihazlar .ad { overflow-wrap: anywhere; }
.bos-satir { padding-top: 0.25rem; color: var(--soluk); }

.olaylar { margin-top: 0.25rem; font-size: 0.875rem; }
.olaylar li { padding: 0.25rem 0; }
.olaylar .ret-olay { color: var(--turuncu); }

.tehlike { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.bildirim {
  inset: auto 1rem 1rem auto;
  margin: 0;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.625rem 0.875rem;
  background: var(--alan);
  color: var(--yazi);
  border: 1px solid var(--kenar);
  border-radius: var(--yaricap);
}
.bildirim.hata { border-color: var(--kirmizi); color: var(--kirmizi); }

@media (max-width: 68rem) {
  th:nth-child(6), td:nth-child(6) { display: none; }
}

/* Dar ekranda satırlar kart olur */
@media (max-width: 56rem) {
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table, tbody, tr, td { display: block; }
  tbody tr { margin-bottom: 0.625rem; padding: 0.5rem 0.75rem; background: var(--yuzey); border: 1px solid var(--kenar); border-radius: var(--yaricap); }
  td, td:nth-child(6) { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0.5rem; padding: 0.25rem 0; border: 0; }
  td::before { content: attr(data-baslik); color: var(--soluk); font-size: 0.8125rem; }
  td:first-child { display: block; }
  td:first-child::before { content: none; }
}

@media (max-width: 46rem) {
  .ust { padding: 0.625rem 1rem; }
  .marka span { display: none; }
  .govde { padding: 1rem 1rem 2rem; }
}
