/* ── Navigator Port fonts ────────────────── */
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-Regular.4dac705158fb.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-SemiBold.2836528ad132.ttf") format("truetype");
  font-weight: 600;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-Bold.ac72fe0f27dd.ttf") format("truetype");
  font-weight: 700;
}
@font-face {
  font-family: "Avenir Next";
  src: url("../fonts/AvenirNextW06-Medium.75ed6d762f5c.woff2") format("woff2");
  font-weight: 500;
}
@font-face {
  font-family: "Avenir Next";
  src: url("../fonts/AvenirNextW06-Bold.76cdb77afe03.woff2") format("woff2");
  font-weight: 700;
}
@font-face {
  font-family: "DNV Display";
  src: url("../fonts/dnv-display-regular-webfont.b9bba17b0641.woff") format("woff");
  font-weight: 400;
}
@font-face {
  font-family: "DNV Display";
  src: url("../fonts/dnv-display-medium-webfont.78d8b83d2c59.woff") format("woff");
  font-weight: 500;
}

/* ── CSS custom properties — Navigator Port light theme ── */
:root {
  --bg-base:        #f4f6f9;
  --bg-surface:     #ffffff;
  --bg-elevated:    #f4f6f9;
  --bg-hover:       #e8f4fd;
  --border:         #d1d9e0;
  --border-light:   #eaecf0;
  --text-primary:   #0f204b;
  --text-secondary: #495057;
  --text-muted:     #6c757d;
  --accent-blue:    #0067c5;
  --accent-blue-dk: #0050a0;
  --accent-green:   #00a651;
  --accent-red:     #c4262e;
  --accent-amber:   #f89c25;
  --accent-sky:     #2ab0d4;
  --sidebar-bg:     #0f204b;
  --sidebar-width:  260px;
  --topbar-h:       64px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:      0 8px 30px rgba(0,0,0,0.14);
  --transition:     160ms ease;
}

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

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

body.theme-light {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
}

/* ── Layout ─────────────────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition);
}

.app-main.sidebar-collapsed {
  margin-left: 0;
}

.app-content {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Sidebar ─────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar.hidden {
  transform: translateX(-100%);
}

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

.sidebar-brand-icon { font-size: 22px; }

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  white-space: nowrap;
  font-family: "DNV Display", sans-serif;
}

/* Nav */

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section { margin-bottom: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 18px;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.nav-item.active {
  background: var(--accent-blue);
  color: #ffffff;
}

.nav-item--group .nav-arrow {
  margin-left: auto;
  font-size: 16px;
  transition: transform var(--transition);
  display: inline-block;
}

.nav-item--group[aria-expanded="true"] .nav-arrow {
  transform: rotate(90deg);
}

.nav-submenu {
  overflow: hidden;
  max-height: 400px;
  transition: max-height 240ms ease;
}

.nav-submenu--collapsed {
  max-height: 0;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 36px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  transition: color var(--transition), background var(--transition);
}

.nav-subitem:hover {
  color: rgba(255,255,255,0.90);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

.nav-subitem.active {
  color: var(--accent-sky);
  font-weight: 600;
}

.nav-subitem--disabled { opacity: 0.4; pointer-events: none; }

.nav-icon { font-size: 14px; flex-shrink: 0; }

/* Sidebar footer */

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.user-avatar { font-size: 22px; }

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

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-signout {
  display: block;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.70);
  font-size: 12px;
  text-align: center;
  transition: background var(--transition), color var(--transition);
}

.btn-signout:hover {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
  text-decoration: none;
}

/* ── Topbar ──────────────────────────────── */

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 2px solid var(--accent-sky);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.topbar-toggle {
  font-size: 18px;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  display: none;
}

.topbar-toggle:hover { color: var(--text-primary); }

.topbar-center {
  flex: 1;
  text-align: center;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent-blue);
  line-height: 1;
  font-family: "DNV Display", sans-serif;
}

.topbar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.topbar-sync {
  font-size: 11px;
  color: var(--accent-green);
  display: block;
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 160px;
}

