@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Outfit:wght@500;600;700&display=swap");

:root {
  --evrasko-brand: #EF4A3F;
  --evrasko-brand-hover: #d63d33;
  --evrasko-brand-soft: rgba(239, 74, 63, 0.12);
  --evrasko-brand-glow: rgba(239, 74, 63, 0.22);
  --evrasko-sidebar: #0e0e0e;
  --evrasko-sidebar-border: rgba(255, 255, 255, 0.08);
  --evrasko-accent: #EF4A3F;
  --evrasko-surface: #ffffff;
  --evrasko-bg: #f3f4f6;
  --evrasko-text: #1a1d21;
  --evrasko-muted: #6b7280;
  --evrasko-radius: .85rem;
  --evrasko-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
  --evrasko-shadow-hover: 0 4px 16px rgba(16, 24, 40, 0.08);
  --bs-primary: #EF4A3F;
  --bs-primary-rgb: 239, 74, 63;
  --bs-link-color: #EF4A3F;
  --bs-link-hover-color: #d63d33;
  --bs-body-font-family: "DM Sans", system-ui, sans-serif;
  --bs-border-radius: .65rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(239, 74, 63, 0.06), transparent 55%),
    var(--evrasko-bg);
  color: var(--evrasko-text);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .page-title {
  font-family: "Outfit", "DM Sans", sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: var(--evrasko-brand);
  transition: color .15s ease;
}

a:hover {
  color: var(--evrasko-brand-hover);
}

.btn {
  border-radius: .65rem;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn-primary {
  --bs-btn-bg: #EF4A3F;
  --bs-btn-border-color: #EF4A3F;
  --bs-btn-hover-bg: #d63d33;
  --bs-btn-hover-border-color: #d63d33;
  --bs-btn-active-bg: #c4352c;
  --bs-btn-active-border-color: #c4352c;
  --bs-btn-disabled-bg: #EF4A3F;
  --bs-btn-disabled-border-color: #EF4A3F;
  box-shadow: 0 6px 16px var(--evrasko-brand-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px var(--evrasko-brand-glow);
}

.btn-outline-primary {
  --bs-btn-color: #EF4A3F;
  --bs-btn-border-color: #EF4A3F;
  --bs-btn-hover-bg: #EF4A3F;
  --bs-btn-hover-border-color: #EF4A3F;
  --bs-btn-active-bg: #d63d33;
  --bs-btn-active-border-color: #d63d33;
  --bs-btn-disabled-color: #EF4A3F;
  --bs-btn-disabled-border-color: #EF4A3F;
}

.btn-outline-secondary,
.btn-outline-danger {
  border-radius: .65rem;
}

.text-primary {
  color: #EF4A3F !important;
}

.page-link {
  color: #EF4A3F;
  border-radius: .45rem !important;
  margin: 0 .1rem;
}

.page-item.active .page-link {
  background-color: #EF4A3F;
  border-color: #EF4A3F;
}

.form-control,
.form-select {
  border-radius: .65rem;
  border-color: #e5e7eb;
  padding: .6rem .85rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: #EF4A3F;
  box-shadow: 0 0 0 .2rem var(--evrasko-brand-soft);
}

.form-label {
  font-weight: 600;
  font-size: .9rem;
  color: #374151;
}

#wrapper {
  min-height: 100vh;
}

#sidebar {
  width: 260px;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%) !important;
  position: fixed;
  top: 0;
  left: 0;
  flex-shrink: 0;
  border-right: 1px solid var(--evrasko-sidebar-border) !important;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar .sidebar-brand,
#sidebar .sidebar-footer {
  flex-shrink: 0;
}

#sidebar > .nav {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#sidebar .sidebar-footer {
  padding: .85rem;
  border-top: 1px solid var(--evrasko-sidebar-border);
}

#sidebar .sidebar-brand {
  padding: 1rem .9rem .9rem !important;
  overflow: hidden;
  border-bottom-color: var(--evrasko-sidebar-border) !important;
}

#sidebar .sidebar-brand a {
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.brand-logo-full {
  display: block;
  max-width: 100%;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

#sidebar .sidebar-brand .small {
  text-align: left;
  margin-top: .45rem !important;
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45) !important;
}

#sidebar .nav-section {
  color: rgba(255, 255, 255, 0.35);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .85rem .85rem .35rem;
}

#sidebar .nav-link {
  border-radius: .7rem;
  margin: 0 .35rem .2rem;
  padding: .55rem .85rem;
  opacity: .88;
  color: rgba(255, 255, 255, 0.82) !important;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}

#sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .08);
  opacity: 1;
  color: #fff !important;
}

#sidebar .nav-link.active {
  background: var(--evrasko-brand);
  opacity: 1;
  font-weight: 600;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(239, 74, 63, 0.28);
}

.auth-logo-img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  border-radius: .5rem;
}

