:root {
  --bg: #0f172a;
  --card: #111827;
  --card-soft: #1f2937;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255,255,255,.08);
  --accent: #f97316;
  --accent-soft: rgba(249,115,22,.16);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --blue: #60a5fa;
  --purple: #c084fc;
  --shadow: 0 18px 50px rgba(0,0,0,.26);
}

body.light {
  --bg: #f3f4f6;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: rgba(15,23,42,.08);
  --shadow: 0 18px 50px rgba(15,23,42,.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(249,115,22,.22), transparent 30%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button,input,textarea,select { font: inherit; }
button { border: 0; cursor: pointer; }
h1,h2,h3,p { margin: 0; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.top-header {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 12px;
  padding: 18px 18px 12px;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, var(--bg), rgba(15,23,42,.70));
}
body.light .top-header { background: linear-gradient(to bottom, var(--bg), rgba(243,244,246,.78)); }
.header-title { min-width: 0; }
h1 { font-size: 25px; letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h2 { font-size: 20px; letter-spacing: -.03em; }
.eyebrow { display:block; color:var(--accent); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; margin-bottom:4px; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card-soft); color: var(--text);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
}

.side-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.52); }
.side-menu {
  width: min(330px, calc(100% - 52px)); height: 100%;
  background: var(--card); border-right: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 18px; animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0;} to { transform: translateX(0); opacity:1;} }
.side-menu-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.menu-item {
  width:100%; display:flex; align-items:center; gap:12px;
  min-height:52px; padding:0 14px; margin-bottom:8px;
  border-radius:18px; background:var(--card-soft); color:var(--text); border:1px solid var(--line);
  font-weight:900;
}
.menu-item.active { background: var(--accent); color:white; border-color:transparent; }

.page { display:none; }
.page.active { display:block; }
.main-content,.report-page { padding: 8px 14px 22px; }

.today-card,.intervention-card,.report-card {
  background: rgba(17,24,39,.92);
  border:1px solid var(--line); border-radius:28px; box-shadow:var(--shadow);
  padding:18px; margin-bottom:14px;
}
body.light .today-card,body.light .intervention-card,body.light .report-card { background: rgba(255,255,255,.92); }

.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:18px; }
.section-head.compact { align-items:center; margin-bottom:14px; }
.badge {
  padding:8px 11px; border-radius:999px;
  background:var(--accent-soft); color:var(--accent);
  font-size:12px; font-weight:800; white-space:nowrap;
}
.badge.weekend { background: rgba(96,165,250,.16); color: var(--blue); }
.badge.holiday { background: rgba(168,85,247,.17); color: var(--purple); }
.badge.leave { background: rgba(34,197,94,.15); color: var(--success); }

.date-navigator { display:grid; grid-template-columns:52px 1fr 52px; gap:8px; margin-bottom:14px; }
.nav-day-btn,.nav-today-btn {
  min-height:44px; border-radius:16px; background:var(--card-soft); color:var(--text);
  border:1px solid var(--line); font-weight:900;
}
.nav-day-btn { font-size:28px; line-height:1; }
.nav-day-btn:disabled { opacity:.35; cursor:not-allowed; }

.holiday-info {
  padding:12px; margin-bottom:13px; border-radius:18px;
  background:rgba(168,85,247,.13); border:1px solid rgba(168,85,247,.25);
  color:#d8b4fe; font-size:13px; font-weight:800; line-height:1.35;
}
.hidden { display:none !important; }

.day-mode-panel {
  background:var(--card-soft); border:1px solid var(--line); border-radius:20px;
  padding:12px; margin-bottom:13px;
}
.day-mode-panel > span { display:block; color:var(--muted); font-size:12px; font-weight:800; margin-bottom:9px; }
.chip-row { display:flex; gap:8px; overflow-x:auto; padding-bottom:1px; }
.chip-btn,.report-category {
  min-height:38px; border-radius:999px; padding:0 13px;
  background:rgba(255,255,255,.04); border:1px solid var(--line); color:var(--muted);
  font-weight:900; white-space:nowrap;
}
.chip-btn.active,.report-category.active { background:var(--accent); color:white; border-color:transparent; }

.time-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.time-box,.stat-card {
  background:var(--card-soft); border:1px solid var(--line); border-radius:20px; padding:14px;
}
.time-box span,.stat-card span { display:block; color:var(--muted); font-size:12px; font-weight:700; margin-bottom:6px; }
.time-box strong { font-size:22px; letter-spacing:-.03em; }

