/* KM Technolabs PMS — screenshot redesign overrides */

:root {
  --km-blue: #0066ff;
  --km-blue-hover: #0052cc;
  --km-blue-soft: #e8f1ff;
  --km-green: #58ac3c;
  --km-navy: #0f172a;
  --km-text: #1e293b;
  --km-muted: #64748b;
  --km-border: #e2e8f0;
  --km-bg: #f0f4f8;
  --km-white: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --sidebar-width: 248px;
  --primary: var(--km-blue);
  --primary-hover: var(--km-blue-hover);
}

body.app-body {
  background: var(--km-bg);
  color: var(--km-text);
}

/* —— App shell —— */
.app-sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--km-border);
  box-shadow: none;
}

.sidebar-brand {
  padding: 0;
  border-bottom: 1px solid var(--km-border);
}

.sidebar-brand-link {
  padding: 1.1rem 1.15rem 0.55rem;
}

.sidebar-brand-logo {
  max-width: 168px;
}

.sidebar-brand-meta {
  padding: 0 1.15rem 0.85rem;
}

.sidebar-brand-meta strong {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--km-navy);
}

.sidebar-brand-meta small {
  color: var(--km-muted) !important;
  font-size: 0.75rem;
}

.sidebar-section-label {
  margin: 0.85rem 0.65rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0.45rem;
  padding: 0.62rem 0.8rem;
  border-radius: 10px;
  color: #475569 !important;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-link i {
  font-size: 1.05rem;
  opacity: 0.9;
}

.sidebar-link:hover {
  background: #f8fafc;
  color: var(--km-navy) !important;
}

.sidebar-link.active {
  background: var(--km-blue-soft);
  color: var(--km-blue) !important;
  font-weight: 600;
}

.sidebar-link .badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.35rem 1rem;
}

.sidebar-user {
  margin-top: auto;
  padding: 0.85rem 1rem 1.1rem;
  border-top: 1px solid var(--km-border);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0066ff, #58ac3c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-meta {
  min-width: 0;
}

.sidebar-user-meta strong {
  display: block;
  font-size: 0.82rem;
  color: var(--km-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-meta small {
  color: var(--km-muted);
  font-size: 0.72rem;
}

.sidebar-footer { display: none; }

/* —— Topbar —— */
.app-topbar {
  background: transparent;
  border-bottom: none;
  padding: 1rem 1.5rem 0.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-left { display: none; }

.topbar-search {
  flex: 1;
  min-width: 220px;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.topbar-search i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  border: 1px solid var(--km-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.65rem 3.5rem 0.65rem 2.45rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.topbar-search input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.topbar-search .kbd {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.12rem 0.4rem;
  font-family: inherit;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.theme-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--km-border);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow);
}

.theme-toggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.theme-toggle button.active {
  background: #2563eb;
  color: #fff;
}

.login-theme-toggle.theme-toggle button {
  width: auto;
  height: auto;
  padding: 0.4rem 0.85rem;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--km-blue);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
  transition: background 160ms ease, transform 160ms ease;
}

.btn-create:hover {
  background: var(--km-blue-hover);
  color: #fff !important;
  transform: translateY(-1px);
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--km-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  position: relative;
}

.topbar-icon-btn:hover {
  background: #f8fafc;
  color: var(--km-navy);
}

.topbar-icon-btn .badge,
#notification-badge.badge {
  font-size: 0.62rem;
  min-width: 1.1rem;
}

.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--km-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.65rem 0.28rem 0.3rem;
  text-decoration: none !important;
  color: inherit;
}

.topbar-user-btn:hover {
  background: #f8fafc;
}

.topbar-user-btn .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
}

.topbar-user-text {
  text-align: left;
  line-height: 1.15;
}

.topbar-user-text strong {
  display: block;
  font-size: 0.78rem;
  color: var(--km-navy);
}

.topbar-user-text small {
  font-size: 0.68rem;
  color: var(--km-muted);
}

