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

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #16212b;
  --muted: #5e6b76;
  --accent: #0f7bff;
  --accent-dark: #0a56b6;
  --danger: #d93535;
  --border: #d9e0ea;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 15%, #d6e7ff 0, transparent 24%),
    radial-gradient(circle at 10% 90%, #dff6ee 0, transparent 28%),
    var(--bg);
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 22px 40px rgba(20, 44, 76, 0.12);
  padding: 28px;
}

.logo {
  width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}

.logo-sm {
  width: 42px;
  height: 42px;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
}

p,
small {
  color: var(--muted);
}

form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #2c3e50;
}

button.danger {
  background: var(--danger);
}

.error {
  color: var(--danger);
  margin-top: 8px;
  min-height: 20px;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: #0d1b2a;
  color: #d8e4f2;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.brand span {
  display: block;
  color: #9bb1cb;
  font-size: 12px;
}

#menu {
  display: grid;
  gap: 6px;
}

#menu button {
  text-align: left;
  background: transparent;
  color: #d8e4f2;
  border: 1px solid transparent;
  font-weight: 600;
}

#menu button.active,
#menu button:hover {
  background: #10263d;
  border-color: #244463;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.content {
  padding: 22px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.message {
  min-height: 20px;
  color: var(--muted);
}

.panel {
  display: block;
}

.grid {
  display: grid;
  gap: 14px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

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

.metric {
  border-radius: 14px;
  background: linear-gradient(130deg, #f7fbff, #eef4ff);
  border: 1px solid var(--border);
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 24px;
}

.mt {
  margin-top: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 8px;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 700;
}

pre {
  background: #0b1220;
  color: #d6e8ff;
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
}

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

  .inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .grid.two,
  .inline-form {
    grid-template-columns: 1fr;
  }
}
