/* ===================================================================
   SPECIAL PROJECT SYSTEM (SPS) — Full Design System
   Naval Civil Works CSR / External Project Management Suite
   Categories: Religious | Clean Sri Lanka | Housing | Miscellaneous
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === ROOT DESIGN TOKENS === */
:root {
  /* Base Colors */
  --bg-app: #080e1c;
  --bg-card: #0f1829;
  --bg-card-alt: #131f33;
  --bg-surface: #1a2540;
  --bg-input: #0f1829;
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.05);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Category Color System */
  --religious: #f59e0b;       /* Amber Gold */
  --religious-bg: rgba(245,158,11,0.1);
  --religious-border: rgba(245,158,11,0.3);

  --csl: #10b981;             /* Emerald Green */
  --csl-bg: rgba(16,185,129,0.1);
  --csl-border: rgba(16,185,129,0.3);

  --housing: #3b82f6;         /* Royal Blue */
  --housing-bg: rgba(59,130,246,0.1);
  --housing-border: rgba(59,130,246,0.3);

  --misc: #8b5cf6;            /* Purple */
  --misc-bg: rgba(139,92,246,0.1);
  --misc-border: rgba(139,92,246,0.3);

  /* Status Colors */
  --status-active: #22c55e;
  --status-hold: #f59e0b;
  --status-completed: #64748b;
  --status-critical: #ef4444;

  /* UI Accents */
  --accent: #38bdf8;
  --accent-glow: rgba(56,189,248,0.2);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Gradients */
  --grad-header: linear-gradient(135deg, #0f1829 0%, #1a2540 100%);
  --grad-card: linear-gradient(145deg, #0f1829, #131f33);
  --grad-religious: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05));
  --grad-csl: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05));
  --grad-housing: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05));
  --grad-misc: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05));

  /* Layout */
  --sidebar-w: 265px;
  --header-h: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  display: flex;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-surface); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* === APP LAYOUT === */
#app { display: flex; width: 100vw; height: 100vh; overflow: hidden; }

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 200;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 900; color: #fff;
  box-shadow: 0 4px 14px rgba(56,189,248,0.35);
  flex-shrink: 0;
}

.brand-info h1 { font-size: 0.95rem; font-weight: 800; line-height: 1.2; }
.brand-info span { font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.nav-section { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); padding: 12px 10px 5px; font-weight: 700; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; border: none; background: none; width: 100%; text-align: left;
}
.nav-link i { width: 18px; text-align: center; font-size: 1rem; }
.nav-link:hover { background: var(--bg-surface); color: var(--text-primary); }
.nav-link.active { background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(79,70,229,0.15)); color: var(--accent); font-weight: 600; }
.nav-link.active i { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  padding: 2px 7px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 700;
}
.nb-gold { background: rgba(245,158,11,0.2); color: var(--religious); }
.nb-green { background: rgba(16,185,129,0.2); color: var(--csl); }
.nb-blue { background: rgba(59,130,246,0.2); color: var(--housing); }
.nb-purple { background: rgba(139,92,246,0.2); color: var(--misc); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.fb-status {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-status-row { display: flex; align-items: center; justify-content: space-between; }
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
  display: inline-block; margin-right: 6px;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(1.4)} }

