/* Admin Pages Shared Styles - Fluent Design */

/* Import shared styles */
@import url("../shared/styles.css");

/* Layout */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #faf9f8;
  color: #323130;
  line-height: 1.5;
  /* Font family inherited from .ms-Fabric class (Fluent UI Fabric Core) */
}

body {
  display: flex;
  flex-direction: column;
}

/* ============================================================================
   ADMIN LAYOUT (Sidebar + Content)
   ============================================================================ */

.admin-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 57px); /* Subtract header height */
  overflow: hidden;
}

/* Left Navigation Sidebar */
.admin-nav {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid #edebe9;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.admin-nav-items {
  flex: 1;
  padding: 16px 0;
}

.admin-nav-bottom {
  padding: 16px 0;
  border-top: 1px solid #edebe9;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #323130;
  text-decoration: none;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.admin-nav-item:hover {
  background-color: #f3f2f1;
}

.admin-nav-item.active {
  background-color: #e6f0ff;
  color: #0078d4;
  border-left: 3px solid #0078d4;
  padding-left: 17px; /* Adjust for border */
}

.admin-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  width: 20px;
  height: 20px;
  color: #605e5c;
  transition: color 0.15s ease;
}

.admin-nav-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.admin-nav-item:hover .admin-nav-icon,
.admin-nav-item.active .admin-nav-icon {
  color: #0078d4;
}

.admin-nav-label {
  font-size: 14px;
  font-weight: 600;
}

/* Main Content Area */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 50%, #f5f6f8 100%);
  position: relative;
}

/* Subtle background pattern */
.admin-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 120, 212, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 120, 212, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(107, 0, 209, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure content is above background pattern */
.admin-view {
  position: relative;
  z-index: 1;
  display: none;
}

.admin-view.active {
  display: block;
}

/* View Header */
.admin-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #edebe9;
}

.admin-view-title {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  color: #323130;
}

.admin-view-actions {
  display: flex;
  gap: 12px;
}

/* ============================================================================
   CONNECTIONS VIEW
   ============================================================================ */

.connections-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Org Connection Card */
.org-connection {
  background: #ffffff;
  border-radius: 8px;
  box-shadow:
    0 1.6px 3.6px rgba(0, 0, 0, 0.13),
    0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  overflow: hidden;
}

.org-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f3f2f1;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.org-header:hover {
  background: #e1dfdd;
}

.org-header.expanded {
  background: #e6f0ff;
}

