:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --border: #dbe4ee;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f4c81;
  --primary-2: #2563eb;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;

  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.1);

  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f4f7fb 0%, #edf2f8 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.page-title {
  font-size: 14px;
  color: var(--muted);
}

.user-info {
  font-size: 14px;
  color: var(--muted);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  height: 42px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.btn-secondary {
  background: #e8eef6;
  color: var(--text);
}

.home-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  background: linear-gradient(135deg, #0a2557 0%, #0f4c81 55%, #2563eb 100%);
  color: #fff;
  border-radius: 30px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}

.hero-left h1 {
  margin: 8px 0 12px;
  font-size: 38px;
  line-height: 1.08;
}

.hero-left p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  opacity: 0.76;
}

.hero-right {
  display: grid;
  gap: 10px;
  align-content: start;
}

.hero-stat {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 14px 16px;
}

.hero-stat span {
  display: block;
  font-size: 12px;
  opacity: 0.78;
  margin-bottom: 6px;
}

.hero-stat strong {
  display: block;
  font-size: 19px;
}

.picker-card,
.panel,
.kpi-card,
.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.picker-card {
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 18px;
}

.picker-head h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.picker-head p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.picker-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.picker-row select {
  flex: 1;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  border-radius: 18px;
  padding: 18px;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.nav-card {
  border-radius: 22px;
  padding: 22px;
  text-decoration: none;
  color: inherit;
  transition: 0.18s ease;
  display: block;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #bfd3e8;
}

.nav-card-eyebrow {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: 1.1px;
}

.nav-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
}

.nav-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.nav-link-text {
  display: inline-block;
  color: var(--primary-2);
  font-weight: 700;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  border-radius: 22px;
  overflow: hidden;
}

.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 18px 20px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.snapshot-item {
  padding: 12px 0;
  border-bottom: 1px solid #eef3f8;
}

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

.snapshot-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.snapshot-meta {
  font-size: 13px;
  color: var(--muted);
}

.page-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  min-width: 260px;
  max-width: 460px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 18px 36px rgba(0,0,0,0.16);
  z-index: 90;
}

.page-message.error {
  background: var(--danger);
}

.page-message.success {
  background: var(--success);
}

.page-message.info {
  background: var(--primary-2);
}

@media (max-width: 1100px) {
  .hero-card,
  .bottom-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .home-shell {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-left,
  .topbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .picker-row {
    flex-direction: column;
    align-items: stretch;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .hero-left h1 {
    font-size: 30px;
  }
}

/* ===== USER AVATAR DROPDOWN ===== */
.user-menu-wrap {
  position: relative;
}

.user-menu-button {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  min-height: 48px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: 0.18s ease;
}

.user-menu-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 38px;
}

.user-menu-texts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.user-display-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 120;
}

.user-dropdown-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: #f8fafc;
}

.user-dropdown-item.danger {
  color: var(--danger);
}

@media (max-width: 700px) {
  .user-menu-button {
    width: 100%;
    justify-content: flex-start;
  }

  .user-dropdown {
    left: 0;
    right: auto;
    min-width: 100%;
  }
}


.user-meta .user-info {
  display: none !important;
}


.user-dropdown-section {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.user-dropdown-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-switch {
  display: flex;
  gap: 8px;
}

.lang-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

