/* ─────────────────────────────────────────────────────────────────────────
   CMIT Customer Portal — Design System
   Ported from Prototype UI demo / styles.css
   ───────────────────────────────────────────────────────────────────────── */

:root {
    --cmit-navy: #002d56;
    --cmit-navy-deep: #012D56;
    --cmit-blue: #2e6da4;
    --cmit-blue-hover: #255a88;
    --cmit-green: #14655A; 
    --cmit-blue-soft: #e7f0f7;
    --cmit-blue-active: #d6e5f1;
    --cmit-border: #d0d7de;
    --cmit-border-light: #e5e9ee;
    --cmit-bg: #f2f5f8;
    --cmit-sidebar-bg: #f9fbfd;
    --cmit-text: #1f2933;
    --cmit-text-muted: #7A7369;
    --cmit-white: #ffffff;
    --cmit-row-alt: #f7fafc;
    --cmit-footer: #002d56;
    --cmit-cream-bg: #F7F5F1;
    --cmit-error: #b42318;
    --topbar-h: 88px;
    --footer-h: 52px;
    --font: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    --radius: 6px;
    --shadow: 0 8px 24px rgba(9, 31, 52, 0.08);
    --transition: 0.22s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--cmit-text);
    background: var(--cmit-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select {
    font: inherit;
}

.text-muted{
    font-size: 14px;
    color: var(--cmit-text-muted);
}

/* ── .sr-only ─────────────────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ── Portal wrapper ───────────────────────────────────────────────────── */
.portal-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    background: var(--cmit-navy);
    color: var(--cmit-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 14px;
    gap: 16px;
    z-index: 40;
    flex-shrink: 0;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.topbar__breadcrumb {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin-left: 72px;
    color: var(--cmit-white);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
}

.topbar__breadcrumb a,
.topbar__breadcrumb span[aria-current="page"] {
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__breadcrumb a {
    opacity: 0.9;
}

.topbar__breadcrumb a:hover {
    opacity: 1;
    text-decoration: underline;
}

.topbar__breadcrumb-separator {
    flex-shrink: 0;
    opacity: 0.75;
}

.topbar__logo {
    display: flex;
    align-items: center;
    height: 56px;
    flex-shrink: 0;
}

.topbar__logo img {
    height: 48px;
    width: auto;
    display: block;
    object-fit: contain;
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.topbar__links {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.topbar__links a {
    color: var(--cmit-white);
    opacity: 0.9;
    transition: opacity 0.15s;
}

.topbar__links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.topbar__divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
}

.topbar__lang {
    font-size: 13px;
    color: var(--cmit-white);
    opacity: 0.9;
    white-space: nowrap;
}

/* ── Dropdown ─────────────────────────────────────────────────────────── */
.dropdown {
    position: relative;
}

.dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--cmit-white);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 13px;
    opacity: 0.9;
    border-radius: var(--radius);
}

.dropdown__trigger:hover {
    opacity: 1;
    background: rgba(255,255,255,0.08);
}

.icon-chevron {
    opacity: 0.85;
    transition: transform var(--transition);
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: var(--cmit-white);
    color: var(--cmit-text);
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 50;
    padding: 4px 0;
    animation: fadeIn 0.12s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown__item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--cmit-text);
}

.dropdown__item:hover {
    background: var(--cmit-blue-soft);
    color: var(--cmit-blue);
}

/* ── Login button in topbar ───────────────────────────────────────────── */
.btn-topbar-login {
    border: 1px solid rgba(255,255,255,0.4);
    background: transparent;
    color: var(--cmit-white);
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}

.btn-topbar-login:hover {
    background: rgba(255,255,255,0.1);
}

/* ── Main layout ──────────────────────────────────────────────────────── */
.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.portal-footer {
    min-height: var(--footer-h);
    background: var(--cmit-footer);
    color: var(--cmit-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    flex-shrink: 0;
}

.footer__logo {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

.footer__copy,
.footer__contact {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 18px;
    height: 40px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--cmit-blue);
    color: var(--cmit-white);
    border-color: var(--cmit-blue);
}

.btn-primary:hover:not(:disabled) {
    background: var(--cmit-blue-hover);
    border-color: var(--cmit-blue-hover);
}

.tab:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.text-link:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pager-btn:disabled,
.page-size-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--cmit-white);
    color: var(--cmit-navy);
    border: 1px solid rgba(0, 45, 86, 0.22);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--cmit-blue);
    color: var(--cmit-blue);
}

