body {
  font-family: Inter, Arial, sans-serif;
  margin: 0;
  background: #f1f5f9;
  color: #0f172a;
}

.topbar {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: white;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar a {
  color: #bfdbfe;
  text-decoration: none;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: #cbd5e1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 52px);
}

.sidebar {
  background: #0f172a;
  color: #d1d5db;
  padding: 20px 12px;
}

.sidebar-title {
  color: #f8fafc;
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.tab-link {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid transparent;
}

.tab-link:hover {
  background: #1e293b;
  color: #fff;
}

.tab-link.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  font-weight: 600;
}

.container {
  margin: 20px;
  padding: 0 4px;
}

.card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  padding: 18px;
  margin-bottom: 16px;
}

input,
select,
button {
  padding: 9px 11px;
  margin: 4px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
}

input {
  min-width: 210px;
}

button {
  cursor: pointer;
  background: #2563eb;
  color: white;
  border: none;
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stat {
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
}

.stat-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.sub-title {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 15px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.inline-details summary {
  cursor: pointer;
  color: #2563eb;
  font-weight: 600;
}

.inline-details[open] {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
}

.detail-grid {
  margin-top: 6px;
  display: grid;
  gap: 4px;
  min-width: 260px;
  white-space: normal;
}

pre {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.utr-table {
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

th {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.id-cell {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error {
  color: #b91c1c;
}

.ok {
  color: #166534;
}

.muted {
  color: #6b7280;
}

.section-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 8px;
  color: #334155;
  font-size: 14px;
}

.pagination-row a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

body.login-page {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 30%),
    radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.18), transparent 25%),
    linear-gradient(135deg, #071a2d 0%, #0d223d 30%, #0a1425 100%);
  color: #eaf4ff;
}

.login-shell {
  width: min(1100px, 92vw);
  min-height: 640px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: rgba(10, 20, 35, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.login-visual {
  padding: 60px 52px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.22), rgba(8, 22, 38, 0.15)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.10));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-pill {
  display: inline-block;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfe7ff;
}

.login-visual h1 {
  margin: 22px 0 12px;
  font-size: clamp(2rem, 2.8vw, 3.3rem);
  line-height: 1.12;
  color: #ffffff;
}

.login-visual p {
  max-width: 500px;
  font-size: 1.02rem;
  color: #d5ebff;
  line-height: 1.7;
  margin: 0;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}

.feature-list li {
  position: relative;
  padding-left: 28px;
  color: #dfeeff;
  font-size: 0.97rem;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #4ade80;
  font-weight: bold;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  color: #0d1b2a;
  padding: 52px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  margin-bottom: 18px;
}

.login-header h2 {
  margin: 0;
  font-size: 2rem;
  color: #0f172a;
}

.login-header p {
  margin: 8px 0 0;
  color: #4b5563;
}

.alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
}

.field input {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  background: #f8fafc;
  transition: 0.2s ease;
  min-width: 0;
}

.field input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
  background: #fff;
}

.login-btn {
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(37, 99, 235, 0.35);
}

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 840px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    padding: 30px 24px 20px;
  }

  .login-card {
    padding: 28px 20px 32px;
  }
}