.org-info {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.org-name-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.org-instance-url {
  font-size: 16px;
  font-weight: 600;
  color: #323130;
}

.org-label-section {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.org-label-display {
  font-size: 14px;
  color: #605e5c;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}

.org-label-display:hover {
  background-color: #f3f2f1;
}

.org-label-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #605e5c;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  opacity: 0.6;
  padding: 0;
}

.org-label-edit-btn:hover {
  background-color: #f3f2f1;
  opacity: 1;
}

.org-label-edit-btn:active {
  background-color: #edebe9;
}

.org-label-input {
  font-size: 14px;
  color: #323130;
  padding: 4px 8px;
  border: 1px solid #0078d4;
  border-radius: 4px;
  outline: none;
  background: #ffffff;
  min-width: 200px;
  max-width: 400px;
  font-family: inherit;
}

.org-label-input:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.org-label-input.saving {
  opacity: 0.6;
  cursor: wait;
  background-color: #f3f2f1;
}

.org-label-input.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.org-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.org-type-badge.sandbox {
  background-color: #fff4ce;
  color: #8a6d3b;
}

.org-type-badge.production {
  background-color: #dff6dd;
  color: #107c10;
}

.org-expired-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background-color: #fde7e9;
  color: #a80000;
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

.org-action-btn {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 32px;
  min-width: auto;
}

.org-toggle-icon {
  font-size: 18px;
  margin-left: 12px;
  transition: transform 0.2s ease;
}

.org-header.expanded .org-toggle-icon {
  transform: rotate(180deg);
}

/* Flows Table */
.org-flows {
  display: none;
  padding: 0;
}

.org-flows.expanded {
  display: block;
}

.flows-table {
  width: 100%;
  border-collapse: collapse;
}

.flows-table thead {
  background-color: #faf9f8;
  border-top: 1px solid #edebe9;
  border-bottom: 1px solid #edebe9;
}

.flows-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flows-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #edebe9;
  font-size: 14px;
  color: #323130;
}

.flows-table tbody tr:hover {
  background-color: #faf9f8;
}

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

/* Checkbox in table */
.flow-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.flow-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.org-flows-empty {
  padding: 40px 20px;
  text-align: center;
  color: #605e5c;
  font-size: 14px;
}

/* Empty State (for connections and users) */
.empty-state {
  background: #ffffff;
  border-radius: 8px;
  box-shadow:
    0 1.6px 3.6px rgba(0, 0, 0, 0.13),
    0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  padding: 64px 40px;
  text-align: center;
  max-width: 600px;
  margin: 40px auto;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 24px;
  font-weight: 600;
  color: #323130;
  margin: 0 0 12px 0;
}

.empty-state-description {
  font-size: 15px;
  color: #605e5c;
  line-height: 1.6;
  margin: 0 0 32px 0;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ============================================================================
   USERS VIEW
   ============================================================================ */

.admin-table-container {
  background: #ffffff;
  border-radius: 8px;
  box-shadow:
    0 1.6px 3.6px rgba(0, 0, 0, 0.13),
    0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background-color: #faf9f8;
}

.admin-table th {
  padding: 16px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #edebe9;
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #edebe9;
  font-size: 14px;
  color: #323130;
}

.admin-table tbody tr:hover {
  background-color: #faf9f8;
}

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

/* Users info message */
.users-info-message {
  margin-bottom: 20px;
}

/* Role dropdown in users table */
.role-select {
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #8a8886;
  border-radius: 2px;
  background-color: #ffffff;
  color: #323130;
  cursor: pointer;
  transition: border-color 0.15s ease;
  font-family:
    "Segoe UI",
    "Segoe UI Web (West European)",
    -apple-system,
    BlinkMacSystemFont,
    Roboto,
    "Helvetica Neue",
    sans-serif;
}

.role-select:hover {
  border-color: #323130;
}

.role-select:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

/* Role badge (for current user - not editable) */
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.role-badge.role-admin {
  background-color: #e8f4fd;
  color: #0078d4;
}

.role-badge.role-user {
  background-color: #f3f2f1;
  color: #605e5c;
}

/* ============================================================================
   SETTINGS VIEW
   ============================================================================ */

.settings-container {
  max-width: 800px;
}

.settings-section {
  background: #ffffff;
  border-radius: 8px;
  box-shadow:
    0 1.6px 3.6px rgba(0, 0, 0, 0.13),
    0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  padding: 32px;
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 20px 0;
  color: #323130;
}

.settings-profile {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Danger Zone */
.settings-danger-zone {
  border: 2px solid #fde7e9;
  background-color: #fffaf9;
}

.settings-danger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #edebe9;
}

.settings-danger-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-danger-item:first-child {
  padding-top: 0;
}

.settings-danger-info {
  flex: 1;
  margin-right: 20px;
}

.settings-danger-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #a80000;
}

.settings-danger-description {
  font-size: 14px;
  color: #605e5c;
  margin: 0;
  line-height: 1.5;
}

/* ============================================================================
   SIGNUP PAGE STYLES (existing)
   ============================================================================ */

/* Signup Page Header (like a normal website) */
.signup-header {
  background: #ffffff;
  border-bottom: 1px solid #edebe9;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.signup-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
}

/* Admin page header - align with sidebar */
.admin-layout ~ .signup-header .signup-header-content,
body:has(.admin-layout) .signup-header-content {
  max-width: none;
  margin: 0;
  padding: 12px 0 12px 20px;
}

.signup-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.signup-logo-img {
  width: 32px;
  height: 32px;
  display: block;
}

.signup-logo-text {
  font-size: 20px;
  font-weight: 600;
  color: #0078d4;
  margin: 0;
}

/* Signup Main Content */
.signup-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.signup-content {
  width: 100%;
  max-width: 540px;
}

.signup-state {
  display: none;
}

.signup-state:not(.hidden) {
  display: block;
}

.signup-state-content {
  background: #ffffff;
  border-radius: 8px;
  box-shadow:
    0 1.6px 3.6px rgba(0, 0, 0, 0.13),
    0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  padding: 48px;
}

/* Full-width buttons in signup forms */
.signup-state-content .flowrunner-primary-btn {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
  padding: 0 24px;
}

.signup-title {
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #323130;
  line-height: 1.2;
}

.signup-subtitle {
  font-size: 15px;
  color: #605e5c;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.signup-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 13px;
  color: #605e5c;
}

.signup-footer a {
  color: #0078d4;
  text-decoration: none;
}

.signup-footer a:hover {
  text-decoration: underline;
}

.signup-footer p {
  margin: 0;
}

/* Old admin container (for other admin pages if they exist) */
.admin-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow:
    0 1.6px 3.6px rgba(0, 0, 0, 0.13),
    0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  padding: 40px;
  max-width: 480px;
  width: 100%;
}

