@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1e293b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --border: #e2e8f0;
  --radius: 12px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); }

.shell { display: flex; min-height: 100vh; }

.sidebar { width: 230px; background: var(--sidebar-bg); display: flex; flex-direction: column; padding: 24px 0; flex-shrink: 0; }
.sidebar .brand { color: white; font-weight: 700; font-size: 16px; padding: 0 24px 20px; border-bottom: 1px solid #1e293b; margin-bottom: 12px; }
.sidebar nav { flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 24px; color: var(--sidebar-text); text-decoration: none; font-size: 14px; font-weight: 500; }
.sidebar nav a:hover { background: var(--sidebar-active); color: white; }
.sidebar .logout { padding: 11px 24px; color: #f87171; text-decoration: none; font-size: 14px; font-weight: 500; border-top: 1px solid #1e293b; padding-top: 16px; margin-top: 12px; }
.sidebar .logout:hover { color: #fca5a5; }

.main { flex: 1; min-width: 0; }
.topbar { background: var(--card); padding: 22px 36px; border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; }
.content { padding: 32px 36px; max-width: 1100px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card:hover { box-shadow: 0 6px 16px rgba(15,23,42,0.06); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0; }
.pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: #dcfce7; color: var(--success); }
.pill.static { background: #e0e7ff; color: var(--accent); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { display: inline-block; padding: 7px 13px; border-radius: 7px; border: 1px solid var(--border); font-weight: 500; font-size: 13px; cursor: pointer; text-decoration: none; font-family: inherit; background: white; color: var(--text); }
.btn:hover { background: #f1f5f9; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-full { width: 100%; text-align: center; padding: 11px; font-size: 14px; }

input[type=text], input[type=password], input[type=url] {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 6px; font-size: 14px; font-family: inherit;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin: 0 0 14px; }

textarea {
  width: 100%; height: 480px; font-family: 'SF Mono', Menlo, monospace; font-size: 13px;
  padding: 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: #1e1e2e; color: #e2e8f0;
}

.back-link { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; display: inline-block; margin-bottom: 18px; }
.back-link:hover { color: var(--text); }

.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; background: var(--bg); }
.login-box { background: var(--card); padding: 44px; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,0.08); width: 320px; }
.login-box h1 { font-size: 20px; margin-bottom: 24px; }

.error-msg { background: #fef2f2; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.success-msg { background: #ecfdf5; color: var(--success); padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
.warning-box { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 16px 20px; border-radius: var(--radius); font-size: 14px; margin-bottom: 24px; }

.file-row { background: var(--card); border: 1px solid var(--border); padding: 13px 18px; border-radius: 10px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.thumb-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; }
.thumb-img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
.thumb-placeholder { width: 100%; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 36px; background: #f1f5f9; border-radius: 8px; }
.thumb-name { font-size: 12px; color: var(--muted); margin: 8px 0; word-break: break-all; }
