/* ====================================================================
   VesselMaint Pro — Main Stylesheet
   ==================================================================== */

:root {
  --navy: #0F4C81;
  --navy-dark: #0a3560;
  --navy-light: #1a5fa0;
  --accent: #00B4D8;
  --accent-dark: #0096c7;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-icon { font-size: 26px; }
.brand-text { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: -.3px; }

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-section { margin-bottom: 8px; }
.nav-label {
  display: block;
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  position: relative;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; border-left-color: rgba(255,255,255,.3); }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--accent); }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none;
  min-width: 0;
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.5); font-size: 11px; text-transform: capitalize; }
.logout-btn {
  color: rgba(255,255,255,.5);
  font-size: 16px;
  padding: 6px;
  text-decoration: none;
  transition: color .2s;
  border-radius: 6px;
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Main Content ─────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin .3s ease;
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gray-600);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.menu-toggle:hover { background: var(--gray-100); }
.topbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-icon {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  transition: all .2s;
}
.topbar-icon:hover { background: var(--gray-100); color: var(--navy); }
.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}
.topbar-avatar {
  width: 34px; height: 34px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  text-decoration: none;
  transition: background .2s;
}
.topbar-avatar:hover { background: var(--navy-light); }

/* ── Page Content ─────────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ── Alerts ───────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.alert-dismissible { position: relative; padding-right: 50px; }
.alert-success { background: #dcfce7; color: #14532d; border-bottom: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #7f1d1d; border-bottom: 1px solid #fecaca; }
.alert-warning { background: #fef9c3; color: #713f12; border-bottom: 1px solid #fef08a; }
.alert-info { background: #dbeafe; color: #1e3a8a; border-bottom: 1px solid #bfdbfe; }
.alert-close {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 18px; cursor: pointer; opacity: .5;
  line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
}
.card-title { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; background: var(--gray-50); border-top: 1px solid var(--gray-100); }

/* ── Stat Cards ───────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.navy { background: #e0eaf5; color: var(--navy); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-icon.orange { background: #ffedd5; color: var(--warning); }
.stat-icon.blue { background: #dbeafe; color: var(--info); }
.stat-icon.teal { background: #ccfbf1; color: #0d9488; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--gray-900); }
.stat-label { font-size: 12px; color: var(--gray-500); font-weight: 500; margin-top: 2px; }

/* ── Tables ───────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Badges / Status Pills ────────────────────────────────────────── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-pill.critical, .badge-pill.overdue  { background:#fee2e2; color:#991b1b; }
.badge-pill.high     { background:#ffedd5; color:#9a3412; }
.badge-pill.medium   { background:#fef9c3; color:#854d0e; }
.badge-pill.low      { background:#dcfce7; color:#166534; }
.badge-pill.completed, .badge-pill.operational { background:#dcfce7; color:#166534; }
.badge-pill.scheduled { background:#dbeafe; color:#1e40af; }
.badge-pill.in_progress, .badge-pill.under_maintenance { background:#fef9c3; color:#854d0e; }
.badge-pill.inactive, .badge-pill.faulty { background:#fee2e2; color:#991b1b; }
.badge-pill.standby  { background:#f3e8ff; color:#6b21a8; }
.badge-pill.cancelled { background:#f1f5f9; color:#64748b; }
.badge-pill.decommissioned { background:#f1f5f9; color:#64748b; }
.badge-pill.active   { background:#dcfce7; color:#166534; }
.badge-pill.under_maintenance { background:#fef9c3; color:#854d0e; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all .2s;
  white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #1d4ed8; }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-900); }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-label .required { color: var(--danger); }
.form-control, .form-select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,76,129,.1);
}
textarea.form-control { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ── Page Header ──────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-header-info h2 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-header-info p { font-size: 14px; color: var(--gray-500); margin-top: 2px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── Filters Bar ──────────────────────────────────────────────────── */
.filters-bar {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-group { flex: 1; min-width: 140px; }
.filter-group label { display: block; font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 16px;
}
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  background: #fff;
  transition: all .2s;
}
.page-link:hover, .page-link.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Dashboard specific ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.priority-dot.critical { background: var(--danger); }
.priority-dot.high { background: var(--warning); }
.priority-dot.medium { background: var(--info); }
.priority-dot.low { background: var(--success); }

