:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --dark: #1f2937;
  --light: #f3f4f6;
  --white: #ffffff;
  --border: #e5e7eb;
  --text: #374151;
  --text-light: #6b7280;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text);
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Login Page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 20px;
  padding-bottom: 100px;
}

.login-box {
  background: var(--white);
  padding: 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.5s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  color: var(--primary);
  font-size: 28px;
  margin-bottom: 10px;
}

.login-header p {
  color: var(--text-light);
  font-size: 14px;
}

/* Dashboard */
.dashboard {
  background: var(--white);
  min-height: 100vh;
}

.navbar {
  background: var(--white);
  padding: 15px 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  text-align: right;
}

.user-name {
  font-weight: 600;
  color: var(--text);
}

.user-type {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
}

.tabs {
  background: var(--light);
  padding: 20px 0;
  border-bottom: 2px solid var(--border);
}

.tabs-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.tab {
  padding: 12px 24px;
  background: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.3s;
  white-space: nowrap;
}

.tab:hover {
  background: var(--primary-light);
  color: var(--white);
}

.tab.active {
  background: var(--primary);
  color: var(--white);
}

.content {
  max-width: 1600px;
  margin: 30px auto;
  padding: 0 20px;
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light);
}

.card-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select.form-control {
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
}

.btn-info {
  background: var(--info);
  color: var(--white);
}

.btn-secondary {
  background: var(--text-light);
  color: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

thead {
  background: var(--light);
}

th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
  font-size: 14px;
  text-transform: uppercase;
}

td {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

tr:hover {
  background: var(--light);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-admin {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-comum {
  background: #e0e7ff;
  color: #3730a3;
}

/* Alerts */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning);
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--info);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeInUp 0.3s ease;
}

.modal-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--light);
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--dark);
}

.modal-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid var(--light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.5s ease;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.empty-state-text {
  font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .login-box {
    padding: 30px 20px;
  }
  
  .card {
    padding: 20px;
  }
  
  .card-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  table {
    font-size: 13px;
  }
  
  th, td {
    padding: 10px;
  }
  
  .modal-content {
    padding: 20px;
  }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

/* Tabela larga com scroll horizontal */
.table-responsive {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  width: 100%;
  table-layout: auto;
}

.table-responsive th,
.table-responsive td {
  font-size: 12px;
  padding: 8px 6px;
  white-space: nowrap;
}

.table-responsive td[style*="min-width"] {
  white-space: normal;
}

/* Tooltip para botões desabilitados */
button[disabled][title] {
  cursor: not-allowed;
  position: relative;
  opacity: 0.6;
}

button[disabled][title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
  z-index: 1000;
  margin-bottom: 5px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Paginação */
.pagination {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Controles de página */
.page-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--light);
}

.page-info {
  font-size: 14px;
  color: var(--text-light);
}