.btn-outline {
    background: var(--cmit-white);
    border-color: var(--cmit-border);
    color: var(--cmit-text);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--cmit-blue);
    color: var(--cmit-blue);
}

.text-link {
    color: var(--cmit-blue);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: inline;
}

.text-link:hover {
    text-decoration: underline;
}

/* ── Form elements ────────────────────────────────────────────────────── */
input[type="text"],
input[type="datetime-local"],
input[type="password"],
select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    background: var(--cmit-white);
    color: var(--cmit-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--cmit-blue);
    box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.18);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.field:has(.field-help:hover),
.field:has(.field-help:focus-visible) {
    z-index: 5;
}

.field label {
    font-weight: 600;
    font-size: 13px;
}

.field--action {
    justify-content: flex-end;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    align-items: end;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.form-inline .field {
    flex: 1;
    min-width: 200px;
    max-width: 340px;
}

.form-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--cmit-text-muted);
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.field-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    outline: none;
}

.field-help__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid var(--cmit-border, #c5ced8);
    background: #fff;
    color: var(--cmit-text-muted, #6b7785);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.field-help:hover .field-help__icon,
.field-help:focus-visible .field-help__icon {
    border-color: var(--cmit-primary, #003087);
    color: var(--cmit-primary, #003087);
}

.field-help__tip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    bottom: auto;
    transform: none;
    z-index: 40;
    width: max-content;
    max-width: min(280px, 70vw);
    padding: 8px 10px;
    border-radius: 6px;
    background: #1f2a37;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
}

.field-help__tip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    top: auto;
    left: 8px;
    transform: none;
    border: 5px solid transparent;
    border-bottom-color: #1f2a37;
}

.field-help:hover .field-help__tip,
.field-help:focus-visible .field-help__tip {
    opacity: 1;
    visibility: visible;
}

/* Field bên phải form: neo tooltip về phải để không tràn mép */
.field:not(.field--chip) .field-help__tip {
    left: auto;
    right: 0;
}

.field:not(.field--chip) .field-help__tip::after {
    left: auto;
    right: 8px;
}

.exclusive-lock:disabled {
    background: #f3f5f7;
    color: var(--cmit-text-muted);
    cursor: not-allowed;
}

/* ── Chip input (multi-container) ─────────────────────────────────────── */
.chip-input-wrap {
    width: 100%;
}

.chip-input {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.chip-input__box {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 10px;
    border: 1px solid var(--cmit-border);
    border-radius: 6px;
    background: #fff;
    cursor: text;
}

.chip-input--disabled .chip-input__box {
    background: #f3f5f7;
    cursor: not-allowed;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cmit-primary-light, #e8f0fe);
    color: var(--cmit-primary, #003087);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.chip__remove {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
    opacity: 0.7;
}

.chip__remove:hover {
    opacity: 1;
}

.chip-input__field {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 4px 0;
    background: transparent;
}

.chip-input__clear {
    align-self: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--cmit-border);
    border-radius: 6px;
    background: #fff;
    color: var(--cmit-text-muted);
    font-size: 18px;
    cursor: pointer;
}

.chip-input__clear:hover {
    background: #f3f5f7;
}

.chip-input__count {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--cmit-text-muted);
    text-align: right;
}

.chip-input__error {
    margin-top: 6px;
    margin-bottom: 0;
}

.batch-summary {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #f8f9fb;
    font-size: 13px;
    color: var(--cmit-text-muted);
}

.batch-summary strong {
    color: var(--cmit-text);
}

.batch-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.batch-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: ui-monospace, monospace;
}

.batch-tag--missing {
    background: #fff3e0;
    color: #e65100;
}

.batch-tag--invalid {
    background: #ffebee;
    color: #c62828;
}

.field--chip {
    grid-column: 1 / -1;
}

/* ── Hero (Public homepage) ───────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: stretch;
    background-image: url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
    /* fallback gradient when no image */
    background-color: var(--cmit-navy);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        rgba(0, 22, 44, 0.85) 0%,
        rgba(0, 35, 70, 0.72) 55%,
        rgba(0, 20, 50, 0.42) 100%
    );
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 56px 40px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 400px);
    gap: 48px;
    align-items: center;
}

