:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;

  /* Pastel aksanlar */
  --p1: #c7d2fe;   /* pastel indigo */
  --p2: #bbf7d0;   /* pastel green */
  --p3: #fde68a;   /* pastel amber */
  --p4: #fecaca;   /* pastel red */
  --btn: #111827;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(900px 500px at 10% 0%, var(--p1), transparent 55%),
              radial-gradient(800px 500px at 90% 10%, var(--p2), transparent 55%),
              radial-gradient(700px 450px at 30% 100%, var(--p3), transparent 50%),
              var(--bg);
  color: var(--text);
}

.container{
  max-width: 1020px;
  margin: 26px auto;
  padding: 0 14px;
}

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

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
}
.badge{
  width:34px; height:34px;
  border-radius:12px;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.nav{
  display:flex; gap:10px; flex-wrap:wrap;
}
.nav a{
  text-decoration:none;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.75);
  color: var(--text);
  box-shadow: 0 8px 22px rgba(0,0,0,.05);
}
.nav a:hover{ transform: translateY(-1px); }

.card{
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,.08);
  margin-bottom: 14px;
}

.h1{
  margin:0 0 6px;
  font-size: 18px;
  letter-spacing: .2px;
}
.muted{ color: var(--muted); font-size: 12px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

label{
  display:block;
  font-size:12px;
  margin: 10px 0 6px;
  color: #374151;
}
input, select{
  width:100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  outline:none;
}
input:focus, select:focus{
  border-color: #cbd5e1;
  box-shadow: 0 0 0 4px rgba(199,210,254,.35);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 0;
  background: var(--btn);
  color: #fff;
  cursor:pointer;
  box-shadow: 0 12px 24px rgba(17,24,39,.18);
}
.btn:hover{ transform: translateY(-1px); }

.alert-ok{
  background: rgba(187,247,208,.6);
  border: 1px solid rgba(187,247,208,.9);
  color: #14532d;
  padding: 10px 12px;
  border-radius: 14px;
  margin-top: 12px;
}
.alert-err{
  background: rgba(254,202,202,.6);
  border: 1px solid rgba(254,202,202,.9);
  color: #7f1d1d;
  padding: 10px 12px;
  border-radius: 14px;
  margin-top: 12px;
}

/* =========================
   TABLE (GENEL)
========================= */
.tablewrap{
  width: 100%;
  max-width: 100%;
  overflow-x: auto;                 /* tablo alanı gerekirse kendi içinde kayar */
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}

table{
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,.85);
}

/* varsayılan tablo hücresi: artık nowrap YOK */
th, td{
  text-align:left;
  padding: 12px;
  border-bottom: 1px solid rgba(229,231,235,.9);
  font-size: 14px;

  white-space: normal;             /* KIRILABİLSİN */
  overflow-wrap: anywhere;         /* boşluksuz uzun şeyler de kırılsın */
  word-break: break-word;
}

th{
  font-size: 12px;
  color: #374151;
  background: rgba(249,250,251,.95);
}

/* =========================
   TODO TABLO (ÖZEL)
========================= */
.todo-table{
  width: 100% !important;
  table-layout: fixed !important;  /* EN KRİTİK: tablo ekranı aşmasın */
}

/* İşlem sütunu genişliği */
.todo-table td.actions{
  width: 360px;                    /* istersen 300-420 arası oynat */
}

/* Butonlar alt satıra insin */
.todo-table td.actions .action-wrap{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

/* Buton yazıları tek parça kalsın ama butonlar alt satıra iner */
.todo-table td.actions .btn,
.todo-table td.actions .logout{
  white-space: nowrap;
}

/* =========================
   SAYFA TAŞMASINI KAPAT
========================= */
html, body{
  max-width: 100%;
  overflow-x: hidden;              /* sayfa sağa kaymasın */
}
/* ===== TODO PAGE: YATAY SCROLL KESİN KAPAT ===== */
body.todo-page{
  overflow-x: hidden !important;
}

body.todo-page .container{
  max-width: 1020px;        /* sende zaten var */
  overflow-x: hidden !important;
}

/* tablewrap asla scroll üretmesin */
body.todo-page .tablewrap{
  overflow-x: hidden !important;
}

/* tablo taşmasın */
body.todo-page table.todo-table{
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}

/* hücreler kırılarak sığsın */
body.todo-page table.todo-table th,
body.todo-page table.todo-table td{
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* işlem hücresi: butonlar alt alta */
body.todo-page table.todo-table td.actions .action-wrap{
  display: grid !important;
  gap: 6px !important;
}

body.todo-page table.todo-table td.actions .btn,
body.todo-page table.todo-table td.actions .logout{
  width: 100% !important;
  white-space: normal !important;
}