/* =========================================================
   MAURITIUS IMMIGRANTS
   COMPLETE GLOBAL STYLESHEET
   Heritage Navy / Gold / Teal Theme
========================================================= */

/* 1. COLOUR VARIABLES */

:root {
    --navy: #102d3b;
    --navy-dark: #0c2430;
    --navy-light: #203b4a;
    --gold: #c99a4b;
    --gold-light: #ead4ad;
    --teal: #28677a;
    --teal-dark: #20566a;

    --background: #f3f6f7;
    --white: #ffffff;
    --text: #203344;
    --muted: #71869a;
    --border: #e1e8ec;

    --blue-light: #edf4f7;
    --success: #287653;
    --danger: #b94040;

    --shadow: 0 8px 28px rgba(16,45,59,.07);
}

/* 2. RESET AND GLOBAL */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

main {
    flex: 1;
}

a {
    color: var(--teal);
    transition: color .2s ease;
}

a:hover {
    color: var(--navy);
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* 3. NAVIGATION BAR */

.site-nav {
    background: var(--navy) !important;
    min-height: 73px;
    padding: 11px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    position: relative;
    z-index: 100;
}

.site-nav .navbar-brand {
    color: var(--white) !important;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -.3px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.site-nav .navbar-brand:hover {
    color: var(--gold-light) !important;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: var(--navy);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
}

.site-nav .nav-link {
    color: #b9c7ce !important;
    font-size: .9rem;
    font-weight: 600;
    padding: 9px 13px;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
    color: var(--white) !important;
}

.site-nav .navbar-text {
    color: #b9c7ce !important;
}

.site-nav .navbar-toggler {
    border-color: rgba(255,255,255,.35);
}

.site-nav .navbar-toggler:focus {
    box-shadow: 0 0 0 .2rem rgba(255,255,255,.15);
}

.site-nav .btn-light {
    background: var(--white);
    color: var(--navy);
    border: none;
    font-weight: 700;
}

.site-nav .btn-light:hover {
    background: var(--gold-light);
    color: var(--navy);
}

/* 4. PAGE LAYOUT */

.page-wrap {
    width: 100%;
    padding-top: 35px;
    padding-bottom: 45px;
}

.page-title,
.dashboard-title {
    color: var(--navy);
    font-weight: 800;
    letter-spacing: -.5px;
}

.page-title {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.page-subtitle,
.dashboard-subtitle {
    color: var(--muted);
}

.muted {
    color: var(--muted) !important;
}

.eyebrow {
    color: #ad7930;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* 5. LOGIN AND REGISTRATION */

.auth-shell {
    width: 100%;
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 45px 15px;
}

.auth-panel {
    width: 100%;
    max-width: 467px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 21px;
    padding: 38px 40px;
    box-shadow: 0 12px 35px rgba(16,45,59,.045);
}

.auth-panel h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.auth-panel > .muted {
    font-size: .93rem;
    margin-bottom: 28px;
}

.auth-panel .form-label {
    color: var(--navy-light);
    font-size: .86rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-panel .form-control {
    min-height: 55px;
    border: 1px solid #dce4e9;
    border-radius: 9px;
    background: var(--white);
    color: var(--text);
}

.auth-panel .form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(40,103,122,.12);
}

.auth-panel a {
    color: #0868d8;
    font-weight: 650;
    text-decoration: none;
}

.auth-panel a:hover {
    text-decoration: underline;
}

/* 6. BUTTONS */

.btn {
    border-radius: 8px;
    font-weight: 650;
    transition: all .2s ease;
}

.btn-primary,
.auth-panel .btn-primary {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.btn-primary:hover,
.auth-panel .btn-primary:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
    transform: translateY(-1px);
}

.auth-panel .btn-primary {
    min-height: 47px;
    border-radius: 9px;
    font-weight: 700;
}

.btn-outline-primary {
    color: var(--teal);
    border-color: var(--teal);
}

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

.btn-outline-secondary {
    color: var(--muted);
    border-color: #cbd5dc;
}

.btn-outline-secondary:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}

.btn-outline-light:hover {
    color: var(--navy);
}

.btn:focus {
    box-shadow: 0 0 0 .2rem rgba(40,103,122,.15);
}

/* 7. GENERAL FORMS */

.form-page {
    max-width: 1050px;
    margin: 0 auto;
}

.form-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.form-label {
    color: var(--navy-light);
    font-weight: 700;
    font-size: .88rem;
}

.form-control,
.form-select {
    border: 1px solid #dce4e9;
    border-radius: 8px;
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 .2rem rgba(40,103,122,.12);
}

.form-control-lg {
    font-size: .95rem;
}

.form-text {
    color: var(--muted);
    font-size: .8rem;
}

.details-area {
    min-height: 250px;
    resize: vertical;
}

/* 8. GENERAL CARDS */

.card,
.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.card-header {
    background: #edf2f4;
    color: var(--navy);
    font-weight: 750;
    border-bottom: 1px solid var(--border);
}

.panel {
    padding: 22px;
}

/* 9. DASHBOARD */

.dashboard-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 25px 45px;
}

.dashboard-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    margin-bottom: 5px;
}

.dashboard-subtitle {
    font-size: .9rem;
}

.total-card {
    height: 100%;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 22px;
    box-shadow: var(--shadow);
    transition: transform .2s ease;
}

.total-card:hover {
    transform: translateY(-3px);
}

.total-card h3,
.total-card h4 {
    color: var(--navy);
    font-weight: 800;
}

.total-card .text-muted {
    color: var(--muted) !important;
}

/* Dashboard filter */

.filter-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 23px;
    margin: 22px 0;
    box-shadow: var(--shadow);
}

