* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #00f0ff;
  --primary-dark: #00b8cc;
  --secondary: #00ff88;
  --danger: #ff0066;
  --warning: #ffaa00;
  --bg-dark: #0a0e17;
  --bg-card: #0f1419;
  --bg-elevated: #1a1f2e;
  --border-color: #1e2838;
  --border-glow: #00f0ff;
  --text-primary: #e0e7ff;
  --text-secondary: #8b92b8;
  --text-muted: #5a5f7d;
  --accent-cyan: #00f0ff;
  --accent-purple: #a855f7;
  --accent-green: #00ff88;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.3);
  --shadow-glow-lg: 0 0 30px rgba(0, 240, 255, 0.4), 0 0 60px rgba(0, 240, 255, 0.2);
}

.colorblind-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

html[data-colorblind="protanopia"] .app {
  filter: url("#cb-protanopia");
}

html[data-colorblind="deuteranopia"] .app {
  filter: url("#cb-deuteranopia");
}

html[data-colorblind="tritanopia"] .app {
  filter: url("#cb-tritanopia");
}

html[data-colorblind="none"] .app {
  filter: none;
}

/* Light Theme */
:root[data-theme="light"] {
  --primary: #0099cc;
  --primary-dark: #007aa3;
  --secondary: #00cc66;
  --danger: #e6004d;
  --warning: #e69500;
  --bg-dark: #f5f7fa;
  --bg-card: #ffffff;
  --bg-elevated: #f0f3f7;
  --border-color: #d1d9e6;
  --border-glow: #0099cc;
  --text-primary: #1a1f2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent-cyan: #0099cc;
  --accent-purple: #8b5cf6;
  --accent-green: #00cc66;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(0, 153, 204, 0.2);
  --shadow-glow-lg: 0 0 30px rgba(0, 153, 204, 0.25), 0 0 60px rgba(0, 153, 204, 0.1);
}

[data-theme="light"] body {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 153, 204, 0.02) 2px, rgba(0, 153, 204, 0.02) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 153, 204, 0.02) 2px, rgba(0, 153, 204, 0.02) 4px);
}

/* Light theme detail page adjustments */
[data-theme="light"] .field-group {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.03) 0%, rgba(139, 92, 246, 0.02) 100%);
}

[data-theme="light"] .field-group-title {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
}

[data-theme="light"] .field-group-title:hover {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.12) 0%, rgba(139, 92, 246, 0.06) 100%);
}

[data-theme="light"] .detail-field {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="light"] .detail-field-value {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

[data-theme="light"] .detail-field:hover .detail-field-value {
  background: #e8ecf2;
}

[data-theme="light"] .detail-header {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.06) 0%, rgba(139, 92, 246, 0.03) 50%, rgba(0, 204, 102, 0.02) 100%);
}

[data-theme="light"] .deployment-tabs {
  background: var(--bg-card);
}

[data-theme="light"] .detail-field-select {
  background: var(--bg-card);
  border-color: var(--border-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230099cc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

[data-theme="light"] .detail-field-input,
[data-theme="light"] .detail-field-textarea {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="light"] .collapse-controls {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
}

/* Light theme dropdown adjustments */
[data-theme="light"] .search-dropdown,
[data-theme="light"] .site-menu,
[data-theme="light"] .nav-menu,
[data-theme="light"] .theme-menu,
[data-theme="light"] .colorblind-menu,
[data-theme="light"] .modal {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 153, 204, 0.1);
}

[data-theme="light"] .search-result-item:hover,
[data-theme="light"] .site-option:hover,
[data-theme="light"] .nav-option:hover,
[data-theme="light"] .theme-option:hover,
[data-theme="light"] .colorblind-option:hover {
  background: linear-gradient(90deg, rgba(0, 153, 204, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
}

[data-theme="light"] .filter-select,
[data-theme="light"] .modal-select {
  background: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230099cc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-header {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.06) 0%, rgba(139, 92, 246, 0.03) 100%);
}

[data-theme="light"] .summary-calendar-fid {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-color: rgba(0, 153, 204, 0.25);
}

[data-theme="light"] .summary-calendar-fid:hover {
  background: linear-gradient(135deg, rgba(0, 153, 204, 0.2) 0%, rgba(139, 92, 246, 0.12) 100%);
}

[data-theme="light"] .calendar-fid-dc {
  background: var(--primary);
  color: #fff;
}

/* Light theme FID color variants */
[data-theme="light"] .summary-calendar-fid.fid-good {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
  color: #2563eb;
  border-color: rgba(59, 130, 246, 0.3);
}
[data-theme="light"] .summary-calendar-fid.fid-good:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.2) 100%);
}
[data-theme="light"] .summary-calendar-fid.fid-good .calendar-fid-dc {
  background: #2563eb;
}

[data-theme="light"] .summary-calendar-fid.fid-warning {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(202, 138, 4, 0.1) 100%);
  color: #ca8a04;
  border-color: rgba(234, 179, 8, 0.3);
}
[data-theme="light"] .summary-calendar-fid.fid-warning:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25) 0%, rgba(202, 138, 4, 0.2) 100%);
}
[data-theme="light"] .summary-calendar-fid.fid-warning .calendar-fid-dc {
  background: #ca8a04;
}

[data-theme="light"] .summary-calendar-fid.fid-urgent {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.1) 100%);
  color: #ea580c;
  border-color: rgba(249, 115, 22, 0.3);
}
[data-theme="light"] .summary-calendar-fid.fid-urgent:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(234, 88, 12, 0.2) 100%);
}
[data-theme="light"] .summary-calendar-fid.fid-urgent .calendar-fid-dc {
  background: #ea580c;
}

[data-theme="light"] .summary-calendar-fid.fid-overdue {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}
[data-theme="light"] .summary-calendar-fid.fid-overdue:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.2) 100%);
}
[data-theme="light"] .summary-calendar-fid.fid-overdue .calendar-fid-dc {
  background: #dc2626;
}

[data-theme="light"] .summary-calendar-fid.fid-complete {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.1) 100%);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.3);
}
[data-theme="light"] .summary-calendar-fid.fid-complete:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(22, 163, 74, 0.2) 100%);
}
[data-theme="light"] .summary-calendar-fid.fid-complete .calendar-fid-dc {
  background: #16a34a;
}

