/* ==========================================================
   GOOGLE FONTS
========================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');


/* ==========================================================
   CSS VARIABLES
========================================================== */

:root {
    --ink: #172b3a;
    --muted: #6b7c89;
    --blue: #126e82;
    --blue2: #0b5265;
    --paper: #f3f6f8;
    --line: #e2e9ed;
    --white: #fff;
    --orange: #f4a340;
    --red: #a93232;
}


/* ==========================================================
   GLOBAL STYLES
========================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15px 'DM Sans', Arial, sans-serif;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    font-family: Manrope, sans-serif;
    line-height: 1.2;
    margin-top: 0;
}

h1 {
    font-size: clamp(27px, 3vw, 37px);
    margin-bottom: 9px;
}

h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

h3 {
    font-size: 17px;
    margin: 0;
}

code {
    background: #edf2f4;
    padding: 2px 5px;
    border-radius: 4px;
}

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

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--blue);
    margin: 0 0 9px;
}


/* ==========================================================
   HEADER AND NAVIGATION
========================================================== */

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px max(22px, calc((100% - 1180px) / 2));
    background: #102e40;
    color: white;
    box-shadow: 0 4px 16px #16374b18;
}

.brand {
    font: 800 21px Manrope, sans-serif;
    color: white;
    white-space: nowrap;
}

.top nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.top nav a {
    color: #e5f2f5;
    font-size: 13px;
}


/* ==========================================================
   PAGE LAYOUT
========================================================== */

.wrap {
    max-width: 1180px;
    margin: 34px auto;
    padding: 0 22px;
    min-height: 70vh;
}

.panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 22px;
    box-shadow: 0 5px 20px #183b4d06;
}

.narrow {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.hero .button {
    flex-shrink: 0;
}

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-title h2 {
    margin: 0;
}

.section-title a {
    font-size: 13px;
    font-weight: 700;
}


/* ==========================================================
   BUTTONS AND LINKS
========================================================== */

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--blue);
    border: 0;
    border-radius: 8px;
    color: #fff;
    padding: 11px 16px;
    font: 700 13px 'DM Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    margin-top: 18px;
}

button:hover,
.button:hover {
    background: var(--blue2);
    text-decoration: none;
}

.button.secondary {
    background: #eaf2f5;
    color: var(--blue2);
}

.link {
    padding: 0;
    margin: 10px 0 0;
    background: none;
    color: var(--red);
    font-size: 12px;
}

.link:hover {
    background: none;
    text-decoration: underline;
}

.danger {
    color: var(--red);
}

.danger-button {
    background: var(--red);
}

.danger-button:hover {
    background: #7e2222;
}


/* ==========================================================
   STATISTICS CARDS
========================================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    padding: 20px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.stat span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.stat strong {
    display: block;
    font: 800 31px Manrope, sans-serif;
    margin-top: 8px;
}


/* ==========================================================
   FORMS AND INPUTS
========================================================== */

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 7px;
}

input,
textarea,
select {
    font: inherit;
    width: 100%;
    border: 1px solid #ccd8df;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px #126e8219;
}

input[type="file"] {
    padding: 8px;
    font-size: 13px;
}