/* Dashboard archive table card */

.table-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-card-header {
    padding: 19px 22px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.table-card-header h3,
.table-card-header h4 {
    color: var(--navy);
    font-weight: 750;
    margin: 0;
}

/* 10. IMMIGRANT TABLE */

.immigrant-table {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
    border-collapse: separate;
    border-spacing: 0;
}

.immigrant-table thead th {
    background: #edf2f4;
    color: var(--navy-light);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 16px 15px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.immigrant-table tbody td {
    padding: 14px 15px;
    border-bottom: 1px solid #edf1f3;
    color: var(--text);
}

.immigrant-table tbody tr:nth-child(even) {
    background: #fafcfc;
}

.immigrant-table tbody tr:hover {
    background: #edf4f5;
}

.immigrant-photo {
    width: 48px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 7px rgba(0,0,0,.1);
}

.no-photo {
    width: 48px;
    height: 54px;
    border-radius: 8px;
    background: #eaf0f2;
    color: #879ba5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.immigrant-name {
    color: var(--navy);
    font-size: .9rem;
    font-weight: 750;
}

.immigrant-number {
    display: inline-block;
    background: #edf3f5;
    color: var(--teal);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: .76rem;
    font-weight: 750;
    white-space: nowrap;
}

.origin-badge {
    display: inline-block;
    background: #f5f0e7;
    color: #98703a;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: .76rem;
    font-weight: 650;
}

.view-btn {
    font-weight: 650;
    white-space: nowrap;
}

.desktop-immigrant-table {
    width: 100%;
}

/* 11. MOBILE IMMIGRANT CARDS */

.mobile-immigrant-list {
    display: none;
}

.mobile-immigrant-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 3px 12px rgba(16,45,59,.04);
}

.mobile-immigrant-photo,
.mobile-no-photo {
    width: 62px;
    height: 72px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
}

.mobile-no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf2f4;
    color: var(--muted);
    font-size: 23px;
}

.mobile-immigrant-info {
    flex: 1;
    min-width: 0;
}

.mobile-immigrant-info .immigrant-name {
    margin-bottom: 5px;
}

.mobile-number {
    color: var(--teal);
    font-size: .78rem;
    font-weight: 750;
}

