:root {
  /* Modern Palette - Professional Tech Blue */
  --primary-color: #4338ca; /* Indigo 700 */
  --primary-gradient-start: #4f46e5; /* Indigo 600 */
  --primary-gradient-end: #6366f1; /* Indigo 500 */
  
  --secondary-color: #64748b; /* Slate 500 */
  
  --success-color: #10b981; /* Emerald 500 */
  --warning-color: #f59e0b; /* Amber 500 */
  --danger-color: #ef4444; /* Red 500 */
  
  --bg-color: #f3f4f6; /* Gray 100 */
  --surface-color: #ffffff;
  
  --text-primary: #111827; /* Gray 900 */
  --text-secondary: #4b5563; /* Gray 600 */
  --border-color: #e5e7eb; /* Gray 200 */

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body { 
  font-family: 'Inter', system-ui, -apple-system, sans-serif; 
  margin: 0; 
  padding: 0; /* Reset padding, handle in container */
  background-color: var(--bg-color); 
  color: var(--text-primary);
  line-height: 1.5;
}

/* Layout */
.container, .container-wide {
  margin: 0 auto;
  padding: 24px;
}

.container { max-width: 900px; }
.container-wide { max-width: 1400px; }

/* Panel System */
.panel {
  background: var(--surface-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden; /* Ensures header corners clip */
  border: 1px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 24px;
}

.panel-header {
  background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
  padding: 20px 24px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h5 {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.panel-body {
  padding: 24px;
}

/* Logo Styling */
.app-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.brand-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.col-span-2 { grid-column: span 2; }

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all 0.2s;
  background-color: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-gradient-start);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn-gradient {
  background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s, filter 0.2s;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-gradient:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary {
  background-color: var(--primary-gradient-start);
  border-color: var(--primary-gradient-start);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg-color);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.icon-btn-sm {
  width: 32px;
  height: 32px;
}

/* Chips & Status */
.user-chip {
  background: rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(4px);
}

.chip {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.chip-success { background: #dcfce7; color: #166534; } /* Green */
.chip-info { background: #e0f2fe; color: #075985; } /* Blue */

/* Dashboard Specifics */
.filter-bar {
  background: var(--bg-color);
  padding: 12px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.table-responsive {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Modern Table */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
}

.table-modern thead th {
  background: #f1f5f9; /* Slate 100 */
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 16px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background 0.2s;
}

.table-modern thead th:first-child {
  border-top-left-radius: var(--radius-lg);
}

.table-modern thead th:last-child {
  border-top-right-radius: var(--radius-lg);
}

.table-modern tbody tr {
  transition: all 0.2s;
}

.table-modern tbody tr:nth-child(even) {
  background-color: #f8fafc; /* Slate 50 */
}

.table-modern tbody tr:hover {
  background-color: #e0e7ff; /* Indigo 50 */
  transform: scale(1);
}

.table-modern td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.875rem;
  vertical-align: middle;
}

.table-modern td:first-child {
  padding-left: 24px;
}

.table-modern td:last-child {
  padding-right: 24px;
}

/* Actions Cell */
.actions-cell {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Checkbox alignment */
.table-modern input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
  margin: 0;
  vertical-align: middle;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Inline utility */
.inline { display: flex; gap: 8px; align-items: center; }
.text-warning { color: var(--warning-color); }
.d-none { display: none !important; }

/* Login Page Center */
.login-page {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
  padding: 16px; /* Reduzido padding externo para mobile */
  overflow-y: auto; /* Permite rolagem */
  box-sizing: border-box;
}

.login-page .container {
  margin: auto; /* Centralização vertical/horizontal segura */
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.login-page .panel {
  width: 100%;
  max-width: 500px; /* Aumentado para dar mais área */
  box-shadow: var(--shadow-lg);
  position: relative;
  margin: 0; /* O container já cuida da margem */
}

.login-logo-area {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo-area img {
  width: 80px;
  margin-bottom: 10px;
}

/* Media Queries */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .panel-header { flex-direction: column; gap: 16px; text-align: center; }
  .app-header-brand { flex-direction: column; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}
