@import "./cores.css";

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font), monospace;
  background: var(--bg);
  color: var(--text);
}

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

.sidebar {
  width: 260px;
  background: #020617;
  color: white;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  margin-bottom: 26px;
}

.brand h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.brand span {
  font-size: 13px;
  color: #a7b0c0;
}

.nav-button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d1d5db;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 4px;
}

.nav-button:hover,
.nav-button.active {
  background: #1f2937;
  color: white;
}

.sidebar-footer {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
}

.main {
  flex: 1;
  padding: 28px;
  min-width: 0;
}

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

.topbar h2 {
  margin: 0;
  font-size: 26px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

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

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

.metric span {
  color: var(--text-muted);
  font-size: 13px;
}

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

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #0b1220;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

select option {
  background: #0b1220;
  color: var(--text);
}

.filter {
  width: min(420px, 100%);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  font-size: 14px;
}

button:hover {
  background: var(--primary-hover);
}

button.secondary {
  background: #4b5563;
}

button.secondary:hover {
  background: #374151;
}

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

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

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

button.ghost:hover {
  background: #1f2937;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: #cbd5e1;
  background: var(--bg);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-wrap {
  overflow: auto;
  max-height: 620px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.status-pill {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.ok {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.bad {
  background: rgba(220, 38, 38, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.log-box {
  background: #0b1220;
  color: #90ee90;
  border-radius: 12px;
  padding: 14px;
  height: 430px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.log-box.small {
  height: 280px;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.operations-panel h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.operations-panel p {
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
  font-size: 14px;
}

.status-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.status-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.operations-result {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #cbd5e1;
  font-family: Consolas, monospace;
  font-size: 13px;
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.hidden {
  display: none !important;
}

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

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
  text-align: center;
}

.login-card button[type="submit"] {
  width: 100%;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

.field input {
  width: 100%;
}

.message {
  margin-top: 12px;
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
}

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

.danger-zone {
  border-color: #7f1d1d;
  background: #1f1113;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 22px;
  border: 1px solid var(--border);
}

.modal h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.modal-grid {
  display: grid;
  gap: 12px;
}

.modal textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #0b1220;
  color: var(--text);
}

@media (max-width: 900px) {
  .app {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .sidebar-footer {
    position: static;
    margin-top: 20px;
  }

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

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

  .main {
    padding: 18px;
  }
}

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

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