/* Light theme urgency columns */
[data-theme="light"] .urgency-item {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .urgency-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .urgency-count {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .urgency-overdue .urgency-count {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}
[data-theme="light"] .urgency-overdue .urgency-item:hover {
  background: rgba(220, 38, 38, 0.08);
}
[data-theme="light"] .urgency-urgent .urgency-count {
  background: rgba(234, 88, 12, 0.15);
  color: #ea580c;
}
[data-theme="light"] .urgency-urgent .urgency-item:hover {
  background: rgba(234, 88, 12, 0.08);
}
[data-theme="light"] .urgency-warning .urgency-count {
  background: rgba(202, 138, 4, 0.15);
  color: #ca8a04;
}
[data-theme="light"] .urgency-warning .urgency-item:hover {
  background: rgba(202, 138, 4, 0.08);
}
[data-theme="light"] .urgency-good .urgency-count {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}
[data-theme="light"] .urgency-good .urgency-item:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* Colorblind Mode: Protanopia (Red-blind) - Uses blue/yellow/orange palette */
[data-colorblind="protanopia"] .summary-calendar-fid.fid-good {
  background: linear-gradient(135deg, rgba(0, 119, 187, 0.2) 0%, rgba(0, 85, 136, 0.15) 100%);
  color: #0077bb;
  border-color: rgba(0, 119, 187, 0.3);
}
[data-colorblind="protanopia"] .summary-calendar-fid.fid-good .calendar-fid-dc { background: #0077bb; }

[data-colorblind="protanopia"] .summary-calendar-fid.fid-warning {
  background: linear-gradient(135deg, rgba(238, 187, 0, 0.2) 0%, rgba(204, 153, 0, 0.15) 100%);
  color: #eebb00;
  border-color: rgba(238, 187, 0, 0.3);
}
[data-colorblind="protanopia"] .summary-calendar-fid.fid-warning .calendar-fid-dc { background: #eebb00; color: #1a1a2e; }

[data-colorblind="protanopia"] .summary-calendar-fid.fid-urgent {
  background: linear-gradient(135deg, rgba(238, 119, 51, 0.2) 0%, rgba(204, 85, 17, 0.15) 100%);
  color: #ee7733;
  border-color: rgba(238, 119, 51, 0.3);
}
[data-colorblind="protanopia"] .summary-calendar-fid.fid-urgent .calendar-fid-dc { background: #ee7733; color: #1a1a2e; }

[data-colorblind="protanopia"] .summary-calendar-fid.fid-overdue {
  background: linear-gradient(135deg, rgba(204, 51, 17, 0.2) 0%, rgba(153, 34, 0, 0.15) 100%);
  color: #cc3311;
  border-color: rgba(204, 51, 17, 0.3);
}
[data-colorblind="protanopia"] .summary-calendar-fid.fid-overdue .calendar-fid-dc { background: #cc3311; }

[data-colorblind="protanopia"] .summary-calendar-fid.fid-complete {
  background: linear-gradient(135deg, rgba(0, 153, 136, 0.2) 0%, rgba(0, 119, 102, 0.15) 100%);
  color: #009988;
  border-color: rgba(0, 153, 136, 0.3);
}
[data-colorblind="protanopia"] .summary-calendar-fid.fid-complete .calendar-fid-dc { background: #009988; }

[data-colorblind="protanopia"] .urgency-overdue .urgency-column-header { background: linear-gradient(135deg, rgba(204, 51, 17, 0.15) 0%, rgba(153, 34, 0, 0.1) 100%); }
[data-colorblind="protanopia"] .urgency-overdue .urgency-icon { background: #cc3311; }
[data-colorblind="protanopia"] .urgency-overdue .urgency-count { background: rgba(204, 51, 17, 0.2); color: #cc3311; }
[data-colorblind="protanopia"] .urgency-overdue .urgency-item { border-color: rgba(204, 51, 17, 0.2); }
[data-colorblind="protanopia"] .urgency-overdue .urgency-item:hover { border-color: rgba(204, 51, 17, 0.4); background: rgba(204, 51, 17, 0.1); }
[data-colorblind="protanopia"] .urgency-overdue .urgency-item .calendar-fid-dc { background: #cc3311; }
[data-colorblind="protanopia"] .urgency-urgent .urgency-column-header { background: linear-gradient(135deg, rgba(238, 119, 51, 0.15) 0%, rgba(204, 85, 17, 0.1) 100%); }
[data-colorblind="protanopia"] .urgency-urgent .urgency-icon { background: #ee7733; }
[data-colorblind="protanopia"] .urgency-urgent .urgency-count { background: rgba(238, 119, 51, 0.2); color: #ee7733; }
[data-colorblind="protanopia"] .urgency-urgent .urgency-item { border-color: rgba(238, 119, 51, 0.2); }
[data-colorblind="protanopia"] .urgency-urgent .urgency-item:hover { border-color: rgba(238, 119, 51, 0.4); background: rgba(238, 119, 51, 0.1); }
[data-colorblind="protanopia"] .urgency-urgent .urgency-item .calendar-fid-dc { background: #ee7733; }
[data-colorblind="protanopia"] .urgency-warning .urgency-column-header { background: linear-gradient(135deg, rgba(238, 187, 0, 0.15) 0%, rgba(204, 153, 0, 0.1) 100%); }
[data-colorblind="protanopia"] .urgency-warning .urgency-icon { background: #eebb00; color: #1a1a2e; }
[data-colorblind="protanopia"] .urgency-warning .urgency-count { background: rgba(238, 187, 0, 0.2); color: #eebb00; }
[data-colorblind="protanopia"] .urgency-warning .urgency-item { border-color: rgba(238, 187, 0, 0.2); }
[data-colorblind="protanopia"] .urgency-warning .urgency-item:hover { border-color: rgba(238, 187, 0, 0.4); background: rgba(238, 187, 0, 0.1); }
[data-colorblind="protanopia"] .urgency-warning .urgency-item .calendar-fid-dc { background: #eebb00; color: #1a1a2e; }
[data-colorblind="protanopia"] .urgency-good .urgency-column-header { background: linear-gradient(135deg, rgba(0, 119, 187, 0.15) 0%, rgba(0, 85, 136, 0.1) 100%); }
[data-colorblind="protanopia"] .urgency-good .urgency-icon { background: #0077bb; }
[data-colorblind="protanopia"] .urgency-good .urgency-count { background: rgba(0, 119, 187, 0.2); color: #0077bb; }
[data-colorblind="protanopia"] .urgency-good .urgency-item { border-color: rgba(0, 119, 187, 0.2); }
[data-colorblind="protanopia"] .urgency-good .urgency-item:hover { border-color: rgba(0, 119, 187, 0.4); background: rgba(0, 119, 187, 0.1); }
[data-colorblind="protanopia"] .urgency-good .urgency-item .calendar-fid-dc { background: #0077bb; }

/* Colorblind Mode: Deuteranopia (Green-blind) - Uses blue/purple/amber/pink palette */
[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-good {
  background: linear-gradient(135deg, rgba(102, 51, 153, 0.2) 0%, rgba(68, 34, 119, 0.15) 100%);
  color: #663399;
  border-color: rgba(102, 51, 153, 0.3);
}
[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-good .calendar-fid-dc { background: #663399; }

[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-warning {
  background: linear-gradient(135deg, rgba(170, 136, 0, 0.2) 0%, rgba(136, 102, 0, 0.15) 100%);
  color: #aa8800;
  border-color: rgba(170, 136, 0, 0.3);
}
[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-warning .calendar-fid-dc { background: #aa8800; color: #1a1a2e; }

[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-urgent {
  background: linear-gradient(135deg, rgba(204, 51, 153, 0.2) 0%, rgba(170, 34, 119, 0.15) 100%);
  color: #cc3399;
  border-color: rgba(204, 51, 153, 0.3);
}
[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-urgent .calendar-fid-dc { background: #cc3399; }

[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-overdue {
  background: linear-gradient(135deg, rgba(136, 0, 68, 0.2) 0%, rgba(102, 0, 51, 0.15) 100%);
  color: #880044;
  border-color: rgba(136, 0, 68, 0.3);
}
[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-overdue .calendar-fid-dc { background: #880044; }

[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-complete {
  background: linear-gradient(135deg, rgba(0, 119, 187, 0.2) 0%, rgba(0, 85, 153, 0.15) 100%);
  color: #0077bb;
  border-color: rgba(0, 119, 187, 0.3);
}
[data-colorblind="deuteranopia"] .summary-calendar-fid.fid-complete .calendar-fid-dc { background: #0077bb; }

[data-colorblind="deuteranopia"] .urgency-overdue .urgency-column-header { background: linear-gradient(135deg, rgba(136, 0, 68, 0.15) 0%, rgba(102, 0, 51, 0.1) 100%); }
[data-colorblind="deuteranopia"] .urgency-overdue .urgency-icon { background: #880044; }
[data-colorblind="deuteranopia"] .urgency-overdue .urgency-count { background: rgba(136, 0, 68, 0.2); color: #880044; }
[data-colorblind="deuteranopia"] .urgency-overdue .urgency-item { border-color: rgba(136, 0, 68, 0.2); }
[data-colorblind="deuteranopia"] .urgency-overdue .urgency-item:hover { border-color: rgba(136, 0, 68, 0.4); background: rgba(136, 0, 68, 0.1); }
[data-colorblind="deuteranopia"] .urgency-overdue .urgency-item .calendar-fid-dc { background: #880044; }
[data-colorblind="deuteranopia"] .urgency-urgent .urgency-column-header { background: linear-gradient(135deg, rgba(204, 51, 153, 0.15) 0%, rgba(170, 34, 119, 0.1) 100%); }
[data-colorblind="deuteranopia"] .urgency-urgent .urgency-icon { background: #cc3399; }
[data-colorblind="deuteranopia"] .urgency-urgent .urgency-count { background: rgba(204, 51, 153, 0.2); color: #cc3399; }
[data-colorblind="deuteranopia"] .urgency-urgent .urgency-item { border-color: rgba(204, 51, 153, 0.2); }
[data-colorblind="deuteranopia"] .urgency-urgent .urgency-item:hover { border-color: rgba(204, 51, 153, 0.4); background: rgba(204, 51, 153, 0.1); }
[data-colorblind="deuteranopia"] .urgency-urgent .urgency-item .calendar-fid-dc { background: #cc3399; }
[data-colorblind="deuteranopia"] .urgency-warning .urgency-column-header { background: linear-gradient(135deg, rgba(170, 136, 0, 0.15) 0%, rgba(136, 102, 0, 0.1) 100%); }
[data-colorblind="deuteranopia"] .urgency-warning .urgency-icon { background: #aa8800; color: #1a1a2e; }
[data-colorblind="deuteranopia"] .urgency-warning .urgency-count { background: rgba(170, 136, 0, 0.2); color: #aa8800; }
[data-colorblind="deuteranopia"] .urgency-warning .urgency-item { border-color: rgba(170, 136, 0, 0.2); }
[data-colorblind="deuteranopia"] .urgency-warning .urgency-item:hover { border-color: rgba(170, 136, 0, 0.4); background: rgba(170, 136, 0, 0.1); }
[data-colorblind="deuteranopia"] .urgency-warning .urgency-item .calendar-fid-dc { background: #aa8800; color: #1a1a2e; }
[data-colorblind="deuteranopia"] .urgency-good .urgency-column-header { background: linear-gradient(135deg, rgba(102, 51, 153, 0.15) 0%, rgba(68, 34, 119, 0.1) 100%); }
[data-colorblind="deuteranopia"] .urgency-good .urgency-icon { background: #663399; }
[data-colorblind="deuteranopia"] .urgency-good .urgency-count { background: rgba(102, 51, 153, 0.2); color: #663399; }
[data-colorblind="deuteranopia"] .urgency-good .urgency-item { border-color: rgba(102, 51, 153, 0.2); }
[data-colorblind="deuteranopia"] .urgency-good .urgency-item:hover { border-color: rgba(102, 51, 153, 0.4); background: rgba(102, 51, 153, 0.1); }
[data-colorblind="deuteranopia"] .urgency-good .urgency-item .calendar-fid-dc { background: #663399; }

/* Colorblind Mode: Tritanopia (Blue-blind) - Uses red/green/magenta palette */
[data-colorblind="tritanopia"] .summary-calendar-fid.fid-good {
  background: linear-gradient(135deg, rgba(51, 187, 238, 0.2) 0%, rgba(17, 153, 204, 0.15) 100%);
  color: #33bbee;
  border-color: rgba(51, 187, 238, 0.3);
}
[data-colorblind="tritanopia"] .summary-calendar-fid.fid-good .calendar-fid-dc { background: #33bbee; color: #1a1a2e; }

[data-colorblind="tritanopia"] .summary-calendar-fid.fid-warning {
  background: linear-gradient(135deg, rgba(238, 51, 119, 0.2) 0%, rgba(204, 17, 85, 0.15) 100%);
  color: #ee3377;
  border-color: rgba(238, 51, 119, 0.3);
}
[data-colorblind="tritanopia"] .summary-calendar-fid.fid-warning .calendar-fid-dc { background: #ee3377; }

[data-colorblind="tritanopia"] .summary-calendar-fid.fid-urgent {
  background: linear-gradient(135deg, rgba(238, 119, 51, 0.2) 0%, rgba(204, 85, 17, 0.15) 100%);
  color: #ee7733;
  border-color: rgba(238, 119, 51, 0.3);
}
[data-colorblind="tritanopia"] .summary-calendar-fid.fid-urgent .calendar-fid-dc { background: #ee7733; color: #1a1a2e; }

[data-colorblind="tritanopia"] .summary-calendar-fid.fid-overdue {
  background: linear-gradient(135deg, rgba(204, 51, 17, 0.2) 0%, rgba(153, 34, 0, 0.15) 100%);
  color: #cc3311;
  border-color: rgba(204, 51, 17, 0.3);
}
[data-colorblind="tritanopia"] .summary-calendar-fid.fid-overdue .calendar-fid-dc { background: #cc3311; }

[data-colorblind="tritanopia"] .summary-calendar-fid.fid-complete {
  background: linear-gradient(135deg, rgba(0, 153, 136, 0.2) 0%, rgba(0, 119, 102, 0.15) 100%);
  color: #009988;
  border-color: rgba(0, 153, 136, 0.3);
}
[data-colorblind="tritanopia"] .summary-calendar-fid.fid-complete .calendar-fid-dc { background: #009988; }

[data-colorblind="tritanopia"] .urgency-overdue .urgency-column-header { background: linear-gradient(135deg, rgba(204, 51, 17, 0.15) 0%, rgba(153, 34, 0, 0.1) 100%); }
[data-colorblind="tritanopia"] .urgency-overdue .urgency-icon { background: #cc3311; }
[data-colorblind="tritanopia"] .urgency-overdue .urgency-count { background: rgba(204, 51, 17, 0.2); color: #cc3311; }
[data-colorblind="tritanopia"] .urgency-overdue .urgency-item { border-color: rgba(204, 51, 17, 0.2); }
[data-colorblind="tritanopia"] .urgency-overdue .urgency-item:hover { border-color: rgba(204, 51, 17, 0.4); background: rgba(204, 51, 17, 0.1); }
[data-colorblind="tritanopia"] .urgency-overdue .urgency-item .calendar-fid-dc { background: #cc3311; }
[data-colorblind="tritanopia"] .urgency-urgent .urgency-column-header { background: linear-gradient(135deg, rgba(238, 119, 51, 0.15) 0%, rgba(204, 85, 17, 0.1) 100%); }
[data-colorblind="tritanopia"] .urgency-urgent .urgency-icon { background: #ee7733; }
[data-colorblind="tritanopia"] .urgency-urgent .urgency-count { background: rgba(238, 119, 51, 0.2); color: #ee7733; }
[data-colorblind="tritanopia"] .urgency-urgent .urgency-item { border-color: rgba(238, 119, 51, 0.2); }
[data-colorblind="tritanopia"] .urgency-urgent .urgency-item:hover { border-color: rgba(238, 119, 51, 0.4); background: rgba(238, 119, 51, 0.1); }
[data-colorblind="tritanopia"] .urgency-urgent .urgency-item .calendar-fid-dc { background: #ee7733; color: #1a1a2e; }
[data-colorblind="tritanopia"] .urgency-warning .urgency-column-header { background: linear-gradient(135deg, rgba(238, 51, 119, 0.15) 0%, rgba(204, 17, 85, 0.1) 100%); }
[data-colorblind="tritanopia"] .urgency-warning .urgency-icon { background: #ee3377; }
[data-colorblind="tritanopia"] .urgency-warning .urgency-count { background: rgba(238, 51, 119, 0.2); color: #ee3377; }
[data-colorblind="tritanopia"] .urgency-warning .urgency-item { border-color: rgba(238, 51, 119, 0.2); }
[data-colorblind="tritanopia"] .urgency-warning .urgency-item:hover { border-color: rgba(238, 51, 119, 0.4); background: rgba(238, 51, 119, 0.1); }
[data-colorblind="tritanopia"] .urgency-warning .urgency-item .calendar-fid-dc { background: #ee3377; }
[data-colorblind="tritanopia"] .urgency-good .urgency-column-header { background: linear-gradient(135deg, rgba(51, 187, 238, 0.15) 0%, rgba(17, 153, 204, 0.1) 100%); }
[data-colorblind="tritanopia"] .urgency-good .urgency-icon { background: #33bbee; color: #1a1a2e; }
[data-colorblind="tritanopia"] .urgency-good .urgency-count { background: rgba(51, 187, 238, 0.2); color: #33bbee; }
[data-colorblind="tritanopia"] .urgency-good .urgency-item { border-color: rgba(51, 187, 238, 0.2); }
[data-colorblind="tritanopia"] .urgency-good .urgency-item:hover { border-color: rgba(51, 187, 238, 0.4); background: rgba(51, 187, 238, 0.1); }
[data-colorblind="tritanopia"] .urgency-good .urgency-item .calendar-fid-dc { background: #33bbee; color: #1a1a2e; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  background: var(--bg-dark);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 240, 255, 0.03) 2px, rgba(0, 240, 255, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 240, 255, 0.03) 2px, rgba(0, 240, 255, 0.03) 4px);
  min-height: 100vh;
  color: var(--text-primary);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-glow);
  padding: 1.5rem;
  box-shadow: var(--shadow-glow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

.header-title {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.site-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  position: relative;
}

.site-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.site-select {
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 0, 0, 0.2));
  color: var(--text-primary);
  padding: 0.45rem 2.2rem 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.2);
}

.site-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-select::after {
  content: "▾";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 0.75rem;
  opacity: 0.8;
}

.site-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-glow-lg), 0 15px 35px rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  display: none;
  z-index: 200;
  overflow: hidden;
}

.site-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
}

.site-menu.open {
  display: grid;
  gap: 0.25rem;
  animation: dropdownSlide 0.2s ease;
}

.site-option {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.site-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-option:hover,
.site-option:focus {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(0, 240, 255, 0.3);
  padding-left: 1.25rem;
}

.site-option:hover::before,
.site-option:focus::before {
  opacity: 1;
}

.site-option.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.5);
}

/* Theme Switcher */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.theme-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.theme-select {
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 0, 0, 0.2));
  color: var(--text-primary);
  padding: 0.45rem 2.2rem 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.2);
  font-size: 0.85rem;
  min-width: 120px;
  text-align: left;
}

.theme-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-switcher::after {
  content: "▾";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 0.75rem;
  opacity: 0.8;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-glow-lg), 0 15px 35px rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  display: none;
  z-index: 200;
  overflow: hidden;
}

.theme-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
}

.theme-menu.open {
  display: grid;
  gap: 0.25rem;
  animation: dropdownSlide 0.2s ease;
}

.theme-option {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.theme-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-option:hover,
.theme-option:focus {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(0, 240, 255, 0.3);
  padding-left: 1.25rem;
}

.theme-option:hover::before,
.theme-option:focus::before {
  opacity: 1;
}

/* Colorblind Switcher */
.colorblind-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.colorblind-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.colorblind-select {
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 0, 0, 0.2));
  color: var(--text-primary);
  padding: 0.45rem 2.2rem 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.2);
  font-size: 0.85rem;
  min-width: 120px;
  text-align: left;
}

.colorblind-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.colorblind-switcher::after {
  content: "▾";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 0.75rem;
  opacity: 0.8;
}

.colorblind-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-glow-lg), 0 15px 35px rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  display: none;
  z-index: 200;
  overflow: hidden;
}

.colorblind-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
}

.colorblind-menu.open {
  display: grid;
  gap: 0.25rem;
  animation: dropdownSlide 0.2s ease;
}

.colorblind-option {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.colorblind-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.colorblind-option:hover,
.colorblind-option:focus {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(0, 240, 255, 0.3);
  padding-left: 1.25rem;
}

.colorblind-option:hover::before,
.colorblind-option:focus::before {
  opacity: 1;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.25);
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

body:has(.summary-view.active) .search-container {
  display: none;
}

body:has(.reports-view.active) .search-container {
  display: none;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
}

.header h1 {
  font-size: 1.6rem;
  color: var(--primary);
  margin: 0;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  white-space: nowrap;
  justify-self: start;
  text-align: left;
}

.theme-toggle {
  background: var(--bg-elevated);
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--primary);
  color: var(--bg-dark);
  box-shadow: var(--shadow-glow);
  transform: scale(1.05);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  justify-self: end;
  flex: 0 0 auto;
}

/* Navigation Menu */
.nav-switcher {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex: 0 0 auto;
}

.nav-select {
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(0, 0, 0, 0.2));
  color: var(--text-primary);
  padding: 0.45rem 2.1rem 0.45rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.2);
  font-size: 0.85rem;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 0 20px rgba(168, 85, 247, 0.45);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-switcher::after {
  content: "▾";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 0.75rem;
  opacity: 0.8;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 170px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-glow-lg), 0 15px 35px rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  display: none;
  z-index: 200;
  overflow: hidden;
}

.nav-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
}

.nav-menu.open {
  display: grid;
  gap: 0.25rem;
  animation: dropdownSlide 0.2s ease;
}

.nav-option {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-option:hover,
.nav-option:focus {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-color: rgba(0, 240, 255, 0.3);
  padding-left: 1.25rem;
}

.nav-option:hover::before,
.nav-option:focus::before {
  opacity: 1;
}

.nav-option.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.5);
}

.user-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.settings-btn:hover {
  transform: rotate(12deg);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.settings-modal {
  max-width: 520px;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.settings-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.settings-actions {
  justify-content: flex-end;
  gap: 0.75rem;
}

.settings-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-choice {
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-choice:hover,
.settings-choice:focus {
  color: var(--text-primary);
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: var(--shadow-glow);
  outline: none;
}

.settings-choice.active {
  color: var(--text-primary);
  border-color: rgba(0, 240, 255, 0.55);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(168, 85, 247, 0.12));
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.2);
}

.user-badge {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  white-space: nowrap;
}

/* Help View */
.help-view {
  display: none;
  padding: 1.5rem;
}

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

.help-card {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}

.help-content {
  padding: 1.5rem 1.75rem 2rem;
  display: grid;
  gap: 1.5rem;
}

.help-section h3 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.help-section p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.help-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  color: var(--text-secondary);
}

.help-list li::before {
  content: "•";
  color: var(--primary);
  margin-right: 0.5rem;
}

.help-faq {
  display: grid;
  gap: 0.85rem;
}

.help-faq-item {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.15);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(168, 85, 247, 0.04));
}

.help-faq-item h4 {
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.help-faq-item p {
  color: var(--text-secondary);
  line-height: 1.55;
}

.login-view {
  display: none;
  min-height: calc(100vh - 120px);
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-glow);
}

.login-header h2 {
  margin: 0;
  color: var(--text-primary);
}

.login-header p {
  margin: 0.35rem 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.login-form input,
.login-form select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  color: var(--text-primary);
}

.login-error {
  min-height: 1.2rem;
  color: #ff8b8b;
  font-size: 0.85rem;
}

.password-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: -0.25rem 0 0.5rem 0;
  line-height: 1.4;
}

body.auth-locked .header {
  display: none;
}

body.auth-locked .summary-view,
body.auth-locked .reports-view,
body.auth-locked .ports-status-view,
body.auth-locked .profile-view,
body.auth-locked .list-view,
body.auth-locked .detail-view,
body.auth-locked .create-view,
body.auth-locked .admin-view {
  display: none;
}

body.auth-locked .login-view {
  display: flex;
}

.search-container {
  display: flex;
  gap: 1rem;
  margin-top: 0;
  position: relative;
  flex: 1 1 320px;
  max-width: 520px;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--bg-elevated);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-glow-lg), 0 20px 40px rgba(0, 0, 0, 0.3);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  display: none;
  backdrop-filter: blur(10px);
}

.search-dropdown::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
  border-radius: 12px 12px 0 0;
}

.search-dropdown.active {
  display: block;
  animation: dropdownSlide 0.2s ease;
}

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

.search-result-item {
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-result-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-result-item:hover {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
  padding-left: 1.5rem;
}

.search-result-item:hover::before {
  opacity: 1;
}

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

.search-result-fid {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.search-result-item:hover .search-result-fid {
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
}

.search-result-dc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-right: 0.5rem;
}

.search-result-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Scrollbar styling for dropdowns */
.search-dropdown::-webkit-scrollbar,
.site-menu::-webkit-scrollbar {
  width: 8px;
}

.search-dropdown::-webkit-scrollbar-track,
.site-menu::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb,
.site-menu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  border-radius: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover,
.site-menu::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1rem;
}

.summary-view,
.ports-status-view,
.reports-view,
.profile-view,
.list-view,
.detail-view,
.create-view {

.audit-ticker {
  max-width: 1400px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  display: none;
}

.audit-ticker.show {
  display: block;
}

.audit-ticker-inner {
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 14px;
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow-glow);
  display: grid;
  gap: 0.6rem;
}

.audit-ticker-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.audit-ticker-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
  padding-bottom: 0.5rem;
}

.audit-ticker-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.audit-ticker-meta {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
  display: none;
}

.summary-view.active,
.ports-status-view.active,
.reports-view.active,
.profile-view.active,
.list-view.active,
.detail-view.active,
.create-view.active {
  display: block;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-glow-lg);
}

.profile-form {
  padding: 1.5rem 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-field label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.profile-field input {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.profile-password {
  padding: 0 2rem 2rem;
  display: grid;
  gap: 1rem;
}

.profile-password h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-password-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.profile-password-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

/* Summary */
.summary-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.summary-header h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.summary-header p {
  color: var(--text-secondary);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.summary-tile {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-tile-hidden {
  display: none;
}

.summary-tile-full {
  width: 100%;
  margin-bottom: 1.5rem;
}

.summary-tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.summary-tile-header h3 {
  margin-bottom: 0.25rem;
}

.summary-tile-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.summary-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summary-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  color: var(--text-primary);
}

.summary-range {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
}

.summary-range input[type="range"] {
  width: 100%;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-list-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.summary-list-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.summary-list-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
}

.summary-item-title {
  font-weight: 600;
  color: var(--text-primary);
}

.summary-item-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.summary-change-line--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.summary-change-line--clamp.summary-change-line--expanded {
  display: block;
  -webkit-line-clamp: initial;
  -webkit-box-orient: initial;
  overflow: visible;
}

.summary-change-toggle {
  margin-top: 0.35rem;
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.summary-change-toggle:hover {
  text-decoration: underline;
}

.summary-calendar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.summary-calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.summary-calendar-nav-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.summary-calendar-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.summary-calendar-month {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.summary-calendar-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.summary-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-calendar-weekdays span {
  text-align: left;
}

.summary-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.summary-calendar-day {
  min-height: 70px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.summary-calendar-day.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.summary-calendar-day--empty {
  border: none;
  background: transparent;
  min-height: 70px;
}

.summary-calendar-date {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
}

.summary-calendar-fids {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.summary-calendar-fid {
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(0, 240, 255, 0.2);
  transition: all 0.2s ease;
}

.summary-calendar-fid:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(168, 85, 247, 0.15) 100%);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.2);
}

/* FID color variants based on days to dock */
.summary-calendar-fid.fid-good {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}
.summary-calendar-fid.fid-good:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.25) 100%);
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.summary-calendar-fid.fid-good .calendar-fid-dc {
  background: #3b82f6;
}

.summary-calendar-fid.fid-warning {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(202, 138, 4, 0.15) 100%);
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.3);
}
.summary-calendar-fid.fid-warning:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3) 0%, rgba(202, 138, 4, 0.25) 100%);
  border-color: #eab308;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}
.summary-calendar-fid.fid-warning .calendar-fid-dc {
  background: #eab308;
  color: #1a1a2e;
}

.summary-calendar-fid.fid-urgent {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.15) 100%);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.3);
}
.summary-calendar-fid.fid-urgent:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.3) 0%, rgba(234, 88, 12, 0.25) 100%);
  border-color: #f97316;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.summary-calendar-fid.fid-urgent .calendar-fid-dc {
  background: #f97316;
  color: #1a1a2e;
}

.summary-calendar-fid.fid-overdue {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.summary-calendar-fid.fid-overdue:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.25) 100%);
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.summary-calendar-fid.fid-overdue .calendar-fid-dc {
  background: #ef4444;
}

.summary-calendar-fid.fid-complete {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}
.summary-calendar-fid.fid-complete:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 163, 74, 0.25) 100%);
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
.summary-calendar-fid.fid-complete .calendar-fid-dc {
  background: #22c55e;
}

.calendar-fid-dc {
  background: var(--primary);
  color: var(--bg-dark);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
}

.summary-calendar-empty {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Urgency Columns */
.urgency-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.urgency-column {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.urgency-column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.urgency-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.urgency-title {
  flex: 1;
  font-size: 0.85rem;
}

.urgency-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.urgency-column-items {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.urgency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-align: left;
}

.urgency-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.urgency-item-fid {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.urgency-item-days {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.urgency-empty {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
}

/* Overdue column (red) */
.urgency-overdue .urgency-column-header {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
}
.urgency-overdue .urgency-icon {
  background: #ef4444;
  color: #fff;
}
.urgency-overdue .urgency-count {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}
.urgency-overdue .urgency-item {
  border-color: rgba(239, 68, 68, 0.2);
}
.urgency-overdue .urgency-item:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}
.urgency-overdue .urgency-item .calendar-fid-dc {
  background: #ef4444;
}

/* Urgent column (orange) */
.urgency-urgent .urgency-column-header {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(234, 88, 12, 0.1) 100%);
}
.urgency-urgent .urgency-icon {
  background: #f97316;
  color: #fff;
}
.urgency-urgent .urgency-count {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}
.urgency-urgent .urgency-item {
  border-color: rgba(249, 115, 22, 0.2);
}
.urgency-urgent .urgency-item:hover {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(249, 115, 22, 0.1);
}
.urgency-urgent .urgency-item .calendar-fid-dc {
  background: #f97316;
}

/* Warning column (yellow) */
.urgency-warning .urgency-column-header {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(202, 138, 4, 0.1) 100%);
}
.urgency-warning .urgency-icon {
  background: #eab308;
  color: #1a1a2e;
}
.urgency-warning .urgency-count {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}
.urgency-warning .urgency-item {
  border-color: rgba(234, 179, 8, 0.2);
}
.urgency-warning .urgency-item:hover {
  border-color: rgba(234, 179, 8, 0.4);
  background: rgba(234, 179, 8, 0.1);
}
.urgency-warning .urgency-item .calendar-fid-dc {
  background: #eab308;
  color: #1a1a2e;
}

/* Good column (blue) */
.urgency-good .urgency-column-header {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
}
.urgency-good .urgency-icon {
  background: #3b82f6;
  color: #fff;
}
.urgency-good .urgency-count {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}
.urgency-good .urgency-item {
  border-color: rgba(59, 130, 246, 0.2);
}
.urgency-good .urgency-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.1);
}
.urgency-good .urgency-item .calendar-fid-dc {
  background: #3b82f6;
}

/* Responsive: stack columns on smaller screens */
@media (max-width: 1200px) {
  .urgency-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-stat-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.4rem;
}

.summary-link {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.4rem 0;
  cursor: pointer;
  color: inherit;
}

.summary-link:hover {
  color: var(--primary);
}

.summary-deployment-link {
  text-align: left;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.summary-deployment-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.ports-status-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ports-status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.ports-status-header h2 {
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.ports-status-header p {
  color: var(--text-secondary);
}

.ports-status-table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  overflow: auto;
}

.ports-status-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.ports-status-table th,
.ports-status-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.ports-status-table th {
  background: var(--bg-elevated);
  color: var(--primary);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ports-status-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
}

/* Reports */
.reports-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.reports-header h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.reports-header p {
  color: var(--text-secondary);
}

.reports-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.reports-tile {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin: 0;
}

.reports-tile-header h3 {
  margin-bottom: 0.25rem;
}

.reports-tile-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.reports-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.reports-input {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.reports-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.secondary-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}

.secondary-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.reports-range {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reports-result {
  min-height: 60px;
}

.handoff-summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.handoff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.handoff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.handoff-chip-label {
  color: var(--text-secondary);
}

.handoff-chip-value {
  color: var(--text-primary);
  font-weight: 600;
}

.handoff-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.handoff-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.handoff-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0.5rem;
}

.handoff-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.handoff-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.handoff-change {
  border-top: 1px dashed var(--border-color);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.handoff-change-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.handoff-change-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.handoff-notice {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.reports-empty {
  color: var(--text-secondary);
  font-style: italic;
}

.reports-table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: auto;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.reports-table th,
.reports-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.reports-table th {
  background: var(--bg-elevated);
  color: var(--primary);
}
.summary-empty {
  color: var(--text-secondary);
  font-style: italic;
}

.summary-loading {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
}

.summary-loading-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.summary-loading-subtitle {
  color: var(--text-secondary);
}

.summary-error {
  border-color: var(--accent-red);
}

/* List Header */
.list-header {
  padding: 1.5rem 0;
  display: flex;
  justify-content: flex-end;
}

.create-btn {
  background: var(--secondary);
  color: var(--bg-dark);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.create-btn:hover {
  background: var(--accent-green);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

/* Deployments List */
.deployments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* Table Styles */
.table-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow-lg);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  overflow-y: visible;
}

/* Filters Section */
.filters-section {
  border-bottom: 2px solid var(--border-color);
}

.filters-header {
  padding: 1rem 1.5rem;
  background: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--primary);
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.filters-header:hover {
  background: rgba(0, 240, 255, 0.05);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.filters-header .toggle-icon {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.filters-header.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.filters-content {
  max-height: 800px;
  overflow: visible;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.filters-content.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.filters-row {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-elevated);
}

.filters-row-dropdowns {
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.filters-row-checkboxes {
  grid-template-columns: 1fr;
  padding-top: 0.75rem;
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pill-filter {
  position: relative;
}

.pill-filter-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
}

.pill-filter-trigger.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.pill-filter-label {
  white-space: nowrap;
}

.pill-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: var(--shadow-glow-lg);
  display: none;
  z-index: 2000;
  max-height: 260px;
  overflow-y: auto;
}

.pill-filter-menu.open {
  display: block;
}

.pill-filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.pill-filter-option:hover {
  background: var(--bg-elevated);
}

.pill-filter-checkbox {
  width: 16px;
  height: 16px;
}

.filter-group-full {
  width: 100%;
}

.filter-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.filter-group-header label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-clear-btn {
  padding: 0.25rem 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-clear-btn:hover {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--primary);
}

.filter-checkboxes {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.filter-checkboxes::-webkit-scrollbar {
  width: 8px;
}

.filter-checkboxes::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.filter-checkboxes::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.filter-checkboxes::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.filter-checkbox-label:hover {
  background: rgba(0, 240, 255, 0.05);
  color: var(--primary);
}

.filter-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  appearance: none;
  border: 2px solid var(--border-color);
  border-radius: 3px;
  background: var(--bg-elevated);
  position: relative;
  transition: all 0.2s ease;
}

.filter-checkbox:hover {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.filter-checkbox:checked {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.filter-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-dark);
  font-size: 12px;
  font-weight: bold;
}

.filter-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 240, 255, 0.02) 100%);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300f0ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.filter-select:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(0, 240, 255, 0.05) 100%);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15), var(--shadow-glow);
}

.filters-actions {
  padding: 0 1.5rem 1.5rem;
  background: var(--bg-elevated);
  display: flex;
  justify-content: flex-end;
}

.clear-filters-btn {
  padding: 0.625rem 1.25rem;
  background: var(--bg-card);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-filters-btn:hover {
  background: var(--primary);
  color: var(--bg-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.deployments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 900px;
}

.deployments-table thead {
  background: var(--bg-elevated);
  color: var(--primary);
  border-bottom: 2px solid var(--border-glow);
}

.deployments-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

.deployments-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.deployments-table th.sortable:hover {
  background-color: rgba(0, 240, 255, 0.1);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.deployments-table th .sort-indicator {
  font-size: 0.75rem;
  opacity: 0.8;
}

.deployments-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.deployments-table tbody tr:hover {
  background-color: rgba(0, 240, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.1);
}

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

.deployments-table td {
  padding: 1rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.deployments-table th:nth-child(7),
.deployments-table td:nth-child(7) {
  width: 250px;
  max-width: 250px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deployments-table th:nth-child(6),
.deployments-table td:nth-child(6) {
  width: 200px;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.deployments-table td:first-child {
  font-weight: 600;
  color: var(--primary);
}

.deployments-table td:nth-child(2) {
  white-space: nowrap;
}

.watched-star {
  color: var(--warning);
  margin-right: 0.35rem;
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.45);
  font-size: 0.95rem;
  vertical-align: super;
  line-height: 1;
}

.icm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--primary);
  vertical-align: super;
  line-height: 1;
}


.status-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  border: 1px solid;
}

.status-badge.complete {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.status-badge.in-progress {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warning);
  border-color: var(--warning);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}

.status-badge.pending {
  background: rgba(255, 0, 102, 0.1);
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 10px rgba(255, 0, 102, 0.3);
}

.view-btn {
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 2rem;
}

.deployment-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
}

.deployment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-lg);
  border-left-color: var(--accent-green);
}

.deployment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.deployment-id {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.deployment-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.deployment-status.complete {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.deployment-status.in-progress {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warning);
  border-color: var(--warning);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}

.deployment-status.pending {
  background: rgba(255, 0, 102, 0.1);
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 10px rgba(255, 0, 102, 0.3);
}

.deployment-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.deployment-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.95rem;
}

.deployment-field-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 120px;
  flex-shrink: 0;
}

.deployment-field-value {
  color: var(--text-primary);
  word-break: break-word;
  flex: 1;
  text-align: right;
}

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

.view-details-btn {
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.view-details-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Detail View */
.back-button {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-button:hover {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateX(-3px);
  box-shadow: var(--shadow-glow);
}

.deployment-detail {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0;
  box-shadow: var(--shadow-glow-lg);
  overflow: hidden;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(168, 85, 247, 0.05) 50%, rgba(0, 255, 136, 0.03) 100%);
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
  flex-wrap: wrap;
  position: relative;
}

.detail-header::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
  opacity: 0.5;
}

.detail-header h2 {
  font-size: 1.75rem;
  color: var(--primary);
  margin: 0;
  text-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-header h2::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--secondary), 0 0 20px var(--secondary);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* Tabs */
.deployment-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 2rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}

.tab-button {
  padding: 1rem 1.75rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  margin-bottom: -1px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.tab-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tab-button:hover {
  color: var(--primary);
}

.tab-button:hover::before {
  opacity: 1;
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.05) 0%, transparent 100%);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.tab-content {
  display: none;
  padding: 2rem;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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


.changes-entry {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  margin-bottom: 1rem;
  overflow: hidden;
}

.changes-summary {
  list-style: none;
  padding: 1rem;
  cursor: pointer;
  display: grid;
  gap: 0.35rem;
}

.changes-summary::-webkit-details-marker {
  display: none;
}

.changes-summary::after {
  content: "▾";
  position: absolute;
  right: 1rem;
  top: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.changes-entry[open] .changes-summary::after {
  transform: rotate(180deg);
}

.changes-summary {
  position: relative;
}

.changes-summary-main {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.changes-summary-detail {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.changes-count {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.changes-preview {
  color: var(--text-primary);
  font-size: 0.9rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.changes-body {
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1rem 1rem;
}

.changes-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.changes-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.changes-row:last-child {
  border-bottom: none;
}

.changes-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.changes-header {
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.changes-cell {
  color: var(--text-primary);
  word-break: break-word;
}

.changes-cell + .changes-cell {
  border-left: 1px solid var(--border-color);
  padding-left: 0.75rem;
  align-content: center;
  text-align: center;
}

.changes-field {
  font-weight: 600;
}

.changes-row-empty {
  grid-template-columns: 1fr;
}

@media (max-width: 720px) {
  .changes-row {
    grid-template-columns: 1fr;
  }
  .changes-header {
    display: none;
  }
  .changes-cell {
    padding: 0.1rem 0;
  }
  .changes-cell + .changes-cell {
    border-left: none;
    padding-left: 0;
  }
}

.collapse-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.icm-section {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.06) 0%, rgba(0, 240, 255, 0.04) 100%);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: grid;
  gap: 1rem;
}

.icm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.icm-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.icm-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.icm-entries {
  display: grid;
  gap: 0.75rem;
}

.icm-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-wrap: wrap;
}

.icm-entry-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icm-entry-main {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.icm-entry-field {
  display: grid;
  gap: 0.35rem;
}

.icm-entry-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.icm-entry-value,
.icm-entry-status {
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.icm-entry-status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: inline-flex;
  width: max-content;
}

.icm-link {
  color: var(--primary);
  text-decoration: none;
}

.icm-link:hover {
  text-decoration: underline;
}

.icm-connector {
  height: 2px;
  width: 100%;
  min-width: 80px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0.8), rgba(0, 240, 255, 0.1));
  border-radius: 999px;
  position: relative;
}

.icm-connector::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.icm-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.icm-remove-btn {
  white-space: nowrap;
}

.icm-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: -0.5rem 0 1.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.06) 0%, rgba(0, 240, 255, 0.04) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  flex-wrap: wrap;
}

.icm-actions .icm-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.icm-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.collapse-all-btn,
.expand-all-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.05);
  color: var(--primary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.collapse-all-btn:hover,
.expand-all-btn:hover {
  background: var(--primary);
  color: var(--bg-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
  border-color: var(--primary);
}

/* Ports Tab */
.ports-upload {
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  text-align: center;
}

.upload-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.upload-btn.secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  margin-left: 0.5rem;
}

.upload-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.upload-btn.secondary:hover {
  background: var(--bg-elevated);
  color: var(--primary);
}

.upload-btn:disabled,
.upload-btn.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.last-upload-hint {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.ports-upload-note {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.ports-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.ports-table th,
.ports-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.ports-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--primary);
}

.ports-table tr:hover {
  background: var(--bg-elevated);
}

.delete-port-btn {
  padding: 0.5rem 1rem;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.2s ease;
}

.edit-port-btn {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
}

.edit-port-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.delete-port-btn:hover {
  background: #cc0052;
  transform: scale(1.05);
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.watch-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.watch-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.detail-presence {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
}

.detail-presence.is-empty {
  display: none;
}

.presence-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 0.2rem;
}

.presence-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.72rem;
  box-shadow: var(--shadow-glow);
  position: relative;
  z-index: 1;
}

.presence-bubble + .presence-bubble {
  margin-left: -6px;
  z-index: 2;
}

.presence-bubble.presence-more {
  background: var(--accent-purple);
  color: #fff;
  border-color: transparent;
}

.list-presence {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 28px;
}


.field-editing {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.field-editing.active {
  opacity: 1;
}

.edit-btn,
.save-btn,
.cancel-btn {
  padding: 0.625rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.edit-btn::before,
.save-btn::before,
.cancel-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.edit-btn:hover::before,
.save-btn:hover::before,
.cancel-btn:hover::before {
  opacity: 1;
}

.edit-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--bg-dark);
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.3);
}

.edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.5);
}

.save-btn {
  background: linear-gradient(135deg, var(--secondary) 0%, #00cc6a 100%);
  color: var(--bg-dark);
  box-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
}

.save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.5);
}

.cancel-btn {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.cancel-btn:hover {
  background: rgba(255, 0, 102, 0.1);
  border-color: var(--danger);
  color: var(--danger);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 0, 102, 0.2);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 14, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
  will-change: opacity;
}

.modal {
  background: var(--bg-card);
  color: var(--text-primary);
  width: min(560px, 100%);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-glow-lg), 0 25px 50px rgba(0, 0, 0, 0.4);
  padding: 0;
  overflow: hidden;
  animation: modalSlide 0.3s ease;
  will-change: transform, opacity;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.modal-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
  opacity: 0.5;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.modal-body {
  padding: 1.25rem 1.5rem 0.5rem;
}

.modal-subtitle {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
}

.conflict-list {
  display: grid;
  gap: 0.75rem;
}

.conflict-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.75rem 1rem;
}

.conflict-item h4 {
  margin: 0 0 0.4rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.conflict-values {
  display: grid;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.conflict-values span {
  color: var(--text-primary);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 0, 102, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
}

.modal-form {
  padding: 1.5rem;
}

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

.modal-body {
  display: grid;
  gap: 1rem;
}

.modal-field {
  display: grid;
  gap: 0.5rem;
}

.modal-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-select {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(0, 240, 255, 0.02) 100%);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300f0ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.modal-select:hover {
  border-color: rgba(0, 240, 255, 0.4);
}

.modal-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.modal-select option {
  color: var(--text-primary);
  background: var(--bg-card);
}

[data-theme="dark"] .modal-select option {
  color: #0a0e17;
  background: #f5f7fa;
}

[data-theme="dark"] .modal-select {
  color-scheme: light;
  background: #f5f7fa;
  color: #0a0e17;
  border-color: rgba(0, 240, 255, 0.35);
}

.modal-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-form input,
.modal-form select {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(0, 240, 255, 0.02) 100%);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.modal-form input:hover,
.modal-form select:hover {
  border-color: rgba(0, 240, 255, 0.4);
}

.modal-form input:focus,
.modal-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.admin-view {
  display: none;
  padding: 2rem;
}

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

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-header h2 {
  margin: 0;
  color: var(--text-primary);
}

.admin-header-meta {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-grid {
  display: grid;
  gap: 1.5rem;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.admin-card h3 {
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.admin-card p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

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

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.admin-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.admin-input,
.admin-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.4rem 0.5rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 100%;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-create-form {
  display: grid;
  gap: 1rem;
}

.admin-create-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-create-field {
  display: grid;
  gap: 0.4rem;
}

.admin-create-field label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-create-form .password-hint,
.admin-create-form .login-error {
  margin: 0;
}

.admin-chip {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1200;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  min-width: 220px;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 18px rgba(0, 240, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  animation: toast-drop 0.25s ease;
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

@keyframes toast-drop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-actions {
  display: flex;
  gap: 0.5rem;
}

.toast-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.25rem 0.6rem;
  color: var(--text-primary);
  font-size: 0.75rem;
  cursor: pointer;
}

.toast-btn.primary {
  border-color: var(--primary);
  color: var(--primary);
}

.toast-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

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

/* Deployment detail h2 styles are now in .detail-header h2 */

/* Field Group Container */
.field-group {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.02) 0%, rgba(168, 85, 247, 0.02) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.field-group:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: var(--shadow-glow);
}

.field-group:last-child {
  margin-bottom: 0;
}

/* Field Group Header */
.field-group-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  padding: 1rem 1.25rem;
  margin: 0;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.85rem;
}

.field-group-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent-purple) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.field-group-title {
  position: relative;
}

.field-group-title:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.field-group-title:hover::before {
  opacity: 1;
}

.field-group-title .toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  opacity: 0.7;
  background: rgba(0, 240, 255, 0.1);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-group-title:hover .toggle-icon {
  opacity: 1;
  background: rgba(0, 240, 255, 0.2);
}

.field-group-title.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.field-group-title.collapsed {
  border-bottom-color: transparent;
}

/* Field Grid */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 1;
  background: var(--bg-card);
}

.field-grid.collapsed {
  max-height: 0;
  opacity: 0;
  padding: 0 1.25rem;
}

/* Individual Field Cards */
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.detail-field::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.detail-field:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 240, 255, 0.1);
}

.detail-field:hover::before {
  opacity: 1;
}

/* Field Label */
.detail-field-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Field Value */
.detail-field-value {
  color: var(--text-primary);
  font-size: 0.95rem;
  word-break: break-word;
  padding: 0.625rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.detail-field:hover .detail-field-value {
  border-color: rgba(0, 240, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.detail-field-value.empty {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.6;
}

.af-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 240, 255, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.af-link:hover {
  color: var(--bg-dark);
  background: var(--primary);
  border-color: var(--primary);
  text-shadow: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
}

.af-link::after {
  content: "↗";
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.af-link:hover::after {
  transform: translate(2px, -2px);
}

/* Custom Dropdown Component */
.custom-dropdown {
  position: relative;
  width: 100%;
}

.custom-dropdown-trigger {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.5rem;
  font-size: 0.95rem;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 240, 255, 0.03) 100%);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-dropdown-trigger:hover {
  border-color: rgba(0, 240, 255, 0.5);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 240, 255, 0.06) 100%);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.custom-dropdown.open .custom-dropdown-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15), var(--shadow-glow);
}

.custom-dropdown-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown-arrow {
  font-size: 0.7rem;
  color: var(--primary);
  transition: transform 0.2s ease;
  margin-left: 0.5rem;
}

.custom-dropdown.open .custom-dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-glow-lg), 0 20px 40px rgba(0, 0, 0, 0.3);
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 9999;
  display: none;
  min-width: 200px;
}

/* Portal version of menu (appended to body) */
.custom-dropdown-menu-portal {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-glow-lg), 0 20px 40px rgba(0, 0, 0, 0.3);
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 9999;
  min-width: 200px;
}

.custom-dropdown-menu-portal .custom-dropdown-option {
  display: block;
  width: 100%;
}

.custom-dropdown-menu-portal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
  border-radius: 12px 12px 0 0;
  pointer-events: none;
}

/* Scrollbar for portal dropdown */
.custom-dropdown-menu-portal::-webkit-scrollbar {
  width: 10px;
}

.custom-dropdown-menu-portal::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 0 12px 12px 0;
}

.custom-dropdown-menu-portal::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  border-radius: 5px;
  border: 2px solid var(--bg-elevated);
}

.custom-dropdown-menu-portal::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.custom-dropdown-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple), var(--secondary));
  border-radius: 12px 12px 0 0;
}

.custom-dropdown.open .custom-dropdown-menu {
  display: block;
  animation: dropdownSlide 0.2s ease;
}

.custom-dropdown-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-primary);
}

.custom-dropdown-option::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.custom-dropdown-option:hover {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.08) 0%, rgba(168, 85, 247, 0.04) 100%);
  padding-left: 1.25rem;
}

