/* Tank gauge visualization */
.tank-gauge {
    width: 100%;
    height: 2rem;
    background: var(--pico-secondary-background);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.tank-gauge-fill {
    height: 100%;
    background: var(--pico-primary);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
}

.tank-gauge-fill.low {
    background: #e53935;
}

.tank-gauge-fill.medium {
    background: #fb8c00;
}

/* Tank gauge numeric label (UX5) */
.tank-gauge-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin-bottom: 1rem;
}

/* FIFO progress bars */
.fifo-bar {
    width: 100%;
    height: 1rem;
    background: var(--pico-secondary-background);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
}

.fifo-bar-fill {
    height: 100%;
    background: var(--pico-primary);
}

/* Flash messages (UX4) */
.flash {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
    position: relative;
    transition: opacity 0.4s ease;
}

.flash-success, .flash.success {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
    background: #c8e6c9;
    color: #2e7d32;
    position: relative;
}

.flash-error, .flash.error {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
    background: #ffcdd2;
    color: #c62828;
    position: relative;
}

.flash-warning, .flash.warning {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
    background: #fff3cd;
    color: #856404;
    position: relative;
}

.flash-info, .flash.info {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
    background: #d1ecf1;
    color: #0c5460;
    position: relative;
}

.flash-dismiss {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
}

.flash-dismiss:hover {
    opacity: 1;
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1rem;
    border-radius: var(--pico-border-radius);
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.25rem;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Table improvements */
table {
    font-size: 0.9rem;
}

/* Sticky table header */
.table-scroll {
    max-height: 75vh;
    overflow-y: auto;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
}

.table-scroll table {
    margin-bottom: 0;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    background: var(--pico-background-color);
    z-index: 1;
    box-shadow: 0 1px 0 var(--pico-muted-border-color);
}

.text-right {
    text-align: right;
}

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

/* Delivery row highlight */
tr.delivery-row {
    background: #e3f2fd;
}

/* Text color utilities */
.text-success {
    color: #2e7d32;
}

.text-danger {
    color: #c62828;
}

/* Site header & navigation (UX2) */
.site-header {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.nav-bar {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.nav-toggle {
    all: unset !important;
    display: none !important;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--pico-color) !important;
    background: transparent !important;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    padding: 0.25rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--pico-color);
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.nav-links a[aria-current="page"] {
    font-weight: bold;
    color: var(--pico-primary);
}

.nav-links a:hover {
    color: var(--pico-primary);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block !important;
        background: transparent !important;
        color: var(--pico-color) !important;
    }
    .nav-links {
        display: none !important;
        flex-direction: column;
        gap: 0;
    }
    .nav-links.open {
        display: flex !important;
    }
    .nav-links a {
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--pico-muted-border-color);
    }
}

/* Action links on dashboard (WF4) */
.action-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-links a {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

.action-links .warning-btn {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
    font-weight: bold;
}

/* Month comparison table (FI6) */
.month-comparison {
    overflow-x: auto;
}

.month-comparison table th.current-month {
    background: var(--pico-primary-focus);
}

.month-comparison table td.current-month {
    background: rgba(52, 152, 219, 0.05);
    font-weight: bold;
}

/* Delete button inline */
.btn-delete {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Edit button inline */
.btn-edit {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Utility: no text wrapping */
.text-nowrap {
    white-space: nowrap;
}

/* Utility: hidden element */
.hidden {
    display: none !important;
}

/* Nav-Logo (App-Name als Home-Link) */
.nav-logo {
    text-decoration: none;
    color: var(--pico-color);
    font-weight: bold;
    font-size: 1rem;
}

.nav-logo:hover {
    color: var(--pico-primary);
    text-decoration: none;
}

/* Small button variant (replaces inline padding/font-size) */
.btn-sm {
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
}

/* Export button row (replaces inline-block + margin-right) */
.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Chart canvas bottom spacing */
.chart-canvas {
    margin-bottom: 2rem;
}

/* Required field hint */
.required-hint {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin-bottom: 1rem;
}

/* Hint text below headings / explanatory paragraphs */
.hint-text {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Inline form (e.g. delete buttons inside table cells) */
.form-inline {
    display: inline;
    margin: 0;
}

/* Inline form with left margin (e.g. inside info banners) */
.form-inline--ml {
    margin-left: 0.5rem;
}

/* Inline form with bottom margin (e.g. standalone action above content) */
.form-inline--mb {
    margin-bottom: 1rem;
}

/* Top-spaced details block */
.details-mt {
    margin-top: 0.5rem;
}

/* Top-spaced form inside details */
.form-mt {
    margin-top: 0.5rem;
}

/* Danger table row (e.g. tank below 20% in prognosis table) */
.row-danger {
    color: #e53935;
    font-weight: bold;
}

/* Abschlag recommendation paragraph */
.abschlag-recommendation {
    margin-bottom: 1rem;
}

/* Settlement confirmed banner (replaces Pico-internal var(--pico-ins-color)) */
.settlement-info-banner {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: #c8e6c9;
    color: #1b5e20;
    border-radius: var(--pico-border-radius);
}

/* Overlapping settlements warning banner */
.overlapping-settlements-banner {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff3cd;
    color: #664d03;
    border-radius: var(--pico-border-radius);
}

.overlapping-settlements-note {
    display: block;
    margin-top: 0.25rem;
}

.overlapping-settlements-list {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}
