/* ================================================================
   fleet_check.css — HiFleetCare Template Builder
   Dark-first. fck- prefix. Light theme via body[data-theme="light"].
   ================================================================ */

/* ── Page shell ────────────────────────────────────────────────── */
.fck-page {
    min-height: 100vh;
    background: #1a1f2e;
    color: #e8eaf0;
    padding: 16px;
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────── */
.fck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #252b3b;
    border-radius: 8px;
    border: 1px solid #2d3548;
    flex-wrap: wrap;
    gap: 8px;
}

.fck-title-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.fck-brand {
    font-size: 20px;
    font-weight: 700;
    color: #4a90d9;
    letter-spacing: 0.5px;
}

.fck-page-subtitle {
    font-size: 16px;
    color: #9aa3b5;
    font-weight: 400;
}

.fck-status-bar {
    font-size: 13px;
    padding: 4px 0;
    min-height: 20px;
}

/* ── Main layout: list + editor ─────────────────────────────────── */
.fck-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.fck-list-col {
    flex: 0 0 240px;
    background: #252b3b;
    border: 1px solid #2d3548;
    border-radius: 8px;
    overflow: hidden;
}

.fck-editor-col {
    flex: 1;
    min-width: 0;
    background: #252b3b;
    border: 1px solid #2d3548;
    border-radius: 8px;
    overflow: hidden;
}

/* ── Panel header ───────────────────────────────────────────────── */
.fck-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #2d3548;
    background: #1e2537;
}

.fck-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #e8eaf0;
}

.fck-editor-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Template list ──────────────────────────────────────────────── */
.fck-template-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

.fck-template-card {
    padding: 10px 12px;
    background: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.fck-template-card:hover {
    border-color: #4a90d9;
    background: #1e2537;
}

.fck-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.fck-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #e8eaf0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.fck-card-meta {
    font-size: 11px;
    color: #9aa3b5;
}

/* ── Sections ───────────────────────────────────────────────────── */
.fck-section {
    padding: 16px;
    border-top: 1px solid #2d3548;
}

.fck-section-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.fck-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #e8eaf0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fck-hint {
    font-size: 11px;
    color: #9aa3b5;
    font-style: italic;
}

/* ── Form layout ────────────────────────────────────────────────── */
.fck-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.fck-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.fck-field-wide {
    flex: 2;
    min-width: 200px;
}

.fck-label {
    font-size: 11px;
    color: #9aa3b5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.fck-input {
    background: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: 5px;
    color: #e8eaf0;
    padding: 7px 10px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.fck-input:focus {
    outline: none;
    border-color: #4a90d9;
}

.fck-input-sm {
    background: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: 5px;
    color: #e8eaf0;
    padding: 6px 8px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.fck-dropdown .Select-control,
.fck-dropdown .Select--single > .Select-control {
    background: #1a1f2e !important;
    border: 1px solid #2d3548 !important;
    color: #e8eaf0 !important;
    border-radius: 5px;
    min-height: 34px;
}

.fck-dropdown .Select-placeholder,
.fck-dropdown .Select-value-label {
    color: #e8eaf0 !important;
}

.fck-dropdown .Select-menu-outer {
    background: #252b3b !important;
    border: 1px solid #2d3548 !important;
    z-index: 1000;
}

.fck-dropdown .Select-option {
    background: #252b3b !important;
    color: #e8eaf0 !important;
}

.fck-dropdown .Select-option:hover,
.fck-dropdown .Select-option.is-focused {
    background: #1e2537 !important;
}

.fck-checks-row {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-top: 4px;
}

.fck-check label {
    font-size: 13px;
    color: #e8eaf0;
    cursor: pointer;
}

/* ── Zone editor layout ─────────────────────────────────────────── */
.fck-zone-editor-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.fck-image-col {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fck-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1e2537;
    border: 2px dashed #2d3548;
    border-radius: 8px;
    overflow: hidden;
    min-height: 120px;
}

.fck-vehicle-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 2;
}

.fck-vehicle-img[src=""] {
    display: none;
}

.fck-img-placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    color: #9aa3b5;
    font-size: 13px;
    font-style: italic;
    pointer-events: none;
}

.fck-zone-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.fck-draw-preview {
    position: absolute;
    display: none;
    border: 2px dashed #4a90d9;
    background: rgba(74, 144, 217, 0.35);
    border-radius: 3px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 8;
}

.fck-click-capture {
    position: absolute;
    inset: 0;
    cursor: crosshair;
    z-index: 10;
}

.fck-zone-marker {
    position: absolute;
    box-sizing: border-box;
    pointer-events: none;
}