/* Typography */
.admin-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #323130;
}

.admin-subtitle {
  font-size: 14px;
  color: #605e5c;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

.admin-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #323130;
  margin-bottom: 8px;
}

.admin-hint {
  display: block;
  font-size: 12px;
  color: #605e5c;
  margin-top: 4px;
  line-height: 1.4;
}

/* Form Elements */
.admin-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #8a8886;
  border-radius: 2px;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
  /* Font family inherited from .ms-Fabric */
}

.admin-input:hover {
  border-color: #323130;
}

.admin-input:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

.admin-input:disabled {
  background-color: #f3f2f1;
  border-color: #c8c6c4;
  color: #a19f9d;
  cursor: not-allowed;
}

.admin-input-readonly {
  background-color: #f3f2f1;
  cursor: default;
}

.admin-form-group {
  margin-bottom: 24px;
}

/* Buttons - use shared styles from styles.css */
/* Admin-specific button overrides only if needed */
.admin-btn-primary {
  width: 100%;
  /* All other styles come from .flowrunner-primary-btn in shared/styles.css */
}

/* Messages */
.admin-message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}

.admin-message-error {
  background-color: #fde7e9;
  border-left: 4px solid #a80000;
  color: #a80000;
}

.admin-message-success {
  background-color: #dff6dd;
  border-left: 4px solid #107c10;
  color: #107c10;
}

.admin-message-info {
  background-color: #f3f2f1;
  border-left: 4px solid #605e5c;
  color: #323130;
}

.admin-message p {
  margin: 8px 0 0 0;
}

/* Loading State */
.admin-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: admin-spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

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

/* Footer */
.admin-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: #605e5c;
}

.admin-footer a {
  color: #0078d4;
  text-decoration: none;
}

.admin-footer a:hover {
  text-decoration: underline;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

/* Admin-specific elements */
.admin-section-title {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.admin-list {
  margin: 0;
  padding-left: 24px;
  line-height: 1.8;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 480px;
  padding: 16px;
  margin-bottom: 12px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 20px;
  color: #323130;
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 2px;
  color: #605e5c;
  cursor: pointer;
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2px;
  margin-right: -4px;
}

.toast-close:hover {
  background-color: #f3f2f1;
  color: #323130;
}

.toast-close:active {
  background-color: #edebe9;
}

/* Toast type variants */
.toast-success {
  border-left: 4px solid #107c10;
}

.toast-success .toast-icon {
  color: #107c10;
}

.toast-error {
  border-left: 4px solid #a80000;
}

.toast-error .toast-icon {
  color: #a80000;
}

.toast-warning {
  border-left: 4px solid #f7630c;
}

.toast-warning .toast-icon {
  color: #f7630c;
}

.toast-info {
  border-left: 4px solid #0078d4;
}

.toast-info .toast-icon {
  color: #0078d4;
}

/* ============================================================================
   MODAL DIALOGS
   ============================================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.modal-show {
  opacity: 1;
}

.modal-overlay.modal-show .modal {
  opacity: 1;
  transform: scale(1);
}

.modal {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-width: calc(100vw - 96px);
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #edebe9;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #323130;
}

.modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 2px;
  color: #605e5c;
  cursor: pointer;
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -8px;
}

.modal-close:hover {
  background-color: #f3f2f1;
  color: #323130;
}

.modal-close:active {
  background-color: #edebe9;
}

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

.modal-message {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: #323130;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid #edebe9;
}

/* Danger button variant for modals */
.modal-btn-confirm.flowrunner-danger-btn {
  background-color: #a80000;
  border-color: #a80000;
}

.modal-btn-confirm.flowrunner-danger-btn:hover {
  background-color: #8e0000;
  border-color: #8e0000;
}

.modal-btn-confirm.flowrunner-danger-btn:active {
  background-color: #750000;
  border-color: #750000;
}

/* Wide modal variant for flow selection */
.modal-dialog-wide {
  max-width: calc(100vw - 96px);
}

/* ============================================================================
   FLOW SELECTION MODAL
   ============================================================================ */

.flow-selection-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  max-height: calc(100vh - 300px);
}

.flow-modal-subtitle {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #605e5c;
  flex-shrink: 0;
}

.flow-select-all-container {
  padding: 12px;
  background-color: #faf9f8;
  border: 1px solid #edebe9;
  border-radius: 4px;
  flex-shrink: 0;
}

.flow-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #323130;
  -webkit-user-select: none;
  user-select: none;
  padding-left: 40px;
}

.flow-select-all-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.flow-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #edebe9;
  border-radius: 4px;
  min-height: 200px;
}

