:root {
  --portal-primary: #153b7a;
  --portal-accent: #1f5fbf;
  --portal-sidebar-bg: #0f172a;
}

body {
  font-family: 'Source Sans 3', sans-serif;
}

.portal-login-page {
  background: linear-gradient(135deg, #0f172a 0%, #111827 45%, #153b7a 100%);
}

.portal-login-box {
  width: min(420px, calc(100vw - 2rem));
}

.login-logo-preview,
.placeholder-logo,
.portal-brand-image {
  max-width: 180px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.portal-login-note {
  font-size: 0.95rem;
  color: #6c757d;
  background: #f8f9fa;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}

.app-sidebar {
  background: var(--portal-sidebar-bg) !important;
}

.portal-brand-link {
  justify-content: center;
  padding-inline: 1rem;
}

.portal-brand-link .brand-image {
  float: none;
  max-height: 48px;
  margin: 0;
}

.portal-user-avatar,
.portal-profile-card-avatar {
  width: 52px;
  height: 52px;
  object-fit: cover;
}

.portal-modal-avatar {
  width: 140px;
  height: 140px;
  object-fit: cover;
}

.portal-search-wrap {
  position: relative;
  min-width: 240px;
}

.portal-search-wrap .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  z-index: 3;
}

.portal-card {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.08);
}

.portal-chart {
  min-height: 320px;
}

.portal-chart-modal {
  min-height: 420px;
}

.portal-empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
}

.portal-stat-box {
  height: 100%;
  padding: 1rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #e9ecef;
}

.portal-stat-box span {
  display: block;
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.portal-stat-box strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.portal-todo-list {
  display: grid;
  gap: 0.85rem;
}

.portal-todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #e9ecef;
  background: #fff;
}

.portal-todo-item.is-complete {
  opacity: 0.7;
}

.portal-todo-left {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.portal-todo-title {
  font-weight: 700;
}

.portal-todo-meta {
  font-size: 0.9rem;
  color: #6c757d;
}

.portal-priority-badge {
  text-transform: capitalize;
  min-width: 84px;
}

.portal-priority-low { background: #e2f5e9; color: #176b35; }
.portal-priority-medium { background: #e7f0ff; color: #184fa3; }
.portal-priority-high { background: #fff3cd; color: #7a4d00; }
.portal-priority-urgent { background: #f8d7da; color: #842029; }

.portal-todo-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-placeholder-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

@media (max-width: 767.98px) {
  .portal-search-wrap {
    min-width: 150px;
  }

  .portal-todo-item {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-todo-actions {
    justify-content: flex-start;
  }
}
