:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI",
    Roboto, Arial, sans-serif;
  font-synthesis: none;
  --bg: #080e17;
  --card: #111b29;
  --border: #28384a;
  --text: #f1f5f9;
  --muted: #a3b2c4;
  --green: #24c776;
  --red: #e64e58;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%,
      #15372d 0, transparent 35%),
    radial-gradient(circle at 90% 85%,
      #35202b 0, transparent 30%),
    var(--bg);
  color: var(--text);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.login-card {
  width: 100%;
  max-width: 470px;
  padding: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 24px 70px #0007;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  overflow: hidden;
  border: 3px solid #e2e8f0;
  transform: rotate(-35deg);
}

.brand-red,
.brand-green {
  flex: 1;
}

.brand-red {
  background: var(--red);
}

.brand-green {
  background: var(--green);
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.login-heading {
  margin: 34px 0 28px;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 8px 0 12px;
  font-size: 26px;
  line-height: 1.2;
}

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

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #405168;
  border-radius: 11px;
  background: #0b1421;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #24c77625;
}

.field input::placeholder {
  color: #8190a3;
}

#totp-code {
  letter-spacing: 5px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-message {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--red);
  font-size: 13px;
}

button {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 11px;
  background: var(--green);
  color: #07150e;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #3fda90;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 520px) {
  .login-card {
    padding: 26px 22px;
    border-radius: 17px;
  }

  h1 {
    font-size: 23px;
  }

  .login-footer {
    flex-direction: column;
    gap: 5px;
  }
}


/* RCN ADMIN V2 DASHBOARD */

[hidden] {
  display: none !important;
}

.dashboard {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.logout-button {
  width: auto;
  min-height: 42px;
  padding: 0 20px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.logout-button:hover:not(:disabled) {
  background: #243449;
}

.dashboard-heading {
  margin: 36px 0 28px;
}

#dashboard-message {
  color: var(--muted);
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  min-height: 145px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.stat-card h2 {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  color: var(--green);
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 800px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .dashboard {
    padding: 22px 16px 40px;
  }

  .dashboard-header {
    align-items: flex-start;
  }

  .logout-button {
    padding: 0 12px;
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    min-height: 110px;
    padding: 20px;
  }

  .stat-card strong {
    font-size: 30px;
  }
}


/* RCN ADMIN V2 LAYOUT FIX */

.login-page.dashboard-active {
  display: block;
  min-height: 100vh;
  padding: 0;
}

.login-page.dashboard-active > .login-card {
  display: none;
}

.login-page.dashboard-active > .dashboard {
  display: block;
  box-sizing: border-box;
  max-width: 1200px;
}


/* RCN DRIVERS V2 */

.drivers-section {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid #dce4e8;
  border-radius: 16px;
  background: #fff;
  color: #17212b;
}

.drivers-heading h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.drivers-heading p {
  margin: 0 0 24px;
  color: #596674;
}

.drivers-search-row {
  display: flex;
  gap: 12px;
  margin: 10px 0 20px;
}

.drivers-search-row input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
}

.drivers-search-row button,
.drivers-pagination button {
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: #18794e;
  color: #fff;
  cursor: pointer;
}

.drivers-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.drivers-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.drivers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.drivers-table th,
.drivers-table td {
  padding: 12px;
  border-bottom: 1px solid #e5eaf0;
  text-align: left;
  white-space: nowrap;
}

.drivers-table th {
  background: #f1f5f7;
  font-weight: 700;
}

.drivers-table tbody tr:hover {
  background: #f7faf9;
}

.drivers-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

#drivers-message {
  min-height: 22px;
  color: #596674;
}

@media (max-width: 640px) {
  .drivers-section {
    padding: 14px;
  }

  .drivers-search-row {
    flex-direction: column;
  }

  .drivers-table {
    font-size: 13px;
  }

  .drivers-pagination button {
    padding: 10px;
  }
}


/* RCN DRIVERS SEARCH FIX */
.drivers-section .drivers-search-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
}

.drivers-section .drivers-search-row input {
  display: block;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 46px;
  box-sizing: border-box;
  background: #fff;
  color: #17212b;
}

.drivers-section .drivers-search-row button {
  display: inline-block;
  flex: 0 0 auto;
  width: auto;
  min-width: 110px;
  height: 46px;
  margin: 0;
  padding: 0 20px;
}

@media (max-width: 640px) {
  .drivers-section .drivers-search-row {
    flex-direction: column;
  }

  .drivers-section .drivers-search-row input,
  .drivers-section .drivers-search-row button {
    width: 100%;
  }
}
