/* =========================================================
   Google Material Design 3 (MD3) Component Engine — LOOGS
   ========================================================= */

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--md-sys-font-family, 'Inter', 'Roboto', system-ui, sans-serif);
  margin: 0;
  padding: 0;
  background-color: var(--md-sys-color-background, #f8fafc);
  color: var(--md-sys-color-on-background, #0f172a);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* App Layout Grid */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* =========================================================
   Sidebar / Navigation Drawer (MD3 Style)
   ========================================================= */
.sidebar {
  width: 280px;
  background-color: var(--md-sys-color-surface, #ffffff);
  border-right: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Sidebar */
.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .sidebar-header {
  padding: 0 12px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-header img {
  display: none;
}

.sidebar.collapsed .sidebar-header::after {
  content: 'L';
  font-size: 24px;
  font-weight: 900;
  color: var(--md-sys-color-primary, #006494);
}

.sidebar.collapsed .menu-category {
  display: none;
}

.sidebar.collapsed .nav-item {
  padding: 12px;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-md, 12px);
}

.sidebar.collapsed .nav-item span:not(.material-symbols-outlined) {
  display: none;
}

.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 6px;
  justify-content: center;
}

.sidebar.collapsed .user-info {
  display: none;
}

.sidebar-header {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #006494, #0f766e);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 100, 148, 0.25);
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface, #0f172a);
  letter-spacing: -0.5px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.menu-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.8px;
  margin: 18px 12px 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--md-sys-shape-corner-full, 9999px); /* MD3 pill shape */
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease-in-out;
  text-decoration: none;
  margin-bottom: 3px;
}

.nav-item:hover {
  background-color: var(--md-sys-color-surface-variant, #f1f5f9);
  color: var(--md-sys-color-on-surface, #0f172a);
  transform: translateX(2px);
}

.nav-item.active {
  background-color: var(--md-sys-color-primary-container, #e0f2fe);
  color: var(--md-sys-color-on-primary-container, #0369a1);
  font-weight: 700;
}

.nav-item .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--md-sys-color-error, #dc2626);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* User Profile Footer in Sidebar */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #fafafa;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--md-sys-color-primary, #006494);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface, #0f172a);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant, #64748b);
}

/* =========================================================
   Main Content Canvas & Top App Bar
   ========================================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.top-app-bar {
  height: 64px;
  background-color: var(--md-sys-color-surface, #ffffff);
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.top-bar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface, #0f172a);
}

.view-pane h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface, #0f172a);
  margin: 0;
  line-height: 1.3;
}

.card h3, .card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface, #0f172a);
  margin: 0 0 4px 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--md-sys-color-surface-variant, #f1f5f9);
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-full, 9999px);
  width: 320px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  background-color: #ffffff;
  border-color: var(--md-sys-color-primary, #006494);
  box-shadow: 0 0 0 3px rgba(0, 100, 148, 0.15);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--md-sys-color-on-surface, #0f172a);
}

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

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.icon-button:hover {
  background-color: var(--md-sys-color-surface-variant, #f1f5f9);
  color: var(--md-sys-color-on-surface, #0f172a);
}

.icon-button .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--md-sys-color-error, #dc2626);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

/* Page Container (Scrollable Content Canvas) */
.page-container, .content-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* =========================================================
   MD3 Cards & Grid System
   ========================================================= */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background-color: var(--md-sys-color-surface, #ffffff);
  border-radius: var(--md-sys-shape-corner-lg, 16px);
  border: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  padding: 20px;
  box-shadow: var(--md-sys-elevation-1, 0 1px 3px rgba(15, 23, 42, 0.05));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2, 0 4px 12px rgba(15, 23, 42, 0.08));
  border-color: #cbd5e1;
}

.card-elevated {
  box-shadow: var(--md-sys-elevation-2, 0 4px 12px rgba(15, 23, 42, 0.06));
  border: none;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--md-sys-color-on-surface, #0f172a);
  line-height: 1.1;
  margin-bottom: 6px;
}

.card-subtext {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant, #64748b);
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up {
  color: var(--md-sys-color-success, #16a34a);
  font-weight: 600;
}

.trend-down {
  color: var(--md-sys-color-error, #dc2626);
  font-weight: 600;
}

/* =========================================================
   Status Chips & Badges (MD3 Tonal Chips)
   ========================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--md-sys-shape-corner-full, 9999px);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.chip-success {
  background-color: var(--md-sys-color-success-container, #dcfce7);
  color: var(--md-sys-color-on-success-container, #15803d);
}

.chip-warning {
  background-color: var(--md-sys-color-warning-container, #fef3c7);
  color: var(--md-sys-color-on-warning-container, #92400e);
}

.chip-error {
  background-color: var(--md-sys-color-error-container, #fee2e2);
  color: var(--md-sys-color-on-error-container, #dc2626);
}

.chip-info {
  background-color: var(--md-sys-color-primary-container, #e0f2fe);
  color: var(--md-sys-color-on-primary-container, #0369a1);
}

/* =========================================================
   Data Table (MD3 Styled)
   ========================================================= */
.data-table-container {
  background: var(--md-sys-color-surface, #ffffff);
  border-radius: var(--md-sys-shape-corner-lg, 16px);
  border: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--md-sys-elevation-1);
}

.table-header-title {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface, #0f172a);
  border-bottom: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background-color: var(--md-sys-color-surface-variant, #f8fafc);
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant, #64748b);
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
}

td {
  padding: 16px 24px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--md-sys-color-surface-variant, #f8fafc);
}

/* =========================================================
   MD3 Buttons (Pill Shapes & Tonal Hierarchy)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--md-sys-shape-corner-full, 9999px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--md-sys-color-primary, #006494);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--md-sys-color-primary-hover, #004b71);
  box-shadow: 0 4px 14px rgba(0, 100, 148, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--md-sys-color-primary-container, #e0f2fe);
  color: var(--md-sys-color-on-primary-container, #0369a1);
}

.btn-secondary:hover {
  background-color: #bae6fd;
  transform: translateY(-1px);
}

.btn-outlined {
  background-color: transparent;
  border: 1px solid var(--md-sys-color-outline, #cbd5e1);
  color: var(--md-sys-color-primary, #006494);
}

.btn-outlined:hover {
  background-color: var(--md-sys-color-surface-variant, #f1f5f9);
  border-color: #94a3b8;
}

/* Feed & List Items */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
}

.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feed-time {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}

.feed-text {
  font-size: 14px;
  color: var(--md-sys-color-on-surface, #1e293b);
  line-height: 1.4;
}

/* View Pane Switching */
.view-pane {
  display: none;
}

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

/* =========================================================
   Modal UI Components (MD3 Extra-Large Radii)
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background-color: var(--md-sys-color-surface, #ffffff);
  width: 90%;
  max-width: 520px;
  border-radius: var(--md-sys-shape-corner-2xl, 28px);
  box-shadow: var(--md-sys-elevation-4, 0 20px 32px -8px rgba(15, 23, 42, 0.12));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--md-sys-color-surface-variant, #f1f5f9);
  background-color: #fafafa;
}

/* MD3 Inputs */
.md-input-container {
  margin-bottom: 16px;
}

.md-input-container label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant, #475569);
  margin-bottom: 6px;
}

.md-input, .md-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--md-sys-color-on-surface, #0f172a);
  border: 1px solid var(--md-sys-color-outline, #cbd5e1);
  border-radius: var(--md-sys-shape-corner-md, 12px);
  background-color: var(--md-sys-color-surface-variant, #f8fafc);
  transition: all 0.2s ease;
}

.md-input:focus, .md-select:focus {
  outline: none;
  border-color: var(--md-sys-color-primary, #006494);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 100, 148, 0.12);
}

.md-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
}

.md-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--md-sys-color-primary, #006494);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* =========================================================
   VISUAL WORKFLOW DIAGRAM STUDIO (Drag & Drop Canvas)
   ========================================================= */
.wf-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
}

.wf-palette-item:hover {
  border-color: #006494;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 100, 148, 0.08);
}

.wf-palette-item:active {
  cursor: grabbing;
}

.wf-palette-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wf-node {
  position: absolute;
  width: 250px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  z-index: 10;
}

.wf-node:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.wf-node.selected {
  border-color: #006494 !important;
  box-shadow: 0 0 0 2px #006494, 0 12px 28px rgba(0, 100, 148, 0.2) !important;
  z-index: 25 !important;
}

/* Workflow Diagram SVG Connectors & Connection Ports */
.wf-connector-line {
  fill: none !important;
  stroke: #006494;
  stroke-width: 2.5px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.wf-connector-line:hover {
  stroke: #0284c7;
  stroke-width: 3.5px;
  cursor: pointer;
}

.wf-connector-line.active {
  stroke: #16a34a !important;
  stroke-width: 3.5px !important;
}

.wf-port {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #006494;
  transform: translateY(-50%);
  z-index: 15;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.wf-port-in {
  left: -6px;
}

.wf-port-out {
  right: -6px;
}

.wf-node:hover .wf-port {
  transform: translateY(-50%) scale(1.2);
  border-color: #0284c7;
  background: #e0f2fe;
}

.wf-node.simulating {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3), 0 12px 28px rgba(22, 163, 74, 0.2) !important;
}

/* =========================================================
   Standardized MD3 KPI Cards & Table Utilities
   ========================================================= */
.kpi-card {
  background-color: var(--md-sys-color-surface, #ffffff);
  border-radius: var(--md-sys-shape-corner-lg, 16px);
  border: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  margin: 2px 0 6px 0;
  letter-spacing: -0.5px;
}

.kpi-subtext {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-box .material-symbols-outlined {
  font-size: 24px;
}

/* Proportional Button Sizes */
.btn-sm {
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  gap: 5px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.btn-sm .material-symbols-outlined {
  font-size: 16px !important;
}

/* Stream Feed Tabs */
.live-feed-tab {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}

.live-feed-tab.active {
  background: var(--md-sys-color-primary, #006494);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 100, 148, 0.3);
}

.live-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #006494;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* Table Filter & Search Toolbar */
.table-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.table-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  min-width: 260px;
  transition: all 0.2s ease;
}

.table-search-box:focus-within {
  background-color: #ffffff;
  border-color: var(--md-sys-color-primary, #006494);
  box-shadow: 0 0 0 3px rgba(0, 100, 148, 0.12);
}

.table-search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: #0f172a;
}

.table-search-box input::placeholder {
  color: #94a3b8;
}

.filter-select {
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:focus {
  border-color: var(--md-sys-color-primary, #006494);
  background-color: #ffffff;
}

/* Empty State Card */
.table-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
}

.table-empty-state .material-symbols-outlined {
  font-size: 48px;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}

.table-empty-state h4 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.table-empty-state p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* Modal Sizes */
.modal-container.modal-lg {
  max-width: 800px;
}

.modal-container.modal-md {
  max-width: 640px;
}

/* Form Builder Studio V2 Layout & Styles */
.fb-studio-layout {
  display: grid;
  grid-template-columns: 260px 1fr 380px;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}

@media (max-width: 1350px) {
  .fb-studio-layout {
    grid-template-columns: 240px 1fr;
  }
  .fb-inspector-column {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .fb-studio-layout {
    grid-template-columns: 1fr;
  }
}

/* Left Palette */
.fb-palette-container {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

.fb-palette-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin: 12px 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-palette-category:first-child {
  margin-top: 0;
}

.fb-palette-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.fb-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  color: #1e293b;
  font-weight: 500;
  text-align: left;
  width: 100%;
}

.fb-palette-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateX(2px);
}

.fb-palette-item .material-symbols-outlined {
  font-size: 17px;
  color: #0284c7;
}

/* Center Canvas */
.fb-canvas-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fb-section-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #006494;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.fb-question-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.fb-question-card:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.fb-question-card.active {
  border-color: #006494;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(0,100,148,0.18);
}

.fb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.fb-badge-info { background: #e0f2fe; color: #0369a1; }
.fb-badge-danger { background: #fee2e2; color: #dc2626; }
.fb-badge-warning { background: #fef3c7; color: #b45309; }
.fb-badge-success { background: #dcfce7; color: #15803d; }
.fb-badge-neutral { background: #f1f5f9; color: #475569; }

/* Right Inspector */
.fb-inspector-container {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  position: sticky;
  top: 80px;
}

.fb-tabs-header {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.fb-tab-btn {
  padding: 5px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.fb-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.fb-tab-btn.active {
  background: #006494;
  color: #ffffff;
}

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

.fb-tab-content.active {
  display: block;
}

.fb-rule-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

/* Workflow Builder Graph Studio V2 Styles */
.wf-palette-category-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin: 10px 0 4px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.wf-palette-category-title:first-child {
  margin-top: 0;
}

.wf-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.wf-palette-item:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateX(2px);
}

.wf-palette-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Graph Canvas Nodes */
.wf-node-card {
  position: absolute;
  width: 215px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  cursor: move;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  z-index: 10;
}

.wf-node-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: #94a3b8;
}

.wf-node-card.active {
  border-color: #006494;
  box-shadow: 0 0 0 2.5px rgba(0,100,148,0.25), 0 8px 24px rgba(0,100,148,0.12);
  z-index: 25;
}

/* Category Accent Borders */
.wf-node-trigger { border-left: 5px solid #0284c7; }
.wf-node-work { border-left: 5px solid #0d9488; }
.wf-node-control { border-left: 5px solid #f59e0b; }
.wf-node-people { border-left: 5px solid #7c3aed; }
.wf-node-action { border-left: 5px solid #dc2626; }
.wf-node-end { border-left: 5px solid #475569; }

/* Simulation glow states */
.wf-node-active-step {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22,163,74,0.35), 0 8px 20px rgba(22,163,74,0.15) !important;
  animation: pulse-green 1.5s infinite;
}

.wf-node-rework-step {
  border-color: #d97706 !important;
  box-shadow: 0 0 0 3px rgba(217,119,6,0.35), 0 8px 20px rgba(217,119,6,0.15) !important;
}

.wf-node-fail-step {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.35), 0 8px 20px rgba(220,38,38,0.15) !important;
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* Connector SVG Paths and Labels */
.wf-svg-path {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2.5px;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.wf-svg-path.active {
  stroke: #16a34a;
  stroke-width: 3.5px;
}

.wf-transition-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  z-index: 15;
}

.wf-transition-label:hover {
  background: #eff6ff;
  border-color: #0284c7;
  color: #0284c7;
}

.wf-tab-btn {
  padding: 5px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wf-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.wf-tab-btn.active {
  background: #006494;
  color: #ffffff;
}

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

.wf-tab-content.active {
  display: block;
}

/* ==========================================================================
   RBAC V2: Roles, Positions & Scope Matrix Styles
   ========================================================================== */
.position-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.duty-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.rbac-segmented-nav {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
  gap: 4px;
  flex-wrap: wrap;
}

.rbac-nav-btn {
  background: transparent;
  color: #64748b;
  font-weight: 500;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.rbac-nav-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.rbac-nav-btn.active {
  background: #ffffff;
  color: #006494;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rbac-matrix-table-wrap {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: auto;
  max-height: 65vh;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.rbac-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.rbac-matrix-table th,
.rbac-matrix-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}

.rbac-matrix-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-weight: 700;
  color: #1e293b;
  z-index: 5;
  border-bottom: 2px solid #e2e8f0;
}

.rbac-matrix-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 10;
  background: #f8fafc;
  min-width: 220px;
}

.rbac-matrix-table td:first-child {
  position: sticky;
  left: 0;
  background: #ffffff;
  font-weight: 600;
  color: #0f172a;
  z-index: 4;
}

.rbac-module-header {
  background: #f0f9ff !important;
  color: #0369a1 !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px !important;
}

.role-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.role-preset-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.role-preset-card:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}

.role-preset-card.active {
  border-color: #006494;
  background: #e0f2fe;
  box-shadow: 0 0 0 2px rgba(0, 100, 148, 0.2);
}

.access-summary-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.access-can-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 12px;
}

.access-cannot-box {
  background: #fef2f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 12px;
}

.access-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #15803d;
  margin-bottom: 6px;
  line-height: 1.35;
}

.access-cross-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #b91c1c;
  margin-bottom: 6px;
  line-height: 1.35;
}

@keyframes pulseBorder {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

.pulse-animation {
  animation: pulseBorder 2s infinite ease-in-out;
}

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

.spin {
  animation: spin 1s linear infinite;
}

