* {
  box-sizing: border-box;
}

:root {
  --bg-main: #000000;
  --bg-elev: rgba(18, 36, 56, 0.7);
  --bg-card: rgba(20, 39, 61, 0.64);
  --line-soft: rgba(173, 207, 243, 0.25);
  --text-main: #ecf5ff;
  --text-muted: #b5c8dd;
  --brand-cyan: #61cbff;
  --brand-blue: #2c8bde;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at 18% 20%, rgba(64, 164, 255, 0.24), transparent 36%),
    radial-gradient(circle at 85% 75%, rgba(72, 181, 255, 0.22), transparent 34%),
    var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: linear-gradient(180deg, rgba(10, 23, 37, 0.96) 0%, rgba(16, 42, 66, 0.92) 100%);
  color: #fff;
  padding: 20px;
  border-right: 1px solid rgba(102, 174, 234, 0.25);
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  margin-top: 0;
}

.sidebar nav a {
  display: block;
  color: #c3d9f0;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 10px;
}

.sidebar nav a:hover {
  color: #fff;
  background: rgba(87, 174, 248, 0.2);
}

.user-role {
  font-size: 14px;
  margin: 8px 0 16px;
  color: #b8cee8;
}

.sidebar-logout {
  margin-top: auto;
}

.content {
  flex: 1;
  padding: 20px;
}

.topbar {
  margin-bottom: 16px;
  background: rgba(14, 29, 45, 0.75);
  border: 1px solid rgba(87, 166, 231, 0.25);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  color: #e8f5ff;
  letter-spacing: 0.4px;
}

