:root {
  --bg-deep: #050816;
  --bg-card: rgba(18, 24, 42, 0.72);
  --stroke: rgba(120, 162, 255, 0.18);
  --text: #e8ecff;
  --muted: #9aa4c7;
  --accent: #3ee0b8;
  --accent-2: #6b8cff;
  --danger: #ff6b8a;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

.app-body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #1a2a4a 0%, transparent 55%),
    radial-gradient(900px 500px at 90% 0%, #132a38 0%, transparent 50%),
    var(--bg-deep);
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black, transparent);
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  background: #2a6bff;
  top: -120px;
  left: -80px;
}

.bg-glow-2 {
  background: #1ad4b0;
  bottom: -160px;
  right: -100px;
}

.glass {
  background: rgba(12, 18, 34, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.glass-light {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--stroke);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), #a78bfa, var(--accent));
  box-shadow: 0 8px 28px rgba(62, 224, 184, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-main a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.nav-main a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem 0.35rem 0.85rem;
  border-radius: 999px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--muted);
}

.user-meta strong {
  color: var(--text);
  font-size: 0.85rem;
}

.main-wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-head {
  margin-bottom: 1.75rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 1.25rem;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 8, 22, 0.6);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(62, 224, 184, 0.45);
  border-color: rgba(62, 224, 184, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(120deg, var(--accent), #2dd4bf);
  color: #041016;
  box-shadow: 0 12px 36px rgba(62, 224, 184, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 16px 44px rgba(62, 224, 184, 0.45);
}

.btn-secondary {
  background: rgba(107, 140, 255, 0.2);
  color: var(--text);
  border: 1px solid rgba(107, 140, 255, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: rgba(255, 107, 138, 0.2);
  color: #ffb3c4;
  border: 1px solid rgba(255, 107, 138, 0.4);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(255, 107, 138, 0.12);
  border: 1px solid rgba(255, 107, 138, 0.35);
  color: #ffc2d0;
}

.alert-success {
  background: rgba(62, 224, 184, 0.12);
  border: 1px solid rgba(62, 224, 184, 0.35);
  color: #b8fff0;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.data th,
table.data td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

table.data tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.2);
}

.pill.is-active {
  border-color: rgba(62, 224, 184, 0.5);
  color: var(--accent);
  background: rgba(62, 224, 184, 0.1);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 2rem 2rem 2.25rem;
}

.login-hero {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-hero h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.login-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
}

.stat span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: 0.25rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

hr.soft {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 1.25rem 0;
}

/* —— Takvim (ajanda) —— */
.calendar-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .calendar-layout {
    grid-template-columns: 1fr minmax(300px, 380px);
  }
}

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cal-toolbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cal-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
}

.cal-nav a:hover {
  border-color: rgba(62, 224, 184, 0.45);
  color: var(--accent);
}

.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.cal-dow {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.25rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell {
  min-height: 92px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 8, 22, 0.45);
  padding: 6px 6px 4px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell:hover {
  border-color: rgba(107, 140, 255, 0.35);
}

.cal-cell--outside {
  opacity: 0.38;
}

.cal-cell--today {
  border-color: rgba(62, 224, 184, 0.55);
  box-shadow: inset 0 0 0 1px rgba(62, 224, 184, 0.2);
}

.cal-cell.is-selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(107, 140, 255, 0.25);
}

.cal-cell-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.cal-cell-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.cal-chip {
  font-size: 0.65rem;
  line-height: 1.2;
  padding: 2px 5px;
  border-radius: 6px;
  background: linear-gradient(120deg, rgba(62, 224, 184, 0.25), rgba(107, 140, 255, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-chip--more {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-style: dashed;
}

.cal-side-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.cal-side-empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.cal-event-block {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0.85rem;
  margin-bottom: 0.65rem;
  background: rgba(255, 255, 255, 0.02);
}

.cal-event-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

/* —— Modal —— (kök .modal-root JS ile body sonuna taşınır — fixed konumu garanti) */
.modal-root {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-root[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 0;
  background: rgba(2, 4, 12, 0.72);
  backdrop-filter: blur(8px);
}

.modal-sheet {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(28rem, calc(100% - 1.5rem));
  max-width: min(28rem, calc(100vw - 1.5rem));
  min-width: 0;
  min-height: 0;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: auto;
  margin-top: max(0.75rem, env(safe-area-inset-top, 0px));
  margin-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  max-height: min(80dvh, calc(100dvh - 5.5rem), calc(100vh - 5.5rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  animation: modalIn 0.2s ease-out;
}

.modal-sheet.card {
  padding: 1rem 1.1rem;
}

@keyframes modalIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  min-width: 0;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.task-split {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.task-split h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(107, 140, 255, 0.2);
  color: #b8c9ff;
}

.task-badge--done {
  background: rgba(62, 224, 184, 0.2);
  color: var(--accent);
}

.task-table {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
}

.task-row-head,
.task-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(88px, 0.75fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .task-row-head,
  .task-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .task-row-head .task-col:nth-child(n + 2) {
    display: none;
  }

  .task-row .task-col-dates::before {
    content: "Tarih: ";
    color: var(--muted);
    font-size: 0.75rem;
  }

  .task-row .task-col-atanan::before {
    content: "Atanan: ";
    color: var(--muted);
    font-size: 0.75rem;
  }

  .task-row .task-col-durum {
    justify-self: start;
  }
}

.task-row-head {
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: default;
}

.task-row-head:hover,
.task-row-head:focus {
  background: rgba(0, 0, 0, 0.35);
}

.task-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.12s;
}

.task-row:hover,
.task-row:focus {
  background: rgba(107, 140, 255, 0.08);
  outline: none;
}

.task-row:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(62, 224, 184, 0.35);
}

.task-col-title {
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-col-dates,
.task-col-atanan {
  color: var(--muted);
  font-size: 0.82rem;
  min-width: 0;
}

.task-col-durum {
  justify-self: end;
}

.task-durum-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  white-space: nowrap;
}

.task-durum-pill--tamam {
  border-color: rgba(62, 224, 184, 0.4);
  color: var(--accent);
  background: rgba(62, 224, 184, 0.08);
}

.modal-sheet--lg {
  width: min(32rem, calc(100% - 1.5rem));
  max-width: min(32rem, calc(100vw - 1.5rem));
}

.modal-sheet textarea {
  max-height: 12rem;
  min-height: 4rem;
}
