@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #eef2f0;
  --surface: #ffffff;
  --surface-sunken: #e4eae6;
  --ink: #16241f;
  --ink-soft: #4c5d55;
  --ink-faint: #7c8a83;
  --accent: #2f6f5e;
  --accent-deep: #1f4b3f;
  --gold: #b5892f;
  --gold-soft: #f0e3c4;
  --danger: #a6432e;
  --danger-soft: #f3ded8;
  --border: #d5ded9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 36, 31, 0.06), 0 8px 24px rgba(22, 36, 31, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: var(--accent-deep); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-deep);
  color: #fff;
}
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled { background: var(--ink-faint); cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-sunken); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-soft);
}
.btn-danger:hover { background: var(--danger-soft); }

.btn-small { padding: 6px 12px; font-size: 13px; }

input[type="text"], input[type="password"], input[type="number"] {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
input:focus { border-color: var(--accent); }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.field { margin-bottom: 16px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  display: none;
}
.error-banner.visible { display: block; }

/* ---------- Auth (giriş) sayfaları ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-art {
  background: var(--accent-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.auth-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(181,137,47,0.12), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(255,255,255,0.06), transparent 40%);
}
.dial {
  width: 260px;
  height: 260px;
  position: relative;
  z-index: 1;
}
.auth-art .caption {
  position: absolute;
  bottom: 50px;
  left: 60px;
  right: 60px;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
  z-index: 1;
}
.auth-art .brand {
  position: absolute;
  top: 44px;
  left: 60px;
  color: #fff;
  font-family: 'Fraunces', serif;
  font-size: 20px;
  letter-spacing: 0.01em;
  z-index: 1;
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-form {
  width: 100%;
  max-width: 360px;
}
.auth-form h1 { font-size: 28px; margin-bottom: 6px; }
.auth-form .sub { color: var(--ink-faint); font-size: 14px; margin-bottom: 28px; }
.auth-form button[type="submit"] { width: 100%; padding: 12px; margin-top: 6px; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

/* ---------- Dashboard shell ---------- */
.app-shell { min-height: 100vh; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.topbar .brand .mark {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar .who { font-size: 13.5px; color: var(--ink-faint); }
.topbar .who strong { color: var(--ink); }

.main {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* Quota gauge */
.quota-card {
  padding: 22px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.quota-ring {
  width: 62px; height: 62px;
  flex-shrink: 0;
}
.quota-info { flex: 1; }
.quota-info .label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin-bottom: 4px; }
.quota-info .amounts { font-family: 'IBM Plex Mono', monospace; font-size: 15px; }
.quota-bar-track {
  height: 6px;
  background: var(--surface-sunken);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}
.quota-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  background: var(--surface);
  margin-bottom: 28px;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.dropzone.dragover {
  border-color: var(--accent);
  background: #f3f8f6;
}
.dropzone .icon { font-size: 26px; margin-bottom: 10px; }
.dropzone .hint { color: var(--ink-faint); font-size: 13px; margin-top: 4px; }
.dropzone input[type="file"] { display: none; }

.upload-progress {
  margin-bottom: 28px;
  display: none;
}
.upload-progress.visible { display: block; }
.upload-progress .filename { font-size: 13.5px; margin-bottom: 6px; color: var(--ink-soft); }
.upload-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
}
.upload-stats span:first-child { color: var(--ink-soft); }

/* File list - "deposit ticket" styling */
.section-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 0 0 12px 4px;
}
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.file-row .info { flex: 1; min-width: 0; }
.file-row .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-row .meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 3px;
}
.file-row .actions { display: flex; gap: 8px; flex-shrink: 0; }

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-faint);
}
.empty-state .icon { font-size: 30px; margin-bottom: 12px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 50;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Admin ---------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.admin-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding: 12px 16px;
  background: var(--surface-sunken);
  font-weight: 500;
}
.admin-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.admin-table tr:hover td { background: #fafcfb; }
.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
}
.badge.active { background: #dcefe7; color: var(--accent-deep); }
.badge.inactive { background: var(--danger-soft); color: var(--danger); }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(22,36,31,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop.visible { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal h2 { font-size: 20px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
