:root {
  --ink: #0f2744;
  --ink-soft: #3a4f6a;
  --paper: #f3f6f9;
  --panel: #ffffff;
  --line: #c9d4e3;
  --brand: #0b6e4f;
  --brand-dark: #085540;
  --accent: #b42318;
  --warn: #9a6700;
  --ok: #0b6e4f;
  --shadow: 0 1px 0 rgba(15, 39, 68, 0.06), 0 8px 24px rgba(15, 39, 68, 0.06);
  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9e8f5 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #d7eee4 0%, transparent 50%),
    linear-gradient(180deg, #e8eef5 0%, var(--paper) 40%, #eef2f6 100%);
  min-height: 100vh;
}

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

.topbar {
  background: linear-gradient(90deg, #0f2744 0%, #163a5f 55%, #0b6e4f 160%);
  color: #fff;
  border-bottom: 3px solid #c9a227;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.brand span { font-size: 0.78rem; opacity: 0.85; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.topbar nav a { color: #e8eef5; font-size: 0.9rem; }
.topbar nav a:hover { color: #fff; }
.btn-link {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 0 0 6px;
  font-weight: 600;
}
.page-sub { margin: 0 0 24px; color: var(--ink-soft); }

.flash {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: #e8f6ef;
  color: var(--brand-dark);
}
.flash-error {
  background: #fdecea;
  color: var(--accent);
}

.grid-services {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}
.service {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
  display: block;
  color: inherit;
  text-decoration: none;
  min-height: 118px;
}
.service:hover {
  transform: translateY(-2px);
  border-color: #8eab9f;
  text-decoration: none;
}
.service h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}
.service p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.4; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.panel h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.stat .label { font-size: 0.8rem; color: var(--ink-soft); }
.stat .value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #e8eef5; color: var(--ink); }
.btn-danger { background: var(--accent); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e8eef5;
  color: var(--ink-soft);
}
.badge-ok { background: #e8f6ef; color: var(--ok); }
.badge-warn { background: #fff6db; color: var(--warn); }
.badge-danger { background: #fdecea; color: var(--accent); }

.person-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.avatar {
  width: 96px;
  height: 120px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #e8eef5;
}
.meta-list { display: grid; gap: 6px; }
.meta-list div { font-size: 0.95rem; }
.meta-list span { color: var(--ink-soft); display: inline-block; min-width: 140px; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(15,39,68,0.92), rgba(11,110,79,0.75)),
    radial-gradient(800px 400px at 20% 10%, #2a6f97, transparent);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.login-card h1 {
  font-family: var(--font-display);
  margin: 0 0 6px;
  font-size: 1.7rem;
}
.login-card p { margin: 0 0 20px; color: var(--ink-soft); }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .page-title { font-size: 1.5rem; }
  th { font-size: 0.72rem; }
}

/* --- Search / filters --- */
.topbar-inner { flex-wrap: wrap; }
.top-search {
  display: flex;
  gap: 6px;
  flex: 1 1 220px;
  max-width: 360px;
}
.top-search input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}
.top-search input::placeholder { color: rgba(255,255,255,0.65); }
.top-search button {
  border: 0;
  border-radius: 6px;
  background: #c9a227;
  color: #14233a;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}
.filter-bar, .inline-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input, .filter-bar select, .inline-search input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.empty-state { color: var(--ink-soft); margin: 8px 0; }
.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 18px 0 10px;
}

/* Tip colors */
.tip-haftalik, .badge.tip-haftalik, .chip.tip-haftalik, .matrix-cell.tip-haftalik, .cal-day.tip-haftalik {
  background: #e8f6ef !important;
  color: var(--ok);
}
.tip-ekstra, .badge.tip-ekstra, .chip.tip-ekstra, .matrix-cell.tip-ekstra, .cal-day.tip-ekstra {
  background: #fff6db !important;
  color: var(--warn);
}
.tip-kullandirma, .badge.tip-kullandirma, .chip.tip-kullandirma, .matrix-cell.tip-kullandirma, .cal-day.tip-kullandirma {
  background: #e7f0fb !important;
  color: #1d4f91;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: #e8eef5;
}
.legend { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Matrix */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.matrix-table { border-collapse: collapse; font-size: 0.75rem; min-width: 100%; }
.matrix-table th, .matrix-table td {
  border: 1px solid var(--line);
  text-align: center;
  padding: 4px 2px;
  min-width: 28px;
}
.matrix-table .sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  text-align: left;
  padding: 6px 8px;
  min-width: 120px;
  z-index: 1;
}
.matrix-cell { font-weight: 700; }
.today-col { outline: 2px solid var(--brand); outline-offset: -2px; background: rgba(11,110,79,0.06); }

/* Calendar */
.month-calendar { margin: 16px 0; }
.cal-head, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-head span {
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
}
.cal-day {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-day.empty { background: transparent; border-color: transparent; }
.cal-day strong { font-size: 0.9rem; }
.cal-day small { font-size: 0.7rem; text-transform: uppercase; font-weight: 600; }
.cal-day.is-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

@media print {
  .no-print, .topbar, .btn, form, nav { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
  .page-title { font-size: 1.4rem; }
}

/* --- İşletme takvimi --- */
.takvim-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .takvim-layout { grid-template-columns: 1fr; }
}
.takvim-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.takvim-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #999;
}
.dot-izin { background: #0b6e4f; }
.dot-et { background: #b42318; }
.dot-fatura { background: #1d4f91; }
.dot-gs { background: #9a6700; }
.takvim-grid .takvim-day {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease;
  position: relative;
}
.takvim-grid .takvim-day:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  text-decoration: none;
}
.takvim-day.has-data { background: #f7faf8; }
.takvim-day.is-selected {
  border-color: var(--brand-dark);
  box-shadow: inset 0 0 0 2px var(--brand);
  background: #e8f6ef;
}
.day-dots { display: flex; gap: 3px; flex-wrap: wrap; min-height: 10px; }
.day-ciro {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: auto;
}
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}
.takvim-detay .stats { margin-bottom: 8px; }

.stat-doner {
  border-color: var(--brand);
  background: linear-gradient(180deg, #e8f6ef, #fff);
}
.stat-doner .value { font-size: 1.75rem; color: var(--brand-dark); }
.izin-bos { color: var(--ok); font-weight: 600; font-size: 1.05rem; }
.mobile-sticky-bar {
  display: none;
}
@media (max-width: 720px) {
  .mobile-sticky-bar {
    display: block;
    position: sticky;
    bottom: 12px;
    z-index: 20;
    margin: 12px 0 24px;
  }
  .mobile-sticky-bar .btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
  }
  .form-grid { grid-template-columns: 1fr; }
  input, select, textarea, .btn { min-height: 44px; }
  .top-search { max-width: none; flex: 1 1 100%; order: 3; }
  .takvim-layout { grid-template-columns: 1fr; }
}

/* Yardim asistani */
.ajan-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  font-family: "IBM Plex Sans", sans-serif;
}
.ajan-toggle {
  background: var(--brand-dark, #0a5c42);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.ajan-panel {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: min(380px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--line, #c9d4e3);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.16);
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 520px);
  overflow: hidden;
}
.ajan-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #c9d4e3);
  background: #f4f8f6;
  position: relative;
}
.ajan-head strong { display: block; }
.ajan-sub { font-size: .8rem; color: #666; }
.ajan-close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #555;
}
.ajan-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafbfc;
}
.ajan-bubble {
  padding: 8px 11px;
  border-radius: 10px;
  font-size: .92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  max-width: 95%;
}
.ajan-bot { background: #fff; border: 1px solid #e2e8f0; align-self: flex-start; }
.ajan-user { background: #0b6e4f; color: #fff; align-self: flex-end; }
.ajan-thinking { opacity: .6; }
.ajan-confirm { width: 100%; max-width: 100%; }
.ajan-confirm-q { margin: 0 0 8px; font-weight: 600; }
.ajan-dl { margin: 0 0 10px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: .85rem; }
.ajan-dl dt { color: #666; }
.ajan-dl dd { margin: 0; font-weight: 500; }
.ajan-confirm-actions { display: flex; gap: 8px; }
.ajan-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line, #c9d4e3);
  background: #fff;
}
.ajan-form input {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--line, #c9d4e3);
  border-radius: 8px;
  padding: 0 10px;
}
.ajan-link { color: var(--brand, #0b6e4f); font-weight: 600; }
@media (max-width: 720px) {
  .ajan-widget { right: 10px; bottom: 10px; }
  .ajan-panel { bottom: 48px; }
}

.hatirlatma-panel h2 { margin-top: 0; }
.hatirlatma {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #c9d4e3);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
}
.hatirlatma-uyari { border-color: #c9a227; background: #fffbeb; }
.hatirlatma-bilgi { border-color: #93c5c0; background: #f0faf7; }
.hatirlatma strong { min-width: 110px; }
.hatirlatma span { flex: 1; color: #333; }
.karsilastirma-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.karsilastirma-grid h3 { margin: 0 0 8px; font-size: 1rem; }
@media (max-width: 720px) {
  .karsilastirma-grid { grid-template-columns: 1fr; }
}