.auth-mark-mobile {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: .75rem;
}

#page-content {
  min-width: 0;
  margin-left: 260px;
  width: calc(100% - 260px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
  min-height: 64px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EF4A3F, #c4352c);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  box-shadow: 0 4px 12px var(--evrasko-brand-glow);
}

.page-header {
  margin-bottom: 1.35rem;
}

.page-header h1,
.page-header .h3 {
  margin-bottom: .25rem;
}

.page-header .text-muted {
  color: var(--evrasko-muted) !important;
}

.card {
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--evrasko-radius);
  box-shadow: var(--evrasko-shadow);
  background: var(--evrasko-surface);
  transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
  box-shadow: var(--evrasko-shadow-hover);
}

.card-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  background: #fff;
  border-radius: var(--evrasko-radius) var(--evrasko-radius) 0 0 !important;
  padding: .9rem 1.1rem;
}

.card-body {
  padding: 1.1rem;
}

.stat-card {
  border: 0;
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--evrasko-brand);
  opacity: .85;
}

.stat-card .card-body {
  padding: 1.15rem 1.2rem 1.15rem 1.35rem;
}

.stat-card .stat-label {
  color: var(--evrasko-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.stat-card .stat-value {
  font-family: "Outfit", "DM Sans", sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: .2rem;
}

.stat-card .stat-value.text-primary {
  color: #EF4A3F !important;
}

.chart-card .card-body h2,
.chart-card h2.h6 {
  font-family: "Outfit", "DM Sans", sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
}

.table {
  --bs-table-striped-bg: rgba(243, 244, 246, 0.7);
}

.table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table > :not(caption) > * > * {
  padding: .7rem .85rem;
}

.table-hover > tbody > tr {
  transition: background-color .12s ease;
}

.badge {
  font-weight: 600;
  letter-spacing: .01em;
  padding: .4em .65em;
  border-radius: .5rem;
}

.alert {
  border: 0;
  border-radius: .85rem;
  box-shadow: var(--evrasko-shadow);
}

.login-wrap,
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 85% 15%, rgba(239, 74, 63, .38), transparent 42%),
    radial-gradient(circle at 10% 80%, rgba(239, 74, 63, .12), transparent 35%),
    linear-gradient(155deg, #0a0a0a 0%, #151515 50%, #24110f 100%);
}

.auth-shell {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 1.75rem;
  align-items: stretch;
  animation: fadeRise .45s ease both;
}

.auth-brand {
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand h1 {
  font-family: "Outfit", "DM Sans", sans-serif;
  letter-spacing: -0.03em;
}

.auth-card,
.login-card {
  width: 100%;
  border: 0;
  border-radius: 1.15rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  animation: fadeRise .5s ease .05s both;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #9ca3af;
  font-size: .85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.btn-google:hover,
.btn-google:focus {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.btn-google .google-icon {
  flex-shrink: 0;
}

.password-rules {
  color: #6b7280;
}

.password-rule {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .15rem 0;
  transition: color .15s ease;
}

.password-rule .rule-mark {
  font-size: .7rem;
  line-height: 1;
  color: #9ca3af;
}

.password-rule.is-met {
  color: #15803d;
  font-weight: 500;
}

.password-rule.is-met .rule-mark {
  color: #16a34a;
}

.auth-card .card-body,
.login-card .card-body {
  padding: 1.75rem !important;
}

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

.login-card h1 {
  color: #111;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EF4A3F, #b91c1c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  box-shadow: 0 10px 24px var(--evrasko-brand-glow);
}

.profile-link:hover .fw-semibold {
  color: var(--evrasko-brand);
}

.nav-tabs {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.nav-tabs .nav-link.active {
  color: var(--evrasko-brand);
  border-color: transparent transparent #fff;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--evrasko-brand);
}

.nav-tabs .nav-link {
  color: #6c757d;
  border: 0;
  border-radius: .5rem .5rem 0 0;
}

.nav-tabs .nav-link:hover {
  color: var(--evrasko-brand);
  border-color: transparent;
}

.badge-record-historical {
  background: #0dcaf0;
}

.badge-record-projected {
  background: #ffc107;
  color: #212529;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1025;
}

.sidebar-backdrop.show {
  display: block;
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main.container-fluid > .page-header,
main.container-fluid > .d-flex.justify-content-between:first-child,
main.container-fluid > h1:first-child {
  animation: fadeRise .35s ease both;
}

@media (max-width: 767.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .auth-brand {
    padding: 1rem .5rem .25rem;
    text-align: center;
  }
  .auth-brand .auth-logo-img {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 991.98px) {
  #sidebar {
    left: -280px;
    z-index: 1040;
    transition: left .22s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, .25);
  }
  #sidebar.show {
    left: 0;
  }
  #page-content {
    margin-left: 0;
    width: 100%;
  }
}
