/* ============================================================
   UTown Creatives – GF Hub
   assets/style.css
   ============================================================ */

:root {
  --primary:       #b11b78;
  --primary-dark:  #8f1560;
  --primary-light: #fbeaf0;
  --primary-muted: rgba(177,27,120,0.12);

  --bg:            #0f0f0f;
  --surface:       #1a1a1a;
  --surface-2:     #222222;
  --surface-3:     #2a2a2a;
  --border:        rgba(255,255,255,0.08);
  --border-2:      rgba(255,255,255,0.14);

  --text:          #f0f0f0;
  --text-2:        #a0a0a0;
  --text-3:        #6a6a6a;

  --success:       #1d9e75;
  --success-bg:    rgba(29,158,117,0.12);
  --danger:        #e24b4a;
  --danger-bg:     rgba(226,75,74,0.12);
  --warning:       #ef9f27;
  --warning-bg:    rgba(239,159,39,0.12);
  --info:          #378add;
  --info-bg:       rgba(55,138,221,0.12);

  --radius:        10px;
  --radius-lg:     14px;
  --radius-xl:     20px;
  --shadow:        0 2px 12px rgba(0,0,0,0.4);
}

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

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #0a0a0a;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img { height: 30px; width: auto; }
.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-text strong { display: block; font-size: 15px; font-weight: 600; color: #fff; }
.sidebar-logo-text span   { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

nav { padding: 14px 0; flex: 1; }

.nav-section {
  padding: 10px 20px 4px;
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); text-decoration: none; }
.nav-item.active { color: #fff; border-left-color: var(--primary); background: var(--primary-muted); }
.nav-item i { font-size: 16px; flex-shrink: 0; }

.nav-divider { height: 1px; background: var(--border); margin: 8px 20px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.user-info strong { display: block; font-size: 13px; color: var(--text); font-weight: 500; }
.user-info span   { font-size: 11px; color: var(--text-3); }

/* ─── Main Content ───────────────────────────────────────── */
.main-wrap {
  margin-left: 230px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.content { padding: 28px; flex: 1; max-width: 1400px; }

/* ─── Page Header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 600; color: var(--text); }
.page-header p  { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title i { font-size: 15px; color: var(--primary); }

/* ─── Stats Grid ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card.accent { border-left: 3px solid var(--primary); }
.stat-label { font-size: 11px; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 26px; font-weight: 600; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  transition: all 0.12s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.12s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}
.form-control option { background: var(--surface-2); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: 'SF Mono', monospace; }
td.green { color: var(--success); font-weight: 500; }
td.red   { color: var(--danger);  font-weight: 500; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: var(--surface-3);  color: var(--text-2); }
.badge-primary { background: var(--primary-muted); color: var(--primary); }

/* ─── Alerts / Flash ─────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(29,158,117,0.3); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(226,75,74,0.3); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(239,159,39,0.3); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(55,138,221,0.3); }

/* ─── Status Dot (Server) ────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }
.status-dot.unknown { background: var(--text-3); }

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
}
.tab-btn {
  flex: 1;
  text-align: center;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  transition: all 0.12s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); text-decoration: none; }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 17px; font-weight: 600; }
.modal-close {
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  font-size: 20px; padding: 4px;
  line-height: 1;
}

/* ─── Charts Wrapper ─────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 280px;
}

/* ─── Utilities ──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.flex    { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap { display: flex; align-items: center; gap: 8px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.muted { color: var(--text-2); font-size: 13px; }
.small { font-size: 12px; color: var(--text-3); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.w-100  { width: 100%; }
.gap-8  { gap: 8px; }

/* ─── Login-Seite ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo img   { height: 36px; margin-bottom: 10px; }
.login-logo h1    { font-size: 18px; font-weight: 600; }
.login-logo span  { font-size: 12px; color: var(--text-3); }

/* ─── Kalkulation spezifisch ─────────────────────────────── */
.kalk-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kalk-box {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.kalk-box .label { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.kalk-box .value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kalk-box.highlight { border-color: var(--primary); background: var(--primary-muted); }
.kalk-box.highlight .value { color: var(--primary); }
.kalk-box.green .value { color: var(--success); }
.kalk-box.red   .value { color: var(--danger); }

/* ─── Analyse spezifisch ─────────────────────────────────── */
.analyse-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* ─── Server Status ──────────────────────────────────────── */
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.service-row:last-child { border-bottom: none; }
.service-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.service-name { font-size: 14px; font-weight: 500; }
.service-meta { font-size: 11px; color: var(--text-3); }
.service-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-3); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .main-wrap { margin-left: 200px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .main-wrap { margin-left: 0; }
  .content { padding: 16px; }
}
