/* ══════════════════════════════════════════════════
   IZIN FORM — STYLES
   ══════════════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ── */
:root {
  --accent: #7c5af0;
  --accent-soft: #7c5af018;
  --accent-hover: #8e6ff5;
  --green: #22c55e;
  --blue: #38bdf8;
  --blue-soft: #38bdf812;
  --red-soft: #f8717112;
  --red: #f87171;
  --yellow: #f59e0b;
  --teal: #10b981;
  --gray: #94a3b8;
  --orange: #f97316;
  --pink: #ec4899;
  --lime: #84cc16;
  --radius: 10px;
}

[data-theme="dark"] {
  --bg: #0c0c11;
  --surface: #14141c;
  --surface2: #1a1a25;
  --surface3: #20202e;
  --border: #26263a;
  --text: #e2e2f0;
  --text2: #9898b8;
  --muted: #585878;
  --shadow: 0 4px 24px #00000060;
}

[data-theme="light"] {
  --bg: #f0f0f6;
  --surface: #ffffff;
  --surface2: #f5f5fa;
  --surface3: #ebebf4;
  --border: #dcdce8;
  --text: #1a1a2e;
  --text2: #505070;
  --muted: #9898b8;
  --shadow: 0 4px 24px #00000018;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  transition: background .2s, color .2s;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.logo-wrap { display: flex; align-items: center; gap: 10px; }
.logo-svg { height: 18px; width: auto; }
.topbar-divider { width: 1px; height: 22px; background: var(--border); }
.topbar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px #7c5af040;
}
.btn-ghost {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

/* ── LAYOUT ── */
.main-content {
  padding: 20px 24px;
  display: flex;
  justify-content: center;
}
.form-container { width: 100%; max-width: 700px; padding-bottom: 40px; }
.form-actions { display: flex; gap: 8px; padding: 16px 0; flex-wrap: wrap; }

/* ── FORM SECTIONS ── */
.section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  overflow: visible;
}
.section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── FORM FIELDS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .04em;
}
.req { color: var(--red); }

.field input,
.field select,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
#mailBody { resize: none; overflow: hidden; }

/* ── FOOTER ── */
.made-by {
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
  padding-top: 6px;
  opacity: .75;
}

/* Date/time — click anywhere to open picker */
.field input[type="date"],
.field input[type="time"] { cursor: pointer; position: relative; }
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Validation */
.field input:invalid:not(:placeholder-shown),
.field input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.sig-canvas-wrap.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

/* ── IZIN TYPE GRID ── */
.gun-display {
  font-family: 'DM Mono', monospace;
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
  padding: 3px 0;
}
.izin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.izin-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.izin-option:hover { border-color: var(--accent); }
.izin-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.izin-option.selected .check-box { background: var(--accent); border-color: var(--accent); }
.izin-option.selected .check-box::after { opacity: 1; }

.check-box {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
  position: relative;
  transition: all .15s;
}
.check-box::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0;
  width: 5px;
  height: 8px;
  border: 1.5px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .1s;
}
.izin-label { font-size: 11px; color: var(--text); }

/* ── IZIN ENTRIES ── */
.entry-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}
.entry-remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
}
.entry-remove:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.izin-entries { display: flex; flex-direction: column; gap: 10px; }
.izin-entry {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.izin-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.izin-entry-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.izin-entry-body { padding: 12px; }

.add-izin-btn {
  width: 100%;
  padding: 9px;
  border: 1.5px dashed var(--border);
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}
.add-izin-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ── SIGNATURE ── */
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .sig-grid { grid-template-columns: 1fr; } }