.mobile-origin {
    color: var(--muted);
    font-size: .8rem;
}

.mobile-view-btn {
    margin-top: 9px;
}

/* 12. ARCHIVE TABLE COMPONENTS */

.archive-table-wrapper {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.archive-table {
    margin-bottom: 0;
    vertical-align: middle;
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.archive-table thead th {
    background: #edf2f4;
    color: var(--navy-light);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 750;
    padding: 17px 20px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.archive-table tbody td {
    padding: 15px 20px;
    border-bottom: 1px solid #edf1f3;
    transition: background .2s ease;
}

.archive-table tbody tr:nth-child(even) {
    background: #fafcfc;
}

.archive-table tbody tr:nth-child(odd) {
    background: var(--white);
}

.archive-table tbody tr:hover {
    background: #edf4f5;
    box-shadow: inset 4px 0 0 var(--teal);
}

.archive-table tbody tr:last-child td {
    border-bottom: none;
}

.record-thumb,
.record-thumb-placeholder {
    width: 52px;
    height: 58px;
    border-radius: 9px;
    flex-shrink: 0;
}

.record-thumb {
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: 0 2px 7px rgba(0,0,0,.12);
}

.record-thumb-placeholder {
    background: #eaf0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8294aa;
    font-size: 22px;
}

.immigrant-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 210px;
}

.immigrant-label {
    font-size: .72rem;
    color: var(--muted);
}

.record-id {
    display: inline-block;
    background: #edf3f5;
    color: var(--teal);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .77rem;
    font-weight: 750;
    white-space: nowrap;
}

.record-origin {
    color: #5c6d82;
    font-size: .86rem;
}

.btn-view-record {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #edf3f5;
    color: var(--teal);
    border: 1px solid #dce8eb;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    padding: 9px 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}

.btn-view-record:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
    transform: translateY(-1px);
}

.archive-table tbody tr:hover .record-id {
    background: #dcebed;
}

.archive-table tbody tr:hover .immigrant-name {
    color: var(--teal);
}

/* 13. IMMIGRANT RECORD DETAILS */

.record-page {
    max-width: 1100px;
    margin: 0 auto;
}

.record-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--teal);
    text-decoration: none;
    font-weight: 700;
}

.back-link:hover {
    color: var(--navy);
}

.profile-header {
    background: var(--navy);
    color: var(--white);
    padding: 30px;
    border-radius: 15px 15px 0 0;
}

.profile-header h1,
.profile-header h2 {
    color: var(--white);
    font-family: Georgia, "Times New Roman", serif;
}

