/* TNT Yazılım Müşteri Paneli
   Renkleri değiştirmek için yalnızca aşağıdaki değişkenleri düzenleyin. */
:root {
  --primary: #2b5f8a;
  --primary-dark: #214a6c;
  --text: #24292f;
  --muted: #6a737d;
  --line: #dfe3e8;
  --soft: #f6f7f9;
  --topbar: #3d4248;
  --blue: #4fb3d4;
  --green: #4cae5a;
  --red: #d2524c;
  --gold: #eba63f;
  --ok-bg: #e6f4e8;
  --ok-fg: #256b31;
  --warn-bg: #fdf1dc;
  --warn-fg: #8a5a08;
  --danger-bg: #fbe6e5;
  --danger-fg: #a32a25;
  --muted-bg: #eceff2;
  --muted-fg: #55606b;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: #fff;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

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

h1, h2, p { margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; top: 0; background: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }

/* ---------- Üst çubuk ---------- */
.topbar { background: var(--topbar); color: #cdd2d8; font-size: 0.87rem; }
.topbar a { color: #fff; text-decoration: none; border-bottom: 1px dashed rgba(255, 255, 255, 0.55); }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.topbar-user { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.alerts { position: relative; }
.alerts summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 0; user-select: none; }
.alerts summary::-webkit-details-marker { display: none; }
.alerts-n { background: var(--gold); color: #33270d; font-weight: 700; border-radius: 10px; padding: 0 7px; font-size: 0.8rem; }
.alerts-list {
  position: absolute; top: 100%; left: 0; z-index: 30;
  margin: 0; padding: 0; list-style: none;
  width: 300px; max-width: calc(100vw - 32px);
  background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(30, 40, 50, 0.18);
}
.alerts-list li + li { border-top: 1px solid var(--line); }
.alerts-list a, .alerts-list span { display: block; padding: 10px 12px; color: var(--text); border: 0; text-decoration: none; }
.alerts-list a:hover { background: var(--soft); }

/* ---------- Marka satırı ve menü ---------- */
.brandbar-in { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.brand { font-size: 1.6rem; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.01em; line-height: 1.15; }
.brand small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.brand:hover { color: var(--primary); }

.menu-btn { display: none; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle:focus-visible ~ .mainnav { outline: 2px solid var(--primary); }

.mainnav { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mainnav-in { display: flex; justify-content: space-between; align-items: stretch; gap: 16px; }
.nav-list { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.nav-list a, .nav-btn {
  display: block; padding: 12px 14px; color: var(--text); text-decoration: none;
  border: 0; border-bottom: 3px solid transparent; background: none; font: inherit; cursor: pointer;
}
.nav-list li:first-child a { padding-left: 0; }
.nav-list a:hover, .nav-btn:hover { color: var(--primary); }
.nav-list a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav-right form { margin: 0; }
.nav-right li:first-child a { padding-left: 14px; }

.crumbs { background: #fbfbfc; border-bottom: 1px solid var(--line); font-size: 0.87rem; color: var(--muted); padding: 8px 0; }
.crumbs .sep { margin: 0 8px; }

/* ---------- Sayfa düzeni ---------- */
.page { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; padding-top: 22px; padding-bottom: 40px; align-items: start; }
.content { min-width: 0; }
.page-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 16px; overflow-wrap: anywhere; }

.ftr { border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 0.87rem; padding: 18px 0; }
.ftr a { margin-left: 12px; }

/* ---------- Kartlar ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 18px; }
.card-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; font-size: 1rem; font-weight: 600;
  background: #fbfbfc; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.card-head .head-btn { margin-left: auto; }
.card-body { padding: 14px; margin: 0; }
.card-foot { padding: 10px 14px; border-top: 1px solid var(--line); background: #fbfbfc; margin: 0; }
.accent-blue { border-top: 3px solid var(--blue); }
.accent-green { border-top: 3px solid var(--green); }
.accent-red { border-top: 3px solid var(--red); }
.accent-gold { border-top: 3px solid var(--gold); }
.count { background: var(--muted-bg); color: var(--muted-fg); border-radius: 10px; padding: 0 8px; font-size: 0.8rem; font-weight: 600; }

.who { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.who span { color: var(--muted); font-size: 0.93rem; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }

/* ---------- Sayaç kutuları ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); margin-bottom: 18px; overflow: hidden; }
.tile { position: relative; display: block; padding: 12px 18px 14px; color: var(--text); text-decoration: none; border-right: 1px solid var(--line); transition: background-color 0.15s ease; }
.tile:last-child { border-right: 0; }
.tile:hover { background: #eef0f3; color: var(--text); }
.tile .ico { position: absolute; top: 12px; right: 16px; width: 44px; height: 44px; color: #c9ced4; }
.tile-stat { display: block; margin-top: 18px; font-size: 2.5rem; line-height: 1; font-weight: 300; font-variant-numeric: tabular-nums; }
.tile-title { display: block; margin-top: 6px; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.tile-bar { display: block; height: 3px; border-radius: 2px; margin-top: 6px; }
.tile-blue .tile-bar { background: var(--blue); }
.tile-green .tile-bar { background: var(--green); }
.tile-red .tile-bar { background: var(--red); }
.tile-gold .tile-bar { background: var(--gold); }

/* ---------- Listeler ---------- */
.list-row { display: block; padding: 10px 14px; border-top: 1px solid var(--line); }
.list > .list-row:first-child { border-top: 0; }
.list-link { color: var(--text); text-decoration: none; }
.list-link:hover { background: var(--soft); color: var(--text); }
.side .list-link { display: flex; align-items: center; gap: 8px; }
.empty { padding: 16px 14px; color: var(--muted); }
.sub { display: block; font-size: 0.87rem; color: var(--muted); font-weight: 400; }
.note { margin-top: 4px; }

.svc-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
.svc-name { min-width: 0; overflow-wrap: anywhere; }
.svc-end { font-size: 0.9rem; white-space: nowrap; }
.svc-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.svc-act form { margin: 0; }

.tk-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.tk-title .label { margin-left: 6px; }
.mv-row { display: flex; justify-content: space-between; gap: 12px; }
.mv-row .amt { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Hizmet döneminin ne kadarının geçtiğini gösteren çubuk */
.period { display: block; width: 100%; max-width: 280px; height: 6px; margin-top: 6px; border: 0; border-radius: 3px; background: var(--muted-bg); overflow: hidden; -webkit-appearance: none; -moz-appearance: none; appearance: none; }
.period::-webkit-progress-bar { background: var(--muted-bg); border-radius: 3px; }
.period::-webkit-progress-value { background: var(--green); border-radius: 3px; }
.period::-moz-progress-bar { background: var(--green); border-radius: 3px; }
.period-warn::-webkit-progress-value { background: var(--gold); }
.period-warn::-moz-progress-bar { background: var(--gold); }
.period-danger::-webkit-progress-value { background: var(--red); }
.period-danger::-moz-progress-bar { background: var(--red); }

/* ---------- Etiketler ---------- */
.label { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.8rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.label-ok { background: var(--ok-bg); color: var(--ok-fg); }
.label-warn { background: var(--warn-bg); color: var(--warn-fg); }
.label-danger { background: var(--danger-bg); color: var(--danger-fg); }
.label-muted { background: var(--muted-bg); color: var(--muted-fg); }

.neg, .neg a { color: var(--danger-fg); }
.pos, .pos a { color: var(--ok-fg); }
.zero, .zero a { color: var(--muted); }
.balance { font-size: 1.6rem; font-weight: 600; }
.pay-info { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0 10px; overflow-wrap: anywhere; }

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border: 1px solid #c5ccd3; border-radius: var(--radius);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; line-height: 1.3;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--soft); color: var(--text); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ok { background: #3f9a4d; border-color: #3f9a4d; color: #fff; }
.btn-ok:hover { background: #357f41; border-color: #357f41; color: #fff; }
.btn-danger { background: #fff; border-color: #dba8a5; color: var(--danger-fg); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger-fg); }
.btn-sm { padding: 5px 10px; font-size: 0.87rem; }
.btn-xs { padding: 3px 8px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; }

/* ---------- Formlar ---------- */
.form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="date"],
.form input[type="time"], .form select, .form textarea, .filter select, .copy-field {
  width: 100%; padding: 8px 10px; border: 1px solid #c5ccd3; border-radius: var(--radius);
  background: #fff; color: var(--text); font: inherit;
}
.form textarea { resize: vertical; min-height: 90px; }
.form input:disabled { background: var(--soft); color: var(--muted); }
.form input[type="file"] { display: block; max-width: 100%; font: inherit; }
.form .btn-block { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid > div > label:first-child { margin-top: 10px; }
.f-full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.form label.check, .filter label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hint { color: var(--muted); font-size: 0.93rem; margin: 6px 0; }

.filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter label { font-weight: 600; }
.filter select { width: auto; min-width: 180px; max-width: 100%; padding: 5px 8px; }
.filter .push { margin-left: auto; }

.copy-field { display: block; margin-top: 8px; font-size: 0.87rem; }

/* ---------- Site düzenleyici ---------- */
.site-bar-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-bar-act { display: flex; gap: 8px; flex-wrap: wrap; }
.site-bar-act form { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tabs a { padding: 8px 12px; color: var(--text); text-decoration: none; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: -1px; }
.tabs a:hover { background: var(--soft); color: var(--primary); }
.tabs a.on { background: #fff; border-color: var(--line); border-top: 3px solid var(--primary); color: var(--primary); font-weight: 600; }
.sub-head { font-size: 1rem; font-weight: 600; margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.form .lbl { font-weight: 600; margin: 12px 0 4px; }
.form input[type="color"] { display: block; width: 72px; height: 38px; padding: 2px; border: 1px solid #c5ccd3; border-radius: var(--radius); background: #fff; cursor: pointer; }
.form input[type="time"] { width: auto; }
.hours { display: grid; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 150px auto auto 1fr; gap: 10px; align-items: center; }
.form .hours-row label.check { margin: 0; }
.rows { margin-top: 10px; }
.rows-note { margin-left: 10px; }
.row-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.row-fields { flex: 1; min-width: 0; display: grid; gap: 6px; }
.row-3 { grid-template-columns: 170px minmax(0, 1fr) minmax(0, 2fr); }
.row-tools { display: flex; gap: 4px; flex: none; }
.thumb { display: block; max-width: 260px; max-height: 160px; width: auto; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 6px; }
.thumb-logo { max-height: 70px; padding: 6px; background: var(--soft); }
.thumb-sm { max-width: 96px; max-height: 96px; margin: 0; flex: none; }
.imgf input[type="text"] { margin-top: 6px; }
.site-svc { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Uyarı kutuları ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid transparent; overflow-wrap: anywhere; }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); border-color: #bfe0c4; }
.alert-error { background: var(--danger-bg); color: var(--danger-fg); border-color: #efc2bf; }
.alert-info { background: #e6f1f8; color: #1f4f73; border-color: #bcd8ea; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.table thead th { border-top: 0; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr.off td { background: var(--soft); color: var(--muted); }
.table form { margin: 0; display: inline; }
.table tbody tr:hover td { background: #fafbfc; }

/* ---------- Talep yazışması ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
.facts dt { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }

.thread { margin-bottom: 18px; }
.msg { border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius); margin-bottom: 12px; background: #fff; }
.msg-staff { border-left-color: var(--green); background: #f7fbf7; }
.msg-head { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.msg-body { padding: 12px 14px; overflow-wrap: anywhere; }
.msg-files { margin: 0; padding: 9px 14px; list-style: none; border-top: 1px dashed var(--line); font-size: 0.93rem; }
.msg-files .sub { display: inline; }

/* ---------- Giriş sayfaları ---------- */
.auth-body { background: #f1f3f5; min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 40px; }
.auth-box { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--primary); border-radius: var(--radius); padding: 26px 26px 22px; }
.auth-box h1 { font-size: 1.2rem; font-weight: 600; margin: 16px 0 12px; }
.auth-links, .auth-foot { margin-top: 14px; font-size: 0.93rem; }
.auth-foot { color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- Dar ekranlar ---------- */
@media (max-width: 960px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .content { order: 1; }
  .side { order: 2; }
  .menu-btn { display: inline-flex; }
  .mainnav { display: none; }
  .nav-toggle:checked ~ .mainnav { display: block; }
  .mainnav-in { flex-direction: column; gap: 0; padding-top: 4px; padding-bottom: 8px; }
  .nav-list { flex-direction: column; }
  .nav-list a, .nav-btn { padding: 10px 0; border-bottom: 0; width: 100%; text-align: left; }
  .nav-right { border-top: 1px solid var(--line); }
  .nav-right li:first-child a { padding-left: 0; }
  .nav-list a.on { border-bottom: 0; }
}

@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(2n) { border-right: 0; }
  .tile:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .svc-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .svc-end { white-space: normal; }
  .svc-act { justify-content: flex-start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter .push { margin-left: 0; }
  .row-item { flex-wrap: wrap; }
  .row-3 { grid-template-columns: minmax(0, 1fr); }
  .row-fields { flex-basis: 100%; }
  .hours-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .brand { font-size: 1.3rem; }
  .tile-stat { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Sayfalar ve ek sayfalar (1.2.0) ---------- */
.pages { display: grid; gap: 8px; }
.pages-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: center; }
.form .pages-row label.check, .pages-row .check { margin: 0; }
.site-sub { padding-left: 38px; }
@media (max-width: 700px) {
  .pages-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .site-sub { padding-left: 24px; }
}
