:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #ffffff;
  --panel-border: #dbe2ea;
  --text: #111827;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --info-bg: #dbeafe;
  --info-text: #1d4ed8;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f6fa;
  color: var(--text);
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 6px 0 20px rgba(0, 0, 0, 0.18);
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
}

.brand-text h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.brand-text p {
  margin: 4px 0 0 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.sidebar nav a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  transition: .2s ease;
  font-weight: 600;
}

.sidebar nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.user-box {
  background: rgba(255,255,255,0.06);
  padding: 14px;
  border-radius: 14px;
  margin-top: 20px;
}

.user-box strong {
  display: block;
  margin-bottom: 4px;
}

.user-box span {
  font-size: 14px;
  color: #cbd5e1;
}

/* CONTEÚDO */
.content {
  margin-left: 280px;
  padding: 28px;
  min-height: 100vh;
}

.content-full {
  margin-left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

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

.page-header h1 {
  margin: 0 0 6px 0;
}

.page-header-badge img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--panel-border);
  background: #fff;
}

/* ALERTAS */
.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-weight: 600;
}

.alert.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.alert.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.alert.info {
  background: var(--info-bg);
  color: var(--info-text);
}

.muted {
  color: var(--muted);
}

/* CARDS */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.card span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.card strong {
  font-size: 28px;
}

/* PAINÉIS */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

/* TABELAS */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  font-size: 14px;
}

/* FORMULÁRIOS */
.form-grid {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

button,
.btn-link {
  display: inline-block;
  padding: 11px 16px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

button:hover,
.btn-link:hover {
  background: var(--primary-hover);
}

/* LOGIN */
.login-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.14);
  border: 1px solid #e5e7eb;
}

.login-card-wide {
  max-width: 520px;
}

.login-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.login-logo {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid #dbe2ea;
}

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

.hint-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

code {
  background: #eef2ff;
  padding: 2px 6px;
  border-radius: 6px;
}

/* RESPONSIVO */
@media (max-width: 900px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-radius: 0 0 20px 20px;
  }

  .content {
    margin-left: 0;
    padding: 20px;
  }

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