.overdue-row td { background: #fff5f5 !important; }
.due-soon-row td { background: #fffbeb !important; }

/* ── Equipment Status indicator ──────────────────────────────────── */
.status-indicator {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  animation: pulse 2s infinite;
}
.status-dot.operational { background: var(--success); }
.status-dot.faulty { background: var(--danger); }
.status-dot.under_maintenance { background: var(--warning); }
.status-dot.standby { background: var(--info); }
.status-dot.decommissioned { background: var(--gray-400); animation: none; }

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

/* ── Auth ─────────────────────────────────────────────────────────── */
.auth-body { background: #f0f4f8; display: block; }
.auth-bg {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--accent-dark) 100%);
  z-index: 0;
}
.auth-container {
  position: relative; z-index: 1;
  max-width: 440px; margin: 60px auto;
  padding: 0 16px;
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-icon { font-size: 50px; display: block; margin-bottom: 10px; }
.auth-brand h1 { color: #fff; font-size: 26px; font-weight: 800; }
.auth-brand p { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 4px; }
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 34px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--gray-900); }
.auth-card p.subtitle { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.8); }
.auth-footer a { color: #fff; font-weight: 600; text-decoration: none; }

/* ── Notification items ───────────────────────────────────────────── */
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-100);
  transition: background .2s;
  cursor: pointer;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #f0f7ff; border-left: 3px solid var(--navy); }
