/* Operion Connect — Maritime Management System */
:root {
  --rail-bg:      #0a1421;
  --rail-w:       60px;
  --sidebar-bg:   #0f1e2e;
  --sidebar-w:    240px;
  --total-nav-w:  300px;        /* rail + sidebar */
  --nav-link:     #8ba3bb;
  --nav-hover:    #ffffff;
  --nav-active:   #3b82f6;
  --nav-active-bg:#1e3a5a;
  --topbar-h:     56px;
}

/* Layout */
body { background: #f1f5f9; font-size: .875rem; }
#wrapper { display: flex; min-height: 100vh; }

/* Rail (icon-only left strip) */
#sidebar-rail {
  width: var(--rail-w);
  height: 100vh;
  background: var(--rail-bg);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 101;
  padding: 8px 0;
}
#sidebar-rail .rail-brand {
  width: 38px; height: 38px;
  background: var(--nav-active);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.05rem;
  margin-bottom: 10px;
  flex-shrink: 0;
}
#sidebar-rail .rail-groups {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 0 6px;
  overflow-y: auto;
  min-height: 0;
}
/* slim, subtle scrollbar so users see it when there's overflow */
#sidebar-rail .rail-groups::-webkit-scrollbar { width: 3px; }
#sidebar-rail .rail-groups::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 2px;
}
#sidebar-rail .rail-group {
  width: 100%;
  height: 40px;
  background: transparent;
  color: #6b8aa6;
  border: none;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .95rem;
  transition: background .15s, color .15s;
  padding: 0;
  flex-shrink: 0;
}
#sidebar-rail .rail-group:hover { background: rgba(255,255,255,.06); color: #fff; }
#sidebar-rail .rail-group.active {
  background: var(--nav-active);
  color: #fff;
}

/* Sidebar (panel showing current group's items) */
#sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: var(--rail-w);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform .25s;
}
#sidebar .panel-group { display: none; }
#sidebar .panel-group.shown { display: block; }
#sidebar .panel-header {
  padding: .35rem 1.25rem .6rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #3d5a74;
}
#sidebar .sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
#sidebar .sidebar-brand .brand-icon {
  width: 32px; height: 32px;
  background: var(--nav-active);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  margin-right: .75rem;
  flex-shrink: 0;
}
#sidebar .brand-text { color: #fff; font-weight: 700; font-size: .95rem; letter-spacing: .3px; white-space: nowrap; }

#sidebar .nav-section {
  padding: .5rem 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
/* Slim scrollbar for sidebar */
#sidebar .nav-section::-webkit-scrollbar { width: 6px; }
#sidebar .nav-section::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 3px;
}
#sidebar .nav-section::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
#sidebar .nav-section::-webkit-scrollbar-track { background: transparent; }
#sidebar .nav-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #3d5a74;
  padding: 1rem 1.25rem .35rem;
}
#sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: .5rem 1.25rem;
  color: var(--nav-link);
  font-weight: 500;
  border-radius: 0;
  gap: .6rem;
  transition: color .15s, background .15s;
  position: relative;
}
#sidebar .nav-link i { width: 18px; text-align: center; font-size: .9rem; }
#sidebar .nav-link:hover { color: var(--nav-hover); background: rgba(255,255,255,.06); }
#sidebar .nav-link.active {
  color: #fff;
  background: var(--nav-active-bg);
}
#sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--nav-active);
  border-radius: 0 3px 3px 0;
}
#sidebar .nav-link .badge { margin-left: auto; font-size: .65rem; }
#sidebar .sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  color: #4a6880;
  font-size: .75rem;
  flex-shrink: 0;
}

