@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap");

:root {
  --bg-0: #f4f7fb;
  --bg-1: #deecff;
  --bg-2: #c8ddf7;
  --ink-1: #0e2036;
  --ink-2: #324b67;
  --muted: #5b718a;
  --panel: #ffffffd6;
  --line: #cfddf0;
  --accent: #0077b6;
  --accent-2: #00a7a0;
  --danger: #bf2648;
  --success: #1f7a52;
  --shadow-lg: 0 24px 70px rgba(14, 32, 54, 0.18);
  --shadow-md: 0 12px 36px rgba(14, 32, 54, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--ink-1);
  background:
    radial-gradient(900px 500px at 8% 10%, #ffffff 0%, transparent 70%),
    radial-gradient(1200px 700px at 96% -6%, #b7d7ff 0%, transparent 65%),
    linear-gradient(145deg, var(--bg-0), var(--bg-1) 48%, var(--bg-2));
}

.app {
  min-height: 100vh;
  padding: 34px 22px;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(460px, 100%);
  border: 1px solid #ffffff96;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffffee, #f4f9ffec);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.brand-mark--login {
  margin-bottom: 14px;
}

.nuitee-logo {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 1.3rem + 2vw, 3rem);
  font-weight: 700;
  line-height: 0.92;
  color: #111827;
}

.brand-title {
  margin: 0;
  color: #35597b;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 800;
}

.login-heading {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.5rem;
}

.login-subtitle {
  margin: 6px 0 16px;
  color: var(--ink-2);
  font-size: 13px;
}

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

.login-form label {
  font-size: 12px;
  color: #3f5f7f;
  font-weight: 700;
}

.login-form input {
  border: 1px solid #c8d9ef;
  background: #fbfdff;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--ink-1);
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 4px;
}

.login-form input:focus {
  outline: none;
  border-color: #5ca6df;
  box-shadow: 0 0 0 3px #d8ebff;
  background: #ffffff;
}

#loginSubmitBtn {
  margin-top: 6px;
  background: linear-gradient(135deg, #0077b6, #0091d6);
}

.login-error {
  margin: 2px 0 0;
  color: #a32244;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  border: 1px solid #ffffff8c;
  border-radius: 26px;
  background: linear-gradient(175deg, #ffffffdb, #f7fbffe6 36%, #eef5ffdb);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: enter 600ms ease both;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logout-btn {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  font-weight: 800;
}

h1 {
  margin: 4px 0 8px;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(1.45rem, 1.2rem + 1.3vw, 2.2rem);
  line-height: 1.15;
}

.subtitle {
  margin: 0;
  color: var(--ink-2);
  max-width: 720px;
  font-size: 14px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #9fd6cd;
  background: #edfdf8;
  color: #0e5a53;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #19b28a;
  box-shadow: 0 0 0 0 rgba(25, 178, 138, 0.6);
  animation: pulse 1.8s infinite;
}

.controls-panel {
  padding: 16px;
  margin-bottom: 14px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.date-field label {
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--muted);
  font-weight: 700;
}

.filters input,
.filters select {
  width: 100%;
  border: 1px solid #c8d9ef;
  background: #fbfdff;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--ink-1);
  font-size: 13px;
  font-family: inherit;
  transition: all 140ms ease;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: #5ca6df;
  box-shadow: 0 0 0 3px #d8ebff;
  background: #ffffff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 119, 182, 0.24);
  filter: saturate(1.08);
}

#dataBtn {
  background: linear-gradient(135deg, #0077b6, #0091d6);
}

#refreshNowBtn {
  background: linear-gradient(135deg, #028a83, #00a7a0);
}

#stopCheckingBtn {
  background: linear-gradient(135deg, #8a1e3b, #bf2648);
}

#loginBtn {
  background: linear-gradient(135deg, #224e7a, #2f6497);
}

#healthBtn {
  background: linear-gradient(135deg, #4b6480, #607d99);
}

.status,
.refresh-info {
  margin: 0;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 13px;
  border: 1px solid transparent;
}

.status {
  margin-bottom: 8px;
  background: #e8f2ff;
  border-color: #c2daf8;
  color: #1d4b7a;
}

.status.error {
  background: #fff1f4;
  border-color: #ffcad5;
  color: #a32244;
}

.status.success {
  background: #e8f8ef;
  border-color: #bfe9cf;
  color: #0f6a42;
}

.refresh-info {
  color: #2f536d;
  background: #f2f8ff;
  border-color: #cadefb;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi {
  background:
    linear-gradient(180deg, #ffffff, #f7fbff),
    linear-gradient(100deg, #ffffff, #ffffff);
  border: 1px solid #d6e5f7;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 8px 20px rgba(20, 46, 73, 0.08);
  animation: slideIn 420ms ease both;
}

.kpi h3 {
  margin: 0;
  font-size: 11px;
  color: #587089;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 800;
}

.kpi p {
  margin: 7px 0 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #132d46;
}

.changes-box {
  padding: 14px;
  margin-bottom: 14px;
}

.changes-box__head {
  margin-bottom: 10px;
}

.changes-box__head h2 {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 18px;
}

.changes-box__head p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}

.refresh-stamp strong {
  color: #0d6c93;
}

.changes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tracking-log {
  margin-top: 10px;
  border: 1px solid #d8e6f8;
  border-radius: 12px;
  background: #fcfeff;
  padding: 10px;
}

.tracking-log__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tracking-log__head h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: #365476;
}

.clear-log-btn {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 9px;
  background: linear-gradient(135deg, #71839a, #54677f);
}

.tracking-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.tracking-history-item {
  border: 1px solid #dce8f8;
  border-radius: 10px;
  padding: 7px 9px;
  background: #f8fbff;
  font-size: 12px;
  color: #294766;
}

.tracking-history-item strong {
  color: #153552;
}

.change-column {
  border: 1px solid #d8e6f8;
  border-radius: 12px;
  background: #fcfeff;
  padding: 10px;
}

.change-column h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.change-column--added h3 {
  color: var(--success);
}

.change-column--confirmed h3 {
  color: var(--danger);
}

.id-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.id-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  border: 1px solid #ccdef3;
  background: #f5faff;
  color: #103151;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.id-link {
  color: #0b66d8;
  text-decoration: none;
}

.id-link:hover {
  text-decoration: underline;
}

.empty {
  color: #69839d;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  max-height: 430px;
  margin-bottom: 14px;
}

.result-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.result-table th,
.result-table td {
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid #e4edf8;
  font-size: 12px;
}

.result-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #eef5ff, #e5f0ff);
  color: #244666;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.result-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.result-table tbody tr:hover {
  background: #edf5ff;
}

.booking-id-link {
  color: #0b66d8;
  font-weight: 800;
  text-decoration: none;
}

.booking-id-link:hover {
  text-decoration: underline;
}

.booking-id-meta {
  color: #4d6782;
  font-size: 12px;
}

.debug-box {
  padding: 10px 12px;
}

.debug-box summary {
  cursor: pointer;
  color: #2c5378;
  font-weight: 700;
  font-size: 12px;
}

.output {
  min-height: 280px;
  margin-top: 10px;
  background: #0c1d30;
  color: #c6f0ff;
  border-radius: 12px;
  border: 1px solid #264360;
  padding: 14px;
  overflow: auto;
  font-size: 12px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 178, 138, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(25, 178, 138, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 178, 138, 0);
  }
}

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

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

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

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

@media (max-width: 760px) {
  .app {
    padding: 16px;
  }

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

  .dashboard-shell {
    padding: 14px;
    border-radius: 20px;
  }

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

  .hero-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

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

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

@media (max-width: 480px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}
