/* =====================================================================
   FollowDesk – Stylesheet
   ===================================================================== */
:root {
  --bg:        #0f1115;
  --surface:   #181b22;
  --surface-2: #20242d;
  --border:    #2a2f3a;
  --text:      #e7e9ee;
  --muted:     #9aa3b2;
  --primary:   #7c5cff;
  --primary-2: #5b3df0;
  --accent:    #ff5c8a;
  --green:     #2ecc71;
  --red:       #ff5b5b;
  --radius:    14px;
  --shadow:    0 8px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Auth / Guest ---------- */
.guest-body {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 50% -10%, #241a4d 0%, var(--bg) 55%);
}
.guest-main { flex: 1; display: grid; place-items: center; padding: 24px; }
.guest-footer { text-align: center; color: var(--muted); padding: 16px; font-size: 13px; }
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.auth-logo { font-size: 26px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.5px; }
.auth-logo span { color: var(--primary); }
.auth-sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.auth-foot { text-align: center; color: var(--muted); margin-top: 18px; font-size: 14px; }

/* ---------- Forms ---------- */
.form label, .field label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.form label small { color: var(--muted); opacity:.7; }
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=datetime-local],
input[type=url], select, textarea {
  width: 100%; margin-top: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,92,255,.18);
}
textarea { resize: vertical; min-height: 90px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: none; color: #fff; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-danger { color: var(--red); border-color: #4a2630; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 11px; font-size: 13px; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-error   { background: rgba(255,91,91,.10);  border-color: #4a2630; color: #ffb4b4; }
.alert-success { background: rgba(46,204,113,.10); border-color: #235; color: #9fe9bf; border-color:#1f4733; }
.alert-info    { background: rgba(124,92,255,.10); border-color: #33305c; color: #c9bdff; }

/* ---------- App Layout ---------- */
.app-body { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo { font-size: 22px; font-weight: 800; padding: 22px 22px 14px; letter-spacing: -.5px; }
.sidebar-logo span { color: var(--primary); }
.sidebar-nav { display: flex; flex-direction: column; padding: 8px; gap: 2px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar-nav a.active { background: rgba(124,92,255,.14); color: #fff; }
.nav-icon { width: 20px; text-align: center; opacity: .9; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.user-name { font-size: 14px; font-weight: 600; }
.logout { color: var(--muted); font-size: 13px; }

.content { flex: 1; min-width: 0; }
.topbar { padding: 22px 28px 0; }
.page-title { margin: 0; font-size: 22px; font-weight: 700; }
.page { padding: 18px 28px 40px; }

/* ---------- Cards & Grid ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 16px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat-delta { font-size: 13px; margin-top: 6px; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:hover td { background: var(--surface-2); }
table.data th a.th-sort { color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; white-space: nowrap; }
table.data th a.th-sort:hover { color: var(--primary); text-decoration: none; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: rgba(46,204,113,.15); color: #7ee2a8; }
.badge-red   { background: rgba(255,91,91,.15);  color: #ff9d9d; }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-primary { background: rgba(124,92,255,.18); color: #c9bdff; }

/* ---------- Helpers ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  width: 30px; height: 30px; flex-shrink: 0;
  font-size: 13px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.section-gap { margin-top: 22px; }
.hidden { display: none !important; }
.inline-form { display: inline; margin: 0; }
.inline-form select { width: auto; margin: 0; }
form.inline-form, .row-actions form { display: inline-block; margin: 0; }

/* ---------- Stat-Karten mit Erklärung ---------- */
.stat-card .stat-hint {
  margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45;
}
a.link-card { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .1s; }
a.link-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
a.link-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.link-out { color: var(--muted); font-size: 15px; }
.link-out:hover { color: var(--primary); }

/* ---------- Export-Anleitung (Schritt-Karten) ---------- */
.guide-steps { display: grid; gap: 18px; margin-top: 8px; }
.guide-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.guide-step .step-num {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  border-radius: 50%; font-weight: 700; font-size: 18px;
}
.guide-step .step-body h4 { margin: 4px 0 6px; font-size: 16px; }
.guide-step .step-body p { margin: 0 0 12px; color: var(--muted); }
.guide-step .step-body code {
  background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 13px;
}
.guide-shot {
  display: block; width: 100%; max-width: 360px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg);
}
.guide-shot.missing { display: none; }
.guide-shot { cursor: zoom-in; transition: border-color .15s; }
.guide-shot:hover { border-color: var(--primary); }
.guide-step .step-body ol { margin: 0 0 12px; padding-left: 18px; color: var(--text); }
.guide-step .step-body ol li { margin-bottom: 4px; }
.guide-step .step-body ol li .hint { color: var(--muted); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.85); padding: 30px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 95vw; max-height: 92vh;
  border-radius: 10px; box-shadow: var(--shadow);
}
.lightbox .lightbox-close {
  position: absolute; top: 18px; right: 24px;
  font-size: 34px; color: #fff; line-height: 1; cursor: pointer;
  background: none; border: none;
}
.guide-shot-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 360px; min-height: 120px;
  border: 1px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: 13px; text-align: center; padding: 16px;
  background: var(--bg);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .sidebar-foot { border-top: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
