:root {
  --tc-bg: #06070a;
  --tc-surface: rgba(24, 27, 36, 0.72);
  --tc-surface-2: rgba(255, 255, 255, 0.06);
  --tc-border: rgba(255, 255, 255, 0.08);
  --tc-text: #eef0f6;
  --tc-muted: #9099ac;
  --tc-accent: #6ba0ff;
  --tc-green: #34d399;
  --tc-orange: #f5a623;
  --tc-red: #ff6b6b;
  --tc-gold: #d4af6a;
  --tc-radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body.tc-body {
  margin: 0;
  min-height: 100vh;
  background: var(--tc-bg);
  color: var(--tc-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* Ambient glowing background blobs */
body.tc-body::before,
body.tc-body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
}
body.tc-body::before {
  width: 520px; height: 520px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(79,140,255,0.28), transparent 70%);
}
body.tc-body::after {
  width: 480px; height: 480px;
  bottom: -180px; right: -140px;
  background: radial-gradient(circle, rgba(212,175,106,0.22), transparent 70%);
}

.tc-shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.tc-back {
  color: var(--tc-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}
.tc-back:hover { color: var(--tc-text); }

.tc-header { text-align: center; margin-bottom: 32px; }
.tc-header img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 12px; border-radius: 12px; }
.tc-header h1 { font-size: 1.7rem; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.01em; }
.tc-header p { color: var(--tc-muted); margin: 0; font-size: 0.95rem; }

/* Glass card */
.tc-card {
  background: var(--tc-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6);
}

/* Status-based glow on the main dashboard card */
.tc-dashboard-card { padding: 0; overflow: hidden; transition: box-shadow 0.3s ease; }
.tc-glow-on { box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(52,211,153,0.15), 0 0 60px -10px rgba(52,211,153,0.25); }
.tc-glow-break { box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,166,35,0.2), 0 0 60px -10px rgba(245,166,35,0.3); }
.tc-glow-off { box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6); }

.tc-dept-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--tc-border);
}
.tc-dept-banner-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; }
.tc-dept-banner-name { font-weight: 700; font-size: 0.95rem; }
.tc-onduty-pill {
  margin-left: auto;
  background: rgba(52,211,153,0.14);
  color: var(--tc-green);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.tc-dash-top { display: flex; align-items: center; gap: 18px; padding: 28px 28px 24px; }

.tc-avatar-ring {
  width: 76px; height: 76px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: conic-gradient(from 0deg, var(--tc-border), var(--tc-border));
  padding: 3px;
}
.tc-avatar-ring.on { background: conic-gradient(from 0deg, var(--tc-green), #1a5c46, var(--tc-green)); animation: tc-spin 3s linear infinite; }
.tc-avatar-ring.break { background: conic-gradient(from 0deg, var(--tc-orange), #6b4300, var(--tc-orange)); animation: tc-spin 3s linear infinite; }
@keyframes tc-spin { to { transform: rotate(360deg); } }
.tc-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #10121a; display: block; }

.tc-greeting { margin: 0 0 8px; font-size: 1.4rem; font-weight: 800; }
.tc-status-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tc-status-text { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; color: var(--tc-muted); }
.tc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc-muted); }
.tc-dot.on { background: var(--tc-green); box-shadow: 0 0 12px var(--tc-green); }
.tc-dot.break { background: var(--tc-orange); box-shadow: 0 0 12px var(--tc-orange); }

.tc-dashboard-card > form,
.tc-dashboard-card > .tc-btn-row,
.tc-dashboard-card > .tc-notice {
  margin-left: 28px;
  margin-right: 28px;
}
.tc-dashboard-card > form:last-child,
.tc-dashboard-card > .tc-btn-row:last-child { margin-bottom: 28px; }
.tc-dashboard-card > .tc-notice { margin-bottom: 24px; }

/* Buttons */
.tc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.tc-btn:hover { transform: translateY(-2px); text-decoration: none; filter: brightness(1.08); }
.tc-btn:active { transform: translateY(0); }
.tc-btn-in { background: linear-gradient(135deg, #34d399, #1fa876); color: #05261a; box-shadow: 0 10px 24px -8px rgba(52,211,153,0.5); }
.tc-btn-out { background: linear-gradient(135deg, #ff6b6b, #d43f3f); color: #2b0a0a; box-shadow: 0 10px 24px -8px rgba(255,107,107,0.5); }
.tc-btn-break { background: linear-gradient(135deg, #f5a623, #d4880a); color: #2b1900; box-shadow: 0 10px 24px -8px rgba(245,166,35,0.5); }
.tc-btn-discord { background: linear-gradient(135deg, #5865F2, #4752c4); color: white; box-shadow: 0 10px 24px -8px rgba(88,101,242,0.5); }
.tc-btn-small { width: auto; padding: 10px 18px; font-size: 0.85rem; box-shadow: none; }
.tc-btn-outline { background: rgba(255,255,255,0.03); border: 1px solid var(--tc-border); color: var(--tc-text); }
.tc-btn-outline:hover { border-color: var(--tc-accent); filter: none; }
.tc-btn-danger-outline { background: rgba(255,107,107,0.06); border: 1px solid rgba(255,107,107,0.35); color: var(--tc-red); }

.tc-btn-row { display: flex; gap: 12px; }
.tc-btn-row form { flex: 1; }

.tc-btn-fit {
  width: fit-content;
  padding: 16px 44px;
  margin: 0 28px 28px;
}
.tc-dashboard-card form:has(.tc-btn-fit) { display: flex; }

.tc-admin-link { text-align: center; margin-top: 4px; }

/* Hub grid */
.tc-hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tc-hub-card {
  background: var(--tc-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  padding: 26px 20px;
  text-align: center;
  color: var(--tc-text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tc-hub-card:hover { transform: translateY(-4px); border-color: rgba(107,160,255,0.4); box-shadow: 0 16px 32px -12px rgba(0,0,0,0.5); text-decoration: none; }
.tc-hub-card img { width: 52px; height: 52px; object-fit: contain; margin-bottom: 12px; border-radius: 10px; }
.tc-hub-card h2 { margin: 0; font-size: 1.05rem; }

.tc-empty { color: var(--tc-muted); text-align: center; padding: 40px 0; }

/* Tables */
.tc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tc-table th, .tc-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--tc-border); }
.tc-table th { color: var(--tc-muted); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.tc-table tr:last-child td { border-bottom: none; }

.tc-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.tc-badge-active { background: rgba(52,211,153,0.15); color: var(--tc-green); }

.tc-section-title { font-size: 1rem; font-weight: 800; margin: 0 0 16px; color: var(--tc-text); }

.tc-inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tc-inline-form select, .tc-inline-form input[type="datetime-local"] {
  background: var(--tc-surface-2);
  border: 1px solid var(--tc-border);
  color: var(--tc-text);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
}

.tc-notice { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 20px; }
.tc-notice-success { background: rgba(52,211,153,0.1); color: var(--tc-green); border: 1px solid rgba(52,211,153,0.3); }
.tc-notice-error { background: rgba(255,107,107,0.1); color: var(--tc-red); border: 1px solid rgba(255,107,107,0.3); }

.tc-footer { text-align: center; margin-top: 40px; color: var(--tc-muted); font-size: 0.8rem; }