/* Compact topbar user / notification menus */
.user-menu.dropdown-menu {
  min-width: 10.5rem;
  max-width: 12.5rem;
  padding: 0.35rem;
  margin-top: 0.4rem !important;
  border: 1px solid var(--km-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.8125rem;
}

.user-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  color: #334155;
}

.user-menu .dropdown-item i {
  font-size: 0.9rem;
  width: 1rem;
  text-align: center;
  color: #64748b;
  line-height: 1;
}

.user-menu .dropdown-item:hover,
.user-menu .dropdown-item:focus {
  background: #f1f5f9;
  color: #0f172a;
}

.user-menu .dropdown-item:hover i,
.user-menu .dropdown-item:focus i {
  color: #475569;
}

.user-menu .dropdown-item-danger,
.user-menu .dropdown-item-danger:hover,
.user-menu .dropdown-item-danger:focus {
  color: #dc4c4c;
}

.user-menu .dropdown-item-danger i {
  color: #dc4c4c;
}

.user-menu .dropdown-divider {
  margin: 0.3rem 0.35rem;
  border-top-color: var(--km-border);
  opacity: 1;
}

.notification-menu.dropdown-menu {
  min-width: 18rem;
  max-width: 22rem;
  padding: 0;
  margin-top: 0.4rem !important;
  border: 1px solid var(--km-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.8125rem;
  overflow: hidden;
}

.app-content {
  padding: 0.75rem 1.5rem 2rem;
}

/* —— Dashboard hero —— */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.dash-greeting .dash-date {
  color: var(--km-muted);
  font-size: 0.84rem;
  margin-bottom: 0.35rem;
}

.dash-greeting h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--km-navy);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.dash-greeting p {
  color: var(--km-muted);
  margin: 0;
  max-width: 36rem;
}