input[type="checkbox"] {
    width: auto;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form .grow {
    flex: 1;
    min-width: 150px;
}

.inline-form label {
    margin-top: 10px;
}

.inline-form button {
    margin-top: 0;
    white-space: nowrap;
}

.filters {
    display: grid;
    grid-template-columns: 2fr 1.3fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.filters label {
    margin-top: 0;
}

.filters button {
    margin-top: 0;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ==========================================================
   LOGIN AND REGISTRATION
========================================================== */

.auth {
    max-width: 460px;
    margin: 48px auto;
    padding: 32px;
}

.auth p {
    color: var(--muted);
}


/* ==========================================================
   TABLES
========================================================== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    white-space: nowrap;
}

th {
    text-align: left;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #f7f9fa;
}

th,
td {
    padding: 12px 11px;
    border-bottom: 1px solid var(--line);
}

tbody tr:last-child td {
    border-bottom: 0;
}


/* ==========================================================
   RECENT REGISTRATIONS
========================================================== */

.recent-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.recent-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.recent-list li:last-child {
    border-bottom: 0;
}

.recent-list li div span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.recent-list small {
    color: var(--muted);
    text-align: right;
    font-size: 11px;
}


/* ==========================================================
   NOTIFICATIONS
========================================================== */

.flash {
    padding: 14px 17px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.flash.success {
    background: #e6f5ec;
    color: #20643b;
    border: 1px solid #c8ead5;
}

.flash.notice {
    background: #fff4df;
    color: #7c510c;
    border: 1px solid #f4dfb4;
}

.flash.error {
    background: #fff0ef;
    color: #8c2925;
    border: 1px solid #f3cfcc;
}


/* ==========================================================
   EMPTY STATES AND LABELS
========================================================== */

.empty {
    padding: 22px;
    background: #f7f9fa;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
}

.pill {
    display: inline-block;
    background: #edf3f5;
    color: #4d6470;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.pill.warning {
    background: #fff0d9;
    color: #8a590d;
}


/* ==========================================================
   AIRCRAFT AND SIGHTING CARDS
========================================================== */

.sighting-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.aircraft-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 130px 1fr;
    min-width: 0;
}

.plane-photo,
.photo-placeholder {
    width: 130px;
    height: 100%;
    min-height: 190px;
    object-fit: cover;
    background: #eaf1f4;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #82a1ad;
}

.aircraft-info {
    padding: 15px;
    min-width: 0;
}

.aircraft-info > p {
    font-size: 13px;
    margin: 9px 0;
    color: #536775;
}

.aircraft-info .notes {
    white-space: normal;
    overflow-wrap: anywhere;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
    font-weight: 700;
    margin-top: 13px;
}

.edit-photo {
    max-width: 220px;
    max-height: 160px;
    border-radius: 8px;
    object-fit: cover;
}


/* ==========================================================
   AIRCRAFT HISTORY PHOTOGRAPH
========================================================== */

.aircraft-photo-panel {
    width: 100%;
}

.aircraft-photo-container {
    width: 100%;
    text-align: center;
}

.aircraft-history-photo {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}


/* ==========================================================
   REPORTS
========================================================== */

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

.report-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--ink);
    transition: transform .15s, box-shadow .15s;
}

.report-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px #183b4d12;
    text-decoration: none;
}

.report-stat strong {
    margin: 0;
}

.report-stat small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.report-stat b {
    font-size: 12px;
    color: var(--blue);
    margin-top: 4px;
}


/* ==========================================================
   FOOTER
========================================================== */

footer {
    text-align: center;
    color: #8a9aa3;
    font-size: 12px;
    padding: 25px 15px;
    border-top: 1px solid var(--line);
}


/* ==========================================================
   TABLET AND SMALL LAPTOPS
========================================================== */

@media (max-width: 850px) {

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

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

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

    .filters button {
        align-self: end;
    }

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

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

    .top nav {
        gap: 13px;
    }

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

    .wrap {
        margin-top: 22px;
    }

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


/* ==========================================================
   MOBILE PHONES
========================================================== */

@media (max-width: 500px) {

    .wrap {
        padding: 0 12px;
    }

    .panel {
        padding: 17px;
    }

    .stats {
        gap: 9px;
    }

    .stat {
        padding: 14px;
    }

    .stat strong {
        font-size: 25px;
    }

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

    .aircraft-card {
        grid-template-columns: 95px 1fr;
    }

    .plane-photo,
    .photo-placeholder {
        width: 95px;
        min-height: 160px;
    }

    .aircraft-info {
        padding: 11px;
    }

    .recent-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .recent-list small {
        text-align: left;
    }

    .top {
        padding: 16px;
    }

    .auth {
        margin: 20px auto;
    }

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