:root {
  --blue: #0877e8;
  --blue-dark: #075fc0;
  --navy: #07182f;
  --text: #14233a;
  --muted: #728098;
  --border: #e5eaf1;
  --background: #f4f7fb;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(28, 57, 91, 0.10);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(380px, 0.9fr);
}

.login-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 70px clamp(45px, 8vw, 120px);
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgba(23, 139, 255, .38), transparent 36%),
    radial-gradient(circle at 80% 75%, rgba(0, 202, 255, .18), transparent 42%),
    linear-gradient(145deg, #06162b 0%, #092b53 56%, #075fae 100%);
}

.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.login-brand::before {
  width: 520px;
  height: 520px;
  right: -230px;
  top: -160px;
}

.login-brand::after {
  width: 380px;
  height: 380px;
  left: -210px;
  bottom: -140px;
}

.brand-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}

.brand-logo {
  width: min(330px, 78%);
  height: auto;
  filter: none;
}

.product-tag {
  display: inline-flex;
  margin-top: 24px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}

.brand-content h1 {
  max-width: 600px;
  margin: 28px 0 18px;
  font-size: clamp(38px, 4vw, 64px);
  line-height: 1.04;
  letter-spacing: -.045em;
}

.brand-content > p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, .75);
  font-size: 18px;
  line-height: 1.65;
}

.brand-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 58px;
}

.brand-features > div {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
}

.feature-icon {
  display: block;
  margin-bottom: 18px;
  color: #62b6ff;
  font-size: 12px;
  font-weight: 900;
}

.brand-features strong,
.brand-features small {
  display: block;
}

.brand-features strong {
  margin-bottom: 7px;
  font-size: 14px;
}

.brand-features small {
  color: rgba(255, 255, 255, .62);
  line-height: 1.45;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px;
  background: #fbfcfe;
}

.login-card {
  width: min(430px, 100%);
}

.mobile-logo {
  display: none;
}

.login-heading {
  margin-bottom: 34px;
}

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.login-heading h2 {
  margin: 9px 0 7px;
  font-size: 36px;
  letter-spacing: -.035em;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
}

.login-card label {
  display: block;
  margin-bottom: 20px;
  color: #35445a;
  font-size: 13px;
  font-weight: 750;
}

.login-card input {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  padding: 0 15px;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: white;
  transition: .2s;
}

.login-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(8, 119, 232, .10);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 60px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 21px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  height: 53px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #0259b1);
  box-shadow: 0 12px 24px rgba(8, 119, 232, .24);
  font-weight: 800;
  transition: .2s;
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: .7;
}

.form-error {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid #ffd0d0;
  border-radius: 10px;
  color: #b42318;
  background: #fff4f3;
  font-size: 13px;
}

.security-note {
  display: block;
  margin-top: 20px;
  text-align: center;
  color: #96a0af;
}

.app-view {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 260px;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  color: white;
  background: var(--navy);
}

.sidebar-brand {
  padding: 0 12px 30px;
}

.sidebar-brand img {
  width: 180px;
  filter: none;
}

.sidebar-brand span {
  display: block;
  width: max-content;
  margin: 9px 0 0 4px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: #6bb9ff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 0;
  border-radius: 11px;
  text-align: left;
  color: #aebdce;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(17, 131, 242, .17);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--blue);
}

.nav-icon {
  width: 25px;
  color: #62b6ff;
  text-align: center;
  font-size: 18px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8fa1b5;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #23ce75;
  box-shadow: 0 0 0 4px rgba(35, 206, 117, .12);
}

.logout-button {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  color: #b8c4d1;
  background: transparent;
}

.main {
  min-height: 100vh;
  margin-left: 260px;
}

.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 38px;
  border-bottom: 1px solid var(--border);
  background: white;
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: 25px;
  letter-spacing: -.025em;
}

.menu-button {
  display: none;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: right;
}

.user-area strong,
.user-area small {
  display: block;
}

.user-area strong {
  font-size: 13px;
}

.user-area small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #064c9b);
  font-weight: 900;
}

.page {
  padding: 32px 38px 50px;
}

.welcome-banner {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 28px 30px;
  border: 1px solid #dceaff;
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 20%, rgba(8, 119, 232, .14), transparent 32%),
    linear-gradient(135deg, #ffffff, #f2f8ff);
}

