/* ═══════════════════════════════════════════════════════════
   Регистър СПО (ТЕРМОЛА) — v1.0.0
   Автор: Йордан Станчев <twizzard@mail.bg>
═══════════════════════════════════════════════════════════ */

.spo-register-wrap { max-width: 1100px; margin: 0 auto; font-family: inherit; }

/* ── Съобщения ───────────────────────────────────────────── */
.spo-notice        { padding: 10px 16px; border-radius: 4px; margin-bottom: 16px; font-weight: 500; }
.spo-success       { background: #d4edda; border: 1px solid #28a745; color: #155724; }
.spo-error         { background: #f8d7da; border: 1px solid #dc3545; color: #721c24; }

/* ── Филтър лента ────────────────────────────────────────── */
.spo-filter-bar    { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 12px 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spo-filter-bar input[type="date"] { padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; }
.spo-list-actions  { margin-bottom: 16px; }

/* ── Списък ──────────────────────────────────────────────── */
.spo-table-wrap    { overflow-x: auto; }
.spo-list-table    { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.spo-list-table th { background: #343a40; color: #fff; padding: 8px 10px; text-align: left; white-space: nowrap; }
.spo-list-table td { padding: 7px 10px; border-bottom: 1px solid #dee2e6; vertical-align: top; }
.spo-list-table tr:hover td { background: #f1f3f5; }
.spo-list-count    { font-size: 0.85rem; color: #666; margin-top: 8px; }
.spo-no-results    { color: #888; font-style: italic; }

/* ── Статус ──────────────────────────────────────────────── */
.spo-status              { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.spo-status-active       { background: #d4edda; color: #155724; }
.spo-status-inactive     { background: #f8d7da; color: #721c24; }
.spo-status-reconstructed{ background: #fff3cd; color: #856404; }

/* ── Дати с предупреждение ───────────────────────────────── */
.spo-date-overdue { color: #dc3545; font-weight: 700; }
.spo-date-soon    { color: #fd7e14; font-weight: 600; }

/* ── Форма ───────────────────────────────────────────────── */
.spo-form-header   { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.spo-form-header h2{ margin: 0; }

.spo-form-table    { width: 100%; border-collapse: collapse; }
.spo-form-table th, .spo-form-table td { padding: 7px 12px; border-bottom: 1px solid #dee2e6; vertical-align: top; }
.spo-form-table th { width: 260px; font-weight: 600; color: #343a40; text-align: right; padding-right: 16px; }

.spo-section-header { background: #e9ecef; font-weight: 700; font-size: 0.95rem; color: #495057; padding: 8px 12px; }

.spo-form-table input[type="text"],
.spo-form-table input[type="date"],
.spo-form-table input[type="number"],
.spo-form-table input[type="email"],
.spo-form-table select,
.spo-form-table textarea { width: 100%; max-width: 520px; padding: 5px 8px; border: 1px solid #ced4da; border-radius: 4px; font-family: inherit; font-size: 0.95rem; box-sizing: border-box; }

.spo-form-table textarea { resize: vertical; }
.spo-json-editor           { max-width: 100% !important; font-family: monospace; font-size: 0.8rem; }

/* ── Лог ──────────────────────────────────────────────────── */
.spo-log           { font-size: 0.85rem; }
.spo-log-entry     { padding: 3px 0; border-bottom: 1px dotted #dee2e6; }
.spo-log-date      { color: #6c757d; font-weight: 600; }

/* ── Бутони ──────────────────────────────────────────────── */
.spo-form-actions  { margin-top: 20px; padding: 16px 0; display: flex; gap: 12px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .spo-form-table th { width: auto; text-align: left; display: block; border-bottom: none; padding-bottom: 2px; }
    .spo-form-table td { display: block; padding-top: 2px; padding-left: 0; }
    .spo-form-table input[type="text"],
    .spo-form-table input[type="date"],
    .spo-form-table input[type="number"],
    .spo-form-table input[type="email"],
    .spo-form-table select,
    .spo-form-table textarea { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   v1.1.0 допълнения
═══════════════════════════════════════════════════════════ */

/* ── ПИН ──────────────────────────────────────────────────── */
.spo-pin { font-size:1.3rem; font-weight:700; letter-spacing:4px; background:#fff3cd; border:1px solid #ffc107; padding:4px 12px; border-radius:4px; color:#856404; }

/* ── Прикачени файлове ───────────────────────────────────── */
.spo-attachments    { margin-top:24px; border:1px solid var(--spo-border,#dee2e6); border-radius:6px; padding:16px 20px; }
.spo-att-title      { margin:0 0 12px; font-size:1rem; }
.spo-att-table      { width:100%; border-collapse:collapse; font-size:0.88rem; margin-bottom:16px; }
.spo-att-table th   { background:#495057; color:#fff; padding:7px 10px; }
.spo-att-table td   { padding:6px 10px; border-bottom:1px solid #dee2e6; vertical-align:middle; }
.spo-att-table a    { color:#0073aa; }
.spo-att-upload     { background:#f8f9fa; border:1px dashed #adb5bd; border-radius:4px; padding:12px 16px; }
.spo-att-upload h4  { margin:0 0 10px; font-size:0.9rem; }
.spo-att-row        { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.spo-att-row input[type="file"] { flex:1; min-width:200px; }
.spo-delete-att     { color:#dc3545 !important; border-color:#dc3545 !important; }
.spo-public-files   { list-style:none; padding:0; }
.spo-public-files li{ padding:6px 0; border-bottom:1px dotted #dee2e6; }
.spo-public-files a { color:#0073aa; font-weight:500; }

/* ── PIN Lookup (публичен shortcode) ─────────────────────── */
.spo-lookup-wrap      { max-width:800px; margin:0 auto; }
.spo-lookup-form-box  { background:#f8f9fa; border:1px solid #dee2e6; border-radius:8px; padding:28px 32px; }
.spo-lookup-title     { margin:0 0 8px; color:#2c3e50; }
.spo-lookup-fields    { display:flex; gap:16px; align-items:flex-end; flex-wrap:wrap; margin-top:20px; }
.spo-lookup-field     { display:flex; flex-direction:column; gap:6px; }
.spo-lookup-field label{ font-weight:600; font-size:0.9rem; }
.spo-lookup-field input{ padding:8px 12px; border:1px solid #ced4da; border-radius:4px; font-size:1rem; width:160px; }
.spo-lookup-btn button  { padding:9px 24px; font-size:1rem; }

.spo-lookup-result         { border:2px solid #dee2e6; border-radius:8px; padding:24px; }
.spo-lookup-result-header  { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.spo-lookup-result-header h2{ margin:0; }
.spo-lookup-table          { width:100%; border-collapse:collapse; margin-bottom:24px; }
.spo-lookup-table th       { width:220px; text-align:right; padding:8px 16px 8px 8px; color:#495057; font-weight:600; border-bottom:1px solid #dee2e6; }
.spo-lookup-table td       { padding:8px; border-bottom:1px solid #dee2e6; }
.spo-lookup-files          { background:#f8f9fa; border-radius:6px; padding:16px 20px; }
.spo-lookup-files h3       { margin:0 0 12px; font-size:1rem; }

/* ═══════════════════════════════════════════════════════════
   v1.2.0 допълнения
═══════════════════════════════════════════════════════════ */

/* ── Подписи ──────────────────────────────────────────────── */
.spo-signatures-wrap     { display:flex; gap:24px; flex-wrap:wrap; margin:20px 0 8px; }
.spo-sig-box             { flex:1; min-width:260px; }
.spo-sig-box label       { display:block; font-weight:600; margin-bottom:8px; font-size:0.9rem; }

/* ── Инспекции ────────────────────────────────────────────── */
.spo-inspections         { margin-top:24px; border:1px solid #dee2e6; border-radius:6px; padding:16px 20px; }
.spo-insp-title          { margin:0 0 12px; font-size:1rem; }
.spo-insp-form-wrap      { background:#f8f9fa; border:1px dashed #adb5bd; border-radius:4px; padding:16px 20px; margin-top:12px; }
.spo-insp-form-wrap h4   { margin:0 0 12px; }
.spo-insp-options        { margin:10px 0; font-size:0.9rem; }
.spo-insp-badge          { display:inline-block; padding:2px 8px; border-radius:12px; font-size:0.8rem; font-weight:600; }
.spo-insp-passed         { background:#d4edda; color:#155724; }
.spo-insp-failed         { background:#f8d7da; color:#721c24; }
.spo-insp-conditional    { background:#fff3cd; color:#856404; }

/* ── Lookup с URL параметър ───────────────────────────────── */
.spo-lookup-field input[readonly] { cursor:default; }

/* Lock badge */
.spo-lock-badge { display:inline-block; background:#fff3cd; color:#856404; border:1px solid #ffc107; border-radius:4px; font-size:0.75rem; padding:2px 8px; margin-left:8px; font-weight:normal; vertical-align:middle; }
.spo-lock-notice { font-size:0.82rem; color:#856404; }

/* Copy link button feedback */
.spo-copy-done { background:#27ae60 !important; color:#fff !important; border-color:#27ae60 !important; }
.spo-sig-person-name { font-size:0.82rem; font-weight:600; color:#444; margin-bottom:4px; }