.hero__copy {
    color: var(--cmit-white);
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero__headline {
    margin: 0 0 16px;
    max-width: 600px;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.25;
}

.hero__sub {
    margin: 0;
    font-size: 16px;
    opacity: 0.88;
    max-width: 520px;
    line-height: 1.6;
}

.hero__card {
    background: var(--cmit-white);
    border: 1px solid var(--cmit-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 28px 32px;
    text-shadow: none;
}

.hero__card h2 {
    margin: 0 0 10px;
    color: var(--cmit-navy-deep);
    font-size: 22px;
}

.hero__card p {
    margin: 0 0 20px;
    color: var(--cmit-text-muted);
    line-height: 1.6;
}

.hero__card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hero__card-link {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--cmit-text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
}

.hero__card-link:hover {
    color: var(--cmit-blue);
    text-decoration: underline;
}

/* ── Public cards (2-column below hero) ──────────────────────────────── */
.public-cards {
    max-width: 1300px;
    margin: 0 auto;
    padding: 32px 40px 40px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.public-card {
    background: var(--cmit-white);
    border: 1px solid var(--cmit-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.public-card__accent {
    display: block;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    margin-bottom: 18px;
    background: var(--cmit-blue);
}

.public-card h2 {
    margin: 0 0 8px;
    color: var(--cmit-navy-deep);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.public-card p {
    margin: 0 0 18px;
    color: var(--cmit-text-muted);
    line-height: 1.55;
}

.public-card__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.public-card__field label {
    font-weight: 600;
    font-size: 13px;
}

.public-card__field input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.public-card__field input:focus {
    border-color: var(--cmit-blue);
    box-shadow: 0 0 0 3px rgba(46, 109, 164, 0.18);
}

.public-card__footer {
    margin-top: 14px;
}

/* ── Track & Trace page layout ────────────────────────────────────────── */
.tt-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 28px;
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
}

.page-title {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: var(--cmit-navy-deep);
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    background: var(--cmit-white);
    color: var(--cmit-text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab:hover {
    border-color: var(--cmit-blue);
    color: var(--cmit-blue);
}

.tab.is-active {
    background: var(--cmit-blue-soft);
    border-color: #8eb4d4;
    color: var(--cmit-blue);
    font-weight: 700;
}

/* ── Panel (search / results) ─────────────────────────────────────────── */
.panel {
    background: var(--cmit-white);
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 16px;
    border-bottom: 1px solid var(--cmit-border-light);
}

.panel__header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cmit-navy);
}

.search-panel .panel__header {
    cursor: pointer;
    user-select: none;
}

.search-panel .panel__header:focus-visible {
    outline: 2px solid var(--cmit-blue);
    outline-offset: -2px;
}

.panel__collapse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--cmit-blue);
    font-weight: 600;
}

.panel__collapse-icon {
    display: inline-block;
    transition: transform var(--transition);
    font-size: 11px;
}

.search-panel.is-collapsed .panel__collapse-icon {
    transform: rotate(180deg);
}

.search-panel.is-collapsed .panel__header {
    border-bottom: none;
}

.panel__body {
    padding: 16px;
}

.search-panel .panel__body {
    overflow: visible;
    transition: max-height var(--transition), opacity var(--transition), padding var(--transition);
    max-height: 2000px;
    opacity: 1;
}

.search-panel.is-collapsed .panel__body {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ── Results toolbar ──────────────────────────────────────────────────── */
.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--cmit-border-light);
    flex-wrap: wrap;
    gap: 10px;
}

.results-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--cmit-navy-deep);
    letter-spacing: 0.01em;
}

.results-meta {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--cmit-text-muted);
}

.results-toolbar__right {
    display: flex;
    gap: 8px;
}

.results-toolbar .btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

/* ── Vessel container summary ─────────────────────────────────────────── */
.vessel-container-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 16px 16px;
}

.vessel-container-summary__item {
    display: grid;
    grid-template-columns: minmax(145px, 42%) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 52px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cmit-border-light);
}

