/* ============================================================
   SHIP INFO PROJECT — Global Stylesheet
   Màu chủ đạo: #065DAB (xanh Cảng vụ)
   ============================================================ */

/* Reset cơ bản */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    background: #f0f4f8;
    color: #000;
}

/* ── Navigation ────────────────────────────────────────────── */
.nav-bar {
    background: #065DAB;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-bar .site-title {
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 20px;
    letter-spacing: 0.5px;
    flex: 1;
}

.nav-bar nav a {
    display: inline-block;
    color: #d0e8ff;
    text-decoration: none;
    padding: 14px 18px;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.nav-bar nav a:hover,
.nav-bar nav a.active {
    background: #004a94;
    color: #fff;
}

/* ── Wrapper & trang ────────────────────────────────────────── */
.page-wrapper {
    max-width: 100%;
    margin: 20px 0;
    padding: 0 16px 40px;
}

/* ── Tiêu đề trang ──────────────────────────────────────────── */
.page-title {
    font-size: 17px;
    font-weight: bold;
    color: #065DAB;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 2px solid #065DAB;
}

/* ── Bộ lọc ngày ────────────────────────────────────────────── */
.filter-bar {
    background: #fff;
    border: 1px solid #c8d8ec;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-bar label {
    font-weight: bold;
    color: #000;
}

.filter-bar input[type="date"] {
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 13px;
    color: #000;
    outline: none;
}

.filter-bar input[type="date"]:focus {
    border-color: #065DAB;
    box-shadow: 0 0 0 2px rgba(6,93,171,0.15);
}

.btn-search {
    background: #065DAB;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 6px 18px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover { background: #004a94; }

/* ── Thông báo lỗi / trống ──────────────────────────────────── */
.alert {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}
.alert-warning { background: #fff8e1; border: 1px solid #f0c000; color: #7a5c00; }
.alert-danger   { background: #fdecea; border: 1px solid #e57373; color: #b71c1c; }
.alert-info     { background: #e3f2fd; border: 1px solid #90caf9; color: #1565c0; }

/* ── Nhóm section ───────────────────────────────────────────── */
.section-block {
    background: #fff;
    border: 1px solid #c8d8ec;
    border-radius: 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.section-header {
    background: #065DAB;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header .row-count {
    font-size: 11px;
    font-weight: normal;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.section-body {
    padding: 0;
    overflow-x: auto;
}

/* ── Bảng dữ liệu ───────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead th {
    
    color: #065DAB;
    font-weight: bold;
    font-size: 12px;
    padding: 8px 10px;
    text-align: center;

    border-right: 1px solid #c8d4e0;
    white-space: nowrap;
}

.data-table thead th:last-child { border-right: none; }

.data-table tbody tr {
    border-bottom: 1px solid #e4eaf2;
    transition: background 0.12s;
}

.data-table tbody tr:hover { background: #f0f6ff; }
.data-table tbody tr:nth-child(even) { background: #fafcff; }
.data-table tbody tr:nth-child(even):hover { background: #f0f6ff; }

.data-table td {
    padding: 7px 10px;
    vertical-align: middle;
    color: #000;
    border-right: 1px solid #dde4ee;
}

.data-table td:last-child { border-right: none; }

.data-table td.stt {
    text-align: center;
    color: #888;
    font-size: 11px;
    width: 36px;
}

.data-table td.ship-name {
    font-weight: bold;
    color: #065DAB;
    white-space: nowrap;
}
input[type="date"] {
    font-family: Arial, sans-serif; /* Thay đổi font theo ý bạn */
}
.date-input {font-family:Arial}
.data-table td.center { text-align: center; }
.data-table td.number { text-align: right; }

/* ── Bảng inport: một bảng duy nhất, cột cố định ────────────── */
.inport-table {
    table-layout: fixed;
}

.inport-table th,
.inport-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inport-table td.ellipsis {
    max-width: 0;
}

/* Row tiêu đề nhóm khu vực */
.inport-table tr.group-header-row td {
    background: #1565C0;
    padding: 7px 14px;
    white-space: normal;
    overflow: visible;
}

.inport-table .group-name {
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.inport-table .group-count {
    float: right;
    font-size: 11px;
    font-weight: normal;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 1px 8px;
    border-radius: 8px;
}

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}

/* ── Summary bar ────────────────────────────────────────────── */
.summary-bar {
    background: #e8f0fb;
    border: 1px solid #b0c8e8;
    border-radius: 4px;
    padding: 10px 16px;
    margin-top: 12px;
    font-size: 13px;
    color: #065DAB;
    font-weight: bold;
}

/* ── Footer ─────────────────────────────────────────────────── */
.page-footer {
    text-align: center;
    color: #888;
    font-size: 11px;
    margin-top: 30px;
    padding-top: 12px;
    border-top: 1px solid #dde4ee;
}

/* ── Loading spinner ─────────────────────────────────────────── */
#loadingOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

#loadingOverlay.show { display: flex; }

.spinner {
    width: 40px; height: 40px;
    border: 4px solid #c8d8ec;
    border-top-color: #065DAB;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-bar { flex-direction: column; align-items: flex-start; }
    .nav-bar nav a { padding: 10px 14px; }
    .filter-bar { flex-direction: column; align-items: flex-start; }
    .page-wrapper { padding: 0 8px 30px; }
}