.topbar-username {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-scope {
  font-size: 11px;
  font-weight: 600;
}

.scope-all        { color: var(--accent-green); }
.scope-restricted { color: var(--accent-amber); }

/* ── Alerts ──────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border-left: 4px solid;
}

.alert-error {
  background: #fef2f2;
  border-color: var(--accent-red);
  color: #9b1c1c;
}

/* ── KPI Cards ───────────────────────────── */

.kpi-section {}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border-left: 5px solid;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.kpi-card:hover { box-shadow: var(--shadow-md); }

.kpi-card--green { border-color: var(--accent-green); }
.kpi-card--blue  { border-color: var(--accent-blue); }
.kpi-card--amber { border-color: var(--accent-amber); }

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-top: 6px;
  line-height: 1;
  font-family: "Avenir Next", "Nunito Sans", sans-serif;
}

/* ── Content card ────────────────────────── */

.content-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ── Table toolbar ───────────────────────── */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-surface);
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "Avenir Next", sans-serif;
}

.table-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 20px;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Search */

.search-box {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px 8px 32px;
  color: var(--text-primary);
  font-size: 13px;
  width: 240px;
  transition: border-color var(--transition);
  outline: none;
}

.search-input:focus { border-color: var(--accent-blue); }
.search-input::placeholder { color: var(--text-muted); }

/* Buttons */

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-primary:hover { background: var(--accent-blue-dk); }

.btn-primary.btn-full { width: 100%; padding: 12px; font-size: 14px; }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-icon {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* ── Fleet Table ─────────────────────────── */

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 320px);
  min-height: 300px;
  background: #fff;
}

.fleet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#headerRow th {
  position: sticky;
  top: 0;
  z-index: 12;
  background: #eef3f8;
}

#filterRow th {
  position: sticky;
  top: 18px;
  z-index: 11;
  background: #f4f6f9;
}

/* Header cells */
.fleet-table th {
  padding: 0;
  border-bottom: 2px solid #c8d6e0;
  white-space: normal;
  word-break: break-word;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
}

.th-sortable {
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  max-width: 120px;
  line-height: 1.3;
}

.th-sortable:hover { color: var(--accent-blue); }

.th-sortable.sorted-asc  .sort-indicator::after { content: " ▲"; color: var(--accent-blue); }
.th-sortable.sorted-desc .sort-indicator::after { content: " ▼"; color: var(--accent-blue); }
.th-sortable .sort-indicator::after { content: " ↕"; color: #94A3B8; font-size: 11px; }

.th-group { min-width: 280px; }

/* Filter row */
.th-filter {
  padding: 5px 8px;
  border-bottom: 2px solid #c8d6e0;
}

/* Filter button */
.col-filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 5px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition);
  justify-content: space-between;
}

.col-filter-btn:hover { border-color: var(--accent-sky); background: var(--bg-hover); }

.col-filter-btn--active {
  border-color: var(--accent-blue);
  background: #e8f4fd;
  color: var(--accent-blue);
  font-weight: 600;
}

.col-filter-arrow { font-size: 9px; opacity: 0.6; flex-shrink: 0; }

/* ── Dropdown panel ── */
.col-filter-dropdown {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow: hidden;
}

.col-filter-dd-search {
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  background: var(--bg-base);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.col-filter-dd-search::placeholder { color: var(--text-muted); }

.col-filter-dd-actions {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-base);
}

.col-filter-dd-btn {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.col-filter-dd-btn:hover { background: var(--bg-hover); color: var(--accent-blue); border-color: var(--accent-sky); }

.col-filter-dd-list {
  overflow-y: auto;
  list-style: none;
  padding: 4px 0;
  flex: 1;
}

.col-filter-dd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--transition);
  width: 100%;
}

.col-filter-dd-row:hover { background: var(--bg-hover); }

/* ── Date tree filter ─────────────────────────── */
.col-filter-dd-tree { list-style: none; padding: 4px 0; margin: 0; }
.col-filter-dd-tree li { list-style: none; }

.tree-children {
  list-style: none;
  padding: 0 0 0 16px;
  margin: 0;
}

.tree-header {
  display: flex;
  align-items: center;
}

.tree-toggle {
  width: 16px;
  flex-shrink: 0;
  text-align: center;
  font-size: 9px;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
  padding: 0 2px;
}

.tree-node > .tree-header .col-filter-dd-row { padding-left: 0; }
.tree-leaf .col-filter-dd-row { padding-left: 16px; }

