
/* ── FDCH — GOV.UK Style ── */
#fdch-wrap * { box-sizing: border-box; }

#fdch-wrap {
    font-family: "GDS Transport", arial, sans-serif;
    font-size: 16px;
    color: #0b0c0c;
    line-height: 1.5;
}

/* Search bar */
#fdch-search-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

#fdch-search-input {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #0b0c0c;
    border-right: none;
    border-radius: 0;
    font-size: 16px;
    font-family: "GDS Transport", arial, sans-serif;
    outline: none;
    color: #0b0c0c;
    background: #fff;
    height: 42px;
}

#fdch-search-input:focus {
    outline: 3px solid #ffdd00;
    outline-offset: 0;
    box-shadow: inset 0 0 0 2px #0b0c0c;
}

#fdch-search-btn {
    padding: 8px 18px;
    background: #00703c;
    color: #fff;
    border: 2px solid #00703c;
    border-radius: 0;
    cursor: pointer;
    font-size: 16px;
    font-family: "GDS Transport", arial, sans-serif;
    font-weight: 700;
    transition: background 0.1s;
    height: 42px;
    white-space: nowrap;
}

#fdch-search-btn:hover { background: #005a30; border-color: #005a30; }
#fdch-search-btn:focus { outline: 3px solid #ffdd00; outline-offset: 0; }
#fdch-search-btn:disabled { background: #6f777b; border-color: #6f777b; cursor: not-allowed; }

#fdch-feedback {
    font-size: 14px;
    color: #505a5f;
    margin-bottom: 12px;
}

/* Results list */
.fdch-result-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid #b1b4b6;
    cursor: pointer;
    background: #fff;
    transition: background 0.1s;
}

