/* IAPE Air - Airline Design System */
:root {
    --color-navy: #102A43;
    --color-navy-dark: #0B1D2F;
    --color-navy-light: #243B53;
    --color-bg: #F7F8FA;
    --color-card: #FFFFFF;
    --color-yellow: #F5C542;
    --color-yellow-dark: #D4A320;
    --color-green: #16834A;
    --color-green-light: #E6F4EA;
    --color-red: #D93838;
    --color-red-light: #FDE8E8;
    --color-blue: #2B6CB0;
    --color-blue-light: #EBF8FF;
    --color-text: #1F2937;
    --color-text-muted: #6B7280;
    --color-border: #E5E7EB;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Header & Navbar */
.app-header {
    background-color: var(--color-navy);
    color: #FFFFFF;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.03em;
}

.brand-badge {
    background-color: var(--color-yellow);
    color: var(--color-navy-dark);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover, .nav-btn.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #FFFFFF;
}

/* Layout container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
    flex: 1;
}

/* Big Screen (Telão) */
.screen-view {
    min-height: calc(100vh - 65px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at center, #1E3A5F 0%, #102A43 100%);
    color: #FFFFFF;
}

.screen-flight-info {
    margin-bottom: 2rem;
}

.flight-route {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 1.75rem;
    font-weight: 800;
    background: rgba(255,255,255,0.08);
    padding: 0.75rem 1.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(245, 197, 66, 0.4);
    color: var(--color-yellow);
}

.screen-qr-card {
    background: #FFFFFF;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    display: inline-block;
    margin-bottom: 1.5rem;
}

.screen-instruction {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.screen-url {
    font-family: var(--font-mono);
    color: var(--color-yellow);
    font-size: 1.25rem;
    text-decoration: underline;
}

/* Registration Form */
.register-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    margin: 2rem auto;
    border-top: 6px solid var(--color-yellow);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-navy);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--color-navy);
}

.btn-primary {
    width: 100%;
    padding: 0.95rem;
    background-color: var(--color-navy);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-secondary {
    padding: 0.6rem 1.2rem;
    background-color: #E2E8F0;
    color: var(--color-navy);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #CBD5E1;
}

/* Boarding Pass (Bilhete) */
.ticket-wrapper {
    max-width: 480px;
    margin: 1.5rem auto;
}

.boarding-pass {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.ticket-header {
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
    color: #FFFFFF;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-flight-badge {
    background: var(--color-yellow);
    color: var(--color-navy-dark);
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
}

.ticket-route {
    padding: 1.25rem;
    background: #F8FAFC;
    border-bottom: 2px dashed #CBD5E1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-stop {
    display: flex;
    flex-direction: column;
}

.route-code {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-navy);
}

.route-city {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.route-arrow {
    font-size: 1.5rem;
    color: var(--color-yellow-dark);
}

.ticket-body {
    padding: 1.5rem;
    text-align: center;
}

.passenger-name-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 600;
}

.passenger-name-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-navy);
    margin-bottom: 1rem;
}

.booking-ref-box {
    display: inline-flex;
    flex-direction: column;
    background: #F1F5F9;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.booking-ref-code {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-navy);
    letter-spacing: 0.1em;
}

.qr-container {
    background: #FFFFFF;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: inline-block;
    margin: 0 auto 1.5rem;
}

.journey-progress {
    text-align: left;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.journey-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
}

.sections-list {
    list-style: none;
    position: relative;
    padding-left: 1.75rem;
}

.sections-list::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: #CBD5E1;
}

.section-item {
    position: relative;
    margin-bottom: 1rem;
}

.section-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #94A3B8;
}

.section-item.confirmed::before {
    background: var(--color-green);
    border-color: var(--color-green);
}

.section-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.section-item-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Operator Gate & Scanner */
.gate-container {
    max-width: 600px;
    margin: 1rem auto;
}

.gate-header-box {
    background: var(--color-navy);
    color: #FFFFFF;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scanner-view-box {
    background: #000000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    min-height: 280px;
    margin-bottom: 1rem;
}

.feedback-banner {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.feedback-green {
    background: var(--color-green-light);
    color: var(--color-green);
    border: 2px solid var(--color-green);
}

.feedback-blue {
    background: var(--color-blue-light);
    color: var(--color-blue);
    border: 2px solid var(--color-blue);
}

.feedback-red {
    background: var(--color-red-light);
    color: var(--color-red);
    border: 2px solid var(--color-red);
}

.feedback-yellow {
    background: #FEF9C3;
    color: #854D0E;
    border: 2px solid #EAB308;
}

/* Admin Dashboard Tables & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #FFFFFF;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-navy);
}

.stat-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-navy);
}

.stat-lbl {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.admin-card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background-color: #F8FAFC;
    color: var(--color-navy);
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-green { background: var(--color-green-light); color: var(--color-green); }
.badge-blue { background: var(--color-blue-light); color: var(--color-blue); }
.badge-yellow { background: #FEF9C3; color: #854D0E; }
.badge-red { background: var(--color-red-light); color: var(--color-red); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Print Friendly */
@media print {
    body { background: #FFFFFF; }
    .app-header, .no-print { display: none !important; }
    .ticket-wrapper { margin: 0 auto; box-shadow: none; border: 2px solid #000000; }
    .boarding-pass { box-shadow: none; border: none; }
}
