:root {
    --primary-color: #005c42; /* Mas Cargo Deep Green */
    --secondary-color: #8cc63f; /* Mas Cargo Lime Green */
    --bg-light: #f4f7f6;
    --bg-dark: #eef2f0;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1e1e1e;
    --text-secondary: #4a4a4a;
    --error-color: #d32f2f;
    --border-color: rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Gradients */
.bg-blobs {
    position: fixed;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    top: 0;
    left: 0;
}

.blob {
    position: absolute;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 0.12;
    border-radius: 50%;
}
.blob1 { width: 60vw; height: 60vw; top: -10vw; left: -10vw; max-width: 600px; max-height: 600px; }
.blob2 { width: 50vw; height: 50vw; bottom: -10vw; right: -10vw; max-width: 500px; max-height: 500px; }

/* Login Container */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeIn 0.6s ease-out forwards;
}

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

h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

p.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

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

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 92, 66, 0.1);
}

.btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #00422f);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 92, 66, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0, 92, 66, 0.3);
}
.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 6px 15px rgba(140, 198, 63, 0.3);
}
.btn-secondary:hover {
    background: #7bb036;
    color: #fff;
}

.error-msg {
    color: var(--error-color);
    background: rgba(211, 47, 47, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
    display: none;
    border-left: 4px solid var(--error-color);
}

/* Dashboard Header */
.dashboard-header {
    text-align: center;
    padding: 2rem 1rem;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1.2rem;
    background: rgba(140, 198, 63, 0.15);
    color: var(--primary-color);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
}

.logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
    cursor: pointer;
    margin-left: 1rem;
    font-weight: 500;
}

.logout-link:hover {
    color: var(--error-color);
    text-decoration: underline;
}

/* Tabs System */
.tabs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.tab-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    border: none;
    background: #e8ebef;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}
.tab-btn:hover {
    background: #d1d8e0;
}
.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 92, 66, 0.2);
}
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-content.active {
    display: block;
}

/* Split Layout */
.split-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}
.form-column {
    flex: 1 1 100%;
}
.preview-column {
    flex: 1 1 100%;
}

@media (min-width: 900px) {
    .split-layout { flex-wrap: nowrap; padding: 0 2rem; }
    .form-column { flex: 0 0 400px; }
    .preview-column { flex: 1; position: sticky; top: 2rem; }
}

.form-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.form-card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    color: var(--primary-color);
}
.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 140px;
}

.ticket-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid #2ecc71;
    border-radius: 12px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}
.ticket-result p {
    color: #2ecc71;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Formal Ticket Canvas */
.ticket-canvas {
    background: #fff;
    padding: 25px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #222;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-radius: 12px;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
}
.ticket-dates { font-size: 1.2rem; font-weight: 800; text-transform: uppercase; color: var(--primary-color); }
.ticket-hr { border: none; border-top: 2px solid #222; margin: 12px 0; }
.ticket-passengers-logo { display: flex; justify-content: space-between; align-items: center; }
.ticket-label { color: #666; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 4px; font-weight: 600; }
.ticket-pax-names { font-weight: 700; font-size: 1.3rem; line-height: 1.4; color: #000; }
.ticket-res-code { margin-top: 20px; }
.ticket-res-val { font-size: 1.1rem; color: #000; font-weight: bold; }
.ticket-departure-header { background: #f9f9f9; padding: 12px; display: flex; align-items: center; font-size: 1.1rem; border-radius: 8px; margin-top: 10px; }
.plane-icon { font-size: 24px; margin-right: 12px; transform: rotate(45deg); display: inline-block; color: var(--primary-color); }
.dep-notice { color: #777; font-size: 0.8rem; margin-left: auto; font-weight: normal; }

.ticket-details-box { display: flex; border: 1px solid #ddd; background: #fff; border-radius: 8px; overflow: hidden; margin-top: 15px; }
.tbox-gray { background: #f4f7f6; padding: 20px; flex: 1; border-right: 1px solid #ddd; }
.tbox-header { font-size: 1rem; color: #555; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; margin-bottom: 5px; }
.tbox-flight { font-weight: 800; font-size: 1.6rem; margin-bottom: 25px; color: var(--primary-color); }
.tlabel { font-size: 0.75rem; color: #666; text-transform: uppercase; font-weight: 600;}
.tval { font-size: 1rem; margin-bottom: 15px; font-weight: 500; color: #111; }
.tval:last-child { margin-bottom: 0; }
.tbox-white { padding: 20px; flex: 2; display: flex; flex-direction: column; justify-content: center; }
.tbox-route { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px dashed #ddd; margin-bottom: 15px; }
.route-point { flex: 1; }
.route-code { font-size: 1.8rem; font-weight: 800; color: #000; }
.route-city { font-size: 0.9rem; color: #666; height: auto; min-height: 40px; margin-bottom: 5px; }
.route-time { font-size: 1.6rem; margin-bottom: 10px; font-weight: 700; color: #000; }
.route-arrow { display: flex; align-items: center; padding: 0 15px; font-size: 1.5rem; color: var(--secondary-color); }
.tbox-right { padding: 20px; flex: 1; border-left: 1px solid #ddd; display: flex; flex-direction: column; justify-content: center; background: #fdfdfd;}
.mb-15 { margin-bottom: 15px; }
.mt-10 { margin-top: 10px; }

.ticket-table { width: 100%; font-size: 0.85rem; margin-top: 20px; border-collapse: collapse; }
.ticket-table thead td { background: #f0f0f0; color: #444; padding: 10px; font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px;}
.ticket-table tbody td { border-bottom: 1px solid #eaeaea; padding: 12px 10px; color: #333; }

/* History Table Styles */
.history-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow-x: auto;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}
.history-table th {
    text-align: left;
    padding: 1rem;
    background: #f4f7f6;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}
.history-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.history-table tr {
    transition: background 0.2s;
}
.history-table tr:hover {
    background: #fafafa;
}
.history-table .badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(140, 198, 63, 0.15);
    color: var(--primary-color);
}
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    margin-top: 0;
}
