/* ── Vessel Tracking Widget ────────────────────────────────────────────────── */

.vat-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.5;
}

.vat-panel-heading {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    padding: 0;
}

.vat-no-mmsi,
.vat-no-position {
    color: #666;
    font-style: italic;
    margin: 0;
}

/* ── Position status ─────────────────────────────────────────────────────── */

.vat-position-status {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vat-position-coords,
.vat-position-time,
.vat-position-name {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

/* Structural only — font properties are scoped to .vat-panel below */
.vat-coord-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    min-width: 90px;
}

/* Owner widget font defaults */
.vat-panel .vat-coord-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
}

.vat-panel .vat-coord-val {
    font-family: monospace;
    font-size: 13px;
    color: #1a1a2e;
}

.vat-public-position {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 16px;
    font-size: 14px;
}

/* ── Workflow toggles ────────────────────────────────────────────────────── */

.vat-workflows-heading {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 0 0 12px;
    padding: 0;
}

.vat-workflow {
    margin-bottom: 14px;
}

.vat-workflow:last-of-type {
    margin-bottom: 0;
}

.vat-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.vat-toggle-disabled {
    cursor: default;
    opacity: 0.6;
}

/* Hide native checkbox */
.vat-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom toggle track */
.vat-toggle-track {
    flex-shrink: 0;
    display: inline-block;
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 10px;
    position: relative;
    margin-top: 2px;
    transition: background 0.2s;
}

.vat-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.vat-toggle input:checked + .vat-toggle-track {
    background: #2563eb;
}

.vat-toggle input:checked + .vat-toggle-track::after {
    left: 18px;
}

.vat-workflow-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vat-workflow-label {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vat-workflow-icon {
    font-size: 16px;
}

.vat-workflow-desc {
    font-size: 12px;
    color: #666;
}

.vat-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #e2e8f0;
    color: #555;
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: middle;
}

.vat-coming-soon {
    opacity: 0.65;
}

/* ── Source badge ────────────────────────────────────────────────────────── */

.vat-position-source {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.vat-source-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
}

.vat-source-badge--signalk {
    background: #dbeafe;
    color: #1d4ed8;
}

.vat-source-badge--ais {
    background: #dcfce7;
    color: #15803d;
}

/* ── Vessel Data widget (bare — no container styling) ────────────────────── */

.vat-data-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vat-data-panel .vat-instruments {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.vat-source-badge {
    white-space: normal;
}


/* ── Divider ─────────────────────────────────────────────────────────────── */

.vat-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    margin: 4px 0;
}

/* ── Instrument data grid ─────────────────────────────────────────────────── */

.vat-instruments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px 12px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.vat-instrument {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Structural only — font properties are scoped to .vat-panel below */
.vat-instr-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Owner widget font defaults */
.vat-panel .vat-instr-label {
    font-size: 10px;
    font-weight: 600;
    color: #888;
}

.vat-panel .vat-instr-val {
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ── Tracking source options ─────────────────────────────────────────────── */

.vat-source-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.vat-source-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.vat-source-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.vat-source-option.vat-source-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.vat-source-option input[type="radio"] {
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: #2563eb;
}

.vat-source-option-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vat-source-title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
}

.vat-source-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ── SignalK setup block ─────────────────────────────────────────────────── */

.vat-signalk-setup {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.vat-signalk-intro {
    font-size: 13px;
    color: #0c4a6e;
    margin: 0 0 12px;
}

.vat-credential-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.vat-credential-row:last-child {
    margin-bottom: 0;
}

.vat-credential-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0369a1;
    white-space: nowrap;
    min-width: 80px;
    padding-top: 5px;
}

.vat-credential-val-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.vat-credential-val {
    font-family: monospace;
    font-size: 12px;
    background: #fff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 3px 8px;
    color: #1a1a2e;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.vat-copy-btn,
.vat-gen-token-btn {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #0284c7;
    background: #fff;
    color: #0284c7;
    line-height: 1.5;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.vat-copy-btn:hover,
.vat-gen-token-btn:hover {
    background: #0284c7;
    color: #fff;
}

.vat-gen-token-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Form footer ─────────────────────────────────────────────────────────── */

.vat-form-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.vat-save-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #2563eb;
    color: #fff;
    border: 1px solid #2563eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1.4;
}

.vat-save-btn:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.vat-save-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.vat-save-feedback {
    font-size: 13px;
}

.vat-save-feedback.vat-success { color: #16a34a; }
.vat-save-feedback.vat-error   { color: #dc2626; }