.sig-block { display: flex; flex-direction: column; gap: 6px; }
.sig-label { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

.sig-canvas-wrap {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 7px;
  background: #fff; /* imza mürekkebi koyu — koyu temada da beyaz kalmalı */
  overflow: hidden;
  cursor: crosshair;
  transition: border-color .15s;
}
.sig-canvas-wrap:hover { border-color: var(--accent); }
.sig-canvas-wrap.upload-mode { cursor: pointer; }
.sig-mode-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}
.sig-mode-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  background: var(--surface);
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sig-mode-btn + .sig-mode-btn { border-left: 1px solid var(--border); }
.sig-mode-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}
.sig-canvas-wrap.has-sig { border-style: solid; border-color: #7c5af060; }
.sig-clear-x {
  display: none;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  border: none;
  font-size: 11px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: opacity .15s;
  line-height: 1;
}
.sig-clear-x:hover { opacity: .8; }
.sig-canvas-wrap.has-sig .sig-clear-x { display: flex; }
.sig-canvas-wrap canvas { display: block; width: 100%; height: 90px; touch-action: none; }

.sig-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
  transition: opacity .2s;
}
.sig-placeholder.hidden { opacity: 0; }
.sig-placeholder svg { opacity: .2; }
.sig-placeholder { color: #9aa3af; }
.sig-placeholder span { font-size: 10px; color: #9aa3af; }

.sig-upload-input { display: none; }

/* ── MISC ── */
.multi-hint { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
}

/* ── TOAST ── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toast {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.toast.show { display: flex; animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.toast-ok { background: #0d2010; border: 1px solid #2d5a30; color: #4ade80; }
.toast-mail { background: #0a1a2a; border: 1px solid #1a4060; color: #38bdf8; }
[data-theme="light"] .toast-ok { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
[data-theme="light"] .toast-mail { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }

/* ── DATE PICKER ── */
.dp-wrapper,
.tp-wrapper { position: relative; }

.dp-popup,
.tp-popup {
  display: none;
  position: fixed;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 280px;
  animation: dpIn .15s ease;
}
.dp-popup.open,
.tp-popup.open { display: block; }
@keyframes dpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dp-title { font-size: 13px; font-weight: 600; color: var(--text); }
.dp-nav {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.dp-nav:hover { border-color: var(--accent); color: var(--accent); }

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.dp-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: all .1s;
  color: var(--text);
  position: relative;
}
.dp-day:not(.dp-empty):hover { background: var(--accent-soft); color: var(--accent); }
.dp-day.dp-empty { cursor: default; }
.dp-day.dp-weekend { color: var(--muted); }
.dp-day.dp-holiday {
  color: var(--red) !important;
  font-weight: 700;
}
.dp-day.dp-holiday::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}
/* Range — seçili tarih aralığı */
.dp-day.dp-in-range {
  background: #7c5af015;
  color: var(--accent);
}
.dp-day.dp-in-range.dp-weekend {
  background: #7c5af00a;
  color: var(--muted);
}
.dp-day.dp-range-holiday {
  background: #ef444418 !important;
  color: var(--red) !important;
}
.dp-day.dp-range-start,
.dp-day.dp-range-end {
  background: var(--accent) !important;
  color: white !important;
  font-weight: 700;
}
.dp-day.dp-range-start { border-radius: 7px 0 0 7px; }
.dp-day.dp-range-end { border-radius: 0 7px 7px 0; }
.dp-day.dp-range-start.dp-range-end { border-radius: 7px; }

.dp-day.dp-today {
  border: 1.5px solid var(--accent);
}
.dp-day.dp-selected {
  background: var(--accent) !important;
  color: white !important;
}
.dp-day.dp-selected::after { background: white; }

/* Holiday tooltip */
.dp-day.dp-holiday { position: relative; }
.dp-day.dp-holiday .dp-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.dp-day.dp-holiday .dp-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--red);
}
.dp-day.dp-holiday:hover .dp-tooltip { display: block; }

/* ── TIME PICKER ── */
.tp-popup {
  min-width: 120px;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.tp-option {
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  color: var(--text);
  transition: all .1s;
}
.tp-option:hover { background: var(--accent-soft); color: var(--accent); }
.tp-option.tp-selected { background: var(--accent); color: white; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .15s;
}
.theme-toggle:hover { border-color: var(--accent); }
