/* Ported from Commons v2 (pages.css). Agent-specific sections dropped; class names kept compatible. */
/* --- v2 pages.css 1-660 --- */
/**
 * Page-Specific Styles
 *
 * Contains page-specific layouts and agent dashboard styles
 * that don't belong in generic modular files.
 *
 * Load Order (set in base.html):
 * 1. core.css - Design tokens, typography
 * 2. components.css - Buttons, forms, cards, tables
 * 3. layouts.css - Containers, utilities
 * 4. widgets.css - Widget framework
 * 5. pages.css (this file) - Page-specific styles
 * 6. themes/*.css - User theme overrides
 *
 * Note: Theme files load after this file and can override variables.
 */

   Sidebar Navigation Styles
   Extracted from navbar.html template
   ============================================ */

#flock-sidebar.preload {
  visibility: hidden;
}

#flock-sidebar {
  font-family: 'Roboto', sans-serif;
}

#flock-sidebar .brand-text {
  font-family: 'Oswald', sans-serif;
}

#flock-sidebar-wrapper {
  all: initial;
}

#flock-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 100%;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s, background-color 0.3s, color 0.3s;
  z-index: 1000;
}

#flock-sidebar.expanded {
  width: 200px;
  -background-color: #fff;
  -color: #3D4F96;
  padding: 10px;
}

#flock-sidebar .sidebar-top,
#flock-sidebar .sidebar-bottom {
  -padding: 10px;
}

#flock-sidebar .brand {
  display: flex;
  align-items: center;
}

#flock-sidebar .brand-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

#flock-sidebar .brand-text {
  display: none;
  -font-weight: bold;
  -font-size: 1.2em;
  margin-left: 8px;

  text-align: center;
  font-size: 30px;
  line-height: 30px;
  margin-left: 0;
  width: 100%;
}

#flock-sidebar.expanded .brand-text {
  display: inline;
}

#flock-sidebar .customer-name {
  display: none;
  font-weight: 600;
  -color: #D77052;
  margin: 10px 0 5px 40px;
  font-size: 14px;
}

#flock-sidebar.expanded .customer-name {
  display: block;
}

#flock-sidebar .customer-switch-link {
  text-decoration: none;
  transition: opacity 0.2s;

  color: #D77052;
  margin-right: -20px;
}

#flock-sidebar .customer-switch-link:hover {
  opacity: 1 !important;
}

#flock-sidebar .sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0; /* Allow flex item to shrink below content size */

  font-size: var(--font-size-small);
}

/* Placeholder agent styling - italic and reduced opacity */
#flock-sidebar .nav-item-placeholder .nav-label {
  font-style: italic;
  opacity: 0.65;
}

#flock-sidebar .nav-item-placeholder .nav-icon {
  opacity: 0.5;
}

/* Mobile-only items hidden on desktop */
#flock-sidebar .nav-item-mobile-only {
  display: none !important;
}

/* Sidebar category headers (per-customer layout, SIDEBAR_CATEGORIES_NOTES.md).
   Mirrors the mockup M1 .nav-h: small caps, 9.5px, .12em tracking, muted. */
#flock-sidebar .nav-section-header {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--sidebar-section-heading);
  padding: 14px 10px 2px;
  line-height: 1.3;
  user-select: none;
}

#flock-sidebar .nav-section-header-other {
  color: var(--sidebar-section-heading-other);
}

#flock-sidebar .nav-section-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapsed rail: the label becomes a thin divider so grouping still reads. */
#flock-sidebar.collapsed .nav-section-header {
  width: 60%;
  padding: 0;
  margin: 10px auto 4px;
  border-top: 1px solid var(--sidebar-section-divider);
}

#flock-sidebar.collapsed .nav-section-label {
  display: none;
}

#flock-sidebar .nav-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  margin: 4px 0;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

#flock-sidebar .nav-item:hover {
  background-color: var(--sidebar-bg-hover);
}

#flock-sidebar.expanded .nav-item:hover {
  background-color: var(--sidebar-bg-hover);
}

/* Active/Selected Nav Item - Fortune 500: Subtle background + text weight only */
#flock-sidebar .nav-item.active,
#flock-sidebar .nav-item[aria-current="page"] {
  background-color: var(--sidebar-bg-selected);
  color: var(--sidebar-icon-active);
  font-weight: 600;
}

#flock-sidebar .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--sidebar-icon);
}

#flock-sidebar .nav-item:hover .nav-icon {
  color: var(--sidebar-icon-active);
}

#flock-sidebar .nav-item.active .nav-icon,
#flock-sidebar .nav-item[aria-current="page"] .nav-icon {
  color: var(--sidebar-icon-active);
}

#flock-sidebar .nav-item.active .nav-label,
#flock-sidebar .nav-item[aria-current="page"] .nav-label {
  color: var(--sidebar-icon-active);
}

#flock-sidebar .nav-label {
  display: none;
  margin-left: 20px;
}

