/* ContaSeed Components & App Layout */

/* App Wrapper */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(3, 20, 16, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand-text h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-text);
  line-height: 1.1;
}

.sidebar-brand-text span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-subtle);
  padding: 0.75rem 0.75rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--color-surface-hover);
  color: #ffffff;
}

.nav-item.active {
  background: var(--color-accent-dim);
  color: var(--color-accent);
  border-color: rgba(143, 212, 168, 0.25);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  flex-shrink: 0;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #031410;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.user-info p {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
}

.user-info span {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: calc(100vw - 260px);
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  height: 70px;
  background: rgba(3, 20, 16, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.topbar-title h1 {
  font-size: 1.5rem;
  font-family: var(--font-serif);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Page Container */
.page-body {
  padding: 1.75rem 2rem;
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Views */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
  min-width: 0;
  width: 100%;
}
.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid & Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--gradient-dark-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.card-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.metric-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-accent);
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-sub.positive {
  color: var(--color-accent);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

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

.chart-header h3 {
  font-size: 1.15rem;
}

/* CRM Kanban Board */
.kanban-wrapper {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  padding-bottom: 1.25rem;
  min-height: calc(100vh - 220px);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.kanban-wrapper::-webkit-scrollbar {
  height: 8px;
}
.kanban-wrapper::-webkit-scrollbar-track {
  background: rgba(2, 16, 12, 0.6);
  border-radius: var(--radius-full);
}
.kanban-wrapper::-webkit-scrollbar-thumb {
  background: rgba(143, 212, 168, 0.3);
  border-radius: var(--radius-full);
}
.kanban-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

.kanban-column {
  flex: 0 0 280px;
  min-width: 280px;
  max-width: 280px;
  background: rgba(4, 25, 19, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  max-height: calc(100vh - 220px);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kanban-column:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

/* Colored top accent bars */
.kanban-column::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stage-color, var(--color-accent));
}

.kanban-column:nth-child(1) { --stage-color: #8fd4a8; }
.kanban-column:nth-child(2) { --stage-color: #38bdf8; }
.kanban-column:nth-child(3) { --stage-color: #5b82f5; }
.kanban-column:nth-child(4) { --stage-color: #c084fc; }
.kanban-column:nth-child(5) { --stage-color: #f59e0b; }
.kanban-column:nth-child(6) { --stage-color: #10b981; }

.kanban-column-header {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 16, 12, 0.6);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.kanban-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text);
}

.kanban-cards {
  padding: 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.kanban-cards::-webkit-scrollbar {
  width: 5px;
}
.kanban-cards::-webkit-scrollbar-track {
  background: transparent;
}
.kanban-cards::-webkit-scrollbar-thumb {
  background: rgba(143, 212, 168, 0.25);
  border-radius: 99px;
}
.kanban-cards::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

.lead-card {
  background: rgba(6, 35, 25, 0.85);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  position: relative;
}

.lead-card:hover {
  border-color: rgba(143, 212, 168, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.lead-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.lead-card-company {
  font-size: 0.775rem;
  color: var(--color-accent);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 0.65rem;
}

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Tables */
.table-card {
  background: var(--gradient-dark-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-header-bar {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.custom-table th {
  background: rgba(2, 16, 12, 0.8);
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
  border-bottom: 1px solid var(--color-border);
}

.custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
}

.custom-table td strong {
  color: var(--color-text);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 16, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  background: #041913;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  padding: 2rem;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal-backdrop.open .modal-dialog {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-header {
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

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

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.45rem;
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #05261d;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(143, 212, 168, 0.2);
  background-color: #073125;
}

.form-control::placeholder {
  color: var(--color-text-subtle);
}

/* Custom styled Select Dropdowns */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #05261d;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238fd4a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.75rem;
  cursor: pointer;
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

select.form-control:hover {
  border-color: rgba(143, 212, 168, 0.45);
}

select.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(143, 212, 168, 0.25);
  background-color: #073125;
}

/* Option tags inside select dropdowns (Chrome / Edge / Firefox) */
select.form-control option {
  background-color: #041913 !important;
  color: #ede8dc !important;
  padding: 12px 14px;
  font-size: 0.875rem;
}

select.form-control option:hover,
select.form-control option:focus,
select.form-control option:checked {
  background-color: #0a3d2f !important;
  color: #8fd4a8 !important;
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Interactive Stage Selector in Modal */
.stage-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 0.5rem;
}

.stage-btn-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
  outline: none;
}

.stage-btn-item:hover {
  background: rgba(143, 212, 168, 0.08);
  border-color: rgba(143, 212, 168, 0.35);
  color: var(--color-text);
  transform: translateX(4px);
}

.stage-btn-item.active {
  background: rgba(143, 212, 168, 0.14);
  border-color: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(143, 212, 168, 0.15);
}

.stage-btn-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-badge-dot {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.stage-check-icon {
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.stage-btn-item.active .stage-check-icon {
  opacity: 1;
  color: var(--color-accent);
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  background: #05261d;
  border: 1px solid var(--color-border-strong);
  border-left: 4px solid var(--color-accent);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--color-text);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   CALENDAR & ACTIVITIES STYLES (SeedTech Identity)
   ============================================================ */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1200px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
}

.calendar-main-card {
  background: var(--gradient-dark-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-nav-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calendar-month-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-month-heading em {
  color: var(--color-accent);
  font-style: normal;
}

.calendar-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.775rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-filter-btn.active {
  background: rgba(143, 212, 168, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

.calendar-filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

/* Calendar Weekdays */
.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-subtle);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

/* Calendar Grid */
.calendar-grid-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-box {
  min-height: 104px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.calendar-day-box:hover {
  background: rgba(143, 212, 168, 0.05);
  border-color: rgba(143, 212, 168, 0.3);
  transform: translateY(-1px);
}

.calendar-day-box.is-other-month {
  opacity: 0.3;
  background: transparent;
  cursor: default;
}

.calendar-day-box.is-today {
  border-color: var(--color-accent);
  background: rgba(143, 212, 168, 0.06);
  box-shadow: inset 0 0 12px rgba(143, 212, 168, 0.1);
}

.calendar-day-box.is-selected {
  outline: 2px solid var(--color-accent);
  background: rgba(143, 212, 168, 0.09);
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.calendar-day-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.calendar-day-box.is-today .calendar-day-number {
  color: #031410;
  background: var(--color-accent);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.calendar-day-add-btn {
  opacity: 0;
  font-size: 0.7rem;
  color: var(--color-accent);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  transition: opacity var(--transition-fast);
}

.calendar-day-box:hover .calendar-day-add-btn {
  opacity: 1;
}

/* Event Chips inside Day Box */
.calendar-events-stream {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  max-height: 80px;
}

.cal-chip {
  font-size: 0.68rem;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  cursor: pointer;
  transition: filter var(--transition-fast);
}

.cal-chip:hover {
  filter: brightness(1.25);
}

.cal-chip-reuniao {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
}

.cal-chip-apresentacao {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.cal-chip-followup {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
}

.cal-chip-tarefa {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.cal-chip-alinhamento {
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #cffafe;
}

.cal-chip-receivable {
  background: rgba(143, 212, 168, 0.2);
  border: 1px solid rgba(143, 212, 168, 0.4);
  color: var(--color-accent);
}

.cal-chip-payable {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.cal-chip.completed {
  opacity: 0.55;
  text-decoration: line-through;
}

.cal-more-indicator {
  font-size: 0.65rem;
  color: var(--color-text-subtle);
  font-weight: 600;
  padding-left: 2px;
}

/* Right Agenda Panel */
.calendar-agenda-panel {
  background: var(--gradient-dark-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.agenda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agenda-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.agenda-date-badge {
  font-size: 0.75rem;
  color: var(--color-accent);
  background: rgba(143, 212, 168, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.agenda-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.agenda-item-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.agenda-item-card:hover {
  background: rgba(143, 212, 168, 0.05);
  border-color: rgba(143, 212, 168, 0.3);
  transform: translateX(2px);
}

.agenda-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.agenda-item-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent);
}

.agenda-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.agenda-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.agenda-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Timeline in Company 360 */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 2px;
  background: rgba(143, 212, 168, 0.2);
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid #031410;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* ========================================================
   ADMINISTRATION, RBAC & TOPBAR AUTHENTICATION STYLES
   ======================================================== */

/* Topbar User Pill & Dropdown */
.topbar-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-base);
  user-select: none;
}

.topbar-user-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(143, 212, 168, 0.3);
}

.user-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #031410;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(143, 212, 168, 0.3);
}

.topbar-user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: #041913;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 8px;
  z-index: 200;
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.user-dropdown-menu.open {
  display: block;
}

.dropdown-header {
  padding: 8px 10px;
}

.dropdown-header strong {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(143, 212, 168, 0.1);
  color: var(--color-accent);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Admin Tabs Navigation */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  padding-bottom: 0px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tab-btn:hover {
  color: var(--color-text);
}

.admin-tab-btn.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  background: rgba(143, 212, 168, 0.05);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

/* RBAC Roles Grid & Cards */
.rbac-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.rbac-role-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.rbac-role-card:hover {
  border-color: rgba(143, 212, 168, 0.4);
  transform: translateY(-2px);
}

.rbac-role-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rbac-role-name {
  font-size: 1rem;
  font-weight: 700;
}

.rbac-role-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.rbac-badge-pill {
  display: inline-block;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Quick Demo Switcher / Login Cards */
.login-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 1rem;
}

.login-demo-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
}

.login-demo-card:hover {
  background: rgba(143, 212, 168, 0.08);
  border-color: var(--color-accent);
}

.login-demo-card strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.login-demo-card span {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}



/* Sem sessão: login obrigatório, sem botão de fechar e sem o app visível atrás */
body.auth-required #modalLogin .modal-close { display: none; }
body.auth-required #modalLogin { background: var(--color-bg, #031410); }
