﻿:root {
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
}

/* Container max width */
.container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}


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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 2rem;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
    padding-left: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-text span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

/* Navigation */
.nav-tabs {
    display: flex;
    gap: 0.75rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
}

.nav-tab {
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-tab:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.nav-arrow {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding: 0 0.25rem;
}

/* Main Layout */
.w-50 {
    width: 50%;
}

.app-container {
    padding: 1.5rem;
}

.sidebar-container {
    width: 320px;
    min-width: 320px;
    padding: 10px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Quick Info Bar */
.quick-info-bar {
    display: grid;
    grid-template-columns: auto repeat(4, 1fr);
    gap: 1rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    align-items: end;
    color: white;
}

.btn-new-flight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-md);
}

.btn-new-flight:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-new-flight svg { width: 22px; height: 22px; }

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-field input,
.form-field select {
    padding: 0.625rem 0.875rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255,255,255,0.95);
    transition: var(--transition);
    width: 100%;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1rem;
    align-items: start;
}

/* Card Component */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.3s ease forwards;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    cursor: pointer;
    user-select: none;
}

.card-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header svg { width: 18px; height: 18px; opacity: 0.9; }

.card-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transition: var(--transition);
}

.card-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.card.collapsed .card-toggle svg { transform: rotate(-90deg); }
.card.collapsed .card-body { display: none; }
.card-body { padding: 1rem 1.25rem; }

/* Scrollable card body for long lists */
.card-body.scrollable {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fuel & Performance side-by-side row */
.fuel-performance-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    grid-column: 1 / -1;
    align-items: start;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.performance-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Reference weight styling */
.ref-weight {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

/* Fuel system card styling */
#card-fuel .data-table input {
    width: 100%;
    max-width: 120px;
}

.card-body.scrollable::-webkit-scrollbar {
    width: 6px;
}

.card-body.scrollable::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 3px;
}

.card-body.scrollable::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.card-body.scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    text-align: left;
    padding: 0.625rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    background: var(--bg-main);
}

.data-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.data-table .row-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.data-table input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: right;
    transition: var(--transition);
    background: var(--bg-card);
}

.data-table input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.data-table input[readonly] {
    background: var(--bg-main);
    color: var(--text-secondary);
    cursor: default;
}

.data-table .total-row {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
}

.data-table .total-row td {
    font-weight: 600;
    border-bottom: none;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.data-table .total-row input {
    font-weight: 600;
    background: white;
    border-color: var(--primary-light);
}

/* Summary Panel */
.summary-panel {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    color: white;
    box-shadow: var(--shadow-xl);
    grid-column: 1 / -1;
}

.summary-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    margin-bottom: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.summary-item:hover { background: rgba(255,255,255,0.15); }

.summary-item label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.summary-item input {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    outline: none;
}

/* Performance Section */
.performance-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.performance-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.performance-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.performance-card h4 svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.btn-calculate {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.75rem;
}

.btn-calculate:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.result-display {
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    white-space: normal;
    word-wrap: break-word;
}

input.result-display {
    text-align: left;
    padding: 0.625rem 0.75rem;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.chart-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    width: 100%;
}

.chart-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.chart-wrapper canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#cg-status {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

#cg-status.status-ok {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

#cg-status.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.sidebar-card-header {
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-card-body { padding: 0.75rem; }

.sidebar-card img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-card img:hover { transform: scale(1.02); }
.sidebar-card.collapsed .sidebar-card-body { display: none; }

/* Status Classes */
.status-ok { color: var(--success) !important; }
.status-error { color: var(--danger) !important; }

/* Hidden Elements */
canvas { border: 1px solid transparent; display: none; }
.hidden { display: none; }

/* Responsive breakpoints disabled - viewport width=1600 forces desktop layout */

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cards-grid .card:nth-child(1) { animation-delay: 0.05s; }
.cards-grid .card:nth-child(2) { animation-delay: 0.1s; }
.cards-grid .card:nth-child(3) { animation-delay: 0.15s; }
.cards-grid .card:nth-child(4) { animation-delay: 0.2s; }
.cards-grid .card:nth-child(5) { animation-delay: 0.25s; }
.cards-grid .card:nth-child(6) { animation-delay: 0.3s; }
.cards-grid .card:nth-child(7) { animation-delay: 0.35s; }


/* Fixed total row outside scrollable area - matches inline total exactly */
.total-fixed {
    margin: 0 1.25rem;
    width: calc(100% - 2.5rem);
}

/* Hide total-fixed and other elements when card is collapsed */
.card.collapsed .total-fixed,
.card.collapsed > div:not(.card-header):not(.card-body) {
    display: none;
}

/* Adjust scrollable height to account for fixed total */
.card-body.scrollable {
    max-height: 350px;
}
/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.gradient-border { border: 2px solid var(--border); }
.input-small { font-size: 0.8125rem; }
.calculation-display { font-size: 0.9375rem; font-weight: 600; }

.container {
    max-width: 1600px;
    margin: 0 auto;
}