/* Flow Selection Table */
.flow-selection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #323130;
}

.flow-selection-table thead {
  background-color: #f3f2f1;
  position: sticky;
  top: 0;
  z-index: 1;
}

.flow-selection-table th {
  text-align: left;
  padding: 12px;
  font-weight: 600;
  color: #323130;
  border-bottom: 2px solid #edebe9;
}

.flow-selection-table td {
  padding: 12px;
  border-bottom: 1px solid #edebe9;
  vertical-align: top;
}

.flow-selection-table tbody tr:hover {
  background-color: #faf9f8;
}

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

/* Column-specific styles */
.flow-checkbox-header {
  width: 50px;
  text-align: left;
  padding: 12px 4px 12px 12px !important;
}

.flow-checkbox-cell {
  width: 50px;
  text-align: left;
  padding: 12px 4px 12px 12px !important;
}

.flow-checkbox,
.flow-select-all-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
  display: block;
}

.flow-name-header {
  font-weight: 600;
  padding-left: 4px !important;
  width: 25%;
}

.flow-name-cell {
  font-weight: 600;
  width: 25%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding-left: 4px !important;
}

.flow-developer-name-cell {
  width: 20%;
  color: #605e5c;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.flow-type-cell {
  width: 120px;
  color: #605e5c;
  white-space: nowrap;
}

.flow-description-header {
  width: 30%;
}

.flow-description-cell {
  width: 30%;
  color: #605e5c;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 1px;
  overflow: hidden;
}

.flow-description-cell:empty {
  padding: 0;
  width: 0;
  max-width: 0;
}

.flow-description-header:has(~ tr .flow-description-cell:not(:empty)),
.flow-selection-table:has(.flow-description-cell:not(:empty)) .flow-description-header {
  width: 30%;
}

.flow-selection-table:not(:has(.flow-description-cell:not(:empty))) .flow-description-header {
  width: 0;
  padding: 0;
}

.flow-selection-table:not(:has(.flow-description-cell:not(:empty))) .flow-name-cell {
  width: 35%;
}

.flow-selection-table:not(:has(.flow-description-cell:not(:empty))) .flow-developer-name-cell {
  width: 30%;
}

/* Already Added badge - keep this one */
.flow-exists-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  margin-left: 8px;
  background-color: #e1f3ff;
  color: #0078d4;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flow-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0 0;
  border-top: 1px solid #edebe9;
  flex-shrink: 0;
}

#selectedFlowCount {
  font-size: 14px;
  font-weight: 600;
  color: #323130;
}

/* ============================================================================
   ORG FLOWS SECTION
   ============================================================================ */

.org-flows {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: #faf9f8;
  border-top: 1px solid #edebe9;
}

.org-flows.expanded {
  max-height: 1000px; /* Arbitrary large value */
}

.org-flows-loading,
.org-flows-empty,
.org-flows-error {
  padding: 24px;
  text-align: center;
  color: #605e5c;
}

.org-flows-empty p {
  margin: 0 0 16px 0;
}

.org-flows-table {
  padding: 16px;
}

.org-flows-table .admin-table {
  margin-bottom: 12px;
}

/* Org flows table with collapsible description column */
.org-flows-admin-table {
  width: 100%;
}

.org-flows-admin-table .flow-description-header {
  width: 30%;
}

.org-flows-admin-table .flow-description-cell {
  width: 30%;
  color: #605e5c;
  font-size: 13px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 1px;
  overflow: hidden;
}

.org-flows-admin-table .flow-description-cell:empty {
  padding: 0;
  width: 0;
  max-width: 0;
}

/* Collapse description column when all cells are empty */
.org-flows-admin-table:not(:has(.flow-description-cell:not(:empty))) .flow-description-header {
  width: 0;
  padding: 0;
  border: 0;
}

.org-flows-admin-table:not(:has(.flow-description-cell:not(:empty))) .flow-description-cell {
  width: 0;
  padding: 0;
  border: 0;
}

.flow-cell-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flow-cell-description {
  font-size: 12px;
  color: #605e5c;
  font-weight: normal;
}

.flow-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flow-status-enabled {
  background-color: #dff6dd;
  color: #107c10;
}

.flow-status-disabled {
  background-color: #f3f2f1;
  color: #605e5c;
}

.flow-status-missing {
  background-color: #fde7e9;
  color: #a80000;
}

.flow-action-btn {
  font-size: 13px;
  padding: 4px 8px;
  margin-right: 4px;
}

.org-flows-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0 0;
  border-top: 1px solid #edebe9;
  font-size: 13px;
  color: #605e5c;
}