/* === MAIN CONTENT === */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* === TOP HEADER === */
.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.page-breadcrumb span { color: var(--text-secondary); }
#page-title { font-size: 1.2rem; font-weight: 800; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.search-wrap { position: relative; }
.search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 0.85rem; }
#global-search {
  width: 240px; padding: 8px 12px 8px 34px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text-primary); font-size: 0.85rem;
}
#global-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border: none; transition: var(--transition);
  font-family: var(--font);
}
.btn-primary { background: linear-gradient(135deg, #0284c7, #4f46e5); color: #fff; box-shadow: 0 4px 12px rgba(56,189,248,0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(56,189,248,0.4); }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-alt); border-color: var(--text-muted); }
.btn-success { background: var(--success); color: #070d19; }
.btn-warning { background: var(--warning); color: #070d19; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* === CONTENT AREA === */
.content { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 20px; }

/* === VIEWS === */
.view { display: none; flex-direction: column; gap: 20px; }
.view.active { display: flex; }

/* === KPI CARDS === */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.kpi-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: flex-start; justify-content: space-between;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
}
.kpi-card.kpi-green::after { background: var(--success); }
.kpi-card.kpi-gold::after { background: var(--religious); }
.kpi-card.kpi-purple::after { background: var(--misc); }
.kpi-card.kpi-red::after { background: var(--danger); }

.kpi-text label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-muted); font-weight: 700; }
.kpi-val { font-size: 1.7rem; font-weight: 900; font-family: var(--mono); line-height: 1.1; }
.kpi-sub { font-size: 0.73rem; color: var(--text-muted); margin-top: 3px; }
.kpi-icon { font-size: 1.3rem; opacity: 0.6; }

/* === CATEGORY TABS === */
.cat-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
}
.cat-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  color: var(--text-secondary); background: transparent;
  transition: var(--transition); font-family: var(--font);
}
.cat-tab i { font-size: 0.9rem; }
.cat-tab .count {
  background: rgba(255,255,255,0.1);
  padding: 1px 8px; border-radius: 10px;
  font-size: 0.72rem;
}
.cat-tab.all.active, .cat-tab.all:hover { background: rgba(56,189,248,0.15); color: var(--accent); border-color: rgba(56,189,248,0.3); }
.cat-tab.religious.active, .cat-tab.religious:hover { background: var(--religious-bg); color: var(--religious); border-color: var(--religious-border); }
.cat-tab.csl.active, .cat-tab.csl:hover { background: var(--csl-bg); color: var(--csl); border-color: var(--csl-border); }
.cat-tab.housing.active, .cat-tab.housing:hover { background: var(--housing-bg); color: var(--housing); border-color: var(--housing-border); }
.cat-tab.misc.active, .cat-tab.misc:hover { background: var(--misc-bg); color: var(--misc); border-color: var(--misc-border); }

/* === PROJECT CARDS GRID === */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

.project-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card.inactive-card { opacity: 0.55; }

.card-top-strip {
  height: 4px;
  width: 100%;
}
.strip-religious { background: var(--religious); }
.strip-csl { background: var(--csl); }
.strip-housing { background: var(--housing); }
.strip-misc { background: var(--misc); }

.card-body { padding: 16px 18px; }

.card-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.card-title-block { flex: 1; }
.card-code { font-size: 0.7rem; font-family: var(--mono); color: var(--text-muted); margin-bottom: 3px; }
.card-title { font-size: 0.92rem; font-weight: 700; line-height: 1.3; }
.card-loc { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }
.card-loc i { margin-right: 4px; }

