/* ==========================================================================
   VIDABRICKS HR MANAGEMENT SYSTEM - COMPONENTS
   Cards, Tables, Badges, Buttons, Forms, Modals, Toasts, Dropdowns
   ========================================================================== */

/* --------------------------------------------------------------------------
   SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width var(--transition-normal);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
}

#app-root.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-gold), #8c6a12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}

.brand-logo-img {
  height: 38px;
  max-width: 175px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(197, 155, 39, 0.25));
  transition: transform var(--transition-fast);
}

.brand-icon-emblem {
  width: 36px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(197, 155, 39, 0.3));
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  line-height: 1.1;
}

.brand-name span {
  color: var(--brand-gold);
}

.brand-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-gold);
  font-weight: 600;
}

.sidebar-toggle-btn {
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

#app-root.sidebar-collapsed .brand-text,
#app-root.sidebar-collapsed .brand-full-logo,
#app-root.sidebar-collapsed .sidebar-toggle-btn {
  display: none !important;
}

#app-root.sidebar-collapsed .brand-collapsed-logo {
  display: block !important;
  margin: 0 auto;
}

#app-root.sidebar-collapsed .brand-logo-wrap {
  margin: 0 auto;
  justify-content: center;
}

/* Sidebar Menu */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.25rem;
  white-space: nowrap;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(197, 155, 39, 0.18), rgba(197, 155, 39, 0.05));
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid var(--brand-gold);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.nav-item.active .nav-icon {
  color: var(--brand-gold);
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#app-root.sidebar-collapsed .nav-label,
#app-root.sidebar-collapsed .nav-badge {
  display: none;
}

.nav-badge {
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-badge.badge-amber {
  background: var(--status-warning);
  color: #78350f;
}

.nav-badge.badge-red {
  background: var(--status-danger);
  color: #ffffff;
}

/* Sidebar Footer Profile Card */
.sidebar-footer {
  padding: 1rem 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.sidebar-user-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand-navy-700);
  border: 2px solid var(--brand-gold);
  object-fit: cover;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--brand-gold);
  font-weight: 500;
}

#app-root.sidebar-collapsed .sidebar-footer .user-info {
  display: none;
}

/* --------------------------------------------------------------------------
   TOP HEADER
   -------------------------------------------------------------------------- */
.top-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: var(--shadow-xs);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumbs-current {
  font-weight: 600;
  color: var(--brand-navy-900);
}

.header-search-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  min-width: 280px;
  transition: all var(--transition-fast);
}

.header-search-btn:hover {
  border-color: var(--brand-navy-700);
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.kbd-shortcut {
  margin-left: auto;
  font-size: 0.72rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Role Switcher Pill */
.role-pill-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-gold-light);
  border: 1px solid var(--brand-gold-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--brand-gold-dark);
  font-weight: 600;
}

.role-pill-select select {
  background: transparent;
  border: none;
  color: var(--brand-gold-dark);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
}

/* Header Icon Buttons */
.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition-fast);
}

.header-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--brand-navy-900);
}

.notification-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--status-danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 17px;
  height: 17px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
}

/* Google Drive Header Jump Button */
.drive-header-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--drive-bg);
  color: #137333;
  border: 1px solid var(--drive-border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.drive-header-btn:hover {
  background: #ceead6;
  box-shadow: var(--shadow-xs);
}

/* Live Cloud Sync Indicator */
.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease-in-out;
}

.sync-status-indicator:hover {
  background: #dcfce7;
  border-color: #86efac;
}

.sync-status-indicator.syncing {
  background: #fefce8;
  color: #854d0e;
  border-color: #fde047;
}

.sync-status-indicator.offline {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.sync-status-indicator.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
  transition: all 0.2s ease-in-out;
}

.sync-status-indicator.syncing .sync-dot {
  background: #ca8a04;
  box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.35);
  animation: sync-pulse 0.9s infinite alternate;
}

.sync-status-indicator.offline .sync-dot {
  background: #ea580c;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.25);
}

