/* Kuşbakışı: zemin çuha yeşili masa, üstündeki her şey beyaz kâğıt ve porselen. */
:root {
  color-scheme: light;
  --font: 'Familjen Grotesk Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ground: #0f4a38;
  --ground-2: #155a45;
  --ground-3: #1e6b54;
  --ground-line: #2a7660;

  --paper: #fbfbf9;
  --paper-2: #f1f0e8;
  --paper-3: #e7e5da;
  --paper-line: #e3e1d6;
  --paper-line-strong: #c9c6b8;
  --ink: #21150e;
  --ink-2: #5a4c42;
  --ink-3: #6f6257;

  --text: #f6f7f1;
  --text-2: #cfe0d7;
  --text-3: #bfd6cb;
  --line: var(--ground-line);
  --line-strong: #3f8d75;
  --surface: var(--ground-2);
  --surface-2: var(--ground-3);
  --surface-3: #277a61;

  --primary: var(--paper);
  --on-primary: var(--ink);
  --primary-hover: #ffffff;
  --accent: #f0c05a;
  --on-accent: var(--ink);
  --accent-text: #f0c05a;
  --selected-soft: rgb(240 192 90 / 0.16);
  --danger-text: #ffb4a2;
  --danger-strong: #b3321f;
  --danger-soft: rgb(255 180 162 / 0.14);
  --success: #a6e3c3;
  --ring: #f0c05a;
  --ring-soft: rgb(240 192 90 / 0.3);

  --paper-primary: #0f4a38;
  --paper-on-primary: #ffffff;
  --paper-primary-hover: #155a45;
  --paper-accent-text: #0f5c45;
  --paper-selected: #e4efe9;
  --paper-danger: #b3321f;
  --paper-danger-soft: rgb(179 50 31 / 0.09);
  --paper-success: #1f7a4f;
  --paper-ring: #0f4a38;
  --paper-ring-soft: rgb(15 74 56 / 0.2);

  --input-bg: #ffffff;
  --input-text: var(--ink);
  --input-hint: var(--ink-3);
  --input-line: var(--paper-line-strong);

  --toast-bg: var(--ink);
  --toast-text: #ffffff;
  --toast-success: #8fdcb4;
  --toast-error: #ffb4a2;

  --shadow-paper: 2px 4px 10px rgb(0 0 0 / 0.26);
  --shadow-float: 0 10px 28px rgb(0 0 0 / 0.38);
  --backdrop: rgb(0 0 0 / 0.58);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
  --rule: 1px solid var(--line);
  --mark-cut: #2a160b;
  --header-h: 56px;
  --dur-fast: 120ms;
  --dur: 200ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Kâğıt yüzeylerin üstünde renkler mürekkebe döner. */
.paper,
.sheet-panel,
.modal-card,
.login-card,
.ocard,
.rows,
.table-wrap,
.card,
.kpis,
.toasts {
  --text: var(--ink);
  --text-2: var(--ink-2);
  --text-3: var(--ink-3);
  --line: var(--paper-line);
  --line-strong: var(--paper-line-strong);
  --surface: var(--paper);
  --surface-2: var(--paper-2);
  --surface-3: var(--paper-3);
  --primary: var(--paper-primary);
  --on-primary: var(--paper-on-primary);
  --primary-hover: var(--paper-primary-hover);
  --accent-text: var(--paper-accent-text);
  --selected-soft: var(--paper-selected);
  --danger-text: var(--paper-danger);
  --danger-soft: var(--paper-danger-soft);
  --success: var(--paper-success);
  --ring: var(--paper-ring);
  --ring-soft: var(--paper-ring-soft);
  color: var(--text);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--ground);
  scrollbar-color: var(--line-strong) var(--ground);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--ground);
  caret-color: var(--ring);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure, fieldset {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

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

[hidden] {
  display: none !important;
}

.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drawn {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

.muted {
  color: var(--text-3);
  font-weight: 400;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

/* Düğmeler */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease), opacity var(--dur) var(--ease);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
}

.btn.is-loading {
  opacity: 0.85;
  cursor: progress;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost {
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-strong);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-danger-ghost {
  color: var(--danger-text);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 54px;
  border-radius: var(--r-lg);
  font-size: 17px;
}

.btn-sm {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14.5px;
}

.btn .i {
  width: 18px;
  height: 18px;
}

.btn-sep {
  opacity: 0.55;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  color: var(--text-2);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.link-btn {
  min-height: 32px;
  padding: 4px 0;
  color: var(--accent-text);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:disabled {
  color: var(--text-3);
  text-decoration: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form */

.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--input-line);
  background-color: var(--input-bg);
  color: var(--input-text);
  caret-color: var(--paper-ring);
  font-size: 16px;
  transition: border-color var(--dur) var(--ease), outline-color var(--dur) var(--ease);
}

.input::placeholder {
  color: var(--input-hint);
}

.input:focus {
  outline: 2px solid var(--paper-ring);
  outline-offset: 0;
  border-color: var(--paper-ring);
}

.input[aria-invalid='true'] {
  border-color: var(--paper-danger);
}

.textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.45;
}

select.input {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a4c42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  cursor: pointer;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 700;
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-row .input {
  flex: 1;
  min-width: 0;
}

.field-hint {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13.5px;
}

.field-error {
  margin-top: 6px;
  color: var(--danger-text);
  font-size: 14px;
  font-weight: 600;
}

input.switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}

input.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform var(--dur) var(--ease);
}

input.switch:checked {
  background: var(--primary);
}

input.switch:checked::after {
  transform: translateX(18px);
}

/* Etiket ve bildirim */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.tag .i {
  width: 14px;
  height: 14px;
}

.tag-accent {
  background: var(--accent);
  color: var(--on-accent);
}

.ring-glyph {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.toasts {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 1000;
  display: grid;
  gap: 8px;
  width: min(calc(100vw - 32px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--toast-bg);
  color: var(--toast-text);
  box-shadow: var(--shadow-float);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: auto;
}

.toast .i {
  margin-top: 1px;
}

.toast-success .i {
  color: var(--toast-success);
}

.toast-error .i {
  color: var(--toast-error);
}

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