/* ── Logbook CSS ── */

:root {
    --logbook-color-keypoints: #185FA5;
    --logbook-color-issues: #BA7517;
    --logbook-color-lookahead: #0F6E56;
    --logbook-color-component: #185FA5;
    --logbook-shift-header-bg: #1a2332;
    --logbook-alt-shift-header-bg: #34495e;
    --logbook-separator: #185FA5;
}

/* ── Public logbook header ── */

.logbook-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
    padding-top: 16px;
    padding-bottom: 0;
}

.logbook-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
}

.logbook-header h1 {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 4px;
}

.logbook-header .logbook-subtitle {
    font-size: 15px;
    color: #6c757d;
    margin-bottom: 0;
}

.logbook-header .logbook-site-image {
    width: 100px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.logbook-separator {
    height: 3px;
    background: var(--logbook-separator);
    border: none;
    border-radius: 2px;
    margin: 0;
    opacity: 1;
}

/* ── History page header (inside logbook layout) ── */

.logbook-history-header {
    position: sticky;
    top: 56px; /* below navbar */
    z-index: 9;
    background: #fff;
    padding: 12px 0 0 0;
    margin-bottom: 0;
}

/* ── Shift blocks ── */

.logbook-shift-block {
    margin-bottom: 20px;
    border: none;
}

.logbook-shift-alt .logbook-shift-header {
    background: var(--logbook-alt-shift-header-bg);
}

.logbook-shift-header {
    background: var(--logbook-shift-header-bg);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logbook-shift-header .btn-outline-danger {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.logbook-shift-header .btn-outline-danger:hover,
.logbook-shift-header .btn-danger {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}

.logbook-shift-body {
    background: #fff;
    border: 0.5px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.7;
}

/* ── Section headings ── */

.logbook-section-heading {
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    padding-bottom: 6px;
    margin-top: 16px;
    margin-bottom: 12px;
    border-bottom: 2px solid #999;
}

.logbook-section-heading:first-child {
    margin-top: 0;
}

.logbook-section-heading[data-section="General"],
.logbook-section-heading[data-section="General Comments"] {
    border-bottom-color: var(--logbook-color-keypoints);
}

.logbook-section-heading[data-section="Issues"] {
    border-bottom-color: var(--logbook-color-issues);
}

.logbook-section-heading[data-section="Look-Ahead"] {
    border-bottom-color: var(--logbook-color-lookahead);
}

/* ── Entry lists ── */

.logbook-entries {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.7;
}

.logbook-entries li {
    margin-bottom: 4px;
}

/* ── Component groups ── */

.logbook-component-group {
    margin-left: 8px;
    padding-left: 12px;
    border-left: 3px solid var(--logbook-color-component);
    margin-top: 16px;
    margin-bottom: 8px;
}

.logbook-component-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--logbook-color-component);
    margin-bottom: 6px;
}

.logbook-component-group .logbook-entries {
    padding-left: 16px;
}

/* ── Entry action links (draft mode) ── */

.logbook-entry-actions {
    font-size: 12px;
    opacity: 0.6;
}

.logbook-entry-actions:hover {
    opacity: 1;
}

.logbook-entry-actions a,
.logbook-entry-actions button {
    font-size: 12px;
}

/* ── Footer ── */

.logbook-footer {
    text-align: center;
    padding-top: 24px;
    font-size: 13px;
    color: #6c757d;
}

/* ── Compose page ── */

.compose-section-label {
    font-size: 18px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 10px;
}

/* ── Previous shifts (compose page) ── */

.logbook-previous-shifts {
    opacity: 0.7;
}

.logbook-previous-shifts .logbook-shift-header {
    background: #8c919a;
}

/* ── Admin page cleanup ── */

.logbook-admin-content {
    max-width: 900px;
}

.logbook-compose-form {
    max-width: 900px;
}

/* ── Status page ── */

.status-page-bg {
    background: #d9dadb;
}

.status-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 10px;
}

.status-card-inprogress {
    border-left: 4px solid #EF9F27;
}

.status-card-notstarted {
    border-left: 4px solid #ccc;
}

.status-card-complete {
    border-left: 4px solid #0F6E56;
}

.status-track {
    position: relative;
    height: 10px;
    background: #E6F1FB;
    border-radius: 5px;
    overflow: hidden;
}

.status-track-acq {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #EF9F27;
    border-radius: 5px;
    transition: width 0.3s;
}

.status-track-ana {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #0F6E56;
    border-radius: 5px;
    transition: width 0.3s;
}

.status-input-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.status-input {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: background 0.3s;
}

.status-input-muted {
    color: #94a3b8;
}

.status-input-muted:focus {
    color: #1e293b;
}

.status-input-sm {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    padding: 2px 4px;
    transition: background 0.3s;
}

.status-group-header {
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 2px solid #cbd5e1;
    padding-top: 12px;
    padding-bottom: 4px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.status-group-header:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.status-gauges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.status-gauge-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
}

.status-gauge-card-inprogress {
    border-left: 4px solid #EF9F27;
}

.status-gauge-card-notstarted {
    border-left: 4px solid #ccc;
}

.status-gauge-card-complete {
    border-left: 4px solid #0F6E56;
}

/* ── Status publish modal ── */

.status-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-modal {
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.status-modal h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 12px;
}

.status-modal .status-modal-totals {
    display: flex;
    gap: 24px;
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
}

.status-modal .status-modal-totals div {
    text-align: center;
}

.status-modal .status-modal-totals .label {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.status-modal .status-modal-totals .value {
    font-size: 20px;
    font-weight: 500;
}

/* ── Status site image (larger than logbook default) ── */

.logbook-header .status-site-image {
    width: 140px;
    height: 95px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.status-input-capped {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

/* ── Print styles ── */

@media print {
    .logbook-header {
        position: static;
    }

    .logbook-history-header {
        position: static;
    }

    .logbook-shift-alt .logbook-shift-header {
        background: var(--logbook-shift-header-bg);
    }

    .logbook-shift-header {
        background: #1a2332 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .logbook-shift-block {
        break-inside: avoid;
    }

    .logbook-shift-header .btn,
    .logbook-entry-actions {
        display: none !important;
    }

    .logbook-section-heading {
        border-bottom-width: 2px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .logbook-component-group {
        border-left-width: 3px !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .logbook-footer {
        margin-top: 32px;
    }
}