/* ── Inline editable migration date cell ─────── */
.migration-date-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  width: 128px;
  font-family: inherit;
}

.migration-date-input:hover  { border-color: var(--border); }
.migration-date-input:focus  { border-color: var(--accent-blue); outline: none; background: var(--bg-base); }

/* ── Classic Vessel read-only checkbox ───── */
.classic-vessel-cell { text-align: center; }
.classic-vessel-checkbox { cursor: default; width: 15px; height: 15px; accent-color: var(--accent-blue); }

/* ── KPI sublabel ─ */
.kpi-sublabel {
  font-size: 11px;
  color: var(--accent-amber);
  font-weight: 600;
  margin-top: 4px;
}

/* ── Cancelled contract client badge ─────────── */
.cancelled-contract-tag {
  display: inline-block;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  vertical-align: middle;
  margin-right: 6px;
}

.cancelled-vessel-tag {
  display: inline-block;
  background: var(--accent-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}

.wu-error-icon {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 3px;
  vertical-align: middle;
  cursor: help;
}

.col-filter-dd-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.col-filter-dd-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Data rows */
.fleet-table tbody tr {
  border-bottom: 1px solid #e8eef3;
  background: #fff;
  transition: background var(--transition);
}

.fleet-table tbody tr:hover { background: var(--bg-hover); }

.fleet-table td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Group rows */
.row-group {
  background: #eef3f8;
  cursor: pointer;
  border-bottom: 1px solid #c8d6e0;
}

.row-group:hover { background: #deeaf3; }

.row-group td {
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.group-toggle {
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 8px;
  font-size: 11px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.row-group.collapsed .group-toggle { transform: rotate(-90deg); }

.row-group td .group-label { color: var(--accent-blue); font-weight: 700; }
.row-group td .group-meta  { color: var(--text-muted); font-size: 13px; font-weight: 400; margin-left: 8px; }

.row-data.group-hidden { display: none; }
.col-hidden { display: none; }

/* Status badges */
.fleet-table td.status-ok    { color: #0a7c45; font-weight: 600; }
.fleet-table td.status-warn  { color: #c47a00; font-weight: 600; }
.fleet-table td.status-error { color: var(--accent-red); font-weight: 600; }
.fleet-table td.status-info  { color: var(--accent-blue); font-weight: 600; }

/* Empty / loading */
.table-loading, .table-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: #fff;
}

/* ── Column Settings Panel ───────────────── */

.col-settings-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 320px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  transition: right 240ms ease;
}

.col-settings-panel.open { right: 0; }

.col-settings-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,32,75,0.4);
  z-index: 199;
}

.col-settings-backdrop.open { display: block; }

.col-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.col-settings-close {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--transition);
}

.col-settings-close:hover { color: var(--accent-red); }

.col-settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.col-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.col-toggle-row:hover { background: var(--bg-hover); }

.col-toggle-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.col-toggle-label {
  font-size: 12px;
  color: var(--text-secondary);
  user-select: none;
}

.col-settings-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Login Page ──────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f204b 0%, #0067c5 100%);
  padding: 20px;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-icon  { font-size: 38px; display: block; margin-bottom: 8px; }
.login-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-blue);
  font-family: "DNV Display", sans-serif;
}
.login-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.login-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: #9b1c1c;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 18px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--accent-blue); }
.form-input::placeholder { color: var(--text-muted); }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.btn-microsoft:hover {
  background: var(--bg-hover);
  border-color: var(--accent-sky);
  text-decoration: none;
}

.login-footer {
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 18px;
}

/* ── Migration Status checkbox ───────────────── */

.migration-cell {
  text-align: center;
  vertical-align: middle;
}

.migration-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
}

.migration-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

.migration-checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Page loader overlay ─────────────────── */

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.4s ease;
}

.page-loader--out {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Toast notifications ─────────────────── */

.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.toast--success { background: var(--accent-green); }
.toast--error   { background: var(--accent-red); }

/* ── Responsive ──────────────────────────── */

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .topbar-toggle { display: block; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }

  .search-input { width: 160px; }

  .app-content { padding: 16px; }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }

  .table-toolbar { flex-direction: column; align-items: flex-start; }

  .topbar-right { display: none; }

  .login-card { padding: 30px 22px; }
}
