:root {
    --navy: #10324a;
    --ink: #17242f;
    --muted: #667789;
    --line: #dce5ec;
    --panel: #ffffff;
    --page: #f4f7fa;
    --accent: #0d8aa8;
    --sea: #146b7c;
    --teal: #0b8f8a;
    --green: #25845a;
    --amber: #b77812;
    --red: #b44a4a;
    --soft-blue: #e7f3f7;
    --soft-green: #e8f5ef;
    --soft-amber: #fff4df;
    --soft-red: #faeeee;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--sea);
}

.btn {
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
}

.btn-primary {
    background: var(--sea);
    border-color: var(--sea);
}

.btn-primary:hover {
    background: #0e5c6d;
    border-color: #0e5c6d;
}

.btn-outline-primary {
    color: var(--sea);
    border-color: #9dc9d4;
}

.btn-outline-primary:hover {
    background: var(--sea);
    border-color: var(--sea);
}

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

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f3149 0%, #0d2a3e 100%);
    color: #fff;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand,
.brand:hover {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    margin-bottom: 22px;
}

.brand strong {
    display: block;
    font-size: 17px;
    line-height: 1.1;
}

.brand small {
    color: #b8ceda;
    font-size: 12px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #0d8aa8;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #5d8295 transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #5d8295;
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.menu-link {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    color: #cfe0e8;
    border-radius: 8px;
    padding: 8px 10px;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    font-size: 13px;
    border: 1px solid transparent;
}

.menu-button {
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
}

.menu-logout {
    margin: 16px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.12);
}

.menu-link i {
    width: 18px;
    min-width: 18px;
    text-align: center;
    color: inherit;
}

.menu-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-link:hover,
.menu-link.active {
    color: #fff;
    background: rgba(13,138,168,.22);
    border-color: rgba(255,255,255,.12);
}

.menu-link-disabled,
.menu-link-disabled:hover {
    color: #8fa1ad;
    background: rgba(255,255,255,.04);
    border-color: transparent;
    cursor: not-allowed;
    opacity: .72;
}

.menu-link-disabled i {
    color: #8fa1ad;
}

.menu-section {
    color: #91b3c4;
    font-size: 11px;
    text-transform: uppercase;
    margin: 16px 10px 6px;
    letter-spacing: .04em;
}

.main-panel {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 74px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 26px;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 650;
}

.topbar-subtitle {
    color: var(--muted);
    font-size: 13px;
}

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

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
}

.content {
    padding: 24px;
}

