/* HS Grup Depo — tasarim sistemi
   Konu: guvenli depo/kasa. Palet karanlik grafit + pirinc/amber vurgu,
   dosya rozetleri kasa plakalarini andirir. */

@font-face {
  font-family: "Space Grotesk";
  src: local("Space Grotesk");
}

:root {
  --bg: #16181c;
  --bg-raised: #1e2126;
  --bg-card: #24272e;
  --line: #33373f;
  --text: #eef0f2;
  --text-dim: #9aa1ac;
  --brass: #c08a3e;
  --brass-bright: #e0a85a;
  --ok: #4caf7d;
  --danger: #d9634f;
  --radius: 10px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(192,138,62,0.06), transparent 40%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 40px);
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

/* Depolama kullanim gostergesi */
.storage-widget {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
.storage-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.storage-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.storage-fill {
  height: 100%;
  background: var(--brass);
  transition: width 0.3s ease;
}
.storage-widget.storage-warn .storage-fill { background: var(--danger); }
.storage-widget.storage-warn .storage-row { color: var(--danger); }

/* ---------- Auth screen ---------- */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

.dial {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid var(--brass);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  position: relative;
}
.dial::after {
  content: "";
  width: 4px; height: 16px;
  background: var(--brass-bright);
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  border-radius: 2px;
}

.auth-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.auth-card p.sub {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0 0 24px;
}

label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin: 16px 0 6px;
}

input[type="text"], input[type="password"], input[type="file"], select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 13px;
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--sans);
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 1px;
}

button {
  font-family: var(--sans);
  cursor: pointer;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--brass);
  color: #1a1305;
  width: 100%;
  margin-top: 22px;
}
.btn-primary:hover { background: var(--brass-bright); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--brass); color: var(--brass-bright); }

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

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

/* ---------- App shell ---------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}
.brand .mark {
  width: 26px; height: 26px;
  border: 2px solid var(--brass);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--brass-bright);
  font-family: var(--mono);
}

.who {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--brass);
  color: var(--brass-bright);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.content {
  flex: 1;
  padding: 20px 16px 96px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h2 { font-size: 17px; }
.count-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* Upload dropzone */
.dropzone {
  display: block;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg-raised);
  margin-bottom: 22px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.drag {
  border-color: var(--brass);
  background: var(--bg-card);
  color: var(--text);
}
.dropzone .icon { font-size: 22px; margin-bottom: 6px; color: var(--brass); }
.dropzone small { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; }

/* Upload queue */
.upload-item {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.upload-item .row1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.upload-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .pct { font-family: var(--mono); font-size: 11px; color: var(--text-dim); width: 34px; text-align: right; flex-shrink: 0; }
.upload-item .bar-track {
  width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden;
}
.upload-item .bar-fill { height: 100%; background: var(--brass); width: 0%; transition: width 0.2s; }
.upload-item .row2 {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 5px;
}
.upload-item.done .bar-fill { background: var(--ok); }
.upload-item.error .bar-fill { background: var(--danger); }
.upload-item.error .row2 { color: var(--danger); }

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.file-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: #0f1114;
  display: block;
}
.file-thumb.video-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--brass);
  font-size: 26px;
}
.file-meta {
  padding: 8px 9px;
  font-size: 11.5px;
}
.file-meta .fname {
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
}
.file-meta .fowner {
  font-family: var(--mono);
  color: var(--brass-bright);
  font-size: 10.5px;
}
.file-meta .fsize {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 10.5px;
}
.file-actions {
  display: flex;
  gap: 6px;
  padding: 0 9px 9px;
}
.file-actions button {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 11px;
}
.file-actions button:hover { border-color: var(--brass); color: var(--brass-bright); }

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 30px; color: var(--brass); margin-bottom: 8px; }

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
  z-index: 10;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--mono);
}
.bottom-nav a.active { color: var(--brass-bright); background: var(--bg-card); }

/* Admin table */
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.user-row .uname { font-family: var(--mono); flex: 1; min-width: 120px; }
.user-row .inactive { color: var(--danger); font-size: 11px; font-family: var(--mono); }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,11,13,0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 360px;
}
.modal h3 { font-size: 16px; margin-bottom: 4px; }
.modal .sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 4px; }

.toast {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--brass);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 60;
  max-width: 90%;
}

@media (min-width: 720px) {
  .bottom-nav { display: none; }
  .topbar nav { display: flex; gap: 6px; }
  .topbar nav a {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text-dim);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
  }
  .topbar nav a.active { color: var(--brass-bright); background: var(--bg-card); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