/* Main content */
#content {
  margin-left: var(--total-nav-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 99;
}
.topbar .topbar-title { font-weight: 600; color: #1e293b; font-size: .95rem; }
.topbar .topbar-breadcrumb { color: #94a3b8; font-size: .8rem; }
.topbar .ms-auto { display: flex; align-items: center; gap: .75rem; }
.topbar .user-avatar {
  width: 32px; height: 32px;
  background: var(--nav-active);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .8rem;
  cursor: pointer;
}

/* Page content */
.page-content { padding: 1.5rem; flex: 1; }

/* Cards */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 10px 10px 0 0 !important;
  padding: .875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-header .card-title {
  font-size: .875rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

/* Stat cards */
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: #1e293b; line-height: 1; }
.stat-card .stat-label { font-size: .75rem; color: #64748b; margin-top: .2rem; }

/* Tables */
.table { font-size: .84rem; }
.table thead th {
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #f8fafc; }
.table td { vertical-align: middle; }
.table a { color: #3b82f6; text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

/* Badges */
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-pending  { background: #fef9c3; color: #854d0e; }
.badge-completed{ background: #dbeafe; color: #1e40af; }

/* Status pills */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.status-dot.active   { background: #10b981; }
.status-dot.inactive { background: #ef4444; }
.status-dot.pending  { background: #f59e0b; }

/* Forms */
.form-label { font-weight: 600; font-size: .8rem; color: #374151; }
.form-control, .form-select {
  font-size: .875rem;
  border-color: #d1d5db;
  border-radius: 6px;
}
.form-control:focus, .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: .4rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

/* Buttons */
.btn-primary { background: #3b82f6; border-color: #3b82f6; }
.btn-primary:hover { background: #2563eb; border-color: #2563eb; }
.btn-sm { font-size: .78rem; }

/* Nav tabs */
.nav-tabs .nav-link { font-size: .82rem; font-weight: 600; color: #64748b; }
.nav-tabs .nav-link.active { color: #3b82f6; border-bottom-color: #3b82f6; }

/* Vessel KPI mini cards */
.vessel-kpi {
  border-radius: 8px;
  padding: .65rem .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  transition: transform .15s, box-shadow .15s;
}
.vessel-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.vessel-kpi i { font-size: 1.15rem; flex-shrink: 0; }
.vessel-kpi-value { font-weight: 700; font-size: 1.15rem; line-height: 1; }
.vessel-kpi-label { font-size: .68rem; opacity: .85; margin-top: .15rem; line-height: 1.2; }

/* Topbar search */
.topbar-search {
  background: #f1f5f9;
  border-radius: 8px;
  padding: .35rem .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: 1.5rem;
  min-width: 320px;
  flex: 0 1 380px;
}
.topbar-search input {
  background: transparent;
  border: none;
  outline: none;
  font-size: .85rem;
  width: 100%;
  color: #1e293b;
}
.topbar-search input::placeholder { color: #94a3b8; }

/* Alert mini cards (dashboard widget) */
.alert-mini {
  border-radius: 8px;
  padding: .65rem .8rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  transition: transform .15s, box-shadow .15s;
}
.alert-mini:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}
.alert-mini i { font-size: 1.2rem; flex-shrink: 0; }
.alert-mini-count { font-weight: 700; font-size: 1.1rem; line-height: 1; }
.alert-mini-label { font-size: .7rem; opacity: .8; margin-top: .15rem; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }

/* Login page */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1e2e 0%, #1e3a5a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  width: 56px; height: 56px;
  background: #3b82f6;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
  margin: 0 auto 1.5rem;
}

/* Responsive: mobile/tablet */
@media (max-width: 768px) {
  #sidebar-rail { display: none; }
  #sidebar { left: 0; transform: translateX(-100%); }
  #sidebar.show { transform: translateX(0); }
  /* On mobile, ALL groups visible (no rail to switch between them) */
  #sidebar .panel-group {
    display: block !important;
    border-top: 1px solid rgba(255,255,255,.05);
  }
  #sidebar .panel-group:first-child { border-top: 0; }
  #sidebar .panel-header { padding-top: 1rem; }
  #content { margin-left: 0; }
}

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