:root {
  --bg: #F0F3F4;
  --navy: #1B2631;
  --navy-light: #2C3E50;
  --card: #FFFFFF;
  --gold: #B8952E;
  --gold-bright: #D4AF37;
  --primary: #2980B9;
  --primary-dark: #1F618D;
  --danger: #C0392B;
  --success: #1E8449;
  --warning: #B9770E;
  --text: #212F3C;
  --text-muted: #6B7A8A;
  --border: #DDE3E7;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .brand {
  font-family: Georgia, "Liberation Serif", "Times New Roman", serif;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 .5em 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  font-family: inherit;
  font-size: .95rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .55em 1.1em;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .12s ease;
}
button:hover, .btn:hover { background: var(--primary-dark); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 1px;
}

.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #97781f; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #922b21; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: .3em .7em; font-size: .82rem; }
.btn-block { width: 100%; }

input[type=text], input[type=number], input[type=password], input[type=date], input[type=tel], textarea, select {
  width: 100%;
  padding: .55em .7em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 4.5em; }
label { display: block; font-size: .82rem; color: var(--text-muted); margin: .8em 0 .3em; }
.field-row { display: flex; gap: .7em; flex-wrap: wrap; }
.field-row > * { flex: 1 1 180px; }

/* ---------- Üst gezinme ---------- */
header.topbar {
  background: var(--navy);
  border-bottom: 3px solid var(--gold-bright);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7em 1em;
}
.brand { color: #fff; font-size: 1.15rem; margin: 0; }
.brand .accent { color: var(--gold-bright); }
nav.main-nav { display: flex; align-items: center; gap: .3em; }
nav.main-nav a, nav.main-nav .soon {
  color: #D5DBDB;
  padding: .5em .8em;
  border-radius: var(--radius);
  font-size: .92rem;
}
nav.main-nav a:hover { background: var(--navy-light); text-decoration: none; }
nav.main-nav a.active { background: var(--navy-light); color: #fff; font-weight: 600; }
nav.main-nav .soon { color: #5D6D7E; cursor: default; }
.menu-toggle { display: none; }

.user-chip { color: #B0BAC2; font-size: .85rem; }
.user-chip a { color: var(--gold-bright); margin-left: .6em; }

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  nav.main-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    display: none;
    border-top: 1px solid var(--navy-light);
    margin-top: .6em;
    padding-top: .6em;
  }
  #nav-check:checked ~ .topbar nav.main-nav,
  #nav-check:checked ~ .topbar .main-nav { display: flex; }
  .menu-toggle {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--navy-light);
    color: #fff;
  }
}

/* ---------- Sayfa çatısı ---------- */
main.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2em 1em 3em;
}

.flash { padding: .8em 1em; border-radius: var(--radius); margin-bottom: 1em; font-size: .92rem; }
.flash-basari { background: #E9F7EF; color: var(--success); border: 1px solid #ABEBC6; }
.flash-hata { background: #FDEDEC; color: var(--danger); border: 1px solid #F5B7B1; }

/* ---------- Kartlar / panel ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1em;
  margin: 1em 0 1.6em;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold-bright);
  border-radius: var(--radius);
  padding: 1em 1.1em;
}
.stat-card .label { font-size: .8rem; color: var(--text-muted); }
.stat-card .value { font-size: 1.45rem; font-family: Georgia, serif; color: var(--navy); margin-top: .15em; overflow-wrap: normal; }
.stat-card a.value-link { text-decoration: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2em;
  margin-bottom: 1.2em;
}
.card h2, .card h3 { margin-top: 0; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: none; padding: .6em .5em; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: .65em .5em; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:nth-child(even) td { background: #F8F9F9; }
tr:hover td { background: #FCF3CF33; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: .15em .6em; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.pill-danger { background: #FDEDEC; color: var(--danger); }
.pill-success { background: #E9F7EF; color: var(--success); }
.pill-warning { background: #FEF5E7; color: var(--warning); }

.search-row { display: flex; gap: .6em; margin-bottom: 1em; }
.search-row input { flex: 1; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: .6em 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1em; }
.list-plain li:last-child { border-bottom: none; }

.muted { color: var(--text-muted); }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1em; margin-top: 2em; }

.empty-state { text-align: center; padding: 2.5em 1em; color: var(--text-muted); }

/* ---------- Giriş / kurulum ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 1.2em;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2.2em 2em;
  width: 100%;
  max-width: 380px;
  border-top: 4px solid var(--gold-bright);
}
.auth-card h1 { text-align: center; font-size: 1.4rem; }
.auth-sub { text-align: center; color: var(--text-muted); font-size: .85rem; margin-bottom: 1.4em; }

details.inline-form { margin-top: .8em; }
details.inline-form > summary { cursor: pointer; color: var(--primary); font-size: .9rem; list-style: none; }
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > summary { margin-bottom: .8em; font-weight: 600; }
.form-box { border: 1px dashed var(--border); border-radius: var(--radius); padding: 1em; background: #FAFBFB; }

/* ---------- Süreler kartları ---------- */
.sure-list { display: flex; flex-direction: column; gap: .8em; }
.sure-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: .9em 1.1em;
}
.sure-card.sure-kritik { border-left-color: var(--danger); }
.sure-card.sure-yaklasan { border-left-color: var(--warning); }
.sure-card.sure-danismanlik { border-left-color: var(--primary); }
.sure-card.sure-normal { border-left-color: var(--border); }
.sure-ust { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; margin-bottom: .4em; }
.sure-tip { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 600; }
.sure-vade { margin-left: auto; font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sure-baslik { font-weight: 600; color: var(--navy); font-size: 1rem; }
.sure-detay { color: var(--text-muted); font-size: .88rem; margin-top: .15em; }
.sure-aksiyon { display: flex; gap: .5em; flex-wrap: wrap; margin-top: .7em; }
.sure-ertele-form { display: flex; gap: .4em; }
.sure-ertele-form input[type=date] { width: 150px; }

/* ---------- Mobilde tabloyu kaydırma yerine kart listesine çevir ---------- */
@media (max-width: 680px) {
  .table-wrap.responsive-stack table,
  .table-wrap.responsive-stack thead,
  .table-wrap.responsive-stack tbody,
  .table-wrap.responsive-stack th,
  .table-wrap.responsive-stack td,
  .table-wrap.responsive-stack tr { display: block; }
  .table-wrap.responsive-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap.responsive-stack tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7em .9em;
    margin-bottom: .7em;
  }
  .table-wrap.responsive-stack tfoot tr { padding: .5em 0; }
  .table-wrap.responsive-stack td {
    border: none;
    padding: .3em 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1em;
    text-align: right;
  }
  .table-wrap.responsive-stack td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: .76rem;
    font-weight: 600;
    text-align: left;
    flex-shrink: 0;
  }
  .table-wrap.responsive-stack tr:nth-child(even) td { background: transparent; }
}
.num { white-space: nowrap; }