.custom-dropdown-option:hover::before {
  opacity: 1;
}

.custom-dropdown-option:last-child {
  border-bottom: none;
}

.custom-dropdown-option.selected {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.custom-dropdown-option.selected::before {
  opacity: 1;
}

.custom-dropdown-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.custom-dropdown-option.disabled:hover {
  background: transparent;
  padding-left: 1rem;
}

/* Custom dropdown scrollbar */
.custom-dropdown-menu::-webkit-scrollbar {
  width: 8px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent-purple));
  border-radius: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Light theme custom dropdown */
[data-theme="light"] .custom-dropdown-trigger {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="light"] .custom-dropdown-trigger:hover {
  background: var(--bg-elevated);
}

[data-theme="light"] .custom-dropdown-menu,
[data-theme="light"] .custom-dropdown-menu-portal {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 20px rgba(0, 153, 204, 0.1);
}

[data-theme="light"] .custom-dropdown-option:hover {
  background: linear-gradient(90deg, rgba(0, 153, 204, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
}

/* Legacy select styling (fallback) */
.detail-field-select {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.5rem;
  font-size: 0.95rem;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 240, 255, 0.03) 100%);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 2.5rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300f0ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.detail-field-select:hover {
  border-color: rgba(0, 240, 255, 0.5);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 240, 255, 0.06) 100%);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.detail-field-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15), var(--shadow-glow);
}

