* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #17202a;
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #0f172a;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 16px;
}

.login-card h1 {
  margin: 0 0 8px;
}

.login-card p {
  color: #64748b;
  margin-bottom: 22px;
}

input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 12px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: #0f172a;
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  opacity: .9;
}

.login-card button {
  width: 100%;
  margin-bottom: 14px;
}

.error {
  color: #dc2626;
  margin-top: 10px;
}

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

.sidebar {
  width: 260px;
  background: #0f172a;
  color: white;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: white;
  color: #0f172a;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand small {
  display: block;
  color: #cbd5e1;
}

.nav {
  background: transparent;
  text-align: left;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.nav.active,
.nav:hover {
  background: #1e293b;
}

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

.logout {
  width: 100%;
  background: #334155;
}

.main {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0 0 4px;
}

.topbar p {
  margin: 0;
  color: #64748b;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.card small {
  color: #64748b;
}

.card h3 {
  font-size: 30px;
  margin: 8px 0 0;
}

.table-wrap {
  background: white;
  border-radius: 18px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #475569;
  position: sticky;
  top: 0;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
}

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

  .sidebar {
    width: 100%;
  }

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

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

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

  .main {
    padding: 14px;
  }
}

.form-card {
  background: white;
  border-radius: 18px;
  padding: 22px;
  max-width: 720px;
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.form-card h3 {
  margin: 0 0 6px;
}

.form-card p {
  margin: 0 0 20px;
  color: #64748b;
}

.form-card label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
  color: #334155;
}

.form-card select,
.form-card textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 8px;
  background: white;
}

.form-card textarea {
  min-height: 110px;
  resize: vertical;
}

.form-card button {
  margin-top: 14px;
}

.result-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  white-space: pre-wrap;
  overflow: auto;
}

.result-box.error-box {
  background: #fef2f2;
  color: #991b1b;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.small-action {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  margin: 2px;
  background: #334155;
}

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