/* ═══════════════════════════════════════════════════ */
/*  標案監控中心 – Design System & Styles             */
/* ═══════════════════════════════════════════════════ */

:root {
  /* Colors – Clean light palette */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4ff;
  --bg-input: #f8f9fc;
  --border-color: #e2e6ef;
  --border-active: rgba(79, 99, 230, 0.4);

  --text-primary: #1a1f36;
  --text-secondary: #525f7f;
  --text-muted: #8792a2;

  --accent: #4f63e6;
  --accent-light: #3d4ecc;
  --accent-glow: rgba(79, 99, 230, 0.08);

  --danger: #e25050;
  --warning: #e8913a;
  --success: #2dbe60;
  --info: #3e8de3;

  /* Gradients */
  --gradient-accent: linear-gradient(135deg, #4f63e6, #7c5ce7);
  --gradient-danger: linear-gradient(135deg, #e25050, #ff6b6b);
  --gradient-surface: linear-gradient(160deg, #ffffff, #f5f7fa);

  /* Spacing */
  --sidebar-width: 250px;
  --header-height: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }

/* ─── App Layout ─── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease);
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 15px rgba(99, 125, 255, 0.25);
  color: #fff;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
}

.nav-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 16px 6px;
  margin-top: 4px;
}

.nav-section-label:first-child {
  margin-top: 0;
  padding-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-light);
  box-shadow: inset 3px 0 0 var(--accent);
}

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

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.schedule-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 8px rgba(67, 233, 123, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── Top Header ─── */
.top-header {
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

.header-title {
  flex: 1;
}

.header-title h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 125, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 125, 255, 0.4);
}

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

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

.btn-notify {
  background: linear-gradient(135deg, #06c755, #00b347);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 199, 85, 0.3);
}

.btn-notify:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 199, 85, 0.4);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
}

.btn-icon { font-size: 1rem; }

.btn-lucide {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── View Container ─── */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card) transparent;
}

.view {
  display: none;
  animation: fadeIn 0.3s var(--ease);
}

.view.active {
  display: block;
}

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

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s var(--ease);
}

.stat-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.header-dot.urgent {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(255, 77, 106, 0.5);
}

.card-link {
  font-size: 0.85rem;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* ─── Tender Items ─── */
.tender-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s var(--ease);
}

.tender-item:last-child {
  border-bottom: none;
}

.tender-urgency {
  flex-shrink: 0;
  width: 4px;
  height: 100%;
  min-height: 60px;
  border-radius: 2px;
  align-self: stretch;
}

.urgency-high { background: var(--danger); box-shadow: 0 0 10px rgba(255, 77, 106, 0.3); }
.urgency-medium { background: var(--warning); }
.urgency-low { background: var(--success); }
.urgency-unknown { background: var(--text-muted); }

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

.tender-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 6px;
  line-height: 1.4;
  word-break: break-word;
}

.tender-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.tender-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tender-meta-item + .tender-meta-item::before {
  content: '·';
  margin-right: 4px;
  color: var(--text-muted);
  font-weight: 700;
}

.tender-countdown {
  flex-shrink: 0;
  text-align: right;
}

.countdown-days {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.countdown-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.countdown-danger { color: var(--danger); }
.countdown-warning { color: var(--warning); }
.countdown-safe { color: var(--success); }

.tender-actions {
  flex-shrink: 0;
  align-self: center;
}

/* ─── Full Tender Card (List view) ─── */
.tender-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s var(--ease);
}

.tender-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.tender-card .tender-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
  padding: 4px 10px;
  background: var(--accent-glow);
  border-radius: var(--radius-xs);
  transition: all 0.15s var(--ease);
}

.tender-card .tender-detail-link:hover {
  background: rgba(99, 125, 255, 0.25);
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-input {
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  width: 300px;
  transition: border-color 0.2s var(--ease);
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Toggle Switch ─── */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  user-select: none;
}

.toggle-label input { display: none; }

.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--bg-input);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s var(--ease);
  border: 1px solid var(--border-color);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: all 0.2s var(--ease);
}

.toggle-label input:checked + .toggle-switch {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(16px);
  background: #fff;
}

/* ─── Forms ─── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  resize: vertical;
  line-height: 1.6;
}

/* ─── Search form ─── */
.search-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.search-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

.results-header {
  padding: 12px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

/* ─── Settings ─── */
.settings-section {
  margin-bottom: 28px;
}

.settings-section h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cron-presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.line-status {
  margin-bottom: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-badge.checking { background: rgba(79, 172, 254, 0.15); color: var(--info); }
.status-badge.connected { background: rgba(67, 233, 123, 0.15); color: var(--success); }
.status-badge.disconnected { background: rgba(255, 77, 106, 0.15); color: var(--danger); }

.settings-actions {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.page-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 0.95rem;
}

/* ─── Search History ─── */
.log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.log-item:last-child { border-bottom: none; }

.log-keyword {
  font-weight: 600;
  color: var(--text-primary);
}

.log-count {
  color: var(--accent-light);
  font-weight: 700;
}

.log-time {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ─── Loading Overlay ─── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.loading-overlay.active {
  display: flex;
}

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

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-spinner p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  animation: slideInRight 0.3s var(--ease);
  max-width: 400px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.toast.success {
  background: rgba(67, 233, 123, 0.15);
  border: 1px solid rgba(67, 233, 123, 0.3);
  color: var(--success);
}

.toast.error {
  background: rgba(255, 77, 106, 0.15);
  border: 1px solid rgba(255, 77, 106, 0.3);
  color: var(--danger);
}

.toast.info {
  background: rgba(79, 172, 254, 0.15);
  border: 1px solid rgba(79, 172, 254, 0.3);
  color: var(--info);
}

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

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.1);
  }

  .menu-toggle {
    display: block;
  }

  .view-container {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-input {
    width: 100%;
  }

  .search-form {
    flex-direction: column;
  }

  .tender-card {
    flex-direction: column;
  }

  .tender-countdown {
    text-align: left;
  }
}

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

/* ─── Scrollbar ─── */
.view-container::-webkit-scrollbar {
  width: 6px;
}

.view-container::-webkit-scrollbar-track {
  background: transparent;
}

.view-container::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 3px;
}

.view-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── Login Gate ─── */
.login-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1f36 0%, #2d3561 50%, #1a1f36 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-gate-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 40px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.login-gate-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.login-gate-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1f36;
  margin-bottom: 6px;
}

.login-gate-subtitle {
  font-size: 0.9rem;
  color: #8792a2;
  margin-bottom: 24px;
}

.login-gate-error {
  background: rgba(226, 80, 80, 0.1);
  color: #e25050;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.login-gate-input {
  width: 100%;
  padding: 12px 16px;
  background: #f5f7fa;
  border: 1px solid #e2e6ef;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.login-gate-input:focus {
  outline: none;
  border-color: var(--accent, #4f63e6);
  box-shadow: 0 0 0 3px rgba(79, 99, 230, 0.1);
}

/* ─── Teams Grid ─── */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.25s var(--ease);
}

.team-card:hover {
  border-color: var(--border-active);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
}

.team-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.team-card-header h4 {
  font-size: 1.15rem;
  font-weight: 700;
}

.team-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.team-stat {
  background: var(--bg-input);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
}

.team-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.team-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2px;
}

.team-card-actions {
  display: flex;
  gap: 8px;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.team-badge.success { background: rgba(67, 233, 123, 0.15); color: var(--success); }
.team-badge.warning { background: rgba(232, 145, 58, 0.15); color: var(--warning); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  box-shadow: 0 4px 15px rgba(226, 80, 80, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(226, 80, 80, 0.4);
}
