/* ================================================================
   Accreditation Navigator – Main Stylesheet
   ================================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:        #4f46e5;
    --primary-dark:   #4338ca;
    --primary-light:  #eef2ff;
    --secondary:      #64748b;
    --success:        #10b981;
    --success-light:  #d1fae5;
    --error:          #ef4444;
    --error-light:    #fee2e2;
    --warning:        #f59e0b;
    --warning-light:  #fef3c7;
    --bg:             #f8fafc;
    --sidebar-bg:     #1e293b;
    --sidebar-text:   #cbd5e1;
    --card:           #ffffff;
    --border:         #e2e8f0;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --radius:         8px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow-md:      0 4px 12px rgba(0,0,0,.1);
    --transition:     0.18s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

/* ── Layout ───────────────────────────────────────────────────── */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
    width: 256px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width var(--transition);
}

.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-header h2 {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--sidebar-text);
    margin-top: 2px;
    opacity: .7;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: background var(--transition), color var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255,255,255,.08);
    color: #fff;
}

.nav-item.active {
    background-color: rgba(79,70,229,.35);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item .icon {
    margin-right: 11px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.user-info {
    margin-bottom: 12px;
}

.user-info strong {
    display: block;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info small {
    color: var(--sidebar-text);
    font-size: 11px;
    opacity: .75;
}

.btn-logout {
    display: block;
    width: 100%;
    padding: 8px;
    text-align: center;
    background-color: rgba(255,255,255,.1);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    transition: background var(--transition);
}

.btn-logout:hover {
    background-color: rgba(255,255,255,.2);
}

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: 256px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-content--full {
    margin-left: 0;
}

.top-bar {
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 15px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.user-email {
    font-size: 13px;
    color: var(--text-muted);
}

.content-wrapper {
    flex: 1;
    padding: 28px 32px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--error);
    color: #fff;
    border-color: var(--error);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

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

.actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-row {
    display: flex;
    gap: 18px;
}

.form-row .form-group {
    flex: 1;
}

.form-section {
    background-color: var(--card);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.form-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.form-container {
    max-width: 860px;
}

.required {
    color: var(--error);
}

/* ── Login Page ───────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    padding: 42px 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: var(--error-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* ── Dashboard ────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    padding: 22px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-top: 4px;
}

.stat-card--warning .stat-value { color: var(--warning); }
.stat-card--success .stat-value { color: var(--success); }

.section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* ── Tables ───────────────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    background-color: var(--bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
}

.data-table tbody tr:hover {
    background-color: #fafbff;
}

.data-table a {
    color: var(--primary);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--secondary);
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-stage1 { background-color: #dbeafe; color: #1e40af; }
.badge-stage2 { background-color: #fae8ff; color: #86198f; }

.status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-draft        { background-color: #f1f5f9; color: #475569; }
.status-in_review,
.status-peer_review,
.status-public_review { background-color: var(--warning-light); color: #92400e; }
.status-approved     { background-color: var(--success-light); color: #065f46; }
.status-declined     { background-color: var(--error-light); color: #991b1b; }
.status-on_hold      { background-color: #f1f5f9; color: #64748b; }

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    text-transform: capitalize;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* ── Proposal Editor ──────────────────────────────────────────── */
.proposal-editor {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
    flex-wrap: wrap;
}

.editor-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.psips-number {
    color: var(--text-muted);
    font-size: 13px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.completion-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.completion-bar-outer {
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.completion-bar-inner {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
    transition: width .6s ease;
}

.completion-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.editor-container {
    display: flex;
    min-height: calc(100vh - 260px);
}

.editor-sidebar {
    width: 260px;
    border-right: 1px solid var(--border);
    padding: 22px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.editor-sidebar h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 600;
}

.standards-nav {
    list-style: none;
}

.standards-nav li {
    margin-bottom: 4px;
}

.standard-link {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    transition: background var(--transition);
    gap: 10px;
}

.standard-link:hover {
    background-color: var(--bg);
    color: var(--primary);
}

.standard-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.standard-title {
    font-size: 13px;
    line-height: 1.3;
}

.nav-divider {
    height: 1px;
    background-color: var(--border);
    margin: 12px 0;
}

.editor-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    min-width: 0;
}

.standard-section {
    margin-bottom: 44px;
    scroll-margin-top: 70px;
}

.standard-section > h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.response-editor {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: #fafbff;
    transition: border-color var(--transition);
}

.response-editor:focus-within {
    border-color: var(--primary);
}

.response-editor h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary);
}

.response-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.response-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.word-count {
    font-size: 12px;
    color: var(--text-muted);
}

.save-status {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
    min-width: 70px;
    text-align: center;
}

/* ── Appendices ───────────────────────────────────────────────── */
.appendices-section { }

.upload-area {
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color var(--transition);
}

.upload-area:focus-within {
    border-color: var(--primary);
}

.upload-row {
    align-items: flex-end;
    flex-wrap: wrap;
}

.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.upload-progress-bar {
    height: 4px;
    width: 120px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar::after {
    content: '';
    position: absolute;
    left: -50%;
    top: 0;
    height: 100%;
    width: 50%;
    background: var(--primary);
    animation: progress-slide 1s infinite;
}

@keyframes progress-slide {
    from { left: -50%; }
    to   { left: 110%; }
}

/* ── Proposal View ────────────────────────────────────────────── */
.proposal-view { }

.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    gap: 20px;
    flex-wrap: wrap;
}

.proposal-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.meta {
    font-size: 13px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.info-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.info-item span {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.proposal-content h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    color: var(--primary);
}

.standard-view {
    margin-bottom: 28px;
    padding: 18px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.standard-view h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.standard-view h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    margin: 12px 0 6px;
}

.response-text {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text);
}

.response-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── Contributors ─────────────────────────────────────────────── */
.contributors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contributor-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 260px;
}

.contributor-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.contributor-info small {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Utilities ────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ── Responsive ───────────────────────────────────────────────── */
/* ── Modals ────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover { color: var(--text); }

.modal-body {
    padding: 22px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    .editor-container {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .upload-row {
        flex-direction: column;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Contributor management ──────────────────────────────────── */
.add-contributor-bar {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}

.add-contributor-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.add-contributor-fields select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
    min-width: 160px;
}

.add-contributor-fields select:first-child {
    flex: 2;
    min-width: 260px;
}

.add-contributor-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.role-select-inline {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.role-select-inline:focus {
    outline: none;
    border-color: var(--primary);
}

.role-badge.role-lead {
    background: #1e3a8a;
    color: #fff;
}

/* ── Status changer ──────────────────────────────────────────── */
.status-changer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 18px;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    border-bottom: 1px solid #fde68a;
}

.status-changer-label {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.status-advance-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    font-size: 12px;
}

.status-advance-btn:hover {
    background: #1a3a6b;
    border-color: #1a3a6b;
    color: #fff;
}

/* ── Save All ────────────────────────────────────────────────── */
.btn-success {
    background-color: #059669;
    color: #fff;
    border-color: #059669;
}
.btn-success:hover {
    background-color: #047857;
    border-color: #047857;
}
.btn-lg {
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
}

.save-all-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #059669;
    z-index: 40;
    box-shadow: 0 -4px 16px rgba(0,0,0,.1);
}

.save-all-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    gap: 16px;
}

#save-all-summary {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Accordion ───────────────────────────────────────────────── */
.accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}
.accordion-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--bg);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    font-family: inherit;
    transition: background var(--transition);
}
.accordion-toggle:hover { background: #eef2ff; }
.accordion-icon { font-size: 11px; color: var(--text-muted); }
.accordion-body { padding: 0; }

/* ── Search bar ──────────────────────────────────────────────── */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.search-input-wrap {
    flex: 1;
    min-width: 240px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 11px;
    font-size: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 9px 36px 9px 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    padding: 2px;
}

.search-clear:hover { color: var(--text); }

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    min-width: 130px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.search-results-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    min-height: 16px;
    font-style: italic;
}

/* Sortable column headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover { background: #e8edf5; }

.sort-icon {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* Info edit grid */
.info-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px 24px;
    margin-bottom: 16px;
}

.info-edit-grid .form-group {
    margin-bottom: 0;
}