#flock-sidebar.expanded .nav-label {
  display: inline;
}


#flock-sidebar .sidebar-toggle {
  position: absolute;
  right: -20px;
  top: 50px;
  background-color: var(--sidebar-bg-hover);
  color: var(--sidebar-text);
  width: 34px;
  height: 24px;
  border-radius: 0 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

#flock-sidebar.expanded .sidebar-toggle {
  background-color: var(--content-bg);
  color: var(--sidebar-bg);
}

#flock-sidebar .logout {
  margin-top: auto;
}

.sidebar-toggle .toggle-icon {
  font-size: 16px;
  margin-right: -10px;
}

#flock-sidebar.collapsed {
  align-items: center;
}

#flock-sidebar .sidebar-top {
    padding: 16px;
    border-bottom: 1px solid var(--sidebar-border);
}

#flock-sidebar.collapsed .sidebar-top {
  padding-top: 30px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#flock-sidebar.collapsed .sidebar-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#flock-sidebar.collapsed .nav-item {
  width: 100%;
  justify-content: center;
}

#flock-sidebar .sidebar-bottom {
    padding-bottom: 30px;
    font-size: var(--font-size-small);
}

#flock-sidebar.collapsed .sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#flock-sidebar.collapsed .nav-label,
#flock-sidebar.collapsed .nav-greeting,
#flock-sidebar.collapsed .customer-name {
  display: none !important;
}

#flock-sidebar.expanded .nav-label {
  display: inline;
}


#flock-sidebar.expanded .nav-greeting,
#flock-sidebar.expanded .customer-name {
  width: 100%;
  margin: 10px 0;

  text-align: center;
  display: block;
  font-size: 20px;
}

#flock-sidebar.expanded .nav-greeting {
    -color: #D77052;
    font-size: 12px;
    display: none;
}

#flock-sidebar.no-transition {
  transition: none !important;
}


@media (max-width: 768px) {
  #flock-sidebar {
    top: auto;
    bottom: 15px;
    left: 0;
    width: 100%;
    height: 60px;
    flex-direction: row;
    align-items: center;
    background-color: var(--sidebar-bg);
    transition: none;
  }

  #flock-sidebar.expanded {
    width: 100%;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
  }

  #flock-sidebar .sidebar-top,
  #flock-sidebar .sidebar-bottom,
  #flock-sidebar .sidebar-toggle {
    display: none;
  }

  #flock-sidebar .sidebar-nav {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    overflow-y: visible;
  }

  /* Hide dynamic agent items on mobile - they use the Agents list page instead */
  #flock-sidebar .nav-item-agent {
    display: none !important;
  }

  /* Category headers go with the agent items they label */
  #flock-sidebar .nav-section-header {
    display: none !important;
  }

  /* Show mobile-only items (Agents list link, Profile) */
  #flock-sidebar .nav-item-mobile-only {
    display: flex !important;
  }

  #flock-sidebar .nav-item {
    padding: 0;
    flex-direction: column;
    justify-content: center;
  }

  #flock-sidebar .nav-label {
    display: none !important;
  }

  #flock-sidebar .nav-icon {
    font-size: 20px;
  }
}

/* ============================================
   Tools Hub Page Styles
   ============================================ */

.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.tools-hub-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tools-hub-card:hover {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tools-hub-card-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--color-primary, #3b82f6);
  flex-shrink: 0;
}

.tools-hub-card-body {
  flex: 1;
  margin-left: 16px;
}

.tools-hub-card-body h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
}

.tools-hub-card-body p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
}

.tools-hub-card-arrow {
  color: var(--text-secondary, #9ca3af);
  margin-left: 12px;
  flex-shrink: 0;
}

.tools-hub-card-disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ============================================
   Admin Dashboard - Statistics Row
   ============================================ */

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .admin-stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-stat-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: block;
}

a.admin-stat-card:hover {
  border-color: var(--color-primary, #1a2234);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-stat-card-static {
  cursor: default;
}

.admin-stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--content-heading, #374151);
}