.fck-zone-marker-label {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
    overflow: hidden;
    max-width: 90%;
}

.fck-upload {
    border: 1px dashed #2d3548;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    background: #1a1f2e;
    transition: border-color 0.15s;
}

.fck-upload:hover {
    border-color: #4a90d9;
}

.fck-upload-label {
    font-size: 12px;
    color: #9aa3b5;
}

.fck-upload-hint {
    font-size: 10px;
    color: #6c757d;
    margin-top: 2px;
}

.fck-zone-form-col {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fck-row {
    display: flex;
    gap: 8px;
}

.fck-field-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Zone / item tables ─────────────────────────────────────────── */
.fck-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fck-zone-select-btn {
    background: transparent;
    border: none;
    color: #4a90d9;
    cursor: pointer;
    padding: 0;
    font-size: 13px;
    text-decoration: underline;
}

.fck-zone-select-btn:hover {
    color: #74b9ff;
}

.fck-remove-btn {
    background: #dc354522;
    border: 1px solid #dc354555;
    color: #dc3545;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.fck-remove-btn:hover {
    background: #dc354544;
}

.fck-empty-hint {
    color: #9aa3b5;
    font-size: 12px;
    font-style: italic;
    padding: 8px 0;
}

/* ── Approval status ────────────────────────────────────────────── */
.fck-approval-status {
    font-size: 13px;
}

.fck-approval-row {
    margin-bottom: 6px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.fck-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, filter 0.15s;
    white-space: nowrap;
}

.fck-btn:hover {
    filter: brightness(1.15);
}

.fck-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.fck-btn-primary {
    background: #4a90d9;
    color: #fff;
}

.fck-btn-success {
    background: #5ec97e;
    color: #1a1f2e;
}

.fck-btn-warning {
    background: #fd7e14;
    color: #fff;
}

.fck-btn-secondary {
    background: #2d3548;
    color: #e8eaf0;
    border: 1px solid #3d4560;
}

.fck-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.fck-btn-block {
    width: 100%;
}

.fck-btn-hidden {
    display: none !important;
}

/* ── Light theme overrides ─────────────────────────────────────── */
body[data-theme="light"] .fck-page          { background: #f0f2f5; color: #1a1f2e; }
body[data-theme="light"] .fck-header        { background: #ffffff; border-color: #dde1eb; }
body[data-theme="light"] .fck-list-col      { background: #ffffff; border-color: #dde1eb; }
body[data-theme="light"] .fck-editor-col    { background: #ffffff; border-color: #dde1eb; }
body[data-theme="light"] .fck-panel-head    { background: #f8f9fc; border-color: #dde1eb; }
body[data-theme="light"] .fck-panel-title   { color: #1a1f2e; }
body[data-theme="light"] .fck-template-card { background: #f8f9fc; border-color: #dde1eb; }
body[data-theme="light"] .fck-template-card:hover { background: #eef1f7; border-color: #4a90d9; }
body[data-theme="light"] .fck-section       { border-color: #dde1eb; }
body[data-theme="light"] .fck-input         { background: #ffffff; border-color: #ced4da; color: #1a1f2e; }
body[data-theme="light"] .fck-input-sm      { background: #ffffff; border-color: #ced4da; color: #1a1f2e; }
body[data-theme="light"] .fck-upload        { background: #f8f9fc; border-color: #ced4da; }
body[data-theme="light"] .fck-image-container { background: #f0f2f5; border-color: #ced4da; }
body[data-theme="light"] .fck-img-placeholder  { color: #6c757d; }
body[data-theme="light"] .fck-draw-preview     { border-color: #2272c3; background: rgba(34, 114, 195, 0.25); }
body[data-theme="light"] .fck-check label   { color: #1a1f2e; }
body[data-theme="light"] .fck-brand         { color: #2272c3; }
body[data-theme="light"] .fck-page-subtitle { color: #6c757d; }

/* ── Responsive: ≤768px stack columns ──────────────────────────── */
@media (max-width: 768px) {
    .fck-main {
        flex-direction: column;
    }
    .fck-list-col {
        flex: none;
        width: 100%;
    }
    .fck-zone-editor-row {
        flex-direction: column;
    }
    .fck-zone-form-col {
        flex: none;
        width: 100%;
    }
}

/* ── Responsive: ≤390px (mobile) ───────────────────────────────── */
@media (max-width: 390px) {
    .fck-page {
        padding: 8px;
    }
    .fck-header {
        padding: 8px 12px;
    }
    .fck-btn {
        padding: 10px 12px;
        font-size: 14px;
        min-height: 44px;
    }
    .fck-input {
        padding: 10px;
        font-size: 15px;
    }
}
