/* Google Fonts - Inter & Outfit */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* HSL Color Palette - Light Mode Premium */
  --bg-primary: #f8fafc;       /* Ultra-soft ice-white gray */
  --bg-secondary: #ffffff;     /* Pure white */
  --bg-tertiary: #e2e8f0;      /* Light gray border */
  
  --text-primary: #0f172a;     /* Deep slate */
  --text-secondary: #475569;   /* Medium slate */
  --text-muted: #94a3b8;       /* Soft gray slate */
  
  --accent-cyan: #0891b2;      /* Vibrant cyan */
  --accent-blue: #2563eb;      /* Bright blue */
  --accent-purple: #7c3aed;    /* Rich purple */
  --accent-green: #059669;     /* Emerald green */
  --accent-yellow: #d97706;    /* Amber yellow */
  --accent-red: #dc2626;       /* Red alert */
  
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-shadow: rgba(15, 23, 42, 0.04);
  
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(8, 145, 178, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography styling */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition-fast);
}

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

/* Main Layout */
.rnp-topbar {
  width: 100%;
  background-color: #15017D; /* Cor oficial RNP */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 50;
  font-family: var(--font-heading);
}

.rnp-topbar-inner {
  max-width: 100%;
  padding: 0 3rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rnp-topbar-brand-group {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.rnp-title-text {
  font-size: 1.25rem;
  font-weight: 400;
  text-transform: uppercase;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin: 0;
  line-height: 1.2;
}

.rnp-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.user-greeting {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.topbar-logout-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
  line-height: 1.2;
  margin: 0;
  text-decoration: none;
}

@media (max-width: 768px) {
  .rnp-topbar-inner {
    height: auto;
    min-height: 4.5rem;
    flex-direction: column;
    padding: 1rem 1.5rem;
    align-items: center;
    gap: 0.75rem;
  }
  .rnp-title-text {
    font-size: 1.1rem;
  }
  .rnp-topbar-right {
    width: 100%;
    justify-content: center;
  }
}

/* Sub-Menu Bar Navigation (Logo abaixo do título) */
.sub-menu-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--glass-border);
  padding: 0.75rem 3rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sub-menu-btn {
  color: var(--text-secondary);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: all var(--transition-fast);
}

.sub-menu-btn:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -0.75rem;
  top: 25%;
  height: 50%;
  width: 1px;
  background-color: var(--glass-border);
}

.sub-menu-btn:hover {
  color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.05);
}

.sub-menu-btn.active {
  color: var(--accent-blue);
  background-color: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

@media (max-width: 768px) {
  .sub-menu-bar {
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }
  .sub-menu-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.88rem;
  }
  .sub-menu-btn:not(:last-child)::after {
    right: -0.375rem;
  }
}

.app-container {
  max-width: 100%;
  margin: 0;
  padding: 2rem 3rem;
}

@media (max-width: 768px) {
  .app-container {
    padding: 1.5rem 1.25rem;
  }
}

header {
  display: none; /* Removed as nav is now in the topbar */
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 0 20px rgba(8, 145, 178, 0.2);
}

.logo-text {
  font-size: 1.5rem;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.nav-btn.primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.nav-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
}

.nav-btn.secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.nav-btn.secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.nav-btn.danger {
  background-color: rgba(220, 38, 38, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.nav-btn.danger:hover {
  background-color: var(--accent-red);
  color: white;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 10px 30px var(--glass-shadow);
  margin-bottom: 2rem;
  transition: var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 4px solid var(--accent-cyan);
  padding-left: 0.75rem;
}

/* Mini Cards */
.item-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--glass-shadow);
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-cyan);
}

.item-card.upgrade::before {
  background: var(--accent-purple);
}

.item-card.completed::before {
  background: var(--accent-green);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.upgrade {
  background-color: rgba(124, 58, 237, 0.08);
  color: var(--accent-purple);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.badge.new {
  background-color: rgba(8, 145, 178, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(8, 145, 178, 0.2);
}

.badge.danger {
  background-color: rgba(217, 119, 6, 0.08);
  color: var(--accent-yellow);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge.success {
  background-color: rgba(5, 150, 105, 0.08);
  color: var(--accent-green);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Pipeline Grid details (CircuitDetail view) */
.pipeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition-normal);
  position: relative;
  box-shadow: 0 2px 8px var(--glass-shadow);
}

.pipeline-step.faded {
  opacity: 0.55;
  background: rgba(255, 255, 255, 0.35);
}

.pipeline-step.faded:hover {
  opacity: 0.85;
}

.pipeline-step.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(8, 145, 178, 0.12);
  background: rgba(255, 255, 255, 0.95);
}

.pipeline-step.completed {
  border-color: rgba(5, 150, 105, 0.2);
}

.pipeline-step.skipped {
  border-color: rgba(217, 119, 6, 0.25);
}

.step-indicator {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.pipeline-step.active .step-indicator {
  background: var(--accent-cyan);
  color: white;
  box-shadow: 0 0 10px rgba(8, 145, 178, 0.3);
}

.pipeline-step.completed .step-indicator {
  background: var(--accent-green);
  color: white;
}

.pipeline-step.skipped .step-indicator {
  background: var(--accent-yellow);
  color: white;
}

.step-content {
  flex-grow: 1;
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.step-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.step-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1rem;
}

.alert-box {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  color: var(--accent-yellow);
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

/* Stage details updates timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.timeline-item {
  border-left: 2px solid var(--bg-tertiary);
  padding-left: 1.25rem;
  position: relative;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
}

.timeline-item.user-update::after {
  background: var(--accent-cyan);
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.timeline-text {
  font-size: 0.95rem;
}

/* Drag & Drop Reordering Admin CSS */
.draggable-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.draggable-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.draggable-item:active {
  cursor: grabbing;
}

.draggable-item.dragging {
  opacity: 0.5;
  background: var(--bg-secondary);
  border-color: var(--accent-cyan);
}

.drag-handle {
  display: flex;
  gap: 2px;
  flex-direction: column;
}

.drag-handle span {
  width: 12px;
  height: 2px;
  background-color: var(--text-muted);
}

/* Forms styling */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: white;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.15);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.3);
}

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

.btn.success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 2px var(--glass-shadow);
}

.btn.secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Authentication Screen Specific styling */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 4rem);
}

.login-card {
  width: 100%;
  max-width: 420px;
}

/* Table light mode styles */
table th {
  font-weight: 600;
}

table tr:hover {
  background-color: rgba(15, 23, 42, 0.015);
}

/* Responsive improvements */
@media(max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}