.dash-promo {
  background: linear-gradient(135deg, #e8f1ff 0%, #f0fdf4 55%, #fff 100%);
  border: 1px solid #dbe7f7;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dash-promo-copy strong {
  display: block;
  font-size: 0.95rem;
  color: var(--km-navy);
  margin-bottom: 0.2rem;
}

.dash-promo-copy span {
  font-size: 0.78rem;
  color: var(--km-muted);
  line-height: 1.35;
}

.dash-promo-visual {
  width: 96px;
  height: 76px;
  border-radius: 12px;
  background: #fff url("../images/login-bg.6cfd52c86608.jpg") left 40% / cover no-repeat;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  position: relative;
  overflow: hidden;
}

/* —— Stat cards —— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--km-border);
  border-radius: 14px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.stat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-icon.blue { background: #e8f1ff; color: #0066ff; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.teal { background: #ccfbf1; color: #0d9488; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--km-muted);
  margin: 0;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--km-navy);
  line-height: 1;
}

.stat-delta {
  font-size: 0.7rem;
  color: #94a3b8;
}

.stat-delta.up { color: #16a34a; }

/* —— Panels —— */
.panel {
  background: #fff;
  border: 1px solid var(--km-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--km-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header .h6 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--km-navy);
}

.panel-body { padding: 1rem 1.1rem; }

.empty-state {
  text-align: center;
  padding: 2rem 1.25rem;
  color: var(--km-muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  background: linear-gradient(145deg, #e8f1ff, #f0fdf4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--km-blue);
  font-size: 1.6rem;
}

.empty-state strong {
  display: block;
  color: var(--km-navy);
  margin-bottom: 0.25rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e8f1ff;
  color: #0066ff;
}

.status-badge.status-todo { background: #e8f1ff; color: #0066ff; }
.status-badge.status-in_progress { background: #ffedd5; color: #c2410c; }
.status-badge.status-test_deployed { background: #fef3c7; color: #b45309; }
.status-badge.status-production_deployed { background: #dbeafe; color: #1d4ed8; }
.status-badge.status-completed { background: #dcfce7; color: #15803d; }

.priority-pill {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.84rem;
}

.activity-list li:last-child { border-bottom: 0; }

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.project-overview-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.project-overview-item:last-child { border-bottom: 0; }

.project-overview-item a {
  font-weight: 700;
  color: var(--km-navy);
  text-decoration: none !important;
}

.project-overview-item a:hover { color: var(--km-blue); }

.project-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.project-metric {
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.55rem 0.45rem;
  text-align: center;
}

.project-metric strong {
  display: block;
  font-size: 0.95rem;
  color: var(--km-navy);
}

.project-metric span {
  font-size: 0.68rem;
  color: var(--km-muted);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #eef2f6;
}

.progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #0066ff, #38bdf8);
}

.quick-actions {
  background: linear-gradient(145deg, #e8f1ff 0%, #f5f3ff 50%, #ecfdf5 100%);
  border: 1px solid #dbe7f7;
  border-radius: 16px;
  padding: 1.15rem;
  height: 100%;
  box-shadow: var(--shadow);
}

.quick-actions h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--km-navy);
}

.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.qa-item {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  padding: 0.95rem 0.75rem;
  text-align: center;
  text-decoration: none !important;
  color: var(--km-navy);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.qa-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--km-blue);
}

.qa-item i {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
  color: var(--km-blue);
}

.qa-item span {
  font-size: 0.78rem;
  font-weight: 600;
}

.recent-project-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.2fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.recent-project-row:last-child { border-bottom: 0; }

/* —— Login page —— */
body.auth-page {
  background: #d7e8f7;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

body.auth-page .app-shell {
  display: block;
  min-height: 100vh;
}

body.auth-page .app-main,
body.auth-page .app-content {
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

body.auth-page .flash-messages,
body.auth-page #toast-area {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(420px, calc(100% - 2rem));
}

.login-page {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  align-items: stretch;
  background:
    radial-gradient(ellipse 55% 70% at 78% 42%, rgba(255, 255, 255, 0.55) 0%, transparent 70%),
    linear-gradient(100deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.72) 32%, rgba(232, 243, 252, 0.28) 58%, rgba(255, 255, 255, 0.18) 100%),
    url("../images/login-bg.6cfd52c86608.jpg") left 42% / cover no-repeat;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: min(58%, 720px);
  background:
    radial-gradient(ellipse 90% 80% at 20% 50%, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.login-theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 5;
  display: inline-flex;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.login-theme-toggle button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.login-theme-toggle button.active {
  background: #2563eb;
  color: #fff;
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: clamp(2.5rem, 6vh, 4rem) clamp(2rem, 5vw, 4.5rem);
}

.login-brand-inner {
  width: 100%;
  max-width: 460px;
}

.login-brand-logo {
  display: block;
  width: 200px;
  max-width: 55%;
  height: auto;
  margin: 0 0 2.25rem;
}

.login-copy {
  max-width: 420px;
}

.login-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7b8794;
  margin: 0 0 0.85rem;
  line-height: 1.2;
}

.login-headline {
  font-size: clamp(2.15rem, 3.6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: #0f172a;
  margin: 0 0 0.85rem;
}

.login-headline em {
  font-style: normal;
  font-weight: 700;
  color: #2563eb;
}

.login-sub {
  color: #5b6775;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  margin: 0 0 2rem;
  max-width: 22.5rem;
}

.login-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.05rem;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.05rem;
}

.login-feature-icon.blue { background: #e8f0fe; color: #2563eb; }
.login-feature-icon.purple { background: #f0e9ff; color: #7c3aed; }
.login-feature-icon.green { background: #e6f7ed; color: #16a34a; }
.login-feature-icon.orange { background: #fff0e6; color: #ea580c; }

.login-feature-text {
  min-width: 0;
  line-height: 1.25;
}

.login-feature-text strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
}

.login-feature-text span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #7b8794;
  line-height: 1.4;
}

.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4.5rem, 8vh, 5.5rem) clamp(1.5rem, 4vw, 3.5rem) clamp(2rem, 5vh, 3rem);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 28px;
  padding: 2rem 1.85rem 1.85rem;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 18px 48px rgba(15, 23, 42, 0.12);
}

.login-card-logo {
  display: block;
  width: 168px;
  height: auto;
  margin: 0 auto 1.15rem;
}

.login-card-title {
  text-align: center;
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #0f172a;
  margin: 0 0 0.35rem;
}

.login-card-sub {
  text-align: center;
  color: #8b96a5;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  margin: 0 0 1.65rem;
}

.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 1.05rem;
}

.login-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.login-field-error {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap > i {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  line-height: 1;
}

.login-input-wrap .login-input,
.login-card .login-input {
  display: block;
  width: 100%;
  height: 48px;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  padding: 0 0.95rem 0 2.55rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.2;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-input-wrap .login-input::placeholder {
  color: #a0aab8;
  font-weight: 400;
}

.login-input-wrap #id_password {
  padding-right: 2.75rem;
}

.login-input-wrap .login-input:focus,
.login-card .login-input:focus {
  outline: 0;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.login-toggle-pw {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}

.login-toggle-pw:hover {
  color: #475569;
  background: #f8fafc;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.15rem 0 1.35rem;
  font-size: 0.8125rem;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: #475569;
  font-weight: 400;
  cursor: pointer;
  user-select: none;
}

.login-remember .form-check-input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  float: none;
}

.login-remember .form-check-input:checked {
  background-color: #2563eb;
  border-color: #2563eb;
}

.login-row a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.login-row a:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.btn-login {
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.975rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
}

.btn-login span {
  font-size: 1.05em;
  line-height: 1;
}

.btn-login:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.34);
  color: #fff;
}

html.theme-dark .login-page {
  background:
    radial-gradient(ellipse 55% 70% at 78% 42%, rgba(30, 41, 59, 0.45) 0%, transparent 70%),
    linear-gradient(100deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.7) 40%, rgba(15, 23, 42, 0.4) 100%),
    url("../images/login-bg.6cfd52c86608.jpg") left 42% / cover no-repeat;
}

html.theme-dark .login-page::before {
  background: radial-gradient(ellipse 90% 80% at 20% 50%, rgba(15, 23, 42, 0.45) 0%, transparent 70%);
}

html.theme-dark .login-headline,
html.theme-dark .login-feature-text strong { color: #f8fafc; }
html.theme-dark .login-eyebrow,
html.theme-dark .login-sub,
html.theme-dark .login-feature-text span { color: #94a3b8; }
html.theme-dark .login-card {
  background: rgba(15, 23, 42, 0.94);
  border-color: #334155;
}
html.theme-dark .login-card-title { color: #f8fafc; }
html.theme-dark .login-card-sub,
html.theme-dark .login-field label,
html.theme-dark .login-remember { color: #94a3b8; }
html.theme-dark .login-input-wrap .login-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}
html.theme-dark .login-theme-toggle {
  background: rgba(15, 23, 42, 0.9);
  border-color: #334155;
}

/* —— Responsive —— */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 992px) {
  .dash-hero { grid-template-columns: 1fr; }
  .login-page {
    grid-template-columns: 1fr;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(232, 243, 252, 0.55) 100%),
      url("../images/login-bg.6cfd52c86608.jpg") center 30% / cover no-repeat;
  }
  .login-page::before { display: none; }
  .login-brand { display: none; }
  .login-panel {
    min-height: 100vh;
    padding: 5rem 1.25rem 2rem;
  }
  .recent-project-row { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (min-width: 1200px) {
  .login-brand { padding-left: clamp(3rem, 7vw, 5.5rem); }
  .login-panel { padding-right: clamp(2rem, 5vw, 4rem); }
}

@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-search { max-width: none; order: 3; flex-basis: 100%; }
  .qa-grid { grid-template-columns: 1fr; }
  .project-metrics { grid-template-columns: repeat(2, 1fr); }
}