.topbar-user {
  margin: 0;
  color: #b8cee8;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

input,
select,
textarea,
button {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(164, 197, 227, 0.28);
  border-radius: 6px;
  font-size: 14px;
  color: #e9f4ff;
  background: rgba(14, 30, 46, 0.72);
}

input::placeholder,
textarea::placeholder {
  color: #99b5d2;
}

textarea {
  min-height: 80px;
}

button.btn {
  cursor: pointer;
  background: linear-gradient(90deg, #2e8bd6, #52b8ff);
  color: #fff;
  border: none;
}

button.btn.secondary {
  background: linear-gradient(90deg, #3f5972, #64849f);
}

button.btn.danger {
  background: linear-gradient(90deg, #a92d44, #d84d69);
}

.btn-register {
  background: #1e8e5a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.08s ease;
}

.btn-register:hover {
  background: #18774b;
}

.btn-register:active {
  background: #145f3d;
  transform: translateY(1px);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(152, 188, 221, 0.22);
  padding: 10px;
  text-align: left;
  font-size: 14px;
  color: #dcecff;
}

th {
  color: #9ec9ef;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-size: 12px;
}

.alert {
  padding: 10px;
  border-radius: 6px;
  background: rgba(85, 157, 216, 0.18);
  color: #d4ebff;
  border: 1px solid rgba(108, 182, 244, 0.38);
  margin: 8px 0;
}

.auth-mode {
  display: block;
}

.login-panel {
  max-width: 420px;
  margin: 80px auto;
}

.register-wrap {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, #faf7fa 0%, #f3f4f6 100%);
}

.register-card {
  width: 100%;
  max-width: 780px;
  background: #ffffff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(43, 45, 66, 0.08);
}

.register-title {
  margin: 0 0 18px;
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 44px;
  color: #26232e;
}

.register-form {
  display: grid;
  gap: 14px;
}

.register-form input,
.register-form select {
  border: 1px solid #d2d0d6;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 17px;
  color: #3a3742;
  background: #fbfbfc;
}

.register-form input:focus,
.register-form select:focus {
  border-color: #c05d8f;
  outline: none;
  box-shadow: 0 0 0 3px rgba(192, 93, 143, 0.14);
}

.register-row {
  display: grid;
  gap: 14px;
}

.register-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.register-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.register-label-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.register-label-row label {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 15px;
  color: #6a6870;
  font-weight: 600;
}

.register-label-row span {
  color: #d14a85;
}

.register-note {
  margin: -4px 0 2px;
  color: #8a8891;
  font-size: 15px;
  font-style: italic;
}

.register-form .btn-register {
  border-radius: 14px;
  padding: 14px;
  font-size: 25px;
  font-weight: 700;
  background: linear-gradient(90deg, #f0bfd6 0%, #db6fa2 100%);
  color: #7e1f53;
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.register-form .btn-register:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 22px rgba(219, 111, 162, 0.28);
}

.register-form .btn-register:active {
  transform: translateY(1px);
}

.register-login-text {
  margin-top: 16px;
  text-align: center;
  color: #65636b;
  font-size: 16px;
}

.register-login-text a {
  color: #d14a85;
  text-decoration: none;
  font-weight: 600;
}

.register-data-source {
  margin-top: 10px;
  font-size: 12px;
  color: #8c8a93;
  text-align: center;
}

.kpi {
  font-size: 28px;
  font-weight: 700;
  margin: 5px 0;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
}

.auth-card {
  width: 100%;
  max-width: 540px;
  background: linear-gradient(160deg, rgba(11, 23, 38, 0.85) 0%, rgba(25, 63, 95, 0.68) 50%, rgba(83, 192, 255, 0.3) 100%);
  border: 1px solid rgba(138, 208, 255, 0.25);
  border-radius: 18px;
  padding: 36px 42px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
}

.auth-card-wide {
  max-width: 760px;
}

.auth-title {
  margin: 0 0 24px;
  text-align: center;
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.8px;
  color: #f0f7ff;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form-compact {
  gap: 12px;
}

.auth-grid-2,
.auth-grid-3 {
  display: grid;
  gap: 12px;
}

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

.auth-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-input {
  position: relative;
  display: block;
}

.auth-input input {
  border-radius: 35px;
  border: 1px solid rgba(158, 213, 255, 0.34);
  background: rgba(10, 27, 43, 0.58);
  color: #e7f5ff;
  font-size: 34px;
  padding: 18px 62px 18px 22px;
}

.auth-input select {
  border-radius: 35px;
  border: 1px solid rgba(158, 213, 255, 0.34);
  background: rgba(10, 27, 43, 0.58);
  color: #e7f5ff;
  font-size: 34px;
  padding: 18px 22px;
}

.auth-input.compact input,
.auth-input.compact select {
  font-size: 18px;
  border-radius: 16px;
  padding: 12px 44px 12px 14px;
}

.auth-input i {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: #e8f6ff;
  font-size: 26px;
  pointer-events: none;
}

.auth-input.compact i {
  right: 14px;
  font-size: 16px;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e4f5ff;
  font-size: 29px;
}

.auth-check.compact {
  font-size: 13px;
}

.auth-check input {
  width: 18px;
  height: 18px;
  accent-color: #7ed3ff;
}

.auth-submit {
  border: none;
  border-radius: 35px;
  font-size: 38px;
  font-weight: 700;
  padding: 16px;
  color: #1f2b39;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.auth-submit.compact {
  font-size: 16px;
  border-radius: 16px;
  padding: 10px;
}

.auth-submit:hover {
  box-shadow: 0 10px 26px rgba(133, 211, 255, 0.33);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-switch,
.auth-hint {
  text-align: center;
  margin: 14px 0 0;
  color: #d3e8fb;
  font-size: 30px;
}

.auth-switch a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.auth-mode .content {
  padding: 0;
}

.auth-login {
  max-width: 430px;
  min-height: auto;
  border-radius: 32px;
  border: 2px solid rgba(230, 246, 255, 0.7);
  background: linear-gradient(170deg, rgba(21, 62, 84, 0.68), rgba(35, 91, 120, 0.62));
  padding: 56px 42px 48px;
}

.auth-forgot {
  min-height: 460px;
}

.auth-logo {
  display: block;
  width: 136px;
  max-width: 48%;
  margin: 0 auto 22px;
  filter: brightness(0) saturate(100%) invert(100%) contrast(140%);
  opacity: 1;
}

.auth-login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 26px;
}

.auth-login-form {
  gap: 18px;
}

.auth-login-input {
  display: grid;
  gap: 8px;
}

.auth-login-input span {
  font-size: 12px;
  font-weight: 600;
  color: #eaf6ff;
}

.auth-login-input input {
  border: 0;
  border-bottom: 2px solid rgba(234, 246, 255, 0.9);
  border-radius: 0;
  background: transparent;
  padding: 4px 2px 8px;
  font-size: 14px;
  color: #f1f9ff;
}

.auth-login-input input:focus {
  outline: none;
  border-bottom-color: #ffffff;
  box-shadow: none;
}

.auth-login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.remember-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e4f5ff;
  font-size: 12px;
}

.remember-wrap input {
  width: 16px;
  height: 16px;
}

.forgot-link {
  color: #e4f5ff;
  font-size: 12px;
  text-decoration: none;
}

.auth-login-submit {
  margin-top: 6px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
  padding: 10px;
}

.auth-login-switch {
  font-size: 12px;
  margin-top: 26px;
}

.register-switch {
  font-size: 13px;
  margin-top: 16px;
}

/* Registration-specific typography rebalance for better visual consistency. */
.auth-card-wide .auth-title {
  font-size: 28px;
  margin-bottom: 18px;
}

.auth-card-wide .auth-input.compact input,
.auth-card-wide .auth-input.compact select {
  font-size: 14px;
  padding: 10px 40px 10px 12px;
}

.auth-card-wide .auth-check.compact {
  font-size: 12px;
}

.auth-card-wide .auth-submit.compact {
  font-size: 14px;
  padding: 9px;
}

.auth-card-wide .register-switch {
  font-size: 12px;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

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

  .topbar-user {
    text-align: left;
    white-space: normal;
  }

  .grid.cols-4,
  .grid.cols-2,
  .register-row-2,
  .register-row-3,
  .register-label-row {
    grid-template-columns: 1fr;
  }

  .register-card {
    padding: 16px;
  }

  .register-title {
    font-size: 34px;
  }

  .auth-card {
    max-width: 430px;
    padding: 24px;
  }

  .auth-card-wide {
    max-width: 96%;
  }

  .auth-login {
    min-height: auto;
  }

  .auth-title {
    font-size: 44px;
  }

  .auth-input input {
    font-size: 24px;
    padding: 14px 52px 14px 18px;
  }

  .auth-input i {
    font-size: 20px;
  }

  .auth-check,
  .auth-switch,
  .auth-hint {
    font-size: 20px;
  }

  .auth-grid-2,
  .auth-grid-3 {
    grid-template-columns: 1fr;
  }

  .auth-submit {
    font-size: 28px;
  }

  .auth-login {
    padding: 26px 24px 30px;
    border-radius: 20px;
  }

  .auth-logo {
    width: 102px;
  }

  .auth-login-title {
    font-size: 20px;
  }

  .auth-login-input span,
  .auth-login-input input,
  .remember-wrap,
  .forgot-link,
  .auth-login-switch {
    font-size: 12px;
  }

  .auth-login-submit {
    font-size: 15px;
  }

  .auth-check.compact {
    font-size: 13px;
  }

  .auth-submit.compact {
    font-size: 16px;
  }

  .register-switch {
    font-size: 13px;
  }

  .auth-card-wide .auth-title {
    font-size: 24px;
  }

  .auth-card-wide .auth-input.compact input,
  .auth-card-wide .auth-input.compact select,
  .auth-card-wide .auth-check.compact,
  .auth-card-wide .auth-submit.compact,
  .auth-card-wide .register-switch {
    font-size: 12px;
  }
}