.notif-icon-wrap {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.notif-msg { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ── Details list ─────────────────────────────────────────────────── */
.details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; }
.detail-item { padding: 12px 0; border-bottom: 1px solid var(--gray-100); display: flex; gap: 12px; }
.detail-item:last-child { border-bottom: none; }
.detail-label { font-size: 12px; font-weight: 600; color: var(--gray-500); min-width: 130px; text-transform: uppercase; letter-spacing: .4px; }
.detail-value { font-size: 14px; color: var(--gray-800); }

/* ── Maintenance timeline ─────────────────────────────────────────── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content:''; position:absolute; left:8px; top:0; bottom:0; width:2px; background:var(--gray-200); }
.timeline-item { position:relative; margin-bottom:20px; }
.timeline-dot {
  position:absolute; left:-20px; top:4px;
  width:14px; height:14px; border-radius:50%;
  border:2px solid #fff; box-shadow:0 0 0 2px var(--gray-300);
}
.timeline-dot.completed { background:var(--success); box-shadow:0 0 0 2px var(--success); }
.timeline-dot.overdue   { background:var(--danger);  box-shadow:0 0 0 2px var(--danger);  }
.timeline-dot.scheduled { background:var(--info);    box-shadow:0 0 0 2px var(--info);    }
.timeline-dot.in_progress { background:var(--warning); box-shadow:0 0 0 2px var(--warning); }

/* ── Sidebar overlay for mobile ───────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ── Progress bar ─────────────────────────────────────────────────── */
.progress-bar-wrap { background:var(--gray-200); border-radius:99px; height:6px; overflow:hidden; }
.progress-bar { height:100%; border-radius:99px; transition:width .4s; }
.progress-bar.green { background:var(--success); }
.progress-bar.red { background:var(--danger); }
.progress-bar.orange { background:var(--warning); }
.progress-bar.blue { background:var(--info); }

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state { text-align:center; padding:60px 20px; color:var(--gray-500); }
.empty-state i { font-size:52px; opacity:.25; margin-bottom:16px; display:block; }
.empty-state h3 { font-size:18px; color:var(--gray-700); margin-bottom:6px; }
.empty-state p { font-size:14px; }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .sidebar-overlay.visible { opacity: 1; pointer-events: auto; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page-content { padding: 16px; }
  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
  .filters-bar { gap: 8px; }
  .filter-group { min-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .auth-container { margin: 20px auto; }
  .auth-card { padding: 24px 20px; }
  table { min-width: 600px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .topbar { padding: 0 14px; }
  .page-content { padding: 12px; }
  .btn { padding: 8px 14px; font-size: 13px; }
}

/* ── Utility ──────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.text-muted  { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }
.fw-bold     { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ─── Additional Components ──────────────────────────────────────────── */

/* Status Chips */
.status-chips { display:flex; gap:.5rem; flex-wrap:wrap; margin-bottom:1.25rem; }
.chip { padding:.35rem .85rem; border-radius:50px; font-size:.8rem; font-weight:600; border:2px solid var(--border-color); color:var(--text-secondary); text-decoration:none; transition:all .2s; }
.chip:hover,.chip-active { background:var(--bg-secondary); border-color:var(--primary); color:var(--primary); }
.chip-primary { border-color:#3b82f6; color:#3b82f6; }
.chip-info { border-color:#06b6d4; color:#06b6d4; }
.chip-danger { border-color:#ef4444; color:#ef4444; }
.chip-success { border-color:#22c55e; color:#22c55e; }

/* Notification List */
.notification-list { display:flex; flex-direction:column; }
.notification-item { display:flex; gap:1rem; padding:1.25rem 1.5rem; border-bottom:1px solid var(--border-color); cursor:pointer; transition:background .15s; }
.notification-item:last-child { border-bottom:none; }
.notification-item:hover { background:var(--bg-secondary); }
.notification-unread { background:rgba(59,130,246,.04); border-left:3px solid var(--primary); }
.notification-icon { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; }
.notification-icon-warning { background:#fef3c7; color:#d97706; }
.notification-icon-danger  { background:#fee2e2; color:#dc2626; }
.notification-icon-success { background:#dcfce7; color:#16a34a; }
.notification-icon-primary { background:#dbeafe; color:#2563eb; }
.notification-icon-info    { background:#e0f2fe; color:#0284c7; }
.notification-content { flex:1; min-width:0; }
.notification-header { display:flex; align-items:center; gap:.5rem; margin-bottom:.25rem; }
.notification-title { font-weight:600; font-size:.95rem; }
.notification-dot { width:8px; height:8px; border-radius:50%; background:var(--primary); flex-shrink:0; }
.notification-message { font-size:.875rem; color:var(--text-secondary); margin-bottom:.5rem; }
.notification-meta { display:flex; align-items:center; gap:1rem; font-size:.8rem; color:var(--text-muted); flex-wrap:wrap; }
.notification-vessel a { color:var(--text-secondary); text-decoration:none; }
.notification-vessel a:hover { color:var(--primary); }

/* Detail Grid */
.details-grid { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem; }
@media(max-width:900px){ .details-grid{grid-template-columns:1fr;} }
.detail-list { display:flex; flex-direction:column; gap:.75rem; }
.detail-item { display:flex; justify-content:space-between; align-items:flex-start; padding:.5rem 0; border-bottom:1px solid var(--border-color); gap:1rem; }
.detail-item:last-child { border-bottom:none; }
.detail-item.full-width { flex-direction:column; gap:.35rem; }
.detail-label { font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); flex-shrink:0; }
.detail-value { font-size:.9rem; color:var(--text-primary); text-align:right; word-break:break-word; }
.detail-item.full-width .detail-value { text-align:left; }

/* Team Member */
.team-member { display:flex; align-items:center; gap:.75rem; padding:.5rem 0; border-bottom:1px solid var(--border-color); }
.team-member:last-child { border-bottom:none; }
.avatar { width:38px; height:38px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1rem; flex-shrink:0; }

/* Parts container */
.parts-header,.readings-header { display:grid; gap:.5rem; font-size:.8rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; padding:.5rem 0; border-bottom:1px solid var(--border-color); margin-bottom:.5rem; }
.parts-header { grid-template-columns:2fr 1.5fr 1fr 1fr auto; }
.readings-header { grid-template-columns:1.5fr 1fr 1fr 2fr auto; }
.part-row,.reading-row { display:grid; gap:.5rem; margin-bottom:.5rem; align-items:center; }
.part-row { grid-template-columns:2fr 1.5fr 1fr 1fr auto; }
.reading-row { grid-template-columns:1.5fr 1fr 1fr 2fr auto; }

/* Report Cards */
.report-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:1.5rem; }
.report-card { background:var(--bg-primary); border:1px solid var(--border-color); border-radius:var(--radius-lg); overflow:hidden; display:flex; gap:0; flex-direction:column; }
.report-card-icon { padding:2rem; font-size:2.5rem; background:linear-gradient(135deg,var(--primary),var(--primary-dark)); color:#fff; display:flex; align-items:center; justify-content:center; min-height:80px; }
.report-card-icon-green { background:linear-gradient(135deg,#22c55e,#16a34a); }
.report-card-icon-orange { background:linear-gradient(135deg,#f59e0b,#d97706); }
.report-card-content { padding:1.5rem; flex:1; display:flex; flex-direction:column; }
.report-card-content h3 { margin-bottom:.5rem; font-size:1.1rem; }
.report-card-content p { color:var(--text-secondary); font-size:.875rem; margin-bottom:1rem; flex:1; }
.report-form { display:flex; flex-direction:column; gap:.75rem; }
.form-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
.report-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.report-stats-mini { display:grid; grid-template-columns:repeat(4,1fr); gap:.5rem; text-align:center; background:var(--bg-secondary); border-radius:var(--radius); padding:.75rem; }
.stat-num { display:block; font-size:1.5rem; font-weight:700; }
.stat-label { display:block; font-size:.7rem; color:var(--text-muted); text-transform:uppercase; }
.overdue-item { display:flex; justify-content:space-between; padding:.4rem 0; border-bottom:1px solid var(--border-color); font-size:.875rem; }
.overdue-item:last-child { border-bottom:none; }

/* Error Page */
.error-page { text-align:center; padding:5rem 2rem; }
.error-icon { font-size:4rem; color:var(--primary); margin-bottom:1rem; opacity:.6; }
.error-code { font-size:6rem; font-weight:800; color:var(--primary); line-height:1; margin-bottom:.5rem; }
.error-page h2 { font-size:1.75rem; margin-bottom:.75rem; }
.error-page p { color:var(--text-secondary); margin-bottom:2rem; }
.error-actions { display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }

/* Row highlights */
.row-overdue { background:rgba(239,68,68,.05) !important; }
.row-warning { background:rgba(245,158,11,.05) !important; }

/* Toggle switch */
.toggle-group { padding:.75rem 0; border-bottom:1px solid var(--border-color); }
.toggle-group:last-of-type { border-bottom:none; }
.toggle-label { display:flex; align-items:center; justify-content:space-between; cursor:pointer; }
.toggle-switch { position:relative; display:inline-block; width:48px; height:26px; flex-shrink:0; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:#d1d5db; border-radius:26px; transition:.3s; }
.toggle-slider::before { content:''; position:absolute; width:20px; height:20px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; }
.toggle-switch input:checked + .toggle-slider { background:var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform:translateX(22px); }

/* Badge category */
.badge-category { background:rgba(99,102,241,.1); color:#6366f1; }

/* Input group */
.input-group { display:flex; gap:.5rem; }
.input-group .form-control { flex:1; }
.currency-select { width:80px !important; flex-shrink:0; }

/* fw-bold */
.fw-bold { font-weight:700; }
.ml-2 { margin-left:.5rem; }
.ml-auto { margin-left:auto; }
.mt-3 { margin-top:1rem; }
.mt-4 { margin-top:1.5rem; }
.mb-4 { margin-bottom:1.5rem; }
.mb-0 { margin-bottom:0; }
.p-0 { padding:0; }

@media(max-width:768px){
  .report-cards { grid-template-columns:1fr; }
  .form-grid-2 { grid-template-columns:1fr; }
  .report-stats-mini { grid-template-columns:repeat(2,1fr); }
  .parts-header,.part-row { grid-template-columns:1fr 1fr auto; }
  .readings-header,.reading-row { grid-template-columns:1fr 1fr auto; }
  .details-grid { grid-template-columns:1fr; }
}

/* ─── Vessel Cards Grid ──────────────────────────────────────────────── */
.vessel-cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1.5rem; }
.vessel-card { background:var(--bg-primary); border:1px solid var(--border-color); border-radius:var(--radius-lg); overflow:hidden; transition:transform .2s, box-shadow .2s; }
.vessel-card:hover { transform:translateY(-4px); box-shadow:0 12px 30px rgba(0,0,0,.12); }
.vessel-card-img-wrap { position:relative; height:180px; overflow:hidden; }
.vessel-card-img { width:100%; height:100%; object-fit:cover; }
.vessel-card-no-img { display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#1e40af,#2563eb); color:rgba(255,255,255,.5); }
.vessel-card-badge { position:absolute; top:.75rem; right:.75rem; padding:.25rem .6rem; border-radius:50px; font-size:.75rem; font-weight:600; }
.vessel-card-body { padding:1.25rem; }
.vessel-card-name { font-size:1.1rem; font-weight:700; margin-bottom:.25rem; }
.vessel-card-type { font-size:.82rem; color:var(--text-muted); margin-bottom:.25rem; }
.vessel-card-imo  { font-size:.78rem; color:var(--text-muted); margin-bottom:.75rem; font-family:monospace; }
.vessel-card-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:.5rem; background:var(--bg-secondary); border-radius:var(--radius); padding:.65rem; margin-bottom:1rem; text-align:center; }
.vc-stat strong { display:block; font-size:1.25rem; font-weight:700; }
.vc-stat span { font-size:.72rem; color:var(--text-muted); text-transform:uppercase; }
.vc-stat-danger strong { color:#ef4444; }
.vc-stat-warning strong { color:#f59e0b; }
.vessel-card-actions { display:flex; gap:.4rem; flex-wrap:wrap; }
.vessel-card-actions .btn { flex:1; min-width:40px; justify-content:center; }

/* ─── Vessel Detail Image ────────────────────────────────────────────── */
.vessel-detail-top { display:grid; grid-template-columns:350px 1fr; gap:1.5rem; margin-bottom:1.5rem; }
@media(max-width:900px){ .vessel-detail-top{ grid-template-columns:1fr; } }
.vessel-image-card { overflow:hidden; }
.vessel-detail-img { width:100%; max-height:260px; object-fit:cover; display:block; }
.vessel-no-image { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:200px; color:var(--text-muted); background:var(--bg-secondary); padding:2rem; }

/* ─── Image Upload Area ──────────────────────────────────────────────── */
.image-upload-area { border:2px dashed var(--border-color); border-radius:var(--radius-lg); padding:2rem; text-align:center; background:var(--bg-secondary); transition:border-color .2s; }
.image-upload-area:hover { border-color:var(--primary); }

/* ─── Photo Gallery ──────────────────────────────────────────────────── */
.photo-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:1rem; }
.photo-thumb { border-radius:var(--radius); overflow:hidden; border:1px solid var(--border-color); }
.photo-thumb img { width:100%; height:130px; object-fit:cover; display:block; }
.photo-thumb small { display:block; padding:.35rem .5rem; font-size:.75rem; color:var(--text-muted); text-overflow:ellipsis; overflow:hidden; white-space:nowrap; }

/* ─── Multi-image preview ────────────────────────────────────────────── */
.image-preview-grid { display:flex; gap:.75rem; flex-wrap:wrap; }
.preview-thumb { width:100px; text-align:center; }
.preview-thumb img { width:100px; height:80px; object-fit:cover; border-radius:var(--radius); border:1px solid var(--border-color); display:block; }
.preview-thumb small { font-size:.7rem; color:var(--text-muted); display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ─── Misc helpers ────────────────────────────────────────────────────── */
.d-flex { display:flex; }
.gap-1 { gap:.35rem; }
.gap-2 { gap:.5rem; }
.flex-wrap { flex-wrap:wrap; }
.mb-2 { margin-bottom:.5rem; }

/* ─── Vessel detail stats-grid-4 ────────────────────────────────────── */
.mb-4 { margin-bottom:1.5rem; }
