/* =========================================================
   Captain's Toolkit
   Dashboard Module
   ========================================================= */

/* =========================================================
   DASHBOARD LAYOUT
========================================================= */

.dashboard-screen {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.dashboard-main {
  grid-column: span 8;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dashboard-side {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* =========================================================
   STATS GRID
========================================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-5);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-xl);
  background: var(--theme-surface);
  box-shadow: var(--theme-card-shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-card-shadow-strong);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.05);
}

.stat-card-primary::after {
  background: rgba(37, 99, 235, 0.08);
}

.stat-card-success::after {
  background: rgba(22, 163, 74, 0.08);
}

.stat-card-warning::after {
  background: rgba(245, 158, 11, 0.08);
}

.stat-card-danger::after {
  background: rgba(220, 38, 38, 0.08);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.stat-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--theme-muted);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  color: var(--theme-primary);
  font-size: 1.25rem;
}

.stat-value {
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--theme-text);
}

.stat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 800;
}

.stat-trend.positive {
  color: var(--theme-success);
}

.stat-trend.negative {
  color: var(--theme-danger);
}

.stat-trend.warning {
  color: var(--theme-warning);
}

/* =========================================================
   QUICK ACTIONS
========================================================= */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.quick-action-card {
  min-height: 110px;
  padding: var(--space-4);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-xl);
  background: var(--theme-surface);
  box-shadow: var(--theme-card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  text-decoration: none;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--theme-card-shadow-strong);
}

.quick-action-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  color: var(--theme-primary);
  font-size: 1.35rem;
}

.quick-action-title {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--theme-text);
}

.quick-action-text {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--theme-muted);
}

.quick-action-danger {
  border-color: rgba(220, 38, 38, 0.16);
  background:
    linear-gradient(
      135deg,
      var(--theme-surface) 0%,
      rgba(254, 242, 242, 0.7) 100%
    );
}

.quick-action-danger .quick-action-icon {
  background: rgba(220, 38, 38, 0.1);
  color: var(--theme-danger);
}

/* =========================================================
   DASHBOARD CARDS
========================================================= */

.dashboard-card {
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-xl);
  background: var(--theme-surface);
  box-shadow: var(--theme-card-shadow);
  overflow: hidden;
}

.dashboard-card-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--theme-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.dashboard-card-title {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--theme-text);
}

.dashboard-card-subtitle {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--theme-muted);
}

.dashboard-card-body {
  padding: var(--space-5);
}

.dashboard-card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--theme-border);
  background: var(--theme-surface-soft);
}

/* =========================================================
   VESSEL OVERVIEW
========================================================= */

.vessel-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.vessel-overview-card {
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(
      135deg,
      var(--theme-surface) 0%,
      var(--theme-surface-soft) 100%
    );
  border: 1px solid var(--theme-border);
}

.vessel-name {
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--theme-text);
}

.vessel-meta {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.vessel-chip {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--theme-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

/* =========================================================
   FUEL SUMMARY
========================================================= */

.fuel-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.fuel-level-card {
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(
      135deg,
      rgba(37, 99, 235, 0.08),
      rgba(14, 165, 233, 0.06)
    );
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.fuel-level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.fuel-level-title {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--theme-muted);
}

.fuel-level-value {
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--theme-text);
}

.fuel-progress {
  margin-top: var(--space-4);
  height: 14px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.fuel-progress-bar {
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      var(--theme-primary),
      #38bdf8
    );
}

/* =========================================================
   MAINTENANCE WIDGETS
========================================================= */

.maintenance-widget {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.maintenance-item {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--theme-border);
  background: var(--theme-surface-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.maintenance-item-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.maintenance-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.12);
  color: var(--theme-warning);
}

.maintenance-title {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--theme-text);
}

.maintenance-meta {
  margin-top: 0.2rem;
  font-size: var(--text-xs);
  color: var(--theme-muted);
}

.maintenance-status {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.maintenance-status.ok {
  background: rgba(22, 163, 74, 0.12);
  color: var(--theme-success);
}

.maintenance-status.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--theme-warning);
}

.maintenance-status.danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--theme-danger);
}

/* =========================================================
   VOYAGE PREVIEW
========================================================= */

.voyage-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.voyage-card {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--theme-border);
  background: var(--theme-surface);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.voyage-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--theme-card-shadow);
}

