/* =============================================
   FITBIT DASHBOARD – Design analog Freizeitaktivitäten
   ============================================= */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: #00939b;
  --sidebar-hover-bg: #334155;
  --sidebar-header-bg: #0f172a;
  --accent: #00B0B9;
  --accent-light: #e0fafa;
  --accent-dark: #007A7F;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

/* ===== DARK MODE ===== */
body.dark-mode {
  --body-bg: #0f172a;
  --card-bg: #1e293b;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.4);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.5);
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --accent-light: #0f3745;
}
body.dark-mode .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.03);
  --bs-table-hover-bg: rgba(255,255,255,0.05);
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: #334155;
  color: #e2e8f0;
  border-color: #334155;
}
body.dark-mode .table thead th    { background: #0f172a; color: #94a3b8; border-color: #334155 !important; }
body.dark-mode .table tbody tr     { background: transparent; }
body.dark-mode .table tbody tr:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .table tbody td    { color: #e2e8f0; border-color: #334155 !important; background: transparent; }
body.dark-mode .form-control,
body.dark-mode .form-select       { background: #0f172a; color: #e2e8f0; border-color: #334155; }
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus { background: #0f172a; color: #e2e8f0; border-color: var(--accent); box-shadow: 0 0 0 0.2rem rgba(0,176,185,0.25); }
body.dark-mode .btn-outline-secondary { border-color: #475569; color: #94a3b8; }
body.dark-mode .btn-outline-secondary:hover { background: #334155; color: #e2e8f0; border-color: #64748b; }
body.dark-mode .connect-banner    { background: linear-gradient(135deg, #0f3745 0%, #0f2a3f 100%); }
body.dark-mode .alert-warning     { background: #451a03; color: #fde68a; }
body.dark-mode .alert-success     { background: #052e16; color: #4ade80; }
body.dark-mode .alert-danger      { background: #450a0a; color: #fca5a5; }
body.dark-mode .act-tab-btn       { color: #94a3b8; }
body.dark-mode .act-tab-btn:hover { background: rgba(0,176,185,0.08); }
body.dark-mode .act-tabs-nav      { border-color: #334155; }
body.dark-mode .cal-month         { background: #1e293b; }
body.dark-mode .goal-bar-wrap     { background: #334155; }
body.dark-mode .badge.bg-secondary { background: #475569 !important; }
body.dark-mode .input-group-text  { background: #0f172a; color: #94a3b8; border-color: #334155; }
body.dark-mode .page-header h1,
body.dark-mode h1, body.dark-mode h2,
body.dark-mode h3, body.dark-mode h4 { color: #e2e8f0; }
body.dark-mode .form-text         { color: #64748b; }

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--body-bg);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  margin: 0; padding: 0;
  min-height: 100vh;
  overscroll-behavior-y: contain;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0;
  height: 100vh; height: 100dvh;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 1000;
  display: flex; flex-direction: column;
  transition: transform var(--transition);
  overflow: hidden;
}
.sidebar.closed { transform: translateX(-100%); }

.sidebar-header {
  background: var(--sidebar-header-bg);
  padding: 1.4rem 1.5rem;
  font-size: 1.1rem; font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 0.6rem;
  flex-shrink: 0; min-height: 64px;
  user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-menu {
  display: flex; flex-direction: column;
  padding: 0.75rem; gap: 0.15rem;
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}

.sidebar-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  font-size: 0.925rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-link:hover { background: var(--sidebar-hover-bg); color: #e2e8f0; }
.sidebar-link.active-sidebar-link {
  background: var(--sidebar-active-bg) !important;
  color: var(--sidebar-text-active) !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,176,185,0.3);
}

.sidebar-icon { font-size: 1.05rem; flex-shrink: 0; width: 1.4em; text-align: center; }

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.5rem 0.5rem;
}

/* Logout-Button sieht wie Link aus */
.sidebar-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-logout-btn:hover { color: var(--danger) !important; background: rgba(239,68,68,0.1) !important; }

/* ===== SIDEBAR TOGGLE ===== */
.sidebar-toggle {
  display: none;
  position: fixed; top: 0.85rem; left: 0.85rem; z-index: 1101;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; width: 42px; height: 42px;
  font-size: 1.3rem; box-shadow: var(--card-shadow);
  align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
  line-height: 1;
}
.sidebar-toggle:hover { background: var(--accent-light); }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.5); z-index: 999;
  backdrop-filter: blur(2px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 2rem;
  transition: margin-left var(--transition);
}
.main-content.sidebar-closed { margin-left: 0; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-main); margin: 0 0 0.25rem 0; }
.page-header p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

h1, h2, h3, h4, h5, h6 { color: var(--text-main); font-weight: 700; }
h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.35rem; margin-bottom: 1rem; }

/* ===== SECTION HEADERS ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-title { font-size: 1.2rem; font-weight: 700; color: var(--text-main); margin: 0; }

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--card-shadow);
}
.card-body { padding: 1.5rem; }

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  height: 100%;
  text-align: center;
}
.stat-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.stat-card-icon { font-size: 1.8rem; margin-bottom: 0.5rem; display: block; }
.stat-card-title {
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.35rem;
}
.stat-card-value { font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat-card-value small { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.stat-card-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ===== GOAL BAR ===== */
.goal-bar-wrap { background: #e2e8f0; border-radius: 99px; height: 8px; overflow: hidden; margin: 0.5rem 0 0.25rem; }
.goal-bar-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width 1s ease; }

/* ===== DASHBOARD CARD (Jahresziel, Charts, Routen etc.) ===== */
.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* ===== ACTIVITY CARDS ===== */
.activity-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  height: 100%;
}
.activity-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }

/* ===== AKTIVITÄTS-KALENDER ===== */
.cal-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.cal-month {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--card-shadow);
}
.cal-month-title {
  font-weight: 700; font-size: 0.9rem; color: var(--accent);
  margin-bottom: 0.5rem; text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-head {
  font-size: 0.7rem; color: var(--text-muted); text-align: center;
  padding: 3px 0; font-weight: 700;
}
.cal-day {
  font-size: 0.78rem; text-align: center; padding: 4px 2px;
  border-radius: 4px; color: var(--text-muted); min-height: 28px; line-height: 20px;
  cursor: default;
}
.cal-day.active { color: #fff; font-weight: 700; cursor: pointer; }
.cal-day.active:hover { filter: brightness(1.15); }
.cal-day.active.level-1 { background: rgba(0,176,185,0.55); }
.cal-day.active.level-2 { background: rgba(0,176,185,0.8); }
.cal-day.active.level-3 { background: var(--accent); box-shadow: 0 0 0 2px rgba(0,176,185,0.3); }
/* Nach Typ: Laufen – rot */
.cal-day.active.run.level-1 { background: rgba(239,68,68,0.55); }
.cal-day.active.run.level-2 { background: rgba(239,68,68,0.8); }
.cal-day.active.run.level-3 { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.3); }
/* Fahrrad – grün */
.cal-day.active.bike.level-1 { background: rgba(34,197,94,0.55); }
.cal-day.active.bike.level-2 { background: rgba(34,197,94,0.8); }
.cal-day.active.bike.level-3 { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.3); }
/* Hike/Wandern – blau */
.cal-day.active.hike.level-1 { background: rgba(59,130,246,0.55); }
.cal-day.active.hike.level-2 { background: rgba(59,130,246,0.8); }
.cal-day.active.hike.level-3 { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.3); }
/* Walk/Gehen – gelb */
.cal-day.active.walk.level-1 { background: rgba(234,179,8,0.5); color: #713f12; }
.cal-day.active.walk.level-2 { background: rgba(234,179,8,0.8); color: #713f12; }
.cal-day.active.walk.level-3 { background: #eab308; color: #713f12; box-shadow: 0 0 0 2px rgba(234,179,8,0.35); }
/* Kraft/Workout – orange */
.cal-day.active.gym.level-1 { background: rgba(249,115,22,0.55); }
.cal-day.active.gym.level-2 { background: rgba(249,115,22,0.8); }
.cal-day.active.gym.level-3 { background: #f97316; box-shadow: 0 0 0 2px rgba(249,115,22,0.3); }

.cal-day.cal-today { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 700; color: var(--accent); border-radius: 4px; }
.cal-day.active.cal-today { color: #fff; box-shadow: inset 0 0 0 2.5px #fff, 0 0 0 2px var(--accent); }
.cal-day.cal-this-week:not(.cal-today) { background: rgba(0,176,185,0.07); border-radius: 3px; }

.cal-legend { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; font-size: 0.8rem; color: var(--text-muted); }

/* ===== AKTIVITÄTEN TABS ===== */
.act-tabs-nav {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0; padding-bottom: 0;
}
.act-tab-btn {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: 0.65rem 1.25rem; font-size: 0.9rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.act-tab-btn:hover { color: var(--accent); background: rgba(0,176,185,0.05); }
.act-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.act-tab-pane { padding-top: 1.25rem; }
.stat-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted);
  margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.4rem;
}
.dashboard-card table tbody tr:hover { background: var(--body-bg); }
.cal-legend-item { display: flex; align-items: center; gap: 0.3rem; }

.activity-badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.activity-date { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }
.activity-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.4rem; }

/* ===== CONNECT BANNER ===== */
.connect-banner {
  background: linear-gradient(135deg, var(--accent-light) 0%, #f0fffe 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.connect-banner-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}

/* ===== BUTTONS ===== */
.btn {
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem;
  padding: 0.6rem 1.25rem; transition: all var(--transition); cursor: pointer;
}
.btn-primary, .btn-fitbit {
  background: var(--accent); color: white; border: none;
}
.btn-primary:hover, .btn-fitbit:hover {
  background: var(--accent-dark); color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,176,185,0.3);
}
.btn-fitbit { text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-fitbit:disabled, .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline-secondary {
  background: transparent; border: 1.5px solid var(--border); color: var(--text-muted);
}
.btn-outline-secondary:hover { background: var(--body-bg); border-color: #94a3b8; color: var(--text-main); }
.btn-outline-danger { background: transparent; border: 1.5px solid var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-danger { background: var(--danger); color: white; border: none; }
.btn-danger:hover { background: #dc2626; color: white; }

/* ===== HR ZONE BARS ===== */
.hr-zone-bar { height: 14px; border-radius: 7px; min-width: 4px; transition: width 0.8s ease; }
.hr-zone-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.hr-zone-name { font-size: 0.78rem; font-weight: 600; width: 90px; flex-shrink: 0; }
.hr-zone-min  { font-size: 0.78rem; color: var(--text-muted); width: 55px; text-align: right; flex-shrink: 0; }

/* ===== CHART CARD ===== */
.chart-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--card-shadow); height: 100%;
}
.chart-card-title { font-size: 1rem; font-weight: 600; color: var(--text-main); margin-bottom: 1rem; }
.chart-wrapper { position: relative; height: 260px; }

/* ===== SLEEP CARDS ===== */
.sleep-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--card-shadow);
}
.sleep-date { font-size: 0.78rem; color: var(--text-muted); }
.sleep-dur  { font-size: 1.1rem; font-weight: 700; margin: 0.15rem 0; }
.sleep-eff  { font-size: 0.82rem; color: var(--text-muted); }
.sleep-stages { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 0.5rem; gap: 1px; }
.sleep-seg { flex-shrink: 0; }

/* ===== LOADING SPINNER ===== */
.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 3rem 2rem;
  color: var(--text-muted); font-size: 0.95rem;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TABLES ===== */
.table-wrapper {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden;
}
.table { margin: 0; font-size: 0.875rem; }
.table thead th {
  background: #f8fafc; color: var(--text-muted);
  font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border) !important;
  padding: 0.875rem 1rem; white-space: nowrap;
}
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: #f8fafc; }
.table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle; color: var(--text-main);
}
.table tbody tr:last-child td { border-bottom: none !important; }

/* ===== ALERTS & BADGES ===== */
.alert { border: none; border-radius: var(--radius-sm); padding: 0.875rem 1.25rem; font-size: 0.9rem; font-weight: 500; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info   { background: var(--accent-light); color: var(--accent-dark); }
.badge { border-radius: 999px; font-size: 0.78rem; font-weight: 600; padding: 0.3em 0.75em; }
.bg-secondary { background: #64748b !important; color: #fff; }
.bg-success   { background: var(--success) !important; color: #fff; }
.bg-danger    { background: var(--danger) !important; color: #fff; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.5; }

/* ===== RESPONSIVE Desktop (>=901px) ===== */
@media (min-width: 901px) {
  .sidebar-toggle  { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .sidebar { transform: translateX(0) !important; }
  .sidebar.closed { transform: translateX(-100%) !important; }
  .main-content.sidebar-closed { margin-left: 0 !important; }
  .main-content { margin-left: var(--sidebar-width) !important; }
}

/* ===== RESPONSIVE Mobile (<=900px) ===== */
@media (max-width: 900px) {
  .sidebar-toggle { display: flex !important; }
  .sidebar { transform: translateX(-100%); width: min(280px, 85vw); }
  .sidebar.opened-mobile { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.25); }
  body.sidebar-open { overflow: hidden; touch-action: none; }
  .main-content { margin-left: 0 !important; padding: 1rem; padding-top: 4rem; }
  .page-header h1 { font-size: 1.4rem; padding-top: 0.25rem; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.1rem; }
}

/* ===== UTILITY ===== */
.d-none { display: none !important; }
.text-muted { color: var(--text-muted) !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ps-2 { padding-left: 0.5rem !important; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* ===== DARK MODE TOGGLE ===== */
.dark-mode-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  color: var(--sidebar-text);
  border: none; background: none; cursor: pointer;
  font-size: 0.925rem; font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  width: 100%; text-align: left;
  margin-top: auto;
}
.dark-mode-toggle:hover { background: var(--sidebar-hover-bg); color: #e2e8f0; }
.dm-toggle-track {
  width: 34px; height: 18px; border-radius: 9px;
  background: #475569; position: relative; flex-shrink: 0;
  transition: background 0.2s;
}
body.dark-mode .dm-toggle-track { background: var(--accent); }
.dm-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
body.dark-mode .dm-toggle-thumb { transform: translateX(16px); }

/* ===== TOKEN-ABLAUF BADGE ===== */
.token-expiry-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.25rem 0.65rem; border-radius: 999px;
  border: 1px solid transparent;
}
.token-expiry-badge.ok     { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.token-expiry-badge.warn   { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.token-expiry-badge.danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* ===== OFFLINE BANNER ===== */
#offlineBanner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: #dc2626; color: #fff;
  padding: 0.5rem 1rem; text-align: center;
  font-size: 0.88rem; font-weight: 600;
  display: none; align-items: center; justify-content: center; gap: 0.5rem;
  transition: transform 0.3s;
}
#offlineBanner.visible { display: flex; }

/* ===== FLOATING ADD BUTTON ===== */
#fabAdd {
  position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 1050;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; font-size: 1.5rem; line-height: 1;
  box-shadow: 0 4px 16px rgba(0,176,185,0.45);
  cursor: pointer; display: none; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
#fabAdd:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(0,176,185,0.55); }
#fabAdd.visible { display: flex; }

/* ===== HEATMAP ===== */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  gap: 2px;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--border);
  cursor: default;
  transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.4); z-index: 1; position: relative; }
.heatmap-cell.l1 { background: rgba(0,176,185,0.25); }
.heatmap-cell.l2 { background: rgba(0,176,185,0.5); }
.heatmap-cell.l3 { background: rgba(0,176,185,0.75); }
.heatmap-cell.l4 { background: var(--accent); }
.heatmap-cell.future { background: transparent; }

/* ===== SWIPE KALENDER ===== */
#act-tab-kalender { touch-action: pan-y; }

/* ===== KEYBOARD HINT ===== */
.kbd-hint {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem; color: var(--text-muted);
  background: var(--body-bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
body.dark-mode .kbd-hint { background: #0f172a; }
body.dark-mode .token-expiry-badge.ok     { background: #052e16; color: #4ade80; border-color: #166534; }
body.dark-mode .token-expiry-badge.warn   { background: #451a03; color: #fde68a; border-color: #92400e; }
body.dark-mode .token-expiry-badge.danger { background: #450a0a; color: #fca5a5; border-color: #991b1b; }

/* ===== RESPONSIVE TABLE ===== */
@media (max-width: 700px) {
  .act-table-responsive thead { display: none; }
  .act-table-responsive tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    background: var(--card-bg);
    padding: 0.5rem 0.75rem;
  }
  .act-table-responsive td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.3rem 0 !important;
    border: none !important;
    font-size: 0.82rem;
  }
  .act-table-responsive td::before {
    content: attr(data-label);
    font-weight: 700; font-size: 0.72rem;
    text-transform: uppercase; color: var(--text-muted);
    margin-right: 0.5rem; flex-shrink: 0;
  }
}

/* ===== SEARCH INPUT ===== */
.act-search-input {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
  min-width: 160px;
}
.act-search-input:focus { border-color: var(--accent); }
body.dark-mode .act-search-input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