.fdch-result-item:first-child { border-top: 1px solid #b1b4b6; }

.fdch-result-item:hover { background: #f3f2f1; }

.fdch-result-name {
    font-size: 18px;
    font-weight: 700;
    color: #1d70b8;
    text-decoration: underline;
}

.fdch-result-item:hover .fdch-result-name { color: #003078; }

.fdch-result-meta {
    font-size: 14px;
    color: #505a5f;
    margin-top: 4px;
}

/* Status tags */
.fdch-status-badge {
    font-size: 13px;
    padding: 4px 10px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fdch-status-active    { background: #cce2d8; color: #005a30; }
.fdch-status-dissolved { background: #eeefef; color: #505a5f; }
.fdch-status-other     { background: #fff7bf; color: #594d00; }

/* Detail panel */
#fdch-detail {
    border: 5px solid #1d70b8;
    margin-top: 20px;
    display: none;
    background: #fff;
}

/* Header */
.fdch-detail-header {
    background: #1d70b8;
    color: #fff;
    padding: 20px 20px 16px;
}

.fdch-detail-header h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.fdch-detail-header .fdch-number {
    font-size: 14px;
    opacity: 0.85;
}

.fdch-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

/* Buttons */
.fdch-btn {
    padding: 8px 16px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: "GDS Transport", arial, sans-serif;
    font-weight: 700;
    transition: all 0.1s;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}

.fdch-btn:focus { outline: 3px solid #ffdd00; outline-offset: 0; }

.fdch-btn-save   { background: #00703c; color: #fff; border-color: #00703c; }
.fdch-btn-save:hover { background: #005a30; border-color: #005a30; color: #fff; }

.fdch-btn-sync   { background: #fff; color: #0b0c0c; border-color: #fff; }
.fdch-btn-sync:hover { background: #f3f2f1; }

.fdch-btn-remove { background: #d4351c; color: #fff; border-color: #d4351c; }
.fdch-btn-remove:hover { background: #aa2a16; border-color: #aa2a16; }

.fdch-btn-ch {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}
.fdch-btn-ch:hover { background: rgba(255,255,255,0.1); }

.fdch-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Saved notice */
.fdch-saved-notice {
    background: #cce2d8;
    border-left: 4px solid #00703c;
    color: #005a30;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

/* Tabs */
.fdch-tabs {
    display: flex;
    background: #f3f2f1;
    border-bottom: 1px solid #b1b4b6;
    overflow-x: auto;
}

.fdch-tab {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #1d70b8;
    border-bottom: 4px solid transparent;
    margin-bottom: -1px;
    transition: all 0.1s;
    white-space: nowrap;
    text-decoration: underline;
}

.fdch-tab:hover { color: #003078; background: #ebebeb; }

.fdch-tab.active {
    color: #0b0c0c;
    border-bottom-color: #1d70b8;
    background: #fff;
    text-decoration: none;
}

.fdch-tab-content { display: none; }
.fdch-tab-content.active { display: block; }

/* Sections */
.fdch-detail-body { padding: 0; }

.fdch-section {
    padding: 20px;
    border-bottom: 1px solid #b1b4b6;
}

.fdch-section:last-child { border-bottom: none; }

.fdch-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0b0c0c;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1d70b8;
}

/* Summary list — GOV.UK style */
.fdch-summary-list {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.fdch-summary-row {
    display: flex;
    border-bottom: 1px solid #b1b4b6;
    padding: 10px 0;
    gap: 20px;
}

.fdch-summary-row:first-child { border-top: 1px solid #b1b4b6; }

.fdch-summary-key {
    flex: 0 0 220px;
    font-size: 14px;
    font-weight: 700;
    color: #0b0c0c;
}

.fdch-summary-value {
    flex: 1;
    font-size: 14px;
    color: #0b0c0c;
}

/* Grid */
.fdch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.fdch-field-label {
    font-size: 13px;
    color: #505a5f;
    margin-bottom: 2px;
    font-weight: 700;
}

.fdch-field-value {
    font-size: 15px;
    color: #0b0c0c;
}

/* Tables */
.fdch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fdch-table th {
    background: #f3f2f1;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: #0b0c0c;
    border-bottom: 2px solid #0b0c0c;
    font-size: 13px;
}

.fdch-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #b1b4b6;
    vertical-align: top;
}

.fdch-table tr:last-child td { border-bottom: none; }
.fdch-table tr:hover td { background: #f3f2f1; }

/* Badges */
.fdch-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fdch-badge-active    { background: #cce2d8; color: #005a30; }
.fdch-badge-resigned  { background: #eeefef; color: #505a5f; }
.fdch-badge-ceased    { background: #eeefef; color: #505a5f; }
.fdch-badge-director  { background: #d2e2f1; color: #003078; }
.fdch-badge-secretary { background: #ede7f6; color: #3d0d6b; }
.fdch-badge-other     { background: #fff7bf; color: #594d00; }

/* Deadlines */
.fdch-deadline-ok      { color: #005a30; font-weight: 700; }
.fdch-deadline-warning { color: #594d00; font-weight: 700; }
.fdch-deadline-overdue { color: #d4351c; font-weight: 700; }

/* NOC tags */
.fdch-noc-tag {
    display: inline-block;
    background: #d2e2f1;
    color: #003078;
    border: 1px solid #a8c3e0;
    padding: 3px 10px;
    font-size: 12px;
    margin: 2px 2px 2px 0;
    font-weight: 600;
}

/* Loading */
.fdch-loading {
    text-align: center;
    padding: 40px 20px;
    color: #505a5f;
    font-size: 16px;
}

.fdch-spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid #b1b4b6;
    border-top-color: #1d70b8;
    border-radius: 50%;
    animation: fdch-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes fdch-spin { to { transform: rotate(360deg); } }

/* Phase banner style info box */
.fdch-infobox {
    background: #d2e2f1;
    border-left: 6px solid #1d70b8;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #0b0c0c;
}

/* Warning box */
.fdch-warnbox {
    background: #fff7bf;
    border-left: 6px solid #ffdd00;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #0b0c0c;
    font-weight: 700;
}

/* Error box */
.fdch-errbox {
    background: #f6d7d2;
    border-left: 6px solid #d4351c;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #0b0c0c;
    font-weight: 700;
}

/* Toast */
#fdch-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: "GDS Transport", arial, sans-serif;
    z-index: 99999;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    max-width: 380px;
    border-left: 6px solid rgba(0,0,0,0.2);
}

/* Responsive */
@media (max-width: 640px) {
    #fdch-search-bar { flex-direction: column; gap: 8px; }
    #fdch-search-input { border-right: 2px solid #0b0c0c; }
    .fdch-summary-row { flex-direction: column; gap: 4px; }
    .fdch-summary-key { flex: none; }
    .fdch-detail-actions { flex-direction: column; }
    .fdch-btn { text-align: center; }
}
/* ── Dashboard ── */
.fdch-dash-stats {
    display: flex;
    gap: 1px;
    background: #b1b4b6;
    border: 1px solid #b1b4b6;
    margin-bottom: 20px;
}

.fdch-stat {
    flex: 1;
    background: #fff;
    padding: 16px 12px;
    text-align: center;
}

.fdch-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0b0c0c;
    line-height: 1;
}

.fdch-stat-label {
    font-size: 12px;
    color: #505a5f;
    margin-top: 4px;
}

.fdch-stat-danger .fdch-stat-value { color: #d4351c; }
.fdch-stat-warn .fdch-stat-value   { color: #594d00; }
.fdch-stat-ok .fdch-stat-value     { color: #005a30; }

.fdch-dash-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.fdch-filter-btn {
    padding: 6px 14px;
    border: 2px solid #1d70b8;
    background: #fff;
    color: #1d70b8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: "GDS Transport", arial, sans-serif;
}

.fdch-filter-btn:hover { background: #d2e2f1; }
.fdch-filter-btn.active { background: #1d70b8; color: #fff; }

.fdch-dash-search-input {
    flex: 1;
    min-width: 200px;
    padding: 6px 10px;
    border: 2px solid #0b0c0c;
    font-size: 14px;
    font-family: "GDS Transport", arial, sans-serif;
}

.fdch-dash-table-el tbody tr:hover td { background: #f0f4ff; }

.fdch-dash-name {
    font-size: 15px;
    color: #1d70b8;
    text-decoration: underline;
}

.fdch-changes-badge {
    display: inline-block;
    background: #d4351c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Subscription modal */
#fdch-sub-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.fdch-sub-modal-inner {
    background: #fff;
    border: 5px solid #1d70b8;
    width: 100%;
    max-width: 540px;
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.fdch-sub-modal-header {
    background: #1d70b8;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fdch-sub-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.fdch-sub-modal-body { padding: 20px; }

.fdch-sub-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}