.detail-field-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.5rem;
}

.detail-field-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.95rem;
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 240, 255, 0.02) 100%);
  color: var(--text-primary);
  transition: all 0.2s ease;
  min-height: 2.5rem;
}

.detail-field-input:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 240, 255, 0.05) 100%);
}

.detail-field-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15), var(--shadow-glow);
}

.detail-field-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  border: 2px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 240, 255, 0.02) 100%);
  color: var(--text-primary);
  transition: all 0.2s ease;
  min-height: 6rem;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.detail-field-textarea:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 240, 255, 0.05) 100%);
}

.detail-field-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15), var(--shadow-glow);
}

/* Empty State */
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .table-container {
    overflow-x: auto;
  }

  .deployments-table {
    min-width: 900px;
  }
}

@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .deployments-list {
    grid-template-columns: 1fr;
  }

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

  .summary-tile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-range {
    width: 100%;
  }

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

  .ports-status-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .header-content {
    padding: 0;
  }

  .theme-toggle {
    position: static;
    margin-bottom: 0.5rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .deployment-detail {
    border-radius: 12px;
  }

  .detail-header {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-header h2 {
    font-size: 1.35rem;
  }

  .deployment-tabs {
    padding: 0 1rem;
    gap: 0;
    overflow-x: auto;
  }

  .tab-button {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
  }

  .tab-content {
    padding: 1.25rem;
  }

  .detail-actions {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .edit-btn,
  .save-btn,
  .cancel-btn,
  .back-button {
    flex: 1;
    min-width: 90px;
    justify-content: center;
  }

  .field-group {
    border-radius: 12px;
  }

  .field-group-title {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
  }

  .detail-field {
    padding: 0.75rem;
  }

  .collapse-controls {
    padding: 0.5rem 0.75rem;
  }

  .deployments-table th,
  .deployments-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  .filters-row {
    flex-direction: column;
    gap: 1rem;
  }

  .filter-group {
    width: 100%;
  }

  .clear-filters-btn {
    width: 100%;
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.loading::after {
  content: "";
  display: inline-block;
  animation: spin 1s linear infinite;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  margin-left: 0.5rem;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

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

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .header,
  .summary-view,
  .ports-status-view,
  .list-view,
  .detail-view,
  .create-view,
  .reports-header {
    display: none !important;
  }

  .reports-view {
    display: block !important;
  }

  .reports-grid {
    display: block !important;
  }

  .reports-tile {
    display: none !important;
    box-shadow: none;
    border: 1px solid #000;
    margin-bottom: 1rem;
  }

  .reports-tile[data-print-active="true"] {
    display: block !important;
  }

  .reports-actions,
  .reports-controls input,
  .reports-controls button,
  .reports-range {
    display: none !important;
  }

  .reports-table th,
  .reports-table td {
    color: #000000;
  }
}

/* Move to Top Button */
.move-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3), 0 0 30px rgba(0, 240, 255, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  font-family: inherit;
}

.move-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.move-to-top-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.25);
}

.move-to-top-btn:active {
  transform: translateY(-2px) scale(1);
}

.move-to-top-icon {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bg-dark);
  line-height: 1;
}

