/* ============================================================
   STEINWEG PDS — LIGHT CORPORATE THEME
   ============================================================ */

/* --- Google Font --- */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  --steinweg-teal:      #006B7F;
  --steinweg-dark-navy: #003F59;
  --steinweg-gold:      #D9AA27;
  --background:         #FFFFFF;
  --background-alt:     #F2F6F9;
  --surface:            #FFFFFF;
  --border:             #E2E8F0;
  --text-primary:       #1E293B;
  --text-secondary:     #5A5C65;
  --success:            #16A34A;
  --warning:            #D97706;
  --danger:             #DC2626;

  --sidebar-width:      240px;
  --topbar-height:      56px;
  --radius:             8px;
  --radius-lg:          12px;
  --shadow-sm:          0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:          0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg:          0 10px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.07);
  --transition:         0.18s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--background-alt);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--steinweg-dark-navy);
  color: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform var(--transition);
  box-shadow: 1px 0 4px rgba(0,0,0,0.04);
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

.sidebar-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-system-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
  transition: color var(--transition), background var(--transition);
}
.back-link:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.08); }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item svg { opacity: 0.7; flex-shrink: 0; }
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: #fff; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--steinweg-teal);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 150;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-secondary);
}
.menu-toggle:hover { background: var(--background-alt); color: var(--text-primary); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
}
.breadcrumb-system {
  font-weight: 700;
  color: var(--steinweg-teal);
  letter-spacing: 0.04em;
}
.breadcrumb svg { color: var(--border); }
.breadcrumb-page {
  font-weight: 500;
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 3px 8px;
  border-radius: 20px;
}
.badge-dot {
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.topbar-icon-btn {
  position: relative;
  padding: 7px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.topbar-icon-btn:hover { background: var(--background-alt); color: var(--text-primary); }
.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid white;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 24px;
  background: var(--background-alt);
}

.page-header {
  margin-bottom: 24px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--steinweg-teal);
  letter-spacing: 0.01em;
}
.card-body { padding: 20px; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--steinweg-teal);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-card.danger { border-left-color: var(--danger); }
.kpi-card.success { border-left-color: var(--success); }
.kpi-card.gold { border-left-color: var(--steinweg-gold); }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 500;
}
.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.kpi-change.up { color: var(--success); background: #F0FDF4; }
.kpi-change.down { color: var(--danger); background: #FEF2F2; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--steinweg-teal);
  color: white;
  border: 1px solid var(--steinweg-teal);
}
.btn-primary:hover {
  background: var(--steinweg-dark-navy);
  border-color: var(--steinweg-dark-navy);
  box-shadow: 0 2px 8px rgba(0,107,127,0.25);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--background-alt);
  box-shadow: var(--shadow-sm);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 7px 12px;
}
.btn-ghost:hover { background: var(--background-alt); color: var(--text-primary); }
.btn-danger {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ============================================================
   DATE NAVIGATOR
   ============================================================ */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.date-nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-nav-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 4px;
  min-width: 210px;
  text-align: center;
}
.date-nav-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}
.date-nav-btn:hover { background: var(--background-alt); color: var(--steinweg-teal); }
.date-nav-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================
   PLANNING CARDS
   ============================================================ */
.planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--steinweg-teal);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
  cursor: pointer;
}
.plan-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.plan-card.status-progress { border-top-color: var(--steinweg-gold); }
.plan-card.status-completed { border-top-color: var(--success); }
.plan-card.status-delayed { border-top-color: var(--danger); }

