:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --text: #14172b;
  --muted: #6b7080;
  --muted-soft: #9297a8;
  --border: #e7e8f0;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0fe;
  --primary-soft-text: #4338ca;
  --danger: #e11d48;
  --danger-hover: #be123c;
  --danger-soft: #fdeef1;
  --acil-bg: #fdeef1;
  --acil-text: #be123c;
  --uyari-bg: #fef4e6;
  --uyari-text: #b45309;
  --bilgi-bg: #eaf1ff;
  --bilgi-text: #1d4ed8;
  --pinned-bg: #14172b;
  --pinned-text: #ffffff;
  --expired-bg: #f1f2f6;
  --expired-text: #6b7080;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(20, 23, 43, 0.04);
  --shadow: 0 4px 14px rgba(20, 23, 43, 0.06);
  --shadow-lg: 0 16px 40px rgba(20, 23, 43, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Brand ---------- */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  padding: 14px 26px;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.35);
}

.brand-mark-sm {
  font-size: 14px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* ---------- Login ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 20% 20%, #eef0ff 0%, var(--bg) 45%),
    radial-gradient(circle at 80% 85%, #f3e8ff 0%, var(--bg) 50%);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 0 6px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

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

/* ---------- Buttons ---------- */

button {
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  font-family: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

button:active { transform: translateY(1px); }

.btn-block { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #f3f4f8; border-color: #d7d9e4; }

.error-text { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 16px; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar .who { color: rgba(255, 255, 255, 0.85); font-size: 13px; }
.topbar .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.topbar .btn-secondary:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- Layout ---------- */

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.hint-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  color: var(--primary-soft-text);
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.hint-icon { font-size: 15px; flex-shrink: 0; }

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

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Announcement cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.card:hover { box-shadow: var(--shadow); }

.card.dragging { opacity: 0.4; }
.card.drag-over-top { border-top-color: var(--primary); }
.card.drag-over-bottom { border-bottom-color: var(--primary); }

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drag-handle {
  cursor: grab;
  color: var(--muted-soft);
  font-size: 17px;
  line-height: 1.4;
  padding: 2px 4px;
  user-select: none;
  flex-shrink: 0;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.drag-handle:hover { background: var(--bg); color: var(--muted); }
.drag-handle:active { cursor: grabbing; }

.item-content { flex: 1; min-width: 0; }

.item-title { font-size: 15.5px; font-weight: 700; margin: 0 0 5px; letter-spacing: -0.01em; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }

.badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge.acil { background: var(--acil-bg); color: var(--acil-text); }
.badge.uyari { background: var(--uyari-bg); color: var(--uyari-text); }
.badge.bilgi { background: var(--bilgi-bg); color: var(--bilgi-text); }
.badge.pinned { background: var(--pinned-bg); color: var(--pinned-text); }
.badge.expired { background: var(--expired-bg); color: var(--expired-text); }

.item-dates { font-size: 12px; color: var(--muted-soft); margin-bottom: 4px; }
.item-body { font-size: 13.5px; margin-top: 8px; white-space: pre-wrap; color: #3a3d4d; line-height: 1.55; }

.item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.item-actions button { padding: 7px 14px; font-size: 13px; box-shadow: none; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 56px 20px;
  background: var(--card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 23, 43, 0.5);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  animation: fade-in 0.12s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
}

.modal h2 { margin-top: 0; font-size: 18px; }

.row { display: flex; gap: 12px; }
.row > div { flex: 1; }

.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px;
}
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 22px;
}

[hidden] { display: none !important; }

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .login-card { padding: 28px 22px; }
  .brand-mark { font-size: 19px; padding: 12px 22px; }

  .topbar { padding: 12px 16px; }
  .topbar-right { gap: 10px; }
  .topbar .who { display: none; }

  .container { padding: 20px 14px 48px; }

  .toolbar { flex-wrap: wrap; gap: 10px; }

  .card { padding: 14px 14px; }

  .item-head { flex-wrap: wrap; row-gap: 12px; }

  .item-actions {
    flex-basis: 100%;
    justify-content: flex-end;
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .modal { padding: 20px; }
  .row { flex-direction: column; gap: 0; }
}