.record-label {
    color: var(--gold-light);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.profile-origin {
    color: #c3d0d6;
    font-size: .9rem;
}

.record-number-box {
    display: inline-block;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: var(--gold-light);
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 750;
}

.profile-body {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 15px 15px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.profile-photo {
    width: 180px;
    max-height: 230px;
    object-fit: cover;
    border-radius: 12px;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
}

.no-profile-photo {
    width: 180px;
    height: 200px;
    background: #edf2f4;
    color: var(--muted);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
}

.section-heading {
    color: var(--navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 700;
    padding-bottom: 10px;
    margin-bottom: 17px;
    border-bottom: 1px solid var(--border);
}

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

.metadata-item {
    background: #f6f8f9;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 13px 15px;
}

.metadata-item strong,
.metadata-item .record-label {
    display: block;
    margin-bottom: 5px;
}

.metadata-item strong {
    color: var(--navy);
}

.short-description {
    background: #f5f8f8;
    border-left: 4px solid var(--gold);
    border-radius: 5px;
    padding: 17px 20px;
    color: #536a79;
}

.historical-section {
    margin-top: 25px;
}

.historical-text {
    color: #344c5b;
    font-size: .97rem;
    line-height: 1.85;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.record-footer {
    border-top: 1px solid var(--border);
    margin-top: 30px;
    padding-top: 18px;
    color: var(--muted);
    font-size: .82rem;
}

/* 14. EMPTY STATES */

.empty-message {
    padding: 35px 20px;
    text-align: center;
    color: var(--muted);
}

/* 15. PAGINATION */

.pagination {
    gap: 4px;
}

.pagination .page-link {
    color: var(--teal);
    border-color: var(--border);
    border-radius: 6px;
}

.pagination .page-item.active .page-link {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
}

.pagination .page-item.disabled .page-link {
    color: #aab5bc;
}

/* 16. ALERTS */

.alert {
    border-radius: 9px;
    border: 1px solid transparent;
}

.alert-success {
    background: #edf7f1;
    color: #276747;
    border-color: #d3eadd;
}

.alert-danger {
    background: #fff1f0;
    color: #a13b38;
    border-color: #f2d6d4;
}

.alert-warning {
    background: #fff8e9;
    color: #87642c;
    border-color: #f0e3c2;
}

.alert-info {
    background: #edf5f8;
    color: #28677a;
    border-color: #d7e8ee;
}

/* 17. FOOTER */

.site-footer {
    margin-top: auto;
    background: var(--white);
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 20px 0;
    font-size: .82rem;
    text-align: center;
}

/* 18. RESPONSIVE TABLET */

@media (max-width: 991px) {

    .site-nav .navbar-collapse {
        padding-top: 13px;
    }

    .site-nav .navbar-nav {
        align-items: flex-start !important;
    }

    .site-nav .nav-link {
        padding-left: 0;
    }

    .dashboard-container {
        padding-left: 18px;
        padding-right: 18px;
    }

}

/* 19. RESPONSIVE MOBILE */

@media (max-width: 767px) {

    body {
        font-size: 14px;
    }

    .site-nav {
        min-height: 62px;
    }

    .site-nav .navbar-brand {
        font-size: .95rem;
    }

    .page-wrap {
        padding: 23px 15px 30px;
    }

    .auth-shell {
        min-height: auto;
        padding: 30px 12px;
    }

    .auth-panel {
        max-width: 100%;
        padding: 28px 22px;
        border-radius: 16px;
    }

    .auth-panel h1 {
        font-size: 1.9rem;
    }

    .dashboard-container {
        padding: 18px 12px 30px;
    }

    .dashboard-title {
        font-size: 1.65rem;
    }

    .filter-card {
        padding: 16px;
    }

    .table-card-header {
        padding: 15px;
    }

    .desktop-immigrant-table {
        display: none;
    }

    .mobile-immigrant-list {
        display: block;
        padding: 12px;
    }

    .form-card {
        padding: 19px;
    }

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

    .profile-header {
        padding: 22px;
    }

    .profile-body {
        padding: 20px;
    }

    .profile-photo,
    .no-profile-photo {
        width: 140px;
        height: 170px;
    }

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

    .record-toolbar .toolbar-buttons {
        width: 100%;
    }

    .record-toolbar .btn {
        flex: 1;
    }

    .archive-table-wrapper {
        border-radius: 10px;
    }

    .archive-table {
        min-width: 650px;
    }

    .archive-table thead th,
    .archive-table tbody td {
        padding: 12px 14px;
    }

    .record-thumb,
    .record-thumb-placeholder {
        width: 44px;
        height: 50px;
    }

    .immigrant-profile {
        min-width: 190px;
    }

    .panel {
        padding: 16px;
    }

}

/* 20. SMALL MOBILE */

@media (max-width: 400px) {

    .auth-panel {
        padding: 24px 17px;
    }

    .auth-panel h1 {
        font-size: 1.65rem;
    }

    .site-nav .navbar-brand {
        font-size: .86rem;
    }

    .dashboard-title {
        font-size: 1.45rem;
    }

    .mobile-immigrant-card {
        padding: 11px;
        gap: 10px;
    }

    .mobile-immigrant-photo,
    .mobile-no-photo {
        width: 52px;
        height: 62px;
    }

}

/* 21. ACCESSIBILITY */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(201,154,75,.65);
    outline-offset: 2px;
}

/* 22. REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }

}