.move-to-top-text {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--bg-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Light theme */
[data-theme="light"] .move-to-top-btn {
  box-shadow: 0 4px 20px rgba(0, 153, 204, 0.3), 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .move-to-top-btn:hover {
  box-shadow: 0 8px 30px rgba(0, 153, 204, 0.4), 0 4px 15px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .move-to-top-icon,
[data-theme="light"] .move-to-top-text {
  color: #fff;
}

/* Hide on print */
@media print {
  .move-to-top-btn {
    display: none !important;
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .header {
    position: static;
    padding: 1rem;
  }

  .header-top {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
  }

  .header-title {
    width: 100%;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .nav-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0;
    white-space: nowrap;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .site-switcher,
  .theme-switcher,
  .colorblind-switcher {
    width: 100%;
    justify-content: space-between;
  }

  .site-select,
  .theme-select,
  .colorblind-select {
    width: 100%;
  }

  .site-menu,
  .theme-menu,
  .colorblind-menu {
    left: 0;
    right: 0;
    width: 100%;
  }

  .user-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .search-container {
    width: 100%;
    flex: 1 1 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .main-content {
    padding: 1.25rem 0.75rem;
  }

  .summary-content {
    gap: 1.25rem;
  }

  .summary-header h2 {
    font-size: 1.5rem;
  }

  .summary-tile {
    padding: 1rem;
  }

  .summary-tile-header {
    gap: 0.75rem;
  }

  .summary-list-item {
    padding: 0.65rem 0.85rem;
  }

  .summary-list-scroll {
    max-height: 340px;
  }

  .summary-calendar {
    overflow-x: auto;
  }

  .summary-calendar-grid {
    min-width: 520px;
  }

  .table-container {
    overflow-x: auto;
  }

  .deployments-table {
    min-width: 720px;
  }

  .deployment-detail {
    border-radius: 10px;
  }

  .move-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
  }

  .move-to-top-icon {
    font-size: 1.1rem;
  }

  .move-to-top-text {
    font-size: 0.5rem;
  }
}


/* IcM Sidebar */
.icm-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow-y: auto;
}
.icm-sidebar.open {
  right: 0;
}
.icm-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.icm-sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.icm-sidebar-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.icm-sidebar-close:hover {
  color: var(--text-primary);
}
.icm-sidebar-form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.icm-sidebar-form label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.icm-sidebar-form input,
.icm-sidebar-form select {
  padding: 0.6rem 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.icm-sidebar-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Inline field editing */
.field-inline-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.field-inline-actions button {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
}
.field-inline-actions .field-save-btn {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}
.field-inline-actions .field-cancel-btn {
  background: transparent;
  color: var(--text-secondary);
}
.detail-field.editable {
  cursor: pointer;
}
.detail-field.editable:hover {
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

/* Clickable table rows */
.table-row {
  cursor: pointer;
}
.table-row:hover {
  background: var(--bg-elevated);
}

/* UTC Clock */
.utc-clock {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  background: var(--bg-elevated);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  letter-spacing: 0.05em;
}

/* IcM Select Arrow Wrapper */
.icm-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.icm-select-wrapper select {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
}
.icm-select-arrow {
  position: absolute;
  right: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
  font-size: 0.9rem;
}
/* Inline filters bar */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filter-item label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.filters-bar .pill-filter {
  position: relative;
}
.filters-bar .pill-filter {
  min-width: 160px;
}
.filters-bar .pill-filter-trigger {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}
.filters-bar .clear-filters-btn {
  margin-left: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  border-width: 1px;
}
/* Deployment Velocity */
.velocity-filters {
  display: flex;
  gap: 0.4rem;
}
.velocity-filter-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.velocity-filter-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}
.velocity-filter-btn.active {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
  font-weight: 600;
}
.velocity-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem;
}
.velocity-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.velocity-card-count {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}
.velocity-card-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}
.velocity-in-progress .velocity-card-count { color: var(--accent-cyan); }
.velocity-complete .velocity-card-count { color: var(--accent-green); }
.velocity-cancelled .velocity-card-count { color: var(--danger); }

/* Velocity Drill-down Sidebar */
.velocity-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.velocity-sidebar.open {
  right: 0;
}
.velocity-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.velocity-sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.velocity-sidebar-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.velocity-sidebar-close:hover {
  color: var(--text-primary);
}
.velocity-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}
.velocity-sidebar-item {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.velocity-sidebar-item:hover {
  background: var(--bg-elevated);
}
.velocity-sidebar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.velocity-sidebar-fid {
  font-weight: 700;
  color: var(--primary);
}
.velocity-sidebar-dc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.velocity-sidebar-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}
.velocity-sidebar-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.velocity-sidebar-loading,
.velocity-sidebar-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 1rem;
}
.velocity-card[data-velocity-status] {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.velocity-card[data-velocity-status]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Calendar DC Filters */
.calendar-dc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem 1.25rem 0.75rem;
}
.calendar-dc-btn {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.calendar-dc-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}
.calendar-dc-btn.active {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
  font-weight: 600;
}
.calendar-dc-clear {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.calendar-dc-clear:hover {
  background: var(--danger);
  color: var(--bg-dark);
}
