/* officials-editor.css — Editor styles, same design system as officials.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fb;
    padding: 18px;
    min-height: 100vh;
    color: #1f2937;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 85vh;
}

/* ── Header ── */
header {
    background: white;
    color: #0f172a;
    padding: 16px 24px;
    border-bottom: 1px solid #e6eef8;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

header img.logo { width: 40px; height: 40px; }

.header-text h1 {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 1px;
}

.subtitle {
    font-size: 12px;
    color: #475569;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.record-count {
    color: #475569;
    font-weight: 600;
    padding: 5px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #eef2f7;
    white-space: nowrap;
    font-size: 12px;
}

/* ── Toolbar ── */
.toolbar {
    padding: 12px 18px;
    background: #fbfdff;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box { flex: 1 1 260px; min-width: 180px; }
.search-box input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid #e6eef8;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    transition: border-color 0.15s;
}
.search-box input:focus { outline: none; border-color: #2b6cb0; box-shadow: 0 4px 12px rgba(43,108,176,0.06); }

.filter-group { display: flex; gap: 8px; align-items: center; }
.filter-select {
    padding: 8px 12px;
    border: 1px solid #e6eef8;
    border-radius: 8px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.toolbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.btn-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.btn-ghost   { background: white; border: 1px solid #e6eef8; color: #334155; }
.btn-ghost:hover { background: #f8fafc; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── Table ── */
.table-wrapper { padding: 12px 18px; flex: 1; display: flex; flex-direction: column; }
.table-container {
    flex: 1;
    overflow: auto;
    max-height: calc(100vh - 240px);
    background: white;
    border: 1px solid #eef2f7;
    border-radius: 8px;
}

table { width: 100%; border-collapse: collapse; min-width: 900px; }
thead {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 5;
}
th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: #0f172a;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    border-bottom: 2px solid #e2e8f0;
}
th:hover { background: #eef2f7; }
th.sort-asc::after { content: ' ▲'; font-size: 10px; opacity: 0.6; }
th.sort-desc::after { content: ' ▼'; font-size: 10px; opacity: 0.6; }

td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
    line-height: 1.4;
    color: #334155;
    vertical-align: top;
}
tbody tr:hover { background-color: #fbfdff; }
tbody tr.modified { background-color: #fffbeb; }

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }

.no-results { padding: 24px; text-align: center; color: #6c757d; display: none; }
.no-results.show { display: block; }

/* ── Name formatting ── */
.surname { font-weight: 700; font-size: 1.15em; }

/* ── Badges (same as officials.css) ── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-ct-wool     { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.badge-ct-tunnage  { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.badge-ct-petty    { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge-ct-searcher { background: #f3e8ff; color: #6b21a8; border: 1px solid #c4b5fd; }

.badge-role-collector  { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }
.badge-role-controller { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.badge-role-supervisor { background: #fdf2f8; color: #9d174d; border: 1px solid #f9a8d4; }
.badge-role-searcher   { background: #f5f3ff; color: #5b21b6; border: 1px solid #c4b5fd; }
.badge-role-surveyor   { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-role-deputy     { background: #fefce8; color: #854d0e; border: 1px solid #fde047; }
.badge-role-default    { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e6eef8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}
.modal-close:hover { color: #334155; }

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e6eef8;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Form ── */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-group small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; }
.form-group small a { color: #3b82f6; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 10px 24px;
    background: #0f172a;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.error { background: #dc2626; }
.toast.success { background: #16a34a; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-actions { margin-left: 0; flex-wrap: wrap; }
    .header-actions { margin-left: 0; flex-wrap: wrap; width: 100%; }
}

