:root {
  --blue:       #1A56AA;
  --blue-dark:  #0F3878;
  --blue-light: #E8F0FB;
  --blue-hover: #164e9a;
  
  --green:      #16A34A;
  --green-light:#DCFCE7;
  --red:        #DC2626;
  --red-light:  #FEE2E2;
  --amber:      #D97706;
  --amber-light:#FEF3C7;

  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-300:   #D1D5DB;
  --gray-600:   #4B5563;
  --gray-700:   #374151;
  --gray-900:   #111827;
  
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-lg:  0 20px 25px -5px rgba(15, 56, 120, 0.1), 0 10px 10px -5px rgba(15, 56, 120, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top right, #f0f4f9 0%, var(--gray-50) 100%);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: var(--blue);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--blue-dark);
}

/* ── CONTAINER DE AUTENTICAÇÃO ── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-header {
  text-align: center;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-logo .icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  font-weight: bold;
}

.auth-logo span {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue-dark);
  letter-spacing: 0.5px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--gray-600);
}

/* ── FORMULÁRIOS ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.form-control {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 86, 170, 0.15);
}

.form-footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-top: -8px;
  margin-bottom: 20px;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-primary {
  background: var(--blue-dark);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

/* ── ALERTAS/MENSAGENS ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, 0.15);
}

.alert-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(220, 38, 38, 0.15);
}

/* ── DASHBOARD & ESTRUTURA GERAL ── */
.app-header {
  background: var(--blue-dark);
  color: #fff;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo .icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.app-logo span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.main-content {
  flex: 1;
  padding: 40px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 24px;
}

/* ── GRID DE MANUAIS ── */
.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.manual-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manual-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px rgba(15, 56, 120, 0.15);
}

.manual-icon {
  font-size: 36px;
  color: var(--blue);
}

.manual-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

.manual-info p {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}

/* ── ADMIN PANEL & TABELAS ── */
.admin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.data-table th {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 14px 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--gray-200);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-900);
}

.data-table tr:hover td {
  background: var(--gray-50);
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-admin {
  background: var(--blue-light);
  color: var(--blue-dark);
}

.badge-user {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* ── ESTILO FILE UPLOAD ── */
.file-dropzone {
  display: block;
  width: 100%;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
  position: relative;
}

.file-dropzone:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.file-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.file-dropzone-icon {
  font-size: 36px;
  color: var(--blue-dark);
  margin-bottom: 12px;
}

.file-dropzone-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
}

.file-dropzone-hint {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 6px;
}

@media (max-width: 768px) {
  .app-header {
    padding: 16px 20px;
    flex-direction: column;
    gap: 12px;
  }
  .main-content {
    padding: 20px;
  }
  .auth-card {
    padding: 24px;
  }
}
