@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;0,800;1,300;1,800&display=swap');

:root {
  --bg: #F8FAFC;
  --panel: #FFFFFF;
  --panel-strong: #FFFFFF;
  --ink: #0F172A;
  --muted: #64748B;
  --accent: #050766;
  /* Azul FarmaBrasil Principal */
  --accent-hover: #252cb7;
  /* Azul Claro Hover */
  --accent-2: #fef5e0;
  /* Amarelo Super Claro */
  --accent-2-hover: #fcebbb;
  --accent-3: #dd9e00;
  /* Mostarda FarmaBrasil Secundario */
  --stroke: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.splash {
  position: fixed;
  inset: 0;
  background: rgba(246, 242, 234, 0.85);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.splash.is-active {
  opacity: 1;
  pointer-events: all;
}

.splash-card {
  background: var(--panel-strong);
  border-radius: 18px;
  padding: 18px 22px;
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(31, 28, 27, 0.12);
  box-shadow: 0 18px 40px rgba(31, 28, 27, 0.18);
  font-size: 14px;
}

.splash-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(11, 139, 139, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.login-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  padding: 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.login-hero {
  display: grid;
  gap: 16px;
}

.login-hero h1 {
  font-size: 38px;
  line-height: 1.1;
}

.login-highlights {
  display: grid;
  gap: 12px;
}

.login-highlights div {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(31, 28, 27, 0.08);
  display: grid;
  gap: 4px;
}

.login-highlights span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-highlights strong {
  font-size: 14px;
}

.login-card {
  background: var(--panel-strong);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(31, 28, 27, 0.12);
  box-shadow: 0 20px 50px rgba(31, 28, 27, 0.15);
}

.login-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0 0 16px;
  font-size: 22px;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 64px;
  position: relative;
}

.hero {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  animation: floatIn 0.8s ease forwards;
  position: relative;
  z-index: 1;
}

.hero-branding {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
}

.hero-logo {
  max-width: 140px;
  max-height: 50px;
  object-fit: contain;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-3);
  margin: 0;
}

h1,
h2,
h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  /* Extra bold Guanabara emulation */
  margin: 0 0 12px;
}

h1 {
  font-size: 40px;
  line-height: 1.1;
}

.subtitle {
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
}

.hero-card {
  min-width: 320px;
  background: var(--panel-strong);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.stat-row strong {
  color: var(--ink);
}

.master-grid,
.auxiliary-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.master-panel {
  grid-column: span 12;
}

#runPanel {
  grid-column: span 7;
}

#filesPanel {
  grid-column: span 5;
}

.panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  animation: riseUp 0.7s ease forwards;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #38BDF8);
}

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

.panel-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.panel h3 {
  font-size: 18px;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #fff;
  width: 90%;
  max-width: 480px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.2s ease;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.is-active .modal-card {
  transform: translateY(0);
}

.modal-card.modal-lg {
  max-width: 640px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.close-btn:hover {
  color: var(--ink);
  background: #E2E8F0;
  box-shadow: none;
  transform: none;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #F8FAFC;
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--stroke);
  border-radius: 12px;
}

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

.data-table th {
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--stroke);
  background: #F8FAFC;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--stroke);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #F0F9FF;
}

.text-right {
  text-align: right !important;
}

/* Badges & Action Buttons */
.badge {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  letter-spacing: 0.05em;
}

.badge-active {
  background: #DBEAFE;
  color: #1D4ED8;
}

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--muted);
  transition: all 0.2s ease;
}

.action-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.action-btn:hover {
  background: #F1F5F9;
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.action-btn.primary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #EFF6FF;
}

.action-btn.danger:hover {
  border-color: #EF4444;
  color: #EF4444;
  background: #FEF2F2;
}

hr {
  border: none;
  border-top: 1px solid var(--stroke);
  margin: 16px 0;
}

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

.form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 13px;
  color: var(--muted);
}

input,
select,
button {
  font-family: 'IBM Plex Sans', sans-serif;
}

input,
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 28, 27, 0.16);
  background: #ffffff;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(11, 139, 139, 0.8);
  box-shadow: 0 0 0 3px rgba(11, 139, 139, 0.15);
}

.file-field {
  position: relative;
}

.file-field input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-label {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 12px;
  border: 1.5px dashed #CBD5E1;
  background: #F8FAFC;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-field:hover .file-label {
  border-color: var(--accent);
  background: #F0F9FF;
}

.file-title {
  font-weight: 600;
  color: var(--accent-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.file-name {
  font-size: 13px;
  color: var(--ink);
  word-break: break-all;
}

button {
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--stroke);
  box-shadow: none;
}

button.ghost:hover {
  background: var(--stroke);
  color: var(--ink);
}

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

.actions button {
  flex: 1 1 140px;
}

.helper {
  font-size: 13px;
  color: var(--muted);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.divider {
  height: 1px;
  background: var(--stroke);
  margin: 4px 0 8px;
}

pre {
  background: #1E293B;
  color: #E2E8F0;
  padding: 16px;
  border-radius: 12px;
  min-height: 160px;
  max-height: 280px;
  overflow: auto;
  font-size: 13px;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #0F172A;
  line-height: 1.5;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

ul li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid var(--stroke);
  font-size: 13px;
  transition: border-color 0.2s;
}

ul li:hover {
  border-color: #CBD5E1;
}

ul li button {
  padding: 8px 14px;
  background: var(--accent-2);
  color: var(--accent-hover);
  font-size: 12px;
}

ul li button:hover {
  background: var(--accent-2-hover);
}

.file-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
  display: inline-block;
  vertical-align: middle;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes riseUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }
}

@media (max-width: 1100px) {

  #runPanel,
  #filesPanel {
    grid-column: span 12;
  }
}

@media (max-width: 720px) {

  .master-panel,
  #runPanel,
  #filesPanel {
    grid-column: span 12;
  }
}