/* Ortak tasarım dili: renkler, tipografi, düğmeler, formlar, pencere ve bildirimler. */
:root {
  --paper: #f5f0e8;
  --paper-2: #ece5d9;
  --card: #fffdf9;
  --ink: #1b1714;
  --ink-2: #5e554c;
  --ink-3: #8b8177;
  --line: #ddd4c6;
  --dark: #141110;
  --dark-2: #211c18;
  --accent: #c8502b;
  --accent-dark: #a63e1e;
  --accent-soft: #f7e3d9;
  --ok: #2b7556;
  --ok-soft: #dcefe5;
  --warn: #9a6614;
  --warn-soft: #f8ecd0;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 23, 20, 0.06), 0 10px 28px rgba(27, 23, 20, 0.09);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
}

/* ---------- Düğmeler ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0 1.25em;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:hover {
  background: #000;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink-3);
}

.btn--danger {
  background: transparent;
  color: #a12a1c;
  border-color: #e3bdb6;
}

.btn--danger:hover {
  background: #fbe9e6;
}

.btn--sm {
  min-height: 36px;
  padding: 0 0.95em;
  font-size: 0.85rem;
}

.btn--lg {
  min-height: 52px;
  padding: 0 1.6em;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Formlar ---------- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field > span,
.label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-2);
}

.field small {
  color: var(--ink-3);
  font-size: 0.8rem;
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.input {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(200, 80, 43, 0.18);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #fbe9e6;
  color: #8c2416;
  font-size: 0.92rem;
  font-weight: 600;
}

/* ---------- Rozetler ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge--selecting {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.badge--editing {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge--delivered {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge--expired {
  background: #e7e2da;
  color: var(--ink-3);
}

.dot {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

/* ---------- Pencere (modal) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 17, 16, 0.55);
  animation: fade 0.15s ease-out;
}

.modal__box {
  width: min(100%, 480px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  animation: rise 0.2s ease-out;
}

.modal__box--wide {
  width: min(100%, 620px);
}

.modal__title {
  font-size: 1.45rem;
  margin-bottom: 10px;
}

.modal__text {
  color: var(--ink-2);
  margin-bottom: 18px;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- Bildirim ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 400;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease-out;
}

.toast--error {
  background: #8c2416;
}

.toast--ok {
  background: var(--ok);
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