.action-row,.sub-action-row,.export-grid,.filter-grid { display:grid; gap:10px; }
.action-row { grid-template-columns:1fr 1fr; margin-top:16px; }
.sub-action-row { grid-template-columns:1fr 1fr; margin-top:10px; }
.export-grid { grid-template-columns:repeat(3,1fr); margin-top:10px; }
.filter-grid { grid-template-columns:1fr 1fr; }

.primary-btn,.secondary-btn,.ghost-btn,.small-btn {
  min-height:48px; border-radius:17px; font-weight:900;
  transition:transform .12s ease, opacity .12s ease;
}
.primary-btn:active,.secondary-btn:active,.ghost-btn:active,.small-btn:active,.duration-btn:active,.nav-day-btn:active,.nav-today-btn:active,.chip-btn:active { transform:scale(.97); }
.primary-btn { color:white; background:linear-gradient(135deg,#f97316,#fb923c); box-shadow:0 12px 24px rgba(249,115,22,.28); }
.secondary-btn { color:var(--text); background:var(--card-soft); border:1px solid var(--line); }
.ghost-btn { color:var(--muted); background:var(--card-soft); border:1px solid var(--line); }
.ghost-btn.danger { color:var(--danger); background:rgba(239,68,68,.10); }
.small-btn { min-height:40px; padding:0 14px; color:white; background:var(--accent); }
.full { width:100%; }

.quick-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin-bottom:14px; }
.stat-card { padding:13px 10px; }
.stat-card strong { font-size:17px; letter-spacing:-.03em; }

.intervention-list { display:flex; flex-direction:column; gap:10px; }
.intervention-list.empty { color:var(--muted); background:var(--card-soft); border:1px dashed var(--line); border-radius:20px; padding:18px; text-align:center; }
.intervention-item,.leave-item {
  display:grid; grid-template-columns:1fr auto; gap:10px;
  background:var(--card-soft); border:1px solid var(--line); border-radius:20px; padding:13px;
}
.intervention-item strong,.leave-item strong { display:block; font-size:15px; }
.intervention-item p,.leave-item p { color:var(--muted); font-size:13px; margin-top:4px; line-height:1.35; }
.delete-mini { width:34px; height:34px; border-radius:12px; color:var(--danger); background:rgba(239,68,68,.12); }

.tab-row { display:grid; grid-template-columns:repeat(3,1fr); background:var(--card-soft); border-radius:18px; padding:5px; gap:5px; }
.tab-btn { height:38px; border-radius:14px; background:transparent; color:var(--muted); font-weight:900; }
.tab-btn.active { background:var(--accent); color:white; }

.report-category-grid { display:flex; gap:8px; overflow-x:auto; margin-bottom:14px; }
.report-output { margin-top:12px; display:grid; gap:9px; }
.report-row { display:flex; justify-content:space-between; gap:10px; background:var(--card-soft); border:1px solid var(--line); border-radius:17px; padding:12px; }
.report-row span { color:var(--muted); font-weight:700; }
.report-row strong { text-align:right; }
.hint-text { color:var(--muted); font-size:13px; line-height:1.45; margin-top:12px; }

.detail-table-wrap { overflow-x:auto; border-radius:18px; border:1px solid var(--line); }
.detail-table { width:100%; min-width:1020px; border-collapse:collapse; background:var(--card-soft); }
.detail-table th,.detail-table td { padding:11px; border-bottom:1px solid var(--line); text-align:left; font-size:13px; vertical-align:top; }
.detail-table th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }

.sticky-summary {
  position:fixed; left:50%; bottom:14px; transform:translateX(-50%);
  width:min(492px, calc(100% - 24px)); z-index:30;
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:14px 16px; border:1px solid var(--line); border-radius:24px;
  background:rgba(17,24,39,.88); backdrop-filter:blur(18px); box-shadow:var(--shadow);
}
body.light .sticky-summary { background:rgba(255,255,255,.88); }
.sticky-summary span { color:var(--muted); font-size:12px; font-weight:800; }
.sticky-summary strong { display:block; font-size:15px; margin-top:2px; }
.diff { padding:8px 10px; border-radius:999px; font-weight:900; white-space:nowrap; }
.diff.positive { color:var(--success); background:rgba(34,197,94,.14); }
.diff.negative { color:var(--danger); background:rgba(239,68,68,.14); }
.diff.neutral { color:var(--muted); background:var(--card-soft); }

.modal-backdrop { position:fixed; inset:0; z-index:90; display:flex; align-items:flex-end; justify-content:center; padding:14px; background:rgba(0,0,0,.55); }
.modal-card,.message-card {
  width:min(492px,100%); background:var(--card); border:1px solid var(--line);
  border-radius:28px; padding:18px; box-shadow:var(--shadow); animation:modalUp .18s ease-out;
}
.message-card { text-align:center; padding:24px 18px; }
@keyframes modalUp { from{opacity:0; transform:translateY(18px);} to{opacity:1; transform:translateY(0);} }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }

.field { display:block; margin-bottom:13px; }
.field.mini { margin-bottom:0; }
.field > span { display:block; color:var(--muted); font-size:13px; font-weight:800; margin-bottom:7px; }
input,textarea,select {
  width:100%; border:1px solid var(--line); border-radius:17px;
  background:var(--card-soft); color:var(--text); outline:none;
  padding:13px 14px; resize:none;
}
.duration-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.duration-btn { min-height:42px; border-radius:14px; background:var(--card-soft); color:var(--muted); border:1px solid var(--line); font-weight:900; }
.duration-btn.active { background:var(--accent-soft); color:var(--accent); border-color:rgba(249,115,22,.35); }

.switch-row {
  display:flex; justify-content:space-between; align-items:center; gap:14px;
  padding:13px 0; border-bottom:1px solid var(--line); color:var(--text); font-weight:800;
}
.switch-row input { width:22px; height:22px; accent-color: var(--accent); }

.message-icon {
  width:54px; height:54px; margin:0 auto 12px; border-radius:50%;
  background:var(--accent-soft); color:var(--accent); display:flex; align-items:center; justify-content:center;
  font-size:24px; font-weight:900;
}
.message-card p { color:var(--muted); margin-top:8px; line-height:1.45; }
.message-actions { display:grid; grid-template-columns:1fr; gap:9px; margin-top:18px; }
.message-actions.two { grid-template-columns:1fr 1fr; }

@media (min-width:760px) {
  .app-shell { max-width:960px; }
  .main-content { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  .today-card { grid-column:span 2; }
  .quick-stats { grid-column:span 2; }
}


/* v4 refinements */
html, body { overflow-x: hidden; }
.app-shell { overflow-x: hidden; }

.page { display: none !important; }
.page.active { display: block !important; }

@media (min-width: 760px) {
  .main-content.page.active {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .report-page.page.active {
    display: block !important;
  }

  .main-content.page:not(.active),
  .report-page.page:not(.active) {
    display: none !important;
  }
}

.compact-mode { padding: 10px 12px; }
.day-mode-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.day-mode-title > span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.link-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 900; }
.mini-help { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.45; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  width: min(492px, calc(100% - 24px));
  z-index: 120;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(17,24,39,.94);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: toastIn .18s ease-out;
}
body.light .toast { background: rgba(255,255,255,.94); }
.toast .toast-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--accent); flex: 0 0 auto; }
.toast.success .toast-dot { background: var(--success); }
.toast.warning .toast-dot { background: var(--warning); }
.toast.danger .toast-dot { background: var(--danger); }
.toast strong { display: block; font-size: 14px; margin-bottom: 2px; }
.toast span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

button:disabled { cursor: not-allowed; }


/* v5 refinements */
.day-mode-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.link-pill-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
}

.toast-host {
  left: auto !important;
  right: 16px !important;
  top: 76px !important;
  bottom: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: min(360px, calc(100% - 32px));
  justify-items: end;
}

.toast {
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
}

.excel-report-table {
  border-collapse: collapse;
  width: 100%;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.excel-report-table th {
  background: #f97316;
  color: #ffffff;
  font-weight: bold;
  border: 1px solid #c2410c;
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

.excel-report-table td {
  border: 1px solid #dddddd;
  padding: 7px;
  vertical-align: top;
  mso-number-format: "\\@";
}

.excel-summary-table {
  border-collapse: collapse;
  width: 100%;
  font-family: Arial, sans-serif;
  margin-bottom: 14px;
}

.excel-summary-table td {
  border: 1px solid #dddddd;
  padding: 8px;
}

.excel-summary-table .label {
  background: #f3f4f6;
  color: #555555;
  font-weight: bold;
}

.link-as-button{display:flex;align-items:center;justify-content:center;text-decoration:none;margin-top:14px;}

/* iPhone date/time input fix - sadece rapor, izin ve çalışma saati alanları */
@media (max-width: 600px) {
    .mobile-date-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

        .mobile-date-grid .field {
            min-width: 0 !important;
            width: 100% !important;
        }

        .mobile-date-grid input[type="date"],
        .mobile-date-grid input[type="time"] {
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
            font-size: 16px !important;
            height: 48px !important;
            padding: 0 12px !important;
            -webkit-appearance: none !important;
            appearance: none !important;
        }

        .mobile-date-grid input::-webkit-date-and-time-value {
            text-align: left;
        }
}