:root {
  --sidebar-bg: #171a2b;
  --sidebar-bg-alt: #1f2340;
  --sidebar-text: #aeb3d1;
  --sidebar-text-active: #ffffff;
  --accent: #6c63ff;
  --accent-dark: #574fd6;
  --accent-soft: rgba(108, 99, 255, 0.12);
  --content-bg: #f3f4f9;
  --card-radius: 1rem;
  --sidebar-width: 260px;
}

body {
  background-color: var(--content-bg);
  color: #2b2d42;
}

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

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-alt) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar .offcanvas-header {
  color: #fff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.5rem 1.25rem 1rem;
  color: #fff;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.1;
}

.sidebar-brand .brand-sub {
  font-size: 0.72rem;
  color: var(--sidebar-text);
  font-weight: 400;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0.9rem;
  margin: 0;
  flex: 1 1 auto;
}

.sidebar-nav .nav-link {
  color: var(--sidebar-text);
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.93rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-link i {
  font-size: 1.05rem;
  width: 1.2rem;
  text-align: center;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.35);
}

.sidebar-footer {
  padding: 1rem 1.25rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user .name {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-user .role {
  font-size: 0.72rem;
  color: var(--sidebar-text);
}

/* ---------- Mobile topbar ---------- */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.75rem 1rem;
}

.mobile-topbar .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991.98px) {
  .mobile-topbar {
    display: flex;
  }
}

/* ---------- Content area ---------- */
.content-area {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- Cards ---------- */
.card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: 0 2px 10px rgba(23, 26, 43, 0.06);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(23, 26, 43, 0.06);
  font-weight: 600;
}

/* Stat cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
}

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #8a8ea6;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #21243a;
}

.icon-bg-violet { background: rgba(108, 99, 255, 0.12); color: var(--accent); }
.icon-bg-teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }
.icon-bg-amber { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.icon-bg-rose { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }

/* ---------- Timer ---------- */
.timer-card {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--accent-dark) 130%);
  color: #fff;
  border-radius: var(--card-radius);
}

.timer-card .form-select,
.timer-card .form-control {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.timer-card .form-select option {
  color: #21243a;
}

.timer-card .form-select::placeholder,
.timer-card .form-control::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.timer-card .form-select:focus,
.timer-card .form-control:focus {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

#timer-display {
  letter-spacing: 4px;
  font-size: 3.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.timer-status {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.timer-status .pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  margin-right: 0.4rem;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ---------- Misc ---------- */
.navbar-brand { font-weight: 600; }

.table td, .table th { vertical-align: middle; }

.badge.project-badge {
  padding: 0.4em 0.75em;
  border-radius: 50px;
  font-weight: 500;
}

.btn { border-radius: 0.6rem; }
.btn-primary { background-color: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background-color: var(--accent-dark); border-color: var(--accent-dark); }

.form-select, .form-control { border-radius: 0.6rem; }

.chart-card canvas {
  max-height: 260px;
}

/* ---------- Auth page ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--accent-dark) 130%);
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  border-radius: 1.25rem;
  box-shadow: 0 20px 45px rgba(23, 26, 43, 0.35);
}

@media (min-width: 992px) {
  .content-area {
    margin-left: 0;
  }
}
