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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    line-height: 1.6;
}

nav {
    background: #1e3a5f;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
nav .nav-brand {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}
nav .nav-link {
    color: #b0c4de;
    text-decoration: none;
    font-size: 0.95rem;
}
nav .nav-link:hover, nav .nav-link.active { color: white; }

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-user {
    color: #b0c4de;
    font-size: 0.9rem;
}
.nav-logout {
    color: #e74c3c;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.nav-logout:hover { color: #ff6b6b; }

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    color: #b0c4de;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.nav-dropdown-toggle::after {
    content: '\25BE';
    font-size: 0.7rem;
}
.nav-dropdown-toggle:hover { color: white; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: #1e3a5f;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    min-width: 170px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    padding: 0.4rem 0;
}
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #b0c4de;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
.nav-dropdown-menu .nav-logout {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 0.3rem;
    padding-top: 0.6rem;
}

.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.search-box, .upload-box {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}
.login-box {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 420px;
    margin: 3rem auto;
}
.login-box h1 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    cursor: pointer;
    margin-top: 0.5rem;
    font-weight: 500;
}
.btn-login:hover { background: #2d5a8e; }

.search-box h1, .upload-box h1 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.subtitle { color: #636e72; margin-bottom: 1.5rem; }

.search-input-wrapper {
    display: flex;
    gap: 0.5rem;
}
.search-input-wrapper input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    font-size: 1.05rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    outline: none;
    transition: border 0.2s;
}
.search-input-wrapper input:focus { border-color: #1e3a5f; }
.search-input-wrapper button {
    padding: 0.9rem 2rem;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.2s;
}
.search-input-wrapper button:hover { background: #2d5a8e; }

.examples { margin-top: 1rem; color: #636e72; font-size: 0.9rem; }
.examples code { background: #f1f2f6; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }

.results-info { margin-bottom: 1rem; color: #636e72; }

.result-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}
.result-card:hover { box-shadow: 0 3px 15px rgba(0,0,0,0.12); }
.result-card h3 a { color: #1e3a5f; text-decoration: none; }
.result-card h3 a:hover { text-decoration: underline; }
.result-meta { display: flex; gap: 1.5rem; color: #636e72; font-size: 0.85rem; margin: 0.5rem 0; flex-wrap: wrap; align-items: center; }
.snippet { color: #2d3436; font-size: 0.95rem; line-height: 1.5; }
.snippet mark { background: #ffeaa7; padding: 0.1rem 0.2rem; border-radius: 2px; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-order { background: #dfe6e9; color: #2d3436; }
.badge-opinion { background: #1e3a5f; color: white; }
.badge-specialty { background: #6c5ce7; color: white; }

.no-results { text-align: center; padding: 2rem; color: #636e72; }

/* Form styles */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.form-group .hint { font-weight: 400; color: #636e72; font-size: 0.85rem; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus { border-color: #1e3a5f; }
.form-group input[type="file"] { font-size: 0.95rem; }
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    background: white;
    cursor: pointer;
}
.form-group select:focus { border-color: #1e3a5f; }

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

.btn-upload {
    padding: 0.9rem 2.5rem;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    cursor: pointer;
    margin-top: 0.5rem;
}
.btn-upload:hover { background: #2d5a8e; }
.btn-upload:disabled { background: #a0aec0; cursor: not-allowed; }

.btn-reset {
    padding: 0.9rem 2.5rem;
    background: white;
    color: #636e72;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1.05rem;
    cursor: pointer;
    margin-top: 0.5rem;
}
.btn-reset:hover { border-color: #636e72; color: #2d3436; }

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mode-toggle {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}
.toggle-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.extract-status {
    display: inline-block;
    margin-left: 1rem;
    font-size: 0.95rem;
    vertical-align: middle;
}
.extract-status.loading { color: #1e3a5f; }
.extract-status.error { color: #721c24; }

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Document view */
.document-view { background: white; border-radius: 12px; padding: 2.5rem; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.document-view h1 { margin-bottom: 0.5rem; }
.back-link { display: inline-block; margin-bottom: 1rem; color: #1e3a5f; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.doc-meta { display: flex; gap: 1.5rem; color: #636e72; font-size: 0.9rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.doc-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.btn-pdf {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
}
.btn-pdf:hover { background: #219a52; }
.btn-edit {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
}
.btn-edit:hover { background: #2d5a8e; }
.edit-form { margin-top: 1rem; }
.edit-form h2 { margin-bottom: 1rem; }
.doc-content { font-size: 0.95rem; line-height: 1.8; }
.doc-content p { margin-bottom: 1em; }
.doc-content h3 { margin: 1.5em 0 0.5em; font-size: 1.15rem; }
.doc-content h4 { margin: 1.2em 0 0.4em; font-size: 1.05rem; }
.doc-content ol, .doc-content ul { margin: 0.8em 0 0.8em 2em; }
.doc-content li { margin-bottom: 0.4em; }
.doc-content blockquote {
    margin: 1.2em 2.5em;
    padding: 0.8em 1.2em;
    border-left: 3px solid #b0bec5;
    background: #f8f9fa;
    font-size: 0.93rem;
    line-height: 1.7;
}
.doc-content blockquote p { margin-bottom: 0.6em; }
.doc-content blockquote p:last-child { margin-bottom: 0; }
.doc-plain-text { white-space: pre-wrap; font-family: inherit; font-size: inherit; line-height: inherit; margin: 0; background: none; border: none; padding: 0; }

/* Content editing textarea */
.content-textarea {
    width: 100%;
    min-height: 500px;
    max-height: 80vh;
    padding: 1.2rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    outline: none;
    resize: vertical;
    white-space: pre-wrap;
    overflow-y: auto;
    background: #fafafa;
}
.content-textarea:focus { border-color: #1e3a5f; background: white; }

/* Editor toggle */
.editor-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 0.5rem;
}
.toggle-btn {
    padding: 0.4rem 1rem;
    border: 2px solid #dfe6e9;
    background: #f5f6fa;
    color: #636e72;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.toggle-btn:first-child { border-radius: 6px 0 0 6px; }
.toggle-btn:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.toggle-btn.active {
    background: #1e3a5f;
    color: white;
    border-color: #1e3a5f;
}
.toggle-btn:hover:not(.active) { background: #dfe6e9; }

/* Visual editor */
.visual-editor {
    width: 100%;
    min-height: 500px;
    max-height: 80vh;
    padding: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.8;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    outline: none;
    overflow-y: auto;
    background: white;
}
.visual-editor:focus { border-color: #1e3a5f; }
.visual-editor p { margin-bottom: 0.8em; }
.visual-editor h3 { margin: 1.2em 0 0.5em; font-size: 1.1rem; }
.visual-editor blockquote {
    margin: 1em 2em;
    padding: 0.6em 1em;
    border-left: 3px solid #b0bec5;
    background: #f8f9fa;
}

/* Editor toolbar */
.editor-toolbar {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.4rem;
    padding: 0.4rem;
    background: #f5f6fa;
    border-radius: 6px;
    border: 1px solid #dfe6e9;
}
.editor-toolbar button {
    padding: 0.3rem 0.7rem;
    border: 1px solid #dfe6e9;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 32px;
    transition: all 0.15s;
}
.editor-toolbar button:hover { background: #dfe6e9; }
.toolbar-sep { width: 1px; background: #dfe6e9; margin: 0 0.2rem; }

.content-edit-group {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}
.content-edit-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.btn-reformat {
    padding: 0.5rem 1.2rem;
    background: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-reformat:hover { background: #5a4bd1; }
.btn-reformat:disabled { background: #a0aec0; cursor: not-allowed; }

/* Filter sidebar layout */
.search-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.filter-sidebar {
    width: 260px;
    min-width: 260px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: sticky;
    top: 1rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}
.filter-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e3a5f;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.clear-filters {
    font-size: 0.85rem;
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
}
.clear-filters:hover { text-decoration: underline; }

.filter-group {
    margin-bottom: 1.25rem;
}
.filter-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3436;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 0.3rem;
    color: #2d3436;
    font-weight: 400;
}
.filter-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: #1e3a5f;
}

.filter-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    outline: none;
}
.filter-group select:focus { border-color: #1e3a5f; }

.filter-group input[type="date"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 0.4rem;
}
.filter-group input[type="date"]:focus { border-color: #1e3a5f; }

.filter-date-label {
    display: block;
    font-size: 0.8rem;
    color: #636e72;
    margin-bottom: 0.2rem;
    margin-top: 0.3rem;
}

.btn-apply-filters {
    width: 100%;
    padding: 0.7rem;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.5rem;
    font-weight: 500;
}
.btn-apply-filters:hover { background: #2d5a8e; }

.results-column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .search-layout {
        flex-direction: column;
    }
    .filter-sidebar {
        width: 100%;
        min-width: unset;
        position: static;
    }
}

/* Pagination */
/* Recently Added */
.recent-added {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.recent-added h3 {
    font-size: 1.1rem;
    color: #2d3436;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0984e3;
    display: inline-block;
}
.recent-item {
    padding: 0.7rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.recent-item:last-child {
    border-bottom: none;
}
.recent-item a {
    color: #0984e3;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.recent-item a:hover {
    text-decoration: underline;
}
.recent-meta {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #636e72;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.7rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    background: white;
    color: #1e3a5f;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}
.page-btn:hover:not(.active):not(.disabled) {
    background: #1e3a5f;
    color: white;
    border-color: #1e3a5f;
}
.page-btn.active {
    background: #1e3a5f;
    color: white;
    border-color: #1e3a5f;
    cursor: default;
}
.page-btn.disabled {
    color: #b0bec5;
    border-color: #eee;
    cursor: default;
}
.page-ellipsis {
    padding: 0 0.3rem;
    color: #636e72;
}

/* Teaser page styles */
.teaser-snippet {
    max-height: 300px;
    overflow: hidden;
    position: relative;
}
.teaser-fade {
    height: 80px;
    margin-top: -80px;
    position: relative;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
}
.teaser-cta {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 1rem;
    border-top: 1px solid #eee;
}
.teaser-cta p {
    color: #636e72;
    margin-bottom: 1rem;
    font-size: 1rem;
}
.btn-cta {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: #1e3a5f;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-cta:hover { background: #2d5a8e; }

/* Statute browse page */
.statute-titles {
    margin-top: 1.5rem;
}
.statute-titles h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.title-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.title-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    text-decoration: none;
    color: #2d3436;
    transition: box-shadow 0.2s;
}
.title-card:hover {
    box-shadow: 0 3px 15px rgba(0,0,0,0.12);
}
.title-num {
    font-size: 0.8rem;
    color: #1e3a5f;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.title-name {
    font-size: 0.95rem;
    margin-top: 0.3rem;
}
.title-chapters {
    font-size: 0.78rem;
    font-style: italic;
    color: #636e72;
    margin-top: 0.2rem;
}
.chapter-list {
    list-style: none;
    padding: 0;
}
.chapter-list li {
    margin-bottom: 0.5rem;
}
.chapter-list a {
    display: block;
    padding: 0.8rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-decoration: none;
    color: #2d3436;
    transition: box-shadow 0.2s;
}
.chapter-list a:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.chapter-list .chapter-num {
    font-weight: 600;
    color: #1e3a5f;
}
.statute-content {
    font-size: 0.95rem;
    line-height: 1.8;
}
.statute-content b, .statute-content strong {
    font-weight: 700;
}

/* Delete button */
.btn-delete {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-delete:hover { background: #c0392b; }

/* Restore button */
.btn-restore {
    padding: 0.5rem 1.2rem;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-restore:hover { background: #219a52; }

/* Deleted documents table */
.deleted-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}
.deleted-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: #f5f6fa;
    border-bottom: 2px solid #dfe6e9;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d3436;
}
.deleted-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    color: #2d3436;
}
.deleted-table tr:hover td {
    background: #f8f9fa;
}

/* Chapter header row with View All button */
.chapter-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.chapter-header-row h2 {
    margin-bottom: 0;
}
.btn-view-all {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #1e3a5f;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-view-all:hover { background: #2c5282; }

/* View All Sections page */
.chapter-all-section {
    margin-bottom: 1rem;
}
.chapter-all-section .section-heading {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}
.chapter-all-section .section-heading a {
    color: #1e3a5f;
    text-decoration: none;
}
.chapter-all-section .section-heading a:hover {
    text-decoration: underline;
}
.section-divider {
    border: none;
    border-top: 1px solid #dfe6e9;
    margin: 1.5rem 0;
}

/* Last updated text on statute pages */
.last-updated {
    font-size: 0.78rem;
    color: #999;
    margin-top: 1.5rem;
    font-style: italic;
}

/* Statute subsection indentation */
.statute-content .indent-1 {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}
.statute-content .indent-2 {
    margin-left: 3rem;
    margin-top: 0.3rem;
}
.statute-content .indent-3 {
    margin-left: 4.5rem;
    margin-top: 0.3rem;
}

/* Previous / Next section navigation */
.statute-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dfe6e9;
    gap: 1rem;
}
.statute-nav-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #1e3a5f;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
    max-width: 45%;
}
.statute-nav-link:hover {
    background: #f0f4f8;
}
.statute-nav-link span {
    font-weight: 400;
    font-size: 0.8rem;
    color: #636e72;
    margin-top: 0.15rem;
}
.statute-nav-link.next {
    text-align: right;
    margin-left: auto;
}

/* Court rules subcategory headings */
.subcategory-heading {
    font-weight: 600;
    color: #636e72;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.85rem;
}
/* Nested subcategory heading (within a group) */
.subcategory-subheading {
    font-weight: 500;
    color: #636e72;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    margin-left: 0.5rem;
    font-size: 0.82rem;
    font-style: italic;
}

/* Court rules search filters */
.court-filters {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}
.court-filters-label {
    font-size: 0.85rem;
    color: #636e72;
    font-weight: 500;
}

/* Admin Manage Documents Dashboard */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    text-align: center;
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: #636e72;
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.admin-search {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 1rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}
.admin-search:focus { border-color: #1e3a5f; }
.admin-filter-select {
    padding: 0.6rem 0.8rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    outline: none;
}
.admin-filter-select:focus { border-color: #1e3a5f; }
.btn-export {
    padding: 0.6rem 1.2rem;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn-export:hover { background: #219a52; }
.btn-bulk-hide {
    padding: 0.6rem 1.2rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.btn-bulk-hide:hover { background: #c0392b; }
.btn-bulk-hide:disabled { background: #d5d5d5; cursor: not-allowed; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.admin-table thead th {
    text-align: left;
    padding: 0.75rem 0.8rem;
    background: #f5f6fa;
    border-bottom: 2px solid #dfe6e9;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2d3436;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.admin-table thead th:hover { background: #ebedf2; }
.admin-table thead th.sort-asc::after { content: ' \25B2'; font-size: 0.65rem; }
.admin-table thead th.sort-desc::after { content: ' \25BC'; font-size: 0.65rem; }
.admin-table thead th.no-sort { cursor: default; }
.admin-table thead th.no-sort:hover { background: #f5f6fa; }
.admin-table tbody td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #2d3436;
    vertical-align: middle;
}
.admin-table tbody tr:hover td { background: #f8f9fa; }
.admin-table tbody tr.row-flagged td { background: #fffde7; }
.admin-table tbody tr.row-flagged:hover td { background: #fff9c4; }
.admin-table td a { color: #1e3a5f; text-decoration: none; }
.admin-table td a:hover { text-decoration: underline; }

.admin-table .cb-col { width: 36px; text-align: center; }
.admin-table .cb-col input[type="checkbox"] {
    width: 1rem; height: 1rem; cursor: pointer; accent-color: #1e3a5f;
}

.source-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.source-badge.scraped { background: #dfe6e9; color: #2d3436; }
.source-badge.uploaded { background: #d4edda; color: #155724; }
.source-badge.imported { background: #cce5ff; color: #004085; }
.source-badge.unknown { background: #f0f0f0; color: #636e72; }

.reformatted-yes { color: #27ae60; font-weight: 600; }
.reformatted-no { color: #b0bec5; }

.btn-hide-sm {
    padding: 0.25rem 0.6rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}
.btn-hide-sm:hover { background: #c0392b; }

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.admin-pagination button {
    padding: 0.4rem 0.9rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    background: white;
    color: #1e3a5f;
    font-size: 0.85rem;
    cursor: pointer;
}
.admin-pagination button:hover:not(:disabled) {
    background: #1e3a5f;
    color: white;
    border-color: #1e3a5f;
}
.admin-pagination button:disabled {
    color: #b0bec5;
    border-color: #eee;
    cursor: default;
}
.admin-pagination .page-info {
    font-size: 0.85rem;
    color: #636e72;
}

/* Agency filter dropdown for admin rules search */
.agency-filter-select {
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    background: white;
    color: #2d3436;
    outline: none;
    cursor: pointer;
    max-width: 280px;
    transition: border 0.2s;
}
.agency-filter-select:focus {
    border-color: #1e3a5f;
}

/* --- User Management Panel --- */
.user-create-form {
    background: white;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
}
.user-create-form h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #2d3436;
}
.create-user-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.form-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #636e72;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-field input,
.form-field select {
    padding: 0.55rem 0.8rem;
    border: 2px solid #dfe6e9;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}
.form-field input:focus,
.form-field select:focus {
    border-color: #1e3a5f;
}
.btn-create-user {
    padding: 0.6rem 1.4rem;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    height: fit-content;
}
.btn-create-user:hover { background: #2d5a8e; }

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.input-sm {
    padding: 0.3rem 0.5rem;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 0.8rem;
    width: 120px;
    outline: none;
}
.input-sm:focus { border-color: #1e3a5f; }
.select-sm {
    padding: 0.3rem 0.4rem;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
}
.btn-sm {
    padding: 0.25rem 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.btn-reset-pw { background: #f39c12; color: white; }
.btn-reset-pw:hover { background: #e67e22; }
.btn-role { background: #1e3a5f; color: white; }
.btn-role:hover { background: #2d5a8e; }
.btn-enable { background: #27ae60; color: white; }
.btn-enable:hover { background: #219a52; }
.btn-disable { background: #f39c12; color: white; }
.btn-disable:hover { background: #e67e22; }
.btn-delete-user { background: #e74c3c; color: white; }
.btn-delete-user:hover { background: #c0392b; }

.role-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.role-badge.role-admin { background: #1e3a5f; color: white; }
.role-badge.role-public { background: #dfe6e9; color: #2d3436; }

.status-active { color: #27ae60; font-weight: 600; font-size: 0.85rem; }
.status-disabled { color: #e74c3c; font-weight: 600; font-size: 0.85rem; }
.status-pending { color: #e67e22; font-weight: 600; font-size: 0.85rem; }
.badge-you { font-size: 0.72rem; color: #636e72; font-weight: 400; }
.text-muted { color: #b0bec5; font-size: 0.85rem; }

.admin-table tbody tr.row-disabled td { background: #ffeef0; }
.admin-table tbody tr.row-disabled:hover td { background: #fde2e6; }

/* --- Page Markers (inline + margin labels) --- */

/* Inline [ - N - ] marker at end of paragraphs */
.page-marker {
    font-size: 0.78rem;
    color: #8b9298;
    text-decoration: none;
    font-style: italic;
    white-space: nowrap;
    scroll-margin-top: 1rem;
    margin-left: 0.3rem;
}
.page-marker:hover {
    color: #1e3a5f;
}

/* Glow animation when jumped to */
@keyframes page-glow {
    0% { background-color: #ffeaa7; }
    100% { background-color: transparent; }
}
.page-glow {
    animation: page-glow 3s ease-out;
    border-radius: 3px;
    padding: 0.1rem 0.25rem;
}

/* Right-margin annotations (created by JS) */
.doc-content {
    position: relative;
}
.page-margin-label {
    position: absolute;
    right: -1.5rem;
    font-size: 0.72rem;
    color: #8b9298;
    text-decoration: none;
    font-style: italic;
    cursor: pointer;
}
.page-margin-label:hover {
    color: #1e3a5f;
}

@media (max-width: 900px) {
    .page-margin-label { display: none; }
}

/* Page jump navigation bar */
.page-jump-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    background: #f5f6fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-left: auto;
    margin-bottom: 0;
    width: fit-content;
}
.page-jump-label {
    font-size: 0.85rem;
    color: #636e72;
    font-weight: 500;
}
.page-jump-select {
    padding: 0.2rem 0.4rem;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
    outline: none;
    min-width: 50px;
    text-align: center;
}
.page-jump-select:focus {
    border-color: #1e3a5f;
}
