*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e5e7eb;
}

/* LOGIN */
.ld-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at top, #0f172a, #020617);
}

.ld-auth-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 18px;
  padding: 2rem 2.5rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(148,163,184,0.4);
}

.ld-auth-title {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
}

.ld-auth-sub {
  margin: 0 0 1.5rem;
  color: #9ca3af;
  font-size: 0.95rem;
}

.ld-auth-error {
  background: #7f1d1d;
  color: #fee2e2;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.ld-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.ld-field span {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.ld-field input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
}

.ld-field input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.ld-btn-primary {
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

/* LAYOUT DASHBOARD */
.ld-layout {
  display: grid;
  grid-template-columns: 260px minmax(0,1fr);
  min-height: 100vh;
}

.ld-sidebar {
  background: #020617;
  border-right: 1px solid #111827;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ld-logo {
  font-weight: 700;
  font-size: 1.3rem;
}

.ld-logo span {
  color: #60a5fa;
}

.ld-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ld-nav-item {
  text-align: left;
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
}

.ld-nav-item.is-active {
  background: #111827;
  color: #e5e7eb;
}

.ld-logout {
  margin-top: auto;
  font-size: 0.85rem;
  color: #f97373;
  text-decoration: none;
}

/* MAIN */
.ld-main {
  padding: 1.5rem 1.75rem;
}

.ld-main-head h1 {
  margin: 0;
  font-size: 1.6rem;
}

.ld-main-sub {
  margin: 0.25rem 0 1.5rem;
  color: #9ca3af;
  font-size: 0.9rem;
}

.ld-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.ld-card {
  background: #020617;
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  border: 1px solid #111827;
}

.ld-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.ld-stat {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0.4rem 0 0;
}

.ld-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.ld-table th,
.ld-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid #111827;
}

.ld-table th {
  text-align: left;
  color: #9ca3af;
  font-weight: 500;
}

.ld-table tbody tr:hover {
  background: #020617;
}

/* VIEWS */
.ld-view {
  display: none;
  margin-top: 1rem;
}

.ld-view.is-visible {
  display: block;
}

/* Responsive */
@media (max-width: 800px) {
  .ld-layout {
    grid-template-columns: 1fr;
  }
  .ld-sidebar {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .ld-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ld-logout {
    margin-top: 0;
  }
}