.panel,
.metric-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.panel {
    padding: 18px;
    box-shadow: 0 8px 26px rgba(16, 50, 74, .04);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header h2 {
    font-size: 16px;
    margin: 0;
    font-weight: 650;
}

.panel-header p {
    color: var(--muted);
    margin: 3px 0 0;
    font-size: 13px;
}

.table {
    --bs-table-color: var(--ink);
    --bs-table-hover-bg: #f6fbfd;
    font-size: 13px;
    vertical-align: middle;
}

.table thead th {
    background: #f2f7fa;
    color: #41586a;
    border-bottom-color: var(--line);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
}

.table-responsive {
    border-radius: 8px;
}

.datatable,
.dataTable {
    border: 1px solid #cfe2ea;
    border-radius: 8px;
    overflow: hidden;
}

.datatable thead th,
.dataTable thead th {
    background: linear-gradient(180deg, #176f84 0%, #105b6d 100%) !important;
    color: #fff !important;
    border-color: #105b6d !important;
    height: 42px;
    letter-spacing: .02em;
}

.datatable thead th:first-child,
.dataTable thead th:first-child {
    border-top-left-radius: 8px;
}

.datatable thead th:last-child,
.dataTable thead th:last-child {
    border-top-right-radius: 8px;
}

.datatable tbody tr,
.dataTable tbody tr {
    border-left: 4px solid transparent;
}

.datatable tbody tr:nth-child(odd) td,
.dataTable tbody tr:nth-child(odd) td {
    background: #fbfdfe;
}

.datatable tbody tr:nth-child(even) td,
.dataTable tbody tr:nth-child(even) td {
    background: #f2f8fb;
}

.datatable tbody tr:hover,
.dataTable tbody tr:hover {
    border-left-color: var(--accent);
}

.datatable tbody tr:hover td,
.dataTable tbody tr:hover td {
    background: #e8f6fb !important;
}

.datatable tbody td,
.dataTable tbody td {
    border-color: #d7e7ee;
    color: #123047;
}

.datatable tbody td:first-child,
.dataTable tbody td:first-child {
    font-weight: 650;
}

.datatable tbody .btn,
.dataTable tbody .btn {
    background: #fff;
    border-width: 1px;
    box-shadow: 0 2px 8px rgba(16, 50, 74, .06);
}

.datatable tbody .btn:hover,
.dataTable tbody .btn:hover {
    transform: translateY(-1px);
}

.datatable tbody .btn i,
.dataTable tbody .btn i {
    font-size: 14px;
}

.datatable tbody .btn .bi-box-arrow-up-right,
.dataTable tbody .btn .bi-box-arrow-up-right,
.datatable tbody .btn .bi-eye,
.dataTable tbody .btn .bi-eye {
    color: var(--accent);
}

.datatable tbody .btn .bi-pencil,
.dataTable tbody .btn .bi-pencil,
.datatable tbody .btn .bi-pencil-square,
.dataTable tbody .btn .bi-pencil-square {
    color: var(--sea);
}

.datatable tbody .btn .bi-download,
.dataTable tbody .btn .bi-download,
.datatable tbody .btn .bi-cloud-arrow-down,
.dataTable tbody .btn .bi-cloud-arrow-down {
    color: var(--teal);
}

.datatable tbody .btn .bi-receipt-cutoff,
.dataTable tbody .btn .bi-receipt-cutoff,
.datatable tbody .btn .bi-check2,
.dataTable tbody .btn .bi-check2,
.datatable tbody .btn .bi-check2-circle,
.dataTable tbody .btn .bi-check2-circle {
    color: var(--green);
}

.datatable tbody .btn .bi-slash-circle,
.dataTable tbody .btn .bi-slash-circle,
.datatable tbody .btn .bi-x-circle,
.dataTable tbody .btn .bi-x-circle {
    color: var(--amber);
}

.datatable tbody .btn .bi-lock,
.dataTable tbody .btn .bi-lock,
.datatable tbody .btn .bi-trash,
.dataTable tbody .btn .bi-trash {
    color: var(--red);
}

.datatable tbody .btn:hover i,
.dataTable tbody .btn:hover i {
    color: #fff;
}

.dt-container,
.dataTables_wrapper {
    color: var(--ink);
}

.dt-container .dt-length,
.dt-container .dt-search,
.dataTables_length,
.dataTables_filter {
    margin-bottom: 12px;
}

.dt-container .dt-length label,
.dt-container .dt-search label,
.dataTables_length label,
.dataTables_filter label {
    color: #335165;
    font-size: 13px;
    font-weight: 650;
}

.dt-container .dt-length select,
.dataTables_length select {
    min-width: 74px;
    border-color: #9dc9d4;
    background-color: #f4fbfd;
    color: #123047;
    font-weight: 650;
}

.dt-container .dt-search input,
.dataTables_filter input {
    min-height: 38px;
    border: 1px solid #9dc9d4;
    border-radius: 7px;
    background: #fff;
}

.dt-container .dt-search input:focus,
.dataTables_filter input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .18rem rgba(13, 138, 168, .15);
    outline: 0;
}

.dt-container .dt-info,
.dataTables_info {
    color: #335165;
    font-weight: 650;
}

.dt-container .dt-paging .dt-paging-button,
.dataTables_paginate .paginate_button,
.page-link {
    border-color: #cfe2ea !important;
    color: #105b6d !important;
    background: #f6fbfd !important;
    font-weight: 650;
}

.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button:hover,
.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button:hover,
.page-item.active .page-link {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.dt-container .dt-paging .dt-paging-button.disabled,
.dataTables_paginate .paginate_button.disabled,
.page-item.disabled .page-link {
    background: #edf4f7 !important;
    color: #7d92a0 !important;
}

.form-control,
.form-select {
    border-color: var(--line);
    border-radius: 7px;
    font-size: 13px;
}

.form-control:focus,
.form-select:focus {
    border-color: #78b8c7;
    box-shadow: 0 0 0 .18rem rgba(13, 138, 168, .15);
}

.metric-card {
    min-height: 112px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric-card strong {
    font-size: 28px;
    line-height: 1;
}

.metric-card i {
    color: var(--accent);
    font-size: 28px;
}

.status-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
}

.status-step {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

.foundation-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.foundation-item i {
    color: var(--accent);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-span-2 {
    grid-column: span 2;
}

.form-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.port-call-header {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.port-call-header h2 {
    margin: 0;
    font-size: 22px;
}

.port-call-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.eyebrow {
    display: block;
    color: var(--accent);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.header-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.status-badge {
    background: #e6f3f7;
    color: #0d647a;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 650;
}

.mini-stat {
    min-height: 86px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.mini-stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 7px;
}

.mini-stat strong {
    font-size: 15px;
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    max-height: 390px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #9bb7c5 transparent;
}

.timeline::-webkit-scrollbar {
    width: 6px;
}

.timeline::-webkit-scrollbar-thumb {
    background: #9bb7c5;
    border-radius: 999px;
}

.timeline::-webkit-scrollbar-track {
    background: transparent;
}

.timeline li {
    border-left: 3px solid var(--accent);
    background: #f8fbfd;
    border-radius: 0 8px 8px 0;
    padding: 10px 12px;
}

.timeline strong,
.timeline span {
    display: block;
}

.timeline span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.timeline p {
    margin: 6px 0 0;
}

.documents-panel {
    padding: 20px;
}

.document-phase-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.document-phase-grid div {
    min-height: 72px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.document-phase-grid strong,
.document-phase-grid span {
    display: block;
}

.document-phase-grid strong {
    color: var(--sea);
    font-size: 18px;
    line-height: 1;
    margin-bottom: 8px;
}

.document-phase-grid span {
    color: var(--muted);
    font-size: 12px;
}

.document-filter-grid {
    display: grid;
    grid-template-columns: 140px 140px minmax(160px, 1fr) minmax(160px, 1fr) minmax(220px, 1.3fr) auto;
    gap: 10px;
    align-items: end;
}

.document-filter-wide {
    min-width: 0;
}

.document-filter-actions,
.document-checklist-form {
    display: flex;
    gap: 8px;
    align-items: end;
}

.document-filter-actions {
    justify-content: flex-end;
    white-space: nowrap;
}

.document-checklist-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) 130px 42px;
}

.documents-table {
    table-layout: fixed;
}

.documents-table th:nth-child(1) {
    width: 38%;
}

.documents-table th:nth-child(2) {
    width: 33%;
}

.documents-table th:nth-child(3) {
    width: 210px;
}

.documents-table th:nth-child(4) {
    width: 88px;
}

.document-name {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.document-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e7f3f7;
    color: #0d647a;
    font-size: 12px;
    font-weight: 650;
}

.document-path {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.document-ref-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.document-ref-grid span {
    min-width: 0;
    display: block;
    overflow-wrap: anywhere;
}

.document-ref-grid small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 2px;
}

.document-date {
    white-space: nowrap;
}

.document-control-stack {
    display: grid;
    gap: 6px;
    min-width: 170px;
}

.document-control-stack span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.document-control-stack .status-badge {
    justify-self: start;
    color: #0d647a;
}

.timeline-compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    max-height: 210px;
}

.empty-inline {
    min-height: 56px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #f8fbfd;
}

.report-card {
    min-height: 84px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-card:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.report-card i {
    color: var(--accent);
    font-size: 22px;
}

.report-hero {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.report-hero h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.report-hero p {
    margin: 4px 0 0;
    color: var(--muted);
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.result-actions {
    margin-left: auto;
}

.report-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-option-card {
    min-height: 118px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.report-option-card:hover,
.report-option-card.active {
    border-color: var(--sea);
    box-shadow: 0 10px 24px rgba(16, 50, 74, .08);
    color: var(--ink);
}

.report-option-card.active {
    background: #f4fbfd;
}

.report-option-card i {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e7f3f7;
    color: var(--sea);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 18px;
}

.report-option-card strong,
.report-option-card small {
    display: block;
}

.report-option-card strong {
    font-size: 15px;
    margin-bottom: 4px;
}

.report-option-card small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: 150px 150px minmax(220px, 1fr) 180px auto;
    gap: 12px;
    align-items: end;
}

.report-filter-wide {
    min-width: 0;
}

.report-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.report-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.report-metric {
    min-height: 86px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.report-metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.report-metric strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.report-tab {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--muted);
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 650;
}

.report-tab.active,
.report-tab:hover {
    background: var(--sea);
    border-color: var(--sea);
    color: #fff;
}

.report-section {
    display: none;
}

.report-section.active {
    display: block;
}

.report-table {
    min-width: 860px;
}

.print-report-header,
.print-summary {
    display: none;
}

@media print {
    .sidebar,
    .topbar,
    .report-hero,
    .report-card-grid,
    .report-results-panel,
    .report-filter-grid,
    .result-actions,
    .dataTables_length,
    .dataTables_filter,
    .dataTables_info,
    .dataTables_paginate {
        display: none !important;
    }

    .app-shell,
    .main-panel,
    .content {
        display: block;
        padding: 0;
        margin: 0;
        background: #fff;
    }

    .panel {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .report-results-panel {
        display: block;
    }

    .report-output-panel {
        display: block !important;
    }

    .print-report-header,
    .print-summary {
        display: block;
    }

    .print-report-header {
        border-bottom: 1px solid #222;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .print-report-header h1 {
        font-size: 18px;
        margin: 0;
    }

    .print-report-header h2 {
        font-size: 15px;
        margin: 3px 0;
    }

    .print-report-header p {
        margin: 2px 0;
        color: #333;
        font-size: 11px;
    }

    .print-summary {
        margin-bottom: 12px;
    }

    .print-summary span {
        display: inline-block;
        min-width: 150px;
        border: 1px solid #aaa;
        padding: 6px 8px;
        margin: 0 6px 6px 0;
        font-size: 11px;
    }

    .print-summary strong {
        display: block;
        font-size: 10px;
        color: #333;
    }

    .report-table {
        min-width: 0;
        width: 100% !important;
        font-size: 11px;
    }

    .table-responsive {
        overflow: visible;
    }
}

.integration-panel {
    height: 100%;
}

.integration-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.integration-title i {
    color: var(--accent);
    font-size: 22px;
}

.empty-state {
    min-height: 180px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    gap: 8px;
}

.empty-state i {
    color: var(--accent);
    font-size: 34px;
}

.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state strong {
    color: var(--ink);
    font-size: 16px;
}

.dashboard-hero {
    min-height: 150px;
    background:
        linear-gradient(135deg, rgba(16,50,74,.96), rgba(13,104,124,.92)),
        url("https://images.unsplash.com/photo-1565891741441-64926e441838?auto=format&fit=crop&w=1600&q=80") center/cover;
    border-radius: 8px;
    padding: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    overflow: hidden;
}

.dashboard-hero .eyebrow {
    color: #8ee1ef;
}

.dashboard-hero h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 650;
}

.dashboard-hero p {
    color: #d5e8ef;
    margin: 6px 0 0;
    max-width: 680px;
}

.hero-finance {
    min-width: 230px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 14px 16px;
}

.hero-finance span,
.hero-finance small {
    display: block;
    color: #cfe4ec;
    font-size: 12px;
}

.hero-finance strong {
    display: block;
    font-size: 24px;
    line-height: 1.15;
    margin: 4px 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--sea);
    border-radius: 8px;
    padding: 14px;
    min-height: 108px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 8px 26px rgba(16, 50, 74, .035);
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--soft-blue);
    color: var(--sea);
    flex: 0 0 auto;
}

.kpi-card span,
.kpi-card small {
    display: block;
    color: var(--muted);
}

.kpi-card span {
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
}

.kpi-card strong {
    display: block;
    font-size: 24px;
    line-height: 1.1;
    margin: 6px 0 4px;
}

.tone-primary { border-left-color: var(--sea); }
.tone-info { border-left-color: var(--accent); }
.tone-cyan { border-left-color: var(--teal); }
.tone-success { border-left-color: var(--green); }
.tone-warning { border-left-color: var(--amber); }
.tone-danger { border-left-color: var(--red); }

.tone-primary .kpi-icon,
.alert-item.tone-primary i { background: var(--soft-blue); color: var(--sea); }
.tone-info .kpi-icon,
.alert-item.tone-info i { background: #e8f6fb; color: var(--accent); }
.tone-cyan .kpi-icon,
.alert-item.tone-cyan i { background: #e6f7f6; color: var(--teal); }
.tone-success .kpi-icon,
.alert-item.tone-success i { background: var(--soft-green); color: var(--green); }
.tone-warning .kpi-icon,
.alert-item.tone-warning i { background: var(--soft-amber); color: var(--amber); }
.tone-danger .kpi-icon,
.alert-item.tone-danger i { background: var(--soft-red); color: var(--red); }

.ops-pipeline {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.pipeline-step {
    min-height: 76px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--sea);
    border-radius: 8px;
    background: #fbfdfe;
    padding: 12px;
}

.pipeline-step span,
.pipeline-step strong {
    display: block;
}

.pipeline-step span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
}

.pipeline-step strong {
    font-size: 24px;
    margin-top: 6px;
}

.status-expected { border-color: #9dc9d4; border-top-color: var(--sea); color: #0e5c6d; }
.status-arrived { border-color: #9fd5d2; border-top-color: var(--teal); color: #08736f; }
.status-in_port,
.status-in_operation { border-color: #a8d8bf; border-top-color: var(--green); color: #1f6d4b; }
.status-ready_to_depart { border-color: #ecd194; border-top-color: var(--amber); color: #80530b; }
.status-departed { border-color: #c7d3dc; border-top-color: #6f8797; color: #536b7b; }

.port-call-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.operation-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-height: 176px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.operation-card-head,
.operation-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.operation-card-head strong {
    display: block;
    font-size: 15px;
}

.operation-card-head span,
.operation-card-foot span {
    color: var(--muted);
    font-size: 12px;
}

.operation-card-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.operation-card-body span {
    color: #405668;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operation-card-body i {
    color: var(--accent);
    margin-right: 6px;
}

.operation-card-foot {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 10px;
    align-items: center;
}

.operation-card-foot a {
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    border-radius: 999px;
    padding: 4px 9px;
    background: #eef4f7;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.alert-stack {
    display: grid;
    gap: 10px;
}

.alert-item {
    border: 1px solid var(--line);
    border-left: 4px solid var(--sea);
    border-radius: 8px;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    background: #fff;
}

.alert-item i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.alert-item span {
    color: #405668;
    font-size: 13px;
}

.alert-item strong {
    font-size: 18px;
}

.guest-body {
    min-height: 100vh;
    background:
        linear-gradient(rgba(16,50,74,.82), rgba(16,50,74,.82)),
        url("https://images.unsplash.com/photo-1494412519320-aa613dfb7738?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 60px rgba(0,0,0,.24);
}

.login-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.login-brand h1 {
    font-size: 24px;
    margin: 0;
}

.login-brand p,
.login-hint {
    color: var(--muted);
    margin: 0;
}

.login-hint {
    margin-top: 16px;
    font-size: 13px;
}

.company-select-card {
    width: min(620px, 100%);
}

.company-dropdown {
    min-height: 42px;
    font-size: 14px;
}

.company-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
    max-height: 300px;
    background: #fff;
}

.company-list-row {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
    text-align: left;
}

.company-list-row:last-child {
    border-bottom: 0;
}

.company-list-row:hover {
    background: #f8fbfd;
}

.company-list-info {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.company-list-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #e8f6fb;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.company-list-info strong,
.company-list-info small {
    display: block;
}

.company-list-info strong {
    font-size: 14px;
}

.company-list-info small {
    color: var(--muted);
    margin-top: 1px;
    font-size: 12px;
}

.company-enter {
    width: 34px;
    height: 34px;
    border: 1px solid #9dc9d4;
    border-radius: 8px;
    background: #fff;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.company-enter:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.company-create {
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.company-create-actions {
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.company-create h2 {
    font-size: 17px;
    margin: 0 0 14px;
}

@media (max-width: 992px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .sidebar-nav {
        overflow: visible;
        padding-right: 0;
    }

    .status-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero {
        display: block;
    }

    .hero-finance {
        margin-top: 16px;
        min-width: 0;
    }

    .kpi-grid,
    .ops-pipeline,
    .port-call-grid,
    .report-card-grid,
    .document-phase-grid,
    .report-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .port-call-header {
        display: block;
    }

    .header-badges {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .report-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .report-actions {
        justify-content: flex-start;
    }

    .report-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-filter-grid,
    .document-checklist-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-filter-wide,
    .report-filter-actions,
    .document-filter-wide,
    .document-filter-actions {
        grid-column: span 2;
    }
}

@media (max-width: 576px) {
    .topbar {
        height: auto;
        padding: 16px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .content {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: span 1;
    }

    .dashboard-hero {
        padding: 20px;
    }

    .dashboard-hero h2 {
        font-size: 21px;
    }

    .kpi-grid,
    .ops-pipeline,
    .port-call-grid,
    .report-card-grid,
    .document-phase-grid,
    .report-metrics,
    .operation-card-body {
        grid-template-columns: 1fr;
    }

    .report-filter-grid {
        grid-template-columns: 1fr;
    }

    .document-filter-grid,
    .document-checklist-form {
        grid-template-columns: 1fr;
    }

    .report-filter-wide,
    .report-filter-actions,
    .document-filter-wide,
    .document-filter-actions {
        grid-column: span 1;
    }

    .report-filter-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .operation-card-head,
    .operation-card-foot,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .alert-item {
        grid-template-columns: 32px 1fr auto;
    }
}
