* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #0b0f14; color: #f5f7fa; }
a { color: #77c7ff; text-decoration: none; } a:hover { text-decoration: underline; }
.topbar { min-height: 68px; padding: 0 28px; background: rgba(15,21,29,.97); border-bottom: 1px solid #263241; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: sticky; top: 0; z-index: 10; }
.brand,.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 850; letter-spacing: .02em; color: #f8fafc; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: linear-gradient(135deg,#2f80ed,#56ccf2); color: white; font-weight: 900; font-size: .8rem; }
.brand-mark.large { width: 46px; height: 46px; border-radius: 14px; }
.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav a { color: #cbd5e1; font-weight: 650; }
.user-pill { color: #93a4b8; font-size: .95rem; border-left: 1px solid #344154; padding-left: 16px; }
.container { max-width: 1180px; margin: 38px auto; padding: 0 24px; }
.hero-panel,.panel,.stat-card { background: linear-gradient(180deg,#151d29,#101722); border: 1px solid #2b394a; border-radius: 18px; padding: 28px; box-shadow: 0 18px 60px rgba(0,0,0,.25); }
.hero-panel,.panel { margin-bottom: 24px; }
.eyebrow { color: #56ccf2; text-transform: uppercase; font-weight: 850; letter-spacing: .12em; font-size: .76rem; margin: 0 0 10px; }
.hero-copy,.muted,.subtitle,.small-note { color: #aab7c4; }
.grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-value { display: block; font-size: 2.2rem; font-weight: 900; } .stat-label { color: #aab7c4; }
.page-header,.section-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; }
.page-header h1,.panel h2,.hero-panel h1 { margin-top: 0; }
.module-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.module-tile { padding: 18px; border: 1px solid #2d3b4d; border-radius: 14px; background: #0e151f; }
.module-tile strong,.module-tile span,.module-tile em { display: block; }
.module-tile span { margin-top: 8px; color: #aab7c4; } .module-tile em { margin-top: 12px; color: #7e8da0; font-size: .85rem; } .disabled { opacity: .72; }
table { width: 100%; border-collapse: collapse; overflow: hidden; } th,td { border-bottom: 1px solid #263241; padding: 12px 10px; text-align: left; vertical-align: top; }
th { color: #9fb3c8; font-size: .86rem; text-transform: uppercase; letter-spacing: .06em; }
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px; background: radial-gradient(circle at top,#213b56 0,rgba(11,15,20,0) 46%), #0b0f14; }
.login-card { width: 100%; max-width: 440px; background: #151d29; border: 1px solid #334154; border-radius: 22px; padding: 34px; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.login-card h1 { margin: 0; } .subtitle { margin: 18px 0 28px; }
label { display: block; margin: 18px 0 8px; color: #d7e0ea; font-weight: 650; }
input,select,textarea { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid #465666; background: #0c1219; color: #ffffff; outline: none; }
textarea { min-height: 110px; } input:focus,select:focus,textarea:focus { border-color: #56ccf2; box-shadow: 0 0 0 3px rgba(86,204,242,.12); }
button,.button-link { display: inline-block; margin-top: 24px; padding: 13px 16px; border-radius: 12px; border: 0; background: #2f80ed; color: white; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer; }
.button-link:hover,button:hover { filter: brightness(1.08); text-decoration: none; } .button-link.secondary { background: #263648; } .button-link.danger { background: #b83242; } .header-action { margin-top: 0; width: auto; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; } .small-button { width: auto; margin: 0; padding: 9px 13px; } .inline-form { display: inline; }
.error-box { background: #4a1f25; border: 1px solid #9d3c48; color: #ffd9dd; padding: 12px; border-radius: 10px; margin-bottom: 18px; }
.messages { margin-bottom: 20px; } .message { padding: 12px; border-radius: 10px; background: #243244; } .message.success { background: #123d2c; border: 1px solid #2a8c62; } .message.error { background: #4a1f25; border: 1px solid #9d3c48; }
.narrow { max-width: 680px; margin-left: auto; margin-right: auto; } .narrow-wide { max-width: 920px; margin-left: auto; margin-right: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 20px; } .field.full { grid-column: 1 / -1; }
ul.errorlist { color: #ffb4bd; padding-left: 20px; }
.tag { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; } .tag.ok { background: #123d2c; color: #8ff2c1; } .tag.warn { background: #4d3915; color: #ffd38a; }
.credential-box { background: #0c1219; border: 1px solid #3b4d63; border-radius: 14px; padding: 18px; margin: 20px 0; } .credential-box span { display: block; color: #9fb3c8; margin-bottom: 8px; } .credential-box code { font-size: 1.25rem; color: #fff; word-break: break-all; }
.filter-row { display: grid; grid-template-columns: 240px minmax(0,1fr) auto; gap: 16px; align-items: end; } .filter-row button { margin-top: 0; }
.pagination { display: flex; gap: 16px; margin-top: 20px; align-items: center; }
@media (max-width: 920px) { .grid,.stats-grid,.module-grid,.form-grid,.filter-row { grid-template-columns: 1fr; } .topbar,.page-header,.section-row { align-items: flex-start; flex-direction: column; } .container { margin: 24px auto; } }

/* Stage 3 RPAS Assets */
.warning-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.help-text {
    color: #93a4b8;
    font-size: 0.86rem;
    margin: 6px 0 0;
}
.tag.danger {
    background: #5b1f2b;
    color: #ffc3cb;
}
.filter-row.wide {
    grid-template-columns: minmax(160px, 1fr) 180px 180px 180px auto;
}
@media (max-width: 920px) {
    .warning-grid,
    .filter-row.wide {
        grid-template-columns: 1fr;
    }
}

/* Stage 4 Crew & Qualifications */
.qualification-expired,
.training-expired {
    color: #ffc3cb;
    font-weight: 800;
}
.qualification-critical,
.training-critical {
    color: #ffd38a;
    font-weight: 800;
}
.qualification-warning,
.training-warning {
    color: #fff1a8;
}

/* Stage 5 Maintenance & Defects */
.maintenance-critical {
    color: #ffc3cb;
    font-weight: 800;
}
.maintenance-warning {
    color: #ffd38a;
    font-weight: 800;
}

/* Stage 6 Jobs & JSA */
.job-warning {
    color: #ffd38a;
    font-weight: 800;
}
.job-critical {
    color: #ffc3cb;
    font-weight: 800;
}
.airspace-placeholder {
    border: 1px dashed #49647c;
    background: rgba(47, 128, 237, 0.08);
}

/* Stage 7 Airspace & Site Intelligence */
.airspace-map-placeholder {
    border: 1px dashed #56ccf2;
    background: rgba(86, 204, 242, 0.07);
}
.airspace-critical {
    color: #ffc3cb;
    font-weight: 800;
}
.airspace-warning {
    color: #ffd38a;
    font-weight: 800;
}

/* Stage 8 Safety & Compliance */
.sensitive-panel {
    border: 1px dashed #f2c94c;
    background: rgba(242, 201, 76, 0.07);
}
.safety-critical {
    color: #ffc3cb;
    font-weight: 800;
}
.safety-warning {
    color: #ffd38a;
    font-weight: 800;
}

/* Stage 9 Flight Operations & Logbooks */
.dji-placeholder {
    border: 1px dashed #7ed321;
    background: rgba(126, 211, 33, 0.07);
}
.flight-warning {
    color: #ffd38a;
    font-weight: 800;
}
.flight-critical {
    color: #ffc3cb;
    font-weight: 800;
}

/* Stage 10 Flight Sync & Telemetry */
.telemetry-placeholder {
    border: 1px dashed #bb86fc;
    background: rgba(187, 134, 252, 0.08);
}
.telemetry-warning {
    color: #ffd38a;
    font-weight: 800;
}
.telemetry-critical {
    color: #ffc3cb;
    font-weight: 800;
}
.code-block {
    white-space: pre-wrap;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(0,0,0,0.35);
}

/* Stage 10 Flight Sync & Telemetry */
.telemetry-placeholder {
    border: 1px dashed #bb86fc;
    background: rgba(187, 134, 252, 0.08);
}
.telemetry-warning {
    color: #ffd38a;
    font-weight: 800;
}
.telemetry-critical {
    color: #ffc3cb;
    font-weight: 800;
}
.code-block {
    white-space: pre-wrap;
    overflow-x: auto;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(0,0,0,0.35);
}

/* Stage 11 Document & Evidence Management */
.document-placeholder {
    border: 1px dashed #4fc3f7;
    background: rgba(79, 195, 247, 0.08);
}
.document-warning {
    color: #ffd38a;
    font-weight: 800;
}
.document-critical {
    color: #ffc3cb;
    font-weight: 800;
}

/* Stage 12 Reporting & Compliance Exports */
.report-placeholder {
    border: 1px dashed #80cbc4;
    background: rgba(128, 203, 196, 0.08);
}
@media print {
    body { background: #fff !important; color: #111 !important; }
    .topbar, .button-link, button, .messages { display: none !important; }
    .container { max-width: none !important; margin: 0 !important; }
    .panel, .stat-card { box-shadow: none !important; border: 1px solid #aaa !important; background: #fff !important; color: #111 !important; }
}

/* Stage 13 Notifications & Alerts */
.notification-placeholder {
    border: 1px dashed #ffb74d;
    background: rgba(255, 183, 77, 0.08);
}
.severity-critical { color: #ffc3cb; font-weight: 800; }
.severity-warning { color: #ffd38a; font-weight: 800; }
.severity-info { color: #9ad7ff; font-weight: 800; }

/* Stage 14 Map & Airspace Intelligence */
.rpas-map {
    width: 100%;
    height: 620px;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.map-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.map-placeholder {
    border: 1px dashed #81c784;
    background: rgba(129, 199, 132, 0.08);
}

/* Stage 15 Appliance Administration */
.appliance-placeholder {
    border: 1px dashed #ce93d8;
    background: rgba(206, 147, 216, 0.08);
}
.status-ok { color: #9be59b; font-weight: 800; }
.status-warning { color: #ffd38a; font-weight: 800; }
.status-critical { color: #ffc3cb; font-weight: 800; }
.inline-pre {
    white-space: pre-wrap;
    max-width: 700px;
    margin: 0;
}
.log-output {
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 720px;
}

/* Stage 17 Live Integrations & External Connectors */
.integration-placeholder {
    border: 1px dashed #64b5f6;
    background: rgba(100, 181, 246, 0.08);
}

/* Stage 18 Real Email / SMTP Notification Delivery */
.email-placeholder {
    border: 1px dashed #4dd0e1;
    background: rgba(77, 208, 225, 0.08);
}

/* Stage 19 Real Airspace Provider Integration */
.airspace-provider-placeholder {
    border: 1px dashed #81c784;
    background: rgba(129, 199, 132, 0.08);
}

/* Stage 20 Real DJI / Telemetry Import Integration */
.telemetry-placeholder {
    border: 1px dashed #ffb74d;
    background: rgba(255, 183, 77, 0.08);
}

/* Stage 21 Server-Side PDF Generation */
.pdf-placeholder {
    border: 1px dashed #9575cd;
    background: rgba(149, 117, 205, 0.08);
}

/* Stage 22 Mobile / PWA Offline Field Mode */
.fieldmode-panel {
    border: 1px dashed #64b5f6;
    background: rgba(100, 181, 246, 0.08);
}
.status-pill {
    display: inline-block;
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
}
.status-pill.online { background: rgba(76, 175, 80, .18); }
.status-pill.offline { background: rgba(255, 152, 0, .18); }
.field-status-card {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255,255,255,.06);
}

/* Stage 23 Security Hardening */
.security-panel {
    border: 1px dashed #ef5350;
    background: rgba(239, 83, 80, 0.08);
}

/* Stage 24 Backup Restore DR */
.backup-panel {
    border: 1px dashed #26a69a;
    background: rgba(38, 166, 154, 0.08);
}

/* Stage 25 Help Centre */
.help-search-panel input[type="search"] { width: min(760px, 100%); padding: .85rem 1rem; border-radius: .75rem; }
.card-list { display: grid; gap: .75rem; }
.mini-card { display: block; padding: 1rem; border-radius: 1rem; background: rgba(255,255,255,.06); text-decoration: none; }
.mini-card span { display: block; opacity: .75; margin-top: .25rem; }
.help-body { font-size: 1rem; line-height: 1.65; }
@media print {
    .topbar, .button-row, .no-print, .messages { display: none !important; }
    body { background: white !important; color: black !important; }
    .panel { box-shadow: none !important; border: none !important; }
    a { color: black !important; text-decoration: none !important; }
}

/* Stage 26 CASA Audit Pack */
.casa-hero {
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.printable-casa table {
    font-size: .92rem;
}
@media print {
    .topbar, .button-row, .no-print, .messages { display: none !important; }
    body { background: white !important; color: black !important; }
    .panel { box-shadow: none !important; border: none !important; page-break-inside: avoid; }
    table { border-collapse: collapse; width: 100%; }
    td, th { border: 1px solid #333; padding: 4px; }
    a { color: black !important; text-decoration: none !important; }
}

.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
}

.droneworks-return-button {
    margin-left: auto;
    align-self: flex-end;
    background: #b91c1c !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
}

.droneworks-return-button:hover {
    background: #dc2626 !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
}

/* Fix login logo size */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.login-logo {
    display: block;
    width: 120px !important;
    max-width: 120px !important;
    height: auto !important;
    max-height: 120px !important;
    object-fit: contain;
    margin: 0 auto 0.75rem auto;
}

/* Login page logo and favicon-safe sizing */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.login-logo {
    display: block;
    width: 120px !important;
    max-width: 120px !important;
    height: auto !important;
    max-height: 120px !important;
    object-fit: contain;
    margin: 0 auto 0.75rem auto;
}