.voyage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.voyage-route {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--theme-text);
}

.voyage-date {
  font-size: var(--text-xs);
  color: var(--theme-muted);
}

.voyage-meta {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.voyage-badge {
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--theme-primary);
  font-size: 0.68rem;
  font-weight: 800;
}

/* =========================================================
   WEATHER / INFO PANEL
========================================================= */

.weather-widget {
  position: relative;
  overflow: hidden;
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 10rem),
    linear-gradient(
      135deg,
      #0f172a,
      #132038
    );

  color: #ffffff;
}

.weather-widget::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.weather-location {
  font-size: var(--text-sm);
  font-weight: 700;
  opacity: 0.72;
}

.weather-temp {
  margin-top: var(--space-3);
  font-size: 3rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.weather-meta {
  margin-top: var(--space-4);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.weather-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.weather-meta-label {
  font-size: 0.68rem;
  opacity: 0.62;
  text-transform: uppercase;
}

.weather-meta-value {
  font-size: var(--text-sm);
  font-weight: 800;
}

/* =========================================================
   EMPTY STATES
========================================================= */

.dashboard-empty {
  padding: var(--space-8);
  border: 1px dashed var(--theme-border);
  border-radius: var(--radius-xl);
  background: var(--theme-surface);
  text-align: center;
}

.dashboard-empty-icon {
  font-size: 2.6rem;
  opacity: 0.5;
}

.dashboard-empty-title {
  margin-top: var(--space-4);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--theme-text);
}

.dashboard-empty-text {
  margin-top: var(--space-2);
  max-width: 520px;
  margin-inline: auto;
  color: var(--theme-muted);
  line-height: var(--leading-relaxed);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {
  .dashboard-main {
    grid-column: span 12;
  }

  .dashboard-side {
    grid-column: span 12;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-screen {
    gap: var(--space-4);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .stats-grid,
  .quick-actions,
  .vessel-overview {
    grid-template-columns: 1fr;
  }

  .dashboard-card-header,
  .dashboard-card-body,
  .dashboard-card-footer,
  .stat-card,
  .weather-widget,
  .fuel-level-card {
    padding: var(--space-4);
  }

  .stat-value {
    font-size: 2rem;
  }

  .fuel-level-value {
    font-size: 1.9rem;
  }

  .weather-temp {
    font-size: 2.4rem;
  }

  .maintenance-item {
    flex-direction: column;
    align-items: stretch;
  }

  .voyage-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .dashboard-card-header,
  .dashboard-card-body,
  .dashboard-card-footer,
  .stat-card,
  .weather-widget,
  .fuel-level-card,
  .vessel-overview-card {
    padding: var(--space-3);
  }

  .quick-action-card {
    min-height: 96px;
    padding: var(--space-3);
  }

  .stat-value {
    font-size: 1.8rem;
  }

  .weather-temp {
    font-size: 2rem;
  }
}
/* =========================================================
   DASHBOARD STATS
========================================================= */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.dashboard-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-height: 150px;

    padding: 22px;
    border-radius: 20px;

    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);

    box-shadow:
        0 2px 10px rgba(15, 23, 42, 0.04);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-stat-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-stat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: #64748b;
}

.dashboard-stat-value {
    font-size: 34px;
    line-height: 1.1;
    font-weight: 700;

    color: #0f172a;

    word-break: break-word;
}

.dashboard-stat-bottom {
    margin-top: 18px;
}

.dashboard-stat-hint {
    font-size: 14px;
    line-height: 1.5;

    color: #475569;
}

/* =========================================================
   DATA LIST
========================================================= */

.dashboard-data-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-data-row {
    display: flex;
    flex-direction: column;
    gap: 6px;

    padding-bottom: 14px;

    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.dashboard-data-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-data-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;

    color: #64748b;
}

.dashboard-data-value {
    font-size: 16px;
    line-height: 1.5;
    font-weight: 600;

    color: #0f172a;

    word-break: break-word;
}

/* =========================================================
   PANELS
========================================================= */

.dashboard-panel {
    padding: 26px;
    border-radius: 24px;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 768px) {

    .dashboard-stat-card {
        min-height: auto;
        padding: 20px;
    }

    .dashboard-stat-value {
        font-size: 28px;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}