.vessel-container-summary__item:nth-child(odd) {
    padding-right: 24px;
}

.vessel-container-summary__item:nth-child(even) {
    padding-left: 24px;
}

.vessel-container-summary__label {
    color: var(--cmit-text-muted);
    font-size: 13px;
}

.vessel-container-summary__item strong {
    color: var(--cmit-navy-deep);
    font-size: 14px;
    overflow-wrap: anywhere;
}

/* ── Data table ───────────────────────────────────────────────────────── */
.container-grid {
    position: relative;
}

.container-grid__toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 46px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--cmit-border-light);
}

.container-grid__column-count {
    color: var(--cmit-text-muted);
    font-size: 12px;
}

.container-grid__preference-message {
    margin-right: auto;
    color: var(--cmit-text-muted);
    font-size: 12px;
}

.container-grid__column-button {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

.container-grid__column-picker {
    position: absolute;
    z-index: 20;
    top: calc(100% - 4px);
    right: 16px;
    width: min(620px, calc(100vw - 64px));
    max-height: 440px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    background: var(--cmit-white);
    box-shadow: var(--shadow);
}

.container-grid__column-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cmit-border-light);
}

.container-grid__column-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
}

.container-grid__column-actions button:disabled {
    opacity: 0.5;
    cursor: default;
}

.container-grid__column-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
    padding-top: 12px;
}

.container-grid__column-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    min-width: 0;
    font-size: 12px;
}

.container-grid__column-choice {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    cursor: pointer;
}

.container-grid__column-choice span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.container-grid__column-choice:has(input:disabled) {
    color: var(--cmit-text-muted);
    cursor: default;
}

.container-grid__column-order {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 2px;
}

.container-grid__column-order button {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--cmit-border);
    border-radius: 4px;
    background: var(--cmit-white);
    color: var(--cmit-navy-deep);
    cursor: pointer;
    line-height: 1;
}

.container-grid__column-order button:disabled {
    opacity: 0.35;
    cursor: default;
}

.container-grid__column-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--cmit-border-light);
    color: var(--cmit-text-muted);
    font-size: 12px;
}

.container-grid__column-footer > div {
    display: flex;
    gap: 8px;
}

.container-grid__column-footer .btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

.table-wrap {
    overflow-x: auto;
    padding: 0 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--cmit-border-light);
    white-space: nowrap;
    vertical-align: middle;
}

.data-table th {
    background: #eef2f6;
    font-weight: 600;
    color: var(--cmit-text);
    position: sticky;
    top: 0;
    z-index: 1;
    line-height: 1.3;
}

.sortable-table__header {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sortable-table__header:disabled {
    cursor: wait;
}

.sortable-table__header:focus-visible {
    outline: 2px solid var(--cmit-blue);
    outline-offset: 3px;
}

.sortable-table__indicator {
    min-width: 12px;
    color: var(--cmit-text-muted);
    font-size: 10px;
}

.sortable-table__header.is-active .sortable-table__indicator {
    color: var(--cmit-blue);
}

.data-table tbody tr:nth-child(even) {
    background: var(--cmit-row-alt);
}

.data-table tbody tr:hover {
    background: var(--cmit-blue-soft);
}

.data-table td:first-child,
.data-table th:first-child {
    width: 44px;
    text-align: center;
}

.table-refresh-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 30px;
    padding: 6px 16px 0;
    color: var(--cmit-text-muted);
    font-size: 12px;
}

.table-refresh-error {
    margin: 8px 16px 0;
}

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    flex-wrap: wrap;
    gap: 10px;
}

.rows-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cmit-text-muted);
}