.status-badge {
  padding: 3px 10px; border-radius: 12px;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  flex-shrink: 0; margin-left: 8px;
}
.status-active { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.status-hold { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.status-completed { background: rgba(100,116,139,0.15); color: var(--text-muted); border: 1px solid rgba(100,116,139,0.3); }

/* Progress Ring */
.card-progress-row { display: flex; align-items: center; gap: 14px; margin: 12px 0; }

.progress-ring-wrap { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.progress-ring-wrap svg { transform: rotate(-90deg); }
.progress-ring-bg { fill: none; stroke: var(--bg-surface); stroke-width: 4; }
.progress-ring-fill { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-religious { stroke: var(--religious); }
.ring-csl { stroke: var(--csl); }
.ring-housing { stroke: var(--housing); }
.ring-misc { stroke: var(--misc); }
.ring-pct {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 0.78rem; font-weight: 800; font-family: var(--mono);
}

.progress-details { flex: 1; }
.progress-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.progress-bar-wrap { background: var(--bg-surface); border-radius: 4px; height: 6px; overflow: hidden; margin-bottom: 6px; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }
.fill-religious { background: var(--religious); }
.fill-csl { background: var(--csl); }
.fill-housing { background: var(--housing); }
.fill-misc { background: var(--misc); }
.progress-dates { font-size: 0.72rem; color: var(--text-muted); }
.progress-dates strong { color: var(--text-secondary); }

/* Trade Badges */
.trade-row { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0; }
.trade-chip {
  padding: 2px 8px; border-radius: 8px; font-size: 0.7rem; font-weight: 700;
  background: var(--bg-surface); color: var(--text-secondary);
}
.trade-chip span { color: var(--accent); }

/* Card Footer Metrics */
.card-footer-metrics {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; margin-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.76rem;
}
.metric-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.metric-val { font-family: var(--mono); font-weight: 700; font-size: 0.85rem; }
.metric-lbl { color: var(--text-dim); font-size: 0.68rem; }
.mat-ok { color: var(--success); }
.mat-low { color: var(--warning); }
.mat-critical { color: var(--danger); }

/* === SECTION HEADERS === */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.section-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--accent); }
.section-divider { height: 1px; background: var(--border); margin: 4px 0 14px; }

/* === GLASS PANEL === */
.panel {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.02);
}
.panel-title { font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.panel-title i { color: var(--accent); }
.panel-body { padding: 18px; }

/* === INACTIVE BANNER === */
.inactive-banner {
  padding: 10px 16px;
  background: rgba(100,116,139,0.08);
  border: 1px dashed rgba(100,116,139,0.3);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.inactive-banner i { color: var(--text-dim); }

/* === MODALS === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 92%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: modalIn 0.28s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes modalIn { from{opacity:0;transform:scale(0.9) translateY(10px)} to{opacity:1;transform:scale(1) translateY(0)} }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-card); z-index: 5;
}
.modal-header h2 { font-size: 1.15rem; font-weight: 800; }
.modal-close { background: var(--bg-surface); border: none; color: var(--text-secondary); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--danger); color: #fff; }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.modal-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.modal-tab {
  padding: 8px 14px; font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  transition: var(--transition); background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--font); display: inline-flex; align-items: center; gap: 6px;
}
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.modal-tab .tab-badge {
  background: rgba(56,189,248,0.18); color: var(--accent);
  padding: 1px 7px; border-radius: 10px; font-size: 0.7rem; font-family: var(--mono); font-weight: 700;
}
.modal-tab-pane { display: none; }
.modal-tab-pane.active { display: block; }

/* === FORMS === */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.form-control {
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font);
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* === TABLES === */
.sps-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.sps-table th {
  background: var(--bg-surface);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.sps-table td { padding: 11px 14px; border-bottom: 1px solid var(--border-light); color: var(--text-primary); }
.sps-table tr:hover td { background: rgba(255,255,255,0.015); }
.sps-table .mono { font-family: var(--mono); }

/* === SAILOR CALENDAR === */
.cal-container { display: flex; flex-direction: column; gap: 6px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-primary); width: 30px; height: 30px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day-name { text-align: center; font-size: 0.65rem; font-weight: 700; color: var(--text-dim); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 500;
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.today { border: 1px solid var(--accent); }
.cal-day.attached-religious { background: rgba(245,158,11,0.25); color: var(--religious); }
.cal-day.attached-csl { background: rgba(16,185,129,0.25); color: var(--csl); }
.cal-day.attached-housing { background: rgba(59,130,246,0.25); color: var(--housing); }
.cal-day.attached-misc { background: rgba(139,92,246,0.25); color: var(--misc); }

.cal-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; }
.dot-religious { background: var(--religious); }
.dot-csl { background: var(--csl); }
.dot-housing { background: var(--housing); }
.dot-misc { background: var(--misc); }

/* === LABOUR CARDS === */
.sailor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.sailor-card:hover { border-color: var(--accent); background: var(--bg-card-alt); }
.sailor-card.active-att { border-left: 3px solid var(--success); }
.sailor-card.inactive-att { border-left: 3px solid var(--text-dim); opacity: 0.7; }

.sailor-avatar {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1a2540, #0f1829);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.sailor-info { flex: 1; min-width: 0; }
.sailor-name { font-weight: 700; font-size: 0.88rem; }
.sailor-sub { font-size: 0.75rem; color: var(--text-muted); }
.sailor-proj { font-size: 0.73rem; color: var(--accent); margin-top: 2px; font-weight: 600; }

.sailor-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sailor-days { font-family: var(--mono); font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.sailor-days-lbl { font-size: 0.68rem; color: var(--text-dim); }

.sailors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

/* === TOAST === */
#toasts {
  position: fixed; bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease;
  max-width: 360px;
}
.toast.t-success { border-left-color: var(--success); }
.toast.t-warning { border-left-color: var(--warning); }
.toast.t-error { border-left-color: var(--danger); }
@keyframes toastIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; opacity: 0.3; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 0.9rem; }

/* === BULK UPLOAD DROP ZONE === */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.drop-zone i { font-size: 2rem; margin-bottom: 10px; display: block; }
.drop-zone p { font-size: 0.85rem; }
.drop-zone small { font-size: 0.75rem; opacity: 0.7; }

/* === DOCUMENT REF ITEMS === */
.doc-ref {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.doc-ref i { font-size: 1.2rem; color: var(--accent); flex-shrink: 0; }
.doc-ref-info { flex: 1; }
.doc-ref-type { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); font-weight: 700; }
.doc-ref-num { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.doc-ref-auth { font-size: 0.78rem; color: var(--text-muted); }

/* === HEADCOUNT DAY GRID === */
.headcount-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.headcount-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.hc-count { font-size: 1.8rem; font-weight: 900; font-family: var(--mono); }
.hc-project { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .project-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   SLN PROJECT PLATFORM — NAVAL PROJECTS & PROCUREMENT STYLING
   =================================================================== */

:root {
  --vote-2104: #06b6d4;
  --vote-2001: #f59e0b;
  --vote-2506: #10b981;
  --vote-1303: #8b5cf6;
  --vote-non:  #ec4899;
  --vote-2103: #3b82f6;
}

/* Banner */
.naval-header-banner {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(15, 24, 41, 0.95) 50%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
}
.naval-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.naval-header-content h2 {
  font-size: 1.55rem;
  font-weight: 900;
  color: #f8fafc;
  margin-bottom: 4px;
}
.naval-header-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.naval-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Pipeline Summary Strip */
.procurement-pipeline-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.pipeline-step-pill {
  flex: 1;
  min-width: 170px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.pipeline-step-pill:hover {
  background: var(--bg-surface);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.pip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pip-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.pip-count {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--mono);
  margin-left: auto;
}

/* Sub-nav Tabs & Toolbar */
.naval-subnav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.naval-tabs {
  display: flex;
  gap: 8px;
}
.naval-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.naval-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.naval-tab.active {
  background: var(--bg-surface);
  color: var(--accent);
  border-color: var(--border);
  font-weight: 700;
}
.badge-count {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
}
.naval-tab.active .badge-count {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}
.naval-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-input-wrap {
  position: relative;
  min-width: 280px;
}
.search-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.search-input-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 0.84rem;
  outline: none;
  transition: var(--transition);
}
.search-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.view-toggle-btns {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

/* Vote & Position Pills */
.vote-pills-bar, .pos-pills-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vote-pill, .pos-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.vote-pill:hover, .pos-pill:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.vote-pill.active, .pos-pill.active {
  background: var(--accent);
  color: #080e1c;
  border-color: var(--accent);
  font-weight: 800;
}
.pill-count {
  font-size: 0.68rem;
  background: rgba(0,0,0,0.25);
  padding: 1px 6px;
  border-radius: 10px;
}
.vote-pill.active .pill-count, .pos-pill.active .pill-count {
  background: rgba(0,0,0,0.2);
  color: #080e1c;
}

/* Badges */
.vote-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--mono);
}
.vote-generic {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.code-badge {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}
.pr-badge {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}

/* Position Badges */
.position-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pos-processing {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.pos-approval {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.pos-order {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.pos-dispatched {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.pos-received {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Naval Project Card Grid */
.naval-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.naval-project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.naval-project-card:hover {
  background: var(--bg-card-alt);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.npc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.npc-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}
.npc-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.npc-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.npc-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.npc-meta-item i {
  color: var(--accent);
  width: 14px;
  text-align: center;
}

/* Financial Burn-down Bar inside Card */
.npc-financials {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.npc-fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.npc-fin-bars {
  height: 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  margin-bottom: 6px;
}
.bar-spent {
  background: #3b82f6;
  height: 100%;
}
.bar-committed {
  background: #f59e0b;
  height: 100%;
}
.npc-fin-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.npc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-top: auto;
}
.npc-procurement-tag {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.npc-procurement-tag i { color: #ec4899; }
.npc-progress-badge {
  font-size: 0.75rem;
  font-weight: 800;
  font-family: var(--mono);
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 2px 7px;
  border-radius: 12px;
}

/* Naval Data Table */
.naval-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.naval-data-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.naval-data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.naval-data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}
.table-proj-title {
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
}
.table-proj-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.table-actions {
  display: flex;
  gap: 6px;
}
.item-name-text {
  font-weight: 600;
  color: #f1f5f9;
}
.item-code-text {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.supplier-pill {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Vote Budget Matrix Cards */
.vote-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}
.vote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.vc-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}
.vc-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.vc-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
}
.vc-metric label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}
.vc-metric .val {
  font-size: 0.95rem;
  margin-top: 2px;
}
.vc-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vc-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-secondary);
}
.vc-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.bar-fill-spent {
  background: #3b82f6;
  height: 100%;
}
.bar-fill-comm {
  background: #f59e0b;
  height: 100%;
}
.vc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Modal Inside KPIs */
.project-modal-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}
.pm-kpi label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  display: block;
}
.pm-kpi .val {
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 3px;
}
@media (max-width: 768px) {
  .project-modal-kpis { grid-template-columns: 1fr 1fr; }
}

.badge-button {
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.badge-button:hover {
  background: rgba(236, 72, 153, 0.22);
}
.mini-progress-bar {
  width: 55px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.mini-progress-fill {
  background: var(--status-active);
  height: 100%;
}
.procurement-toolbar-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.procurement-summary-chip {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================================================================
   CMSYS PROJECT — UI BANNER, EMBLEM & OFFICERS DIRECTORY STYLES
   =================================================================== */

/* Sidebar Emblem & Branding */
.brand-emblem-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.45);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.brand-emblem-img:hover {
  transform: scale(1.05) rotate(3deg);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.65rem;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  display: block;
}

/* Topbar System Banner */
.system-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, rgba(15, 24, 41, 0.85) 0%, rgba(26, 37, 64, 0.65) 100%);
  padding: 6px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.system-banner-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.banner-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, transparent, rgba(56, 189, 248, 0.4), transparent);
}

.banner-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.banner-project-pill {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #38bdf8;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.banner-project-pill::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.banner-current-view {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

/* Sync Controls & Button */
.btn-sync {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sync:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(16, 185, 129, 0.25));
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}
.btn-sync.spinning i {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Officer Profile Topbar Pill */
.officer-topbar-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 24px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.officer-topbar-pill:hover {
  border-color: var(--accent);
  background: rgba(26, 37, 64, 0.9);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}
.officer-topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Officer Profiles Grid & Cards */
.officer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.officer-card {
  background: linear-gradient(145deg, #0f1829 0%, #152238 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.officer-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.15);
}
.officer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #f59e0b, #38bdf8);
}

.officer-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.officer-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0369a1, #1e3a8a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.officer-card-info {
  flex: 1;
  min-width: 0;
}

.officer-card-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.officer-card-appointment {
  font-size: 0.78rem;
  color: #38bdf8;
  font-weight: 600;
  margin-top: 1px;
}

.officer-card-svc {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.officer-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.officer-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.officer-tag.rank {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}
.officer-tag.role {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.officer-details-table {
  width: 100%;
  font-size: 0.76rem;
  border-collapse: collapse;
}
.officer-details-table td {
  padding: 4px 0;
  color: var(--text-muted);
}
.officer-details-table td:last-child {
  color: var(--text-secondary);
  text-align: right;
  font-weight: 500;
}

.officer-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
  margin-top: auto;
}

/* Officer Login Modal Dialog */
.login-dialog-box {
  background: linear-gradient(145deg, #0a1322 0%, #111d33 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  padding: 30px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  position: relative;
}

.officer-card.officer-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), 0 8px 30px rgba(0, 0, 0, 0.6);
}
.officer-card.officer-card-active::before {
  background: linear-gradient(to bottom, #f59e0b, #10b981);
  width: 6px;
}

.btn-sync.syncing i {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}



/* ==========================================================================
   ENHANCED CMSYS LABOUR, CALENDAR & PROFILE SUITE (V6.0)
   Requirements:
   1. Calendar Deployment, Leave, Sick, Others & Highlighted V/Out / Out Projects
   2. Full CMSys Main Sailor Profile Modal
   3. Sailor ID Photos with Click-to-Enlarge Lightbox
   4. Comprehensive Sortable Master Personnel Register Table
   ========================================================================== */

/* ── 1. Calendar Day Badges & Highlighted Victualing Out ── */
.cal-day {
  min-height: 48px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.cal-day:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 2;
  border-color: rgba(56, 189, 248, 0.5);
}
.cal-day-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1;
}
.cal-day.today .cal-day-num {
  color: #38bdf8;
  font-weight: 900;
}
.cal-day.today {
  border: 1px solid #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
}

/* Event Days Styling */
.cal-day.day-vout {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.1)) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.15);
}
.cal-day.day-vout:hover {
  border-color: #f59e0b !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4), inset 0 0 12px rgba(245, 158, 11, 0.25) !important;
}
.cal-day.day-vin {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
}
.cal-day.day-leave {
  background: rgba(251, 191, 36, 0.12) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
}
.cal-day.day-sick {
  background: rgba(244, 63, 94, 0.15) !important;
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
}
.cal-day.day-other {
  background: rgba(168, 85, 247, 0.12) !important;
  border: 1px solid rgba(168, 85, 247, 0.35) !important;
}

/* Day Badges */
.cal-day-badges {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
}
.cbadge {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 4px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cbadge-vout {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 900;
  letter-spacing: 0.2px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.cbadge-vin {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.cbadge-leave {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.cbadge-sick {
  background: rgba(244, 63, 94, 0.25);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.45);
}
.cbadge-other {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* ── 2. Sailor Avatar Photos & Card Enhancements ── */
.sailor-avatar {
  position: relative;
  width: 48px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #0f172a;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.sailor-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.sailor-card:hover .sailor-avatar-img {
  transform: scale(1.06);
}
.sailor-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
  background: #1e293b;
  text-transform: uppercase;
}
.sailor-vic-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 12px;
}
.vic-badge-out {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
}
.vic-badge-in {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ── 3. View Switcher Toggle Bar ── */
.labour-view-switcher {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px;
  margin-bottom: 14px;
}
.view-switch-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.view-switch-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.view-switch-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(79, 70, 229, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── 4. Master Personnel Register Table & KPI Bar ── */
.personnel-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pkpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pkpi-num {
  font-size: 1.4rem;
  font-weight: 900;
  font-family: var(--mono);
  line-height: 1.1;
}
.pkpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.personnel-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.personnel-filter-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-surface);
}
.personnel-table-wrapper {
  overflow-x: auto;
  max-height: 640px;
}
.personnel-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  text-align: left;
}
.personnel-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0b1322;
}
.personnel-table th {
  padding: 12px 14px;
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.personnel-table th.th-sortable {
  cursor: pointer;
}
.personnel-table th.th-sortable:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}
.personnel-table th.th-sorted {
  color: #38bdf8;
}
.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
}
.personnel-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: var(--text-primary);
}
.personnel-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}
.pt-avatar {
  width: 38px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.pt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vout-highlight-cell {
  background: rgba(245, 158, 11, 0.08) !important;
  color: #f59e0b !important;
  font-weight: 800;
  font-family: var(--mono);
}

/* ── 5. CMSys Main Sailor Profile Modal ── */
#sailor-profile-modal-overlay.open,
#sailor-lightbox-modal-overlay.open {
  display: flex;
}
.cmsys-prof-dialog {
  background: #0d1527;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 18px;
  width: 100%;
  max-width: 960px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 35px rgba(56, 189, 248, 0.15);
  animation: modalIn 0.28s cubic-bezier(0.175,0.885,0.32,1.275);
}
.cmsys-prof-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.cmsys-prof-photo-box {
  width: 80px;
  height: 96px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  background: #0b1322;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.cmsys-prof-photo-box:hover {
  transform: scale(1.05);
}
.cmsys-prof-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cmsys-prof-photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  transition: opacity 0.2s ease;
}
.cmsys-prof-photo-box:hover .cmsys-prof-photo-overlay {
  opacity: 1;
}

.cmsys-prof-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background: #080e1b;
}
@media (max-width: 820px) {
  .cmsys-prof-body { grid-template-columns: 1fr; }
}

.prof-panel {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.prof-panel-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.prof-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
}
.prof-lbl {
  color: #64748b;
  font-weight: 600;
}
.prof-val {
  font-weight: 700;
  color: #f1f5f9;
  text-align: right;
}

/* ── 6. Photo Lightbox Modal ── */
.lightbox-dialog {
  background: #0b1322;
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 18px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(56, 189, 248, 0.25);
  position: relative;
  animation: modalIn 0.25s ease;
}
.lightbox-img {
  max-height: 65vh;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── 7. Settings Navigation Tabs ── */
.settings-nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.settings-tab-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}
.settings-tab-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.08));
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}
.settings-tab-btn .badge-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent);
  font-weight: 800;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

