*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #f1f5f9;
  --secondary-hover: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --selected-row: #eef2ff;
  --search-bg: #f1f5f9;
  --search-focus: #ffffff;
  --search-border: #e2e8f0;
  --input-text: #1e293b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --badge-bg: #f1f5f9;
  --badge-text: #64748b;
  --gradient-1: #f0f7ff;
  --gradient-2: #dbeafe;
  --gradient-3: #bfdbfe;
  --gradient-4: #93c5fd;
  --gradient-5: #60a5fa;
  --gradient-6: #3b82f6;
  --toolbar-bg: #f8fafc;
  --pagination-btn: #ffffff;
  --pagination-btn-hover: #f1f5f9;
  --pagination-btn-active: #2563eb;
  --pagination-text-active: #ffffff;
}
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #172033;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #1e293b;
  --secondary-hover: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --selected-row: #1e3a5f;
  --search-bg: #1e293b;
  --search-focus: #1e293b;
  --search-border: #334155;
  --input-text: #f1f5f9;
  --badge-bg: #1e293b;
  --badge-text: #94a3b8;
  --gradient-1: #0f172a;
  --gradient-2: #0c1f3a;
  --gradient-3: #0f2747;
  --gradient-4: #142d57;
  --gradient-5: #1a3a6b;
  --gradient-6: #1e4a82;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --toolbar-bg: #1e293b;
  --pagination-btn: #1e293b;
  --pagination-btn-hover: #334155;
  --pagination-btn-active: #3b82f6;
  --pagination-text-active: #ffffff;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  transition: background 0.3s, color 0.3s;
}
.bg-gradient {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40vh;
  z-index: -1;
  background: linear-gradient(
    135deg,
    var(--gradient-1) 0%,
    var(--gradient-2) 20%,
    var(--gradient-3) 45%,
    var(--gradient-4) 65%,
    var(--gradient-5) 85%,
    var(--gradient-6) 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  mask-image: linear-gradient(to top, black 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, black 30%, transparent 100%);
  transition: background 0.5s;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  33% { background-position: 50% 100%; }
  66% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 1px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 6px;
}

.greeting h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--secondary);
}

.theme-toggle svg {
  display: block;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--badge-bg);
  color: var(--badge-text);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-badge.syncing .dot {
  background: #f59e0b;
  animation: pulse 1s ease-in-out infinite;
}

.status-badge.error .dot {
  background: var(--danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* ─── Header Avatar ─── */
.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.header-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2rem 0 0;
}
.hidden { display: none !important; }