.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
}
.plan-shift {
  display: flex;
  align-items: center;
  gap: 7px;
}
.shift-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.shift-badge.day { background: #FEF3C7; color: #92400E; }
.shift-badge.night { background: #EDE9FE; color: #5B21B6; }

.plan-vessel {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-card-body { padding: 8px 16px 14px; }
.plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  gap: 8px;
}
.plan-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.plan-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}

.plan-card-footer {
  padding: 10px 16px;
  background: var(--background-alt);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-badge.scheduled  { color: var(--steinweg-teal);       background: #E6F3F6; }
.status-badge.in-progress{ color: #92400E;                     background: #FEF3C7; }
.status-badge.completed  { color: var(--success);              background: #F0FDF4; }
.status-badge.delayed    { color: var(--danger);               background: #FEF2F2; }
.status-badge.active     { color: var(--success);              background: #F0FDF4; }
.status-badge.maintenance{ color: var(--warning);              background: #FFF7ED; }
.status-badge.idle       { color: var(--text-secondary);       background: var(--background-alt); }
.status-badge.offline    { color: var(--danger);               background: #FEF2F2; }
.status-badge.berth      { color: var(--steinweg-teal);        background: #E6F3F6; }
.status-badge.loading    { color: var(--steinweg-gold);        background: #FEF9EC; }
.status-badge.discharging{ color: #7C3AED;                     background: #EDE9FE; }
.status-badge.departed   { color: var(--text-secondary);       background: var(--background-alt); }
.status-badge.leave      { color: var(--warning);              background: #FFF7ED; }

/* ============================================================
   CHARTS SECTION
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-container {
  position: relative;
  height: 240px;
}
.chart-container canvas { max-height: 240px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: var(--background-alt);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #F8FBFD; }

.td-name { font-weight: 600; }
.td-id { color: var(--text-secondary); font-size: 12px; font-family: 'Courier New', monospace; }

/* ============================================================
   ROW ACTION BUTTONS
   ============================================================ */
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-btn {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
}
.row-btn:hover { background: var(--background-alt); color: var(--text-primary); }
.row-btn.danger:hover { background: #FEF2F2; color: var(--danger); border-color: #FECACA; }

/* ============================================================
   SKILL BADGES
   ============================================================ */
.skill-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #EAF4F7;
  color: var(--steinweg-teal);
  border: 1px solid #B3D9E2;
  margin: 1px 2px;
  white-space: nowrap;
}
.skill-badge.gold { background: #FEF9EC; color: #92400E; border-color: #F9E4A6; }
.skill-badge.green { background: #F0FDF4; color: var(--success); border-color: #BBF7D0; }
.skill-badge.purple { background: #EDE9FE; color: #5B21B6; border-color: #DDD6FE; }
.skill-badge.red { background: #FEF2F2; color: var(--danger); border-color: #FECACA; }

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 10px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--steinweg-teal);
  box-shadow: 0 0 0 3px rgba(0,107,127,0.1);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition);
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: var(--steinweg-teal);
}

/* ============================================================
   EQUIPMENT CARDS
   ============================================================ */
.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.equip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}
.equip-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.equip-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: #EAF4F7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
}

.equip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.equip-type {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.equip-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   VESSELS
   ============================================================ */
.vessel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.vessel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.vessel-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.vessel-header {
  background: var(--steinweg-dark-navy);
  padding: 16px 18px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vessel-name {
  font-size: 15px;
  font-weight: 700;
}
.vessel-flag {
  font-size: 22px;
}
.vessel-body { padding: 16px 18px; }
.vessel-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.vessel-meta-item {}
.vm-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}
.vm-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.vessel-progress {
  margin-top: 4px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.progress-bar {
  height: 7px;
  background: var(--background-alt);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--steinweg-teal);
  transition: width 0.6s ease;
}
.progress-fill.gold { background: var(--steinweg-gold); }
.progress-fill.success { background: var(--success); }

/* ============================================================
   GANG CARDS
   ============================================================ */
.gang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.gang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.gang-card:hover { box-shadow: var(--shadow-md); }

.gang-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--steinweg-teal), var(--steinweg-dark-navy));
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gang-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.gang-count {
  font-size: 12px;
  opacity: 0.85;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 20px;
}
.gang-body { padding: 14px 18px; }
.gang-foreman {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.gang-foreman-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.gang-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
.gang-member {
  font-size: 11.5px;
  padding: 3px 8px;
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-weight: 500;
}
.gang-footer {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.gang-stat { text-align: center; flex: 1; }
.gang-stat-val { font-size: 18px; font-weight: 700; color: var(--steinweg-teal); }
.gang-stat-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.gang-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

/* ============================================================
   SKILLS MATRIX
   ============================================================ */
.skills-matrix-table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
}
.skills-matrix-table {
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 600px;
  width: 100%;
}
.skills-matrix-table th {
  background: var(--steinweg-dark-navy);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.skills-matrix-table th:first-child { border-radius: var(--radius) 0 0 0; }
.skills-matrix-table th:last-child { border-radius: 0 var(--radius) 0 0; }
.skills-matrix-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.skills-matrix-table tr:last-child td { border-bottom: none; }
.skills-matrix-table tr:hover td { background: #F8FBFD; }
.skills-matrix-table tr:nth-child(even) td { background: var(--background-alt); }
.skills-matrix-table tr:nth-child(even):hover td { background: #F0F8FB; }

.skill-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  cursor: pointer;
}
.skill-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}
.skill-dot:hover { transform: scale(1.25); }
.skill-dot.filled { background: var(--steinweg-teal); border-color: var(--steinweg-teal); }
.skill-dot.level-1.filled,
.skill-dot.level-2.filled { background: var(--danger); border-color: var(--danger); }
.skill-dot.level-3.filled { background: var(--steinweg-gold); border-color: var(--steinweg-gold); }
.skill-dot.level-4.filled,
.skill-dot.level-5.filled { background: var(--steinweg-teal); border-color: var(--steinweg-teal); }

.skill-level-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: 6px;
  font-weight: 600;
}

/* ============================================================
   REPORTS
   ============================================================ */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.report-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.report-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.report-icon.teal { background: #EAF4F7; }
.report-icon.gold { background: #FEF9EC; }
.report-icon.green { background: #F0FDF4; }
.report-icon.purple { background: #EDE9FE; }

.report-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.report-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.report-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.report-date { font-size: 11px; color: var(--text-secondary); }

/* ============================================================
   DATA MANAGEMENT
   ============================================================ */
.data-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.data-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.data-stat-val { font-size: 24px; font-weight: 700; color: var(--steinweg-teal); }
.data-stat-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ============================================================
   HRMS IMPORT
   ============================================================ */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  background: var(--background-alt);
  margin-bottom: 20px;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.import-zone:hover,
.import-zone.dragover {
  border-color: var(--steinweg-teal);
  background: #F0F8FB;
}
.import-zone-icon { font-size: 40px; margin-bottom: 12px; }
.import-zone-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.import-zone-subtitle { font-size: 13px; color: var(--text-secondary); }

/* Progress bar for HRMS import */
.import-progress-wrap {
  margin: 16px 0;
  display: none;
}
.import-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}
.import-progress-fill {
  height: 100%;
  background: var(--steinweg-teal);
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.setting-item:hover { background: var(--background-alt); }
.setting-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.setting-item:last-child { border-bottom: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.setting-info {}
.setting-label { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.setting-desc { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--steinweg-teal); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================================
   HELP
   ============================================================ */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.help-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.help-icon { font-size: 28px; margin-bottom: 10px; }
.help-title { font-size: 14px; font-weight: 700; color: var(--steinweg-teal); margin-bottom: 6px; }
.help-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   EMPTY / LOADING
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 42px; margin-bottom: 12px; opacity: 0.6; }
.empty-state-text { font-size: 14px; font-weight: 500; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 45, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeOverlay 0.15s ease;
}
@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideModal 0.18s ease;
  overflow: hidden;
}
.modal.modal-lg { max-width: 720px; }
@keyframes slideModal {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  background: none;
  border: none;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.modal-close:hover { background: var(--background-alt); color: var(--text-primary); }

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

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--background-alt);
}
.modal-footer:empty { display: none; }

/* Form elements inside modal */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--steinweg-teal);
  box-shadow: 0 0 0 3px rgba(0,107,127,0.1);
}
.form-textarea { min-height: 90px; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-hint {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Detail view inside modal */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.detail-item {}
.detail-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 3px;
}
.detail-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.detail-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--steinweg-dark-navy);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  pointer-events: none;
  max-width: 340px;
  line-height: 1.4;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .data-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-date { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .data-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   FADE-IN ANIMATION
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content > * {
  animation: fadeInUp 0.25s ease both;
}