.admin-stat-header i {
  font-size: 16px;
  color: var(--icon-default, #9ca3af);
}

.admin-stat-numbers {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.admin-stat-item {
  flex: 1;
}

.admin-stat-value {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--content-heading, #374151);
  line-height: 1.2;
}

.admin-stat-value-alert {
  color: var(--color-danger, #dc3545);
}

.admin-stat-label {
  font-size: 0.75em;
  color: var(--content-text-muted, #6b7280);
  margin-top: 2px;
}

/* ============================================
   Admin Dashboard - Section Header
   ============================================ */

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================
   Admin Dashboard - Activity List
   ============================================ */

.admin-activity-list {
  display: grid;
  gap: 8px;
}

.admin-activity-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 6px;
  transition: background-color 0.15s;
}

.admin-activity-item:hover {
  background-color: var(--bg-hover, #f9fafb);
}

.admin-activity-icon {
  margin-right: 14px;
  color: var(--icon-default, #9ca3af);
  font-size: 1.1em;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.admin-activity-content {
  flex: 1;
  min-width: 0;
}

.admin-activity-title {
  font-weight: 600;
  color: var(--content-heading, #374151);
  font-size: 14px;
}

.admin-activity-entity {
  color: var(--content-text-muted, #6b7280);
  font-weight: normal;
  font-size: 0.9em;
}

.admin-activity-details {
  color: var(--content-text-muted, #6b7280);
  font-size: 13px;
  margin-top: 2px;
}

.admin-activity-meta {
  color: var(--content-text-muted, #9ca3af);
  font-size: 12px;
  margin-top: 4px;
}

.admin-activity-meta i {
  margin-right: 3px;
}

.admin-activity-user {
  margin-left: 10px;
}

.admin-activity-user i {
  margin-right: 3px;
}

.admin-activity-link {
  color: var(--content-text-muted, #9ca3af);
  text-decoration: none;
  padding: 6px;
  margin-left: 8px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.admin-activity-link:hover {
  color: var(--color-primary, #1a2234);
}

/* Remove agent button in table rows */
.btn-remove-agent {
  color: var(--text-secondary, #9ca3af);
  opacity: 0.6;
  transition: color 0.15s, opacity 0.15s;
}
.btn-remove-agent:hover {
  color: var(--color-danger, #dc3545);
  opacity: 1;
}

/* --- v2 pages.css 2145-2213 --- */
/* ========================================
   MFA Requirement Banner (base.html)
   (Phase 2.2 - Inline Style Elimination)
   ======================================== */

/* Base Banner Styles */
.mfa-banner {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Banner Variants - Based on Grace Days */
.mfa-banner-critical {
    background-color: #dc3545;
    color: white;
}

.mfa-banner-urgent {
    background-color: #ff6b6b;
    color: white;
}

.mfa-banner-warning {
    background-color: #ffc107;
    color: #856404;
}

/* Banner Icon */
.mfa-banner-icon {
    font-size: 24px;
}

/* Banner Content */
.mfa-banner-content {
    flex: 1;
}

.mfa-banner-title {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 600;
}

/* Banner Action Button */
.mfa-banner-button {
    padding: 10px 20px;
    background-color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.mfa-banner-critical .mfa-banner-button,
.mfa-banner-urgent .mfa-banner-button {
    color: #dc3545;
}

.mfa-banner-warning .mfa-banner-button {
    color: #856404;
}

/* --- v2 pages.css 5043-5147 --- */
/* ============================================
   Chat Interface Styles
   ============================================ */

.chat-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background-color: #fafafa;
}

.chat-message {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.chat-message-user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 14px;
}

.chat-avatar-success {
    background-color: #28a745;
}

.chat-avatar-primary {
    background-color: #1a2234;
}

.chat-bubble {
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 80%;
}

.chat-bubble-assistant {
    background-color: white;
    border-radius: 15px 15px 15px 5px;
}

.chat-bubble-user {
    background-color: #e3f2fd;
    border-radius: 15px 15px 5px 15px;
}

.chat-bubble p {
    margin: 0;
    color: #333;
    line-height: 1.5;
}

.chat-input-section {
    padding: 20px;
    background-color: white;
    border-top: 1px solid #ddd;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

.chat-input:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

.chat-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.btn-chat-send {
    border-radius: 25px;
    padding: 12px 20px;
}

/* --- v2 pages.css 5380-5469 --- */
/* ============================================
   Dialog/Confirmation Styles - Fortune 500 Style
   ============================================ */

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-container {
    background-color: var(--content-card-bg, white);
    padding: 24px;
    border-radius: var(--radius-lg, 8px);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg, 0 8px 16px rgba(0,0,0,0.15));
}

.dialog-header {
    text-align: center;
    margin-bottom: 16px;
}

/* Dialog icons - neutral grey by default (Fortune 500) */
.dialog-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    color: var(--icon-default, #9ca3af);
}

/* Semantic icon colors - only use when meaning is critical */
.dialog-icon-warning {
    color: var(--accent-warning, #d97706);
}

.dialog-icon-info {
    color: var(--icon-default, #9ca3af); /* Neutral grey, not bright blue */
}

.dialog-icon-error {
    color: var(--accent-danger, #dc2626);
}

.dialog-icon-success {
    color: var(--accent-success, #059669);
}

.dialog-title {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--content-heading, #374151);
}

.dialog-body {
    margin-bottom: 20px;
    color: var(--content-text, #4b5563);
    line-height: 1.5;
}

.dialog-body p {
    margin: 0 0 8px 0;
}

.dialog-body p:last-child {
    margin-bottom: 0;
}

/* Form group inside dialog - proper spacing */
.dialog-container .form-group {
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--content-border, #e5e7eb);
    margin-top: 20px;
}