.welcome-banner h2 {
  margin: 8px 0 5px;
  font-size: 26px;
}

.welcome-banner p {
  margin: 0;
  color: var(--muted);
}

.live-badge {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid #ccebd9;
  border-radius: 999px;
  color: #16814b;
  background: #f1fff7;
  font-size: 12px;
  font-weight: 800;
}

.live-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #23bd6c;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.metric-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  box-shadow: 0 5px 20px rgba(31, 55, 84, .035);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 21px;
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 85px;
  height: 85px;
  right: -30px;
  bottom: -35px;
  border-radius: 50%;
  opacity: .08;
  background: currentColor;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: currentColor;
  background: currentColor;
  box-shadow: inset 0 0 0 20px rgba(255, 255, 255, .88);
  font-weight: 900;
}

.metric-card strong {
  display: block;
  margin: 16px 0 2px;
  color: var(--text);
  font-size: 34px;
}

.metric-card small {
  color: var(--muted);
}

.metric-card.blue {
  color: #0877e8;
}

.metric-card.green {
  color: #14a663;
}

.metric-card.orange {
  color: #ea8b16;
}

.metric-card.purple {
  color: #8357d8;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-top: 22px;
}

.panel {
  padding: 23px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h3 {
  margin: 6px 0 0;
  font-size: 18px;
}

.secondary-button {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: #445269;
  background: white;
  font-size: 12px;
  font-weight: 750;
}

.system-list {
  margin-top: 17px;
}

.system-list > div {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 0;
  border-top: 1px solid #edf0f4;
}

.system-symbol {
  width: 37px;
  height: 37px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--blue);
  background: #eef6ff;
  font-size: 12px;
  font-weight: 900;
}

.system-list div div {
  min-width: 0;
  flex: 1;
}

.system-list strong,
.system-list small {
  display: block;
}

.system-list strong {
  font-size: 13px;
}

.system-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.system-list b {
  font-size: 13px;
}

.online-text {
  color: #159759;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 18px;
}

.quick-actions button {
  min-height: 90px;
  padding: 15px;
  border: 1px solid #e5eaf1;
  border-radius: 13px;
  color: #34435a;
  background: #fbfcfe;
  font-size: 12px;
  font-weight: 750;
}

.quick-actions button:hover {
  border-color: #bad9fb;
  background: #f3f8ff;
}

.quick-actions span {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 22px;
}

.placeholder-panel {
  min-height: 440px;
  display: grid;
  place-content: center;
  text-align: center;
}

.placeholder-icon {
  width: 65px;
  height: 65px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border-radius: 18px;
  color: var(--blue);
  background: #edf6ff;
  font-size: 28px;
}

.placeholder-panel h2 {
  margin: 0;
}

.placeholder-panel p {
  max-width: 420px;
  color: var(--muted);
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1100px) {
  .brand-features {
    grid-template-columns: 1fr;
  }

  .brand-features > div:nth-child(n+3) {
    display: none;
  }

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

@media (max-width: 850px) {
  .login-view {
    display: block;
    background:
      linear-gradient(rgba(4, 27, 55, .82), rgba(4, 27, 55, .82)),
      radial-gradient(circle at top, #0b75d7, #07182f);
  }

  .login-brand {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px 20px;
    background: transparent;
  }

  .login-card {
    padding: 27px 22px;
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow);
  }

  .mobile-logo {
    display: block;
    margin-bottom: 30px;
  }

  .mobile-logo img {
    width: 200px;
  }

  .mobile-logo span {
    display: block;
    width: max-content;
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--blue);
    background: #edf6ff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .16em;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    background: rgba(3, 15, 29, .55);
  }

  .main {
    margin-left: 0;
  }

  .menu-button {
    display: inline-block;
    margin-right: 10px;
    border: 0;
    background: transparent;
    font-size: 20px;
  }

  .topbar {
    min-height: 90px;
    padding: 19px 20px;
  }

  .page {
    padding: 20px;
  }

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

@media (max-width: 560px) {
  .user-area > div:first-child {
    display: none;
  }

  .welcome-banner {
    display: block;
    padding: 23px;
  }

  .live-badge {
    width: max-content;
    margin-top: 18px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 11px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-card strong {
    font-size: 28px;
  }

  .metric-top span:first-child {
    max-width: 90px;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
}
