* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #0f1115;
  color: #e6e9ef;
  min-height: 100vh;
}

/* Shell layout */

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

.sidebar {
  background: #15181f;
  border-right: 1px solid #2a2f3a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar header {
  padding: 20px 18px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #2a2f3a;
}

.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

.sidebar nav a {
  display: block;
  padding: 10px 18px;
  color: #b8bfcc;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 14px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.sidebar nav a:hover {
  background: #1a1d24;
  color: #e6e9ef;
}

.sidebar nav a.active {
  background: #1a1d24;
  color: #e6e9ef;
  border-left-color: #4f7cff;
}

.sidebar footer {
  padding: 14px 18px;
  border-top: 1px solid #2a2f3a;
}

.sidebar footer button {
  width: 100%;
  background: transparent;
  color: #b8bfcc;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.sidebar footer button:hover {
  background: #1a1d24;
  color: #e6e9ef;
}

main#content {
  padding: 32px;
  overflow-y: auto;
}

/* Login layout (página standalone, sem grid) */

body.login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Card genérico (login + ferramentas que quiserem usar) */

.card {
  background: #1a1d24;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.card h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.card .sub {
  margin: 0 0 24px;
  color: #8a92a3;
  font-size: 14px;
}

/* Form genérico */

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #b8bfcc;
}

input {
  background: #0f1115;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e6e9ef;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus {
  border-color: #4f7cff;
}

button[type="submit"] {
  margin-top: 8px;
  background: #4f7cff;
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    opacity 0.15s ease;
}

button[type="submit"]:hover:not(:disabled) {
  background: #3d68e8;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toasts */

#toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
  width: 360px;
  pointer-events: none;
  z-index: 1000;
}

.toast {
  background: #1a1d24;
  border: 1px solid #2a2f3a;
  border-left: 4px solid #4f7cff;
  color: #e6e9ef;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  word-break: break-word;
  animation:
    toast-in 0.2s ease-out,
    toast-out 0.3s ease-in 4.7s forwards;
  pointer-events: auto;
}

.toast.success {
  border-left-color: #2bd47d;
}

.toast.error {
  border-left-color: #ff5d6c;
}

@keyframes toast-in {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  to {
    transform: translateX(20px);
    opacity: 0;
  }
}

/* Helpers */

.empty-state {
  color: #8a92a3;
  font-size: 14px;
}
