/*
 * PORTFLOW - Port Operations Management System
 * High-Density Enterprise Design System (White / Light Mode)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Clean Enterprise White Theme */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-subtle: #f8fafc;
  --bg-input: #ffffff;
  
  --border-color: #e2e8f0;
  --border-light: #cbd5e1;
  --border-focus: #0284c7;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --accent-cyan: #0284c7;
  --accent-blue: #2563eb;
  --accent-sky: #0ea5e9;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #7c3aed;

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
  --header-height: 64px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.mono-num {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: width 0.25s ease-in-out;
  box-shadow: 1px 0 3px rgba(0,0,0,0.03);
}

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

.sidebar-header {
  height: var(--header-height);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar-header);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

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

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-tag {
  font-size: 9px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 4px 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: #475569;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-item:hover {
  color: #0284c7;
  background: #f0f9ff;
}

.nav-item.active {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #bae6fd;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #0284c7;
}

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

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

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

.nav-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 4px;
  font-size: 9px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
}

.system-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-size: 11px;
}

.sidebar.collapsed .system-status-indicator {
  justify-content: center;
  padding: 8px;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 10px var(--accent-emerald); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.status-text-block {
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed .status-text-block {
  display: none;
}

/* Main Layout Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease-in-out;
  background: #f8fafc;
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.terminal-title-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
}

.terminal-name {
  font-weight: 600;
  color: #0f172a;
}

.terminal-badge {
  background: #dcfce7;
  color: #15803d;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #bbf7d0;
}

.header-search {
  position: relative;
  width: 290px;
}

.header-search input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 7px 12px 7px 34px;
  border-radius: 7px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
}

.header-search input:focus {
  outline: none;
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.search-icon-pos {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.telemetry-weather {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.weather-metric {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0284c7;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.2);
}

.quick-action-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3);
}

.header-btn {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--accent-rose);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

/* User Profile & Role Switcher */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.user-profile-menu:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}

.user-role-label {
  font-size: 10px;
  color: #0284c7;
  font-weight: 600;
  line-height: 1.2;
}

/* Main Content Container */
.content-area {
  padding: 24px;
  flex: 1;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-box {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: #0284c7;
  color: white;
  border-color: #0369a1;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.2);
}
.btn-primary:hover {
  background: #0369a1;
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-emerald {
  background: #059669;
  color: white;
  border-color: #047857;
}
.btn-emerald:hover {
  background: #047857;
}

.btn-amber {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.btn-amber:hover {
  background: #fde68a;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #cbd5e1;
}

.kpi-card.accent-cyan::before {
  background: #0284c7;
}
.kpi-card.accent-emerald::before {
  background: #059669;
}
.kpi-card.accent-amber::before {
  background: #d97706;
}
.kpi-card.accent-blue::before {
  background: #2563eb;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: var(--text-secondary);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

.kpi-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  font-size: 11px;
}

.trend-badge.up {
  color: #059669;
}
.trend-badge.down {
  color: #e11d48;
}
.trend-badge.neutral {
  color: #0284c7;
}

/* Card Container */
.card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.card-body {
  padding: 20px;
}

/* Charts Grid */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

@media (max-width: 1100px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 1200px) {
  .dashboard-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .dashboard-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-in-progress, .badge-active {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}
.badge-in-progress .badge-dot-indicator {
  background: #0284c7;
}

.badge-completed {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}
.badge-completed .badge-dot-indicator {
  background: #059669;
}

.badge-scheduled, .badge-waiting, .badge-draft {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.badge-scheduled .badge-dot-indicator {
  background: #64748b;
}

.badge-paused, .badge-idle, .badge-investigating {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-paused .badge-dot-indicator {
  background: #d97706;
}

.badge-delayed, .badge-breakdown, .badge-danger {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}
.badge-delayed .badge-dot-indicator {
  background: #e11d48;
}

.badge-maintenance {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
.badge-maintenance .badge-dot-indicator {
  background: #7c3aed;
}

/* Progress Bar Component */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #0284c7;
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill.striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  0% { background-position: 1rem 0; }
  100% { background-position: 0 0; }
}

.progress-fill.emerald {
  background: #059669;
}
.progress-fill.amber {
  background: #d97706;
}
.progress-fill.rose {
  background: #e11d48;
}

/* Operation Monitoring Cards */
.ops-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.ops-monitor-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.ops-monitor-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.ops-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ops-vessel-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ops-berth-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  color: #0369a1;
}

.ops-cargo-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.ops-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
}

.ops-metric-item {
  display: flex;
  flex-direction: column;
}

.ops-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.ops-metric-val {
  font-weight: 600;
  color: #0f172a;
}

.ops-resources-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

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

/* Timeline Component */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0284c7;
}

.timeline-dot.done {
  background: #0284c7;
}
.timeline-dot.alert {
  border-color: #e11d48;
  background: #e11d48;
}

.timeline-time {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #0284c7;
  font-weight: 600;
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.timeline-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Berth Planning Visual Gantt */
.berth-planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.berth-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.berth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.berth-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.berth-dock-visual {
  height: 54px;
  border-radius: 6px;
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.docked-vessel-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 38px;
  background: linear-gradient(90deg, #0284c7, #0ea5e9);
  border: 1px solid #0284c7;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Yard Visualization */
.yard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.yard-zone-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.yard-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bays-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bay-cell {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.bay-cell:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.bay-cell.occupied {
  border-left: 3px solid #0284c7;
  background: #f0f9ff;
}
.bay-cell.receiving {
  border-left: 3px solid #059669;
  background: #ecfdf5;
}
.bay-cell.available {
  border-left: 3px solid #cbd5e1;
  opacity: 0.75;
}
.bay-cell.reserved {
  border-left: 3px solid #d97706;
  background: #fefce8;
}

.bay-tag {
  font-weight: 700;
  font-size: 11px;
  color: #0f172a;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

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

.filter-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.form-select, .form-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-select:focus, .form-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Modals & Drawers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modal-enter 0.2s ease-out;
}

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

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
  background: #ffffff;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.close-btn:hover {
  color: #0f172a;
}

/* Form Layout */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.form-section-header {
  font-size: 13px;
  font-weight: 700;
  color: #0284c7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  margin: 18px 0 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: toast-slide 0.25s ease-out;
}

@keyframes toast-slide {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
}
.toast-warning {
  border-left: 4px solid var(--accent-amber);
}
.toast-info {
  border-left: 4px solid var(--accent-cyan);
}
.toast-danger {
  border-left: 4px solid var(--accent-rose);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 230px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: #334155;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0284c7;
}

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

/* Workflow Stepper */
.workflow-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 24px;
  overflow-x: auto;
  padding: 10px 0;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  min-width: 90px;
}

.workflow-step-bubble {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.workflow-step.active .workflow-step-bubble {
  background: #0284c7;
  border-color: #0369a1;
  color: white;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
}

.workflow-step.completed .workflow-step-bubble {
  background: #059669;
  border-color: #047857;
  color: white;
}

.workflow-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.workflow-step.active .workflow-step-label {
  color: #0284c7;
}

/* Operational Simulation Banner */
.simulation-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.sim-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hidden views */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
  animation: view-fade-in 0.2s ease-out;
}

@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