.rows-per-page__options {
    display: inline-flex;
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.page-size-btn {
    width: 32px;
    height: 28px;
    border: none;
    background: var(--cmit-white);
    cursor: pointer;
    color: var(--cmit-text);
    border-right: 1px solid var(--cmit-border);
    font-size: 12px;
}

.page-size-btn:last-child {
    border-right: none;
}

.page-size-btn.is-active {
    background: var(--cmit-blue);
    color: var(--cmit-white);
    font-weight: 700;
}

.page-size-btn:hover:not(.is-active) {
    background: var(--cmit-blue-soft);
}

.pager-info {
    font-size: 13px;
    color: var(--cmit-text-muted);
    font-weight: 500;
}

.pager {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pager-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 5px;
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    background: var(--cmit-white);
    cursor: pointer;
    color: var(--cmit-text);
    font-size: 13px;
}

.pager-btn:hover:not(:disabled):not(.is-active) {
    border-color: var(--cmit-blue);
    color: var(--cmit-blue);
}

.pager-btn.is-active {
    background: var(--cmit-blue);
    border-color: var(--cmit-blue);
    color: var(--cmit-white);
    font-weight: 700;
}

.pager-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── Container detail card ────────────────────────────────────────────── */
.detail-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-card {
    background: var(--cmit-white);
    border: 1px solid var(--cmit-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-card__title {
    margin: 0;
    padding: 10px 14px;
    background: #eef2f6;
    font-size: 13px;
    font-weight: 700;
    color: var(--cmit-navy);
    border-bottom: 1px solid var(--cmit-border-light);
}

.detail-card table {
    width: 100%;
    border-collapse: collapse;
}

.detail-card th,
.detail-card td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--cmit-border-light);
    font-size: 13px;
    text-align: left;
    vertical-align: top;
}

.detail-card tr:last-child th,
.detail-card tr:last-child td {
    border-bottom: none;
}

.detail-card th {
    width: 200px;
    background: #f7fafc;
    font-weight: 600;
    color: var(--cmit-text-muted);
    white-space: nowrap;
}

/* ── Error / empty states ─────────────────────────────────────────────── */
.error-msg {
    color: #b00020;
    padding: 8px 0;
    font-size: 13px;
}

.empty-msg {
    color: var(--cmit-text-muted);
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
}

/* ── Result state panels (Loading / Empty / Error) ────────────────────── */
.result-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    padding: 40px 24px;
    background: var(--cmit-white);
    border: 1px solid var(--cmit-border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-state__visual {
    margin-bottom: 16px;
}

.result-state__spinner {
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--cmit-border);
    border-top-color: var(--cmit-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.result-state__icon {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    position: relative;
}

.result-state__icon--empty {
    background: var(--cmit-blue-soft);
    border: 1px solid var(--cmit-blue-active);
}

.result-state__icon--empty::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--cmit-blue);
    border-radius: 50%;
}

.result-state__icon--empty::after {
    content: "";
    position: absolute;
    top: 32px;
    left: 30px;
    width: 10px;
    height: 2px;
    background: var(--cmit-blue);
    transform: rotate(45deg);
    border-radius: 1px;
}

.result-state__icon--error {
    background: #fdecee;
    border: 1px solid #f5c2c7;
}

.result-state__icon--error::before {
    content: "!";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b00020;
    font-size: 28px;
    font-weight: 700;
    line-height: 56px;
}

.result-state__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--cmit-text);
}

.result-state__desc {
    margin: 0;
    max-width: 420px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cmit-text-muted);
}

.result-state__action {
    margin-top: 18px;
}

.result-state--error .result-state__title {
    color: #8a1528;
}

/* ── Loader spinner ───────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cmit-border);
    border-top-color: var(--cmit-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .hero__inner,
    .public-cards {
        grid-template-columns: 1fr;
    }

    .hero__inner {
        padding: 40px 24px;
    }

    .public-cards {
        padding-left: 24px;
        padding-right: 24px;
    }

    .topbar__links {
        display: none;
    }

    .portal-footer .footer__contact {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --topbar-h: 72px;
    }

    .topbar__breadcrumb {
        margin-left: 8px;
        font-size: 12px;
    }

    .container-grid__column-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .container-grid__column-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero {
        min-height: 360px;
    }

    .hero__inner {
        padding: 28px 16px;
    }

    .hero__headline {
        font-size: 24px;
    }

    .public-cards {
        grid-template-columns: 1fr;
        padding: 20px 16px;
        gap: 16px;
    }

    .tt-page {
        padding: 14px 12px;
    }

    .vessel-container-summary {
        grid-template-columns: 1fr;
    }

    .vessel-container-summary__item:nth-child(odd),
    .vessel-container-summary__item:nth-child(even) {
        padding-left: 0;
        padding-right: 0;
    }
}