.sync-status-indicator.error .sync-dot {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

@keyframes sync-pulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* User Menu Button */
.header-user-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.header-user-btn:hover {
  background: var(--bg-subtle);
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.header-user-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand-gold-light, #fbf7ee);
  border: 1.5px solid var(--brand-gold, #c59b27);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.sidebar-user-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(197, 155, 39, 0.15);
  border: 1.5px solid var(--brand-gold, #c59b27);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   CARDS & KPI STAT CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  border-color: #cbd5e1;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-navy-900);
}

.card-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* KPI Card */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--brand-navy-900);
  line-height: 1.2;
}

.kpi-footer {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.kpi-trend {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
}

.kpi-trend.positive {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.kpi-trend.negative {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.kpi-trend.neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--brand-navy-900);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background: var(--brand-navy-800);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-gold {
  background: linear-gradient(135deg, var(--brand-gold), #ad861a);
  color: #ffffff;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d4a72d, #9c7713);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-color);
  color: var(--brand-navy-900);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-danger {
  background: var(--status-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--status-success);
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--status-danger-border);
  color: var(--status-danger);
}

.btn-outline-danger:hover {
  background: var(--status-danger-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--brand-navy-900);
}

.btn-drive {
  background: var(--drive-bg);
  color: #137333;
  border-color: var(--drive-border);
}

.btn-drive:hover {
  background: #ceead6;
  color: #0d652d;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 0.98rem;
  border-radius: var(--radius-lg);
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon-only.btn-sm {
  width: 28px;
  height: 28px;
}

/* --------------------------------------------------------------------------
   DATA TABLES
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table tr:hover td {
  background-color: var(--bg-card-hover);
}

.table-compact th {
  padding: 0.6rem 0.85rem;
}

.table-compact td {
  padding: 0.75rem 0.85rem;
}

/* --------------------------------------------------------------------------
   STATUS BADGES & PILLS
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* Status variants */
.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border: 1px solid var(--status-success-border);
}
.badge-success .badge-dot { background: var(--status-success); }

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border: 1px solid var(--status-warning-border);
}
.badge-warning .badge-dot { background: var(--status-warning); }

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger-text);
  border: 1px solid var(--status-danger-border);
}
.badge-danger .badge-dot { background: var(--status-danger); }

.badge-info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border: 1px solid var(--status-info-border);
}
.badge-info .badge-dot { background: var(--status-info); }

.badge-purple {
  background: var(--status-purple-bg);
  color: var(--status-purple-text);
  border: 1px solid var(--status-purple-border);
}
.badge-purple .badge-dot { background: var(--status-purple); }

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.badge-neutral .badge-dot { background: var(--text-muted); }

.badge-gold {
  background: var(--brand-gold-light);
  color: var(--brand-gold-dark);
  border: 1px solid var(--brand-gold-border);
}
.badge-gold .badge-dot { background: var(--brand-gold); }

.badge-drive {
  background: var(--drive-bg);
  color: #137333;
  border: 1px solid var(--drive-border);
}

/* --------------------------------------------------------------------------
   FORM CONTROLS
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-navy-900);
  margin-bottom: 0.4rem;
}

.form-label.required::after {
  content: ' *';
  color: var(--status-danger);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  color: var(--brand-navy-900);
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--brand-navy-800);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

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

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* --------------------------------------------------------------------------
   TABS
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--brand-navy-900);
}

.tab-btn.active {
  color: var(--brand-navy-900);
  border-bottom-color: var(--brand-gold);
}

.tab-btn-pill {
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.tab-btn-pill.active {
  background: var(--brand-navy-900);
  color: #ffffff;
  border-bottom-color: transparent;
}

/* --------------------------------------------------------------------------
   MODAL DIALOGS
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

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

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--transition-fast);
  overflow: hidden;
}

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

.modal-dialog.modal-lg {
  max-width: 850px;
}

.modal-dialog.modal-xl {
  max-width: 1100px;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-navy-900);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
}

.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--brand-navy-900);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  min-width: 320px;
  max-width: 420px;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-normal);
}

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

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--status-success-bg); color: var(--status-success); }
.toast-error .toast-icon { background: var(--status-danger-bg); color: var(--status-danger); }
.toast-warning .toast-icon { background: var(--status-warning-bg); color: var(--status-warning); }
.toast-info .toast-icon { background: var(--status-info-bg); color: var(--status-info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand-navy-900);
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   DROPDOWN MENUS
   -------------------------------------------------------------------------- */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 100;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.86rem;
  color: var(--text-main);
  transition: background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--bg-subtle);
  color: var(--brand-navy-900);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.4rem 0;
}

/* Global Search Modal */
.search-modal-dialog {
  max-width: 680px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.15rem;
  color: var(--brand-navy-900);
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.75rem;
}

.search-result-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg-subtle);
}

/* --------------------------------------------------------------------------
   SPINNERS & DOCUMENT VIEWER UTILITIES
   -------------------------------------------------------------------------- */
.spinner-border {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: -0.125em;
  border: 0.15em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
  width: 0.85rem;
  height: 0.85rem;
  border-width: 0.12em;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

.doc-viewer-wrap {
  width: 100%;
}

