/* simple-meridian/static/style.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    /* Common system font stack */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #212529;
    /* Slightly darker text */
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.main-content {
    padding-top: 20px;
}

.container {
    padding-bottom: 96px;
}

/* Shared layout primitives */
.page-header,
.section-header,
.header-actions,
.filter-controls,
.job-form-grid,
.jobs-grid,
.brief-grid,
.stats-grid,
.feed-cards-grid,
.info-cards,
.error-stats,
.feed-stats-grid {
    width: 100%;
}

.page-header,
.section-header,
.header-actions,
.filter-controls,
.job-form-grid,
.jobs-grid,
.brief-grid,
.stats-grid,
.feed-cards-grid,
.info-cards,
.error-stats,
.feed-stats-grid,
.actions-buttons,
.pending-stats {
    box-sizing: border-box;
}

.history-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.status-mobile-cards {
    display: none;
}

.status-mobile-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    margin-bottom: 10px;
}

.status-mobile-card__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.status-mobile-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #6c757d;
    font-size: 0.84em;
}

.status-mobile-card__desc {
    color: #495057;
    font-size: 0.9em;
    margin: 0;
}

/* ============================================
   UNIFIED FILTER LAYOUT SYSTEM (Task 17)
   ============================================ */

.filter-unified {
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.filter-unified__row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}

.filter-unified__row:last-child {
    margin-bottom: 0;
}

.filter-unified__field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.filter-unified__field--sm { grid-column: span 3; }
.filter-unified__field--md { grid-column: span 4; }
.filter-unified__field--lg { grid-column: span 6; }
.filter-unified__field--full { grid-column: 1 / -1; }

.filter-unified__label {
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c757d;
}

.filter-unified__input,
.filter-unified select,
.filter-unified input[type="search"],
.filter-unified input[type="date"],
.filter-unified input[type="text"] {
    width: 100%;
    min-height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 9px 12px;
    box-sizing: border-box;
    background: #fff;
}

.filter-unified__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid #dee2e6;
    color: #495057;
    text-decoration: none;
    background: #fff;
    font-size: 0.84em;
}

.filter-chip.active {
    color: #0d6efd;
    border-color: #0d6efd;
    background: #e7f1ff;
    font-weight: 600;
}

.filter-unified__segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.filter-segment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    color: #495057;
    background: #fff;
    font-size: 0.84em;
}

.filter-segment.active {
    color: #0d6efd;
    border-color: #0d6efd;
    background: #e7f1ff;
    font-weight: 600;
}

.filter-unified__search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.filter-unified .sort-link {
    text-decoration: none;
}

.filter-unified .sort-indicator {
    color: currentColor;
}

/* ============================================
   FORMS + A11Y (Task 07)
   ============================================ */

button,
.btn,
input,
select,
textarea,
.page-link,
.sort-link,
.profile-link,
.filter-link {
    min-height: 40px;
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.form-hint {
    display: block;
    color: #6c757d;
    font-size: 0.86em;
    margin-top: 6px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-actions-sticky-mobile {
    position: static;
}

@media (max-width: 768px) {
    button,
    .btn,
    input,
    select,
    textarea,
    .page-link,
    .sort-link,
    .profile-link,
    .filter-link {
        min-height: 44px;
    }

    .form-grid,
    .form-grid--3 {
        grid-template-columns: 1fr;
    }

    .form-actions-sticky-mobile {
        position: sticky;
        bottom: calc(76px + env(safe-area-inset-bottom));
        z-index: 900;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid #e9ecef;
        border-radius: 12px;
        padding: 8px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    }

    .form-actions-sticky-mobile .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .filter-unified {
        padding: 12px;
    }

    .filter-unified__row {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
    }

    .filter-unified__field--sm,
    .filter-unified__field--md,
    .filter-unified__field--lg {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .filter-unified {
        padding: 10px;
        border-radius: 10px;
    }

    .filter-unified__row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .filter-unified__field--sm,
    .filter-unified__field--md,
    .filter-unified__field--lg,
    .filter-unified__field--full {
        grid-column: 1 / -1;
    }

    .filter-unified__chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .filter-chip {
        flex: 0 0 auto;
    }

    .filter-unified__segmented {
        grid-template-columns: 1fr;
    }
}

.history-table {
    min-width: 900px;
}

.page-header,
.section-header {
    flex-wrap: wrap;
}

.page-header h1,
.section-header h2,
.page-title-section h2 {
    overflow-wrap: anywhere;
}

.filter-controls,
.job-control-section,
.jobs-section,
.brief-grid,
.status-section,
.feed-section {
    max-width: 100%;
}

.mobile-app-shell {
    display: none;
}

.mobile-app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-app-bar__title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mobile-app-bar__brand img {
    width: 32px;
    height: 32px;
}

.mobile-app-bar__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-app-bar__eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
}

.mobile-app-bar__page-title {
    font-size: 1rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-app-bar__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mobile-bottom-nav {
    display: none;
}

.mobile-nav-drawer {
    display: none;
}

/* Smaller containers for focused content */
.container.narrow {
    max-width: 800px;
}

/* Full width containers for data tables */
.container.wide {
    max-width: 1400px;
}

/* --- Header Styling --- */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
    margin-bottom: 25px;
    /* Space below header */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5em;
    font-weight: 600;
    color: #212529;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo:hover {
    color: #0056b3;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #212529;
    padding: 5px;
}

.main-menu {
    display: flex;
    align-items: center;
    flex-grow: 1;
    justify-content: flex-end;
}

.main-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.main-nav>a {
    text-decoration: none;
    color: #495057;
    font-size: 0.95em;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.main-nav>a:hover {
    color: #0056b3;
    background-color: #f8f9fa;
}

.main-nav>a i {
    font-size: 0.9em;
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-toggle {
    text-decoration: none;
    color: #495057;
    font-size: 0.95em;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.nav-dropdown .dropdown-toggle:hover {
    color: #0056b3;
    background-color: #f8f9fa;
}

.nav-dropdown .dropdown-toggle i.fa-chevron-down {
    font-size: 0.7em;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.nav-dropdown.active .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    margin-top: 5px;
    padding: 8px 0;
    display: none;
    z-index: 1000;
}

.nav-dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #495057;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.dropdown-theme-toggle {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #495057;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.9em;
}

.dropdown-theme-toggle:hover {
    background-color: #f8f9fa;
    color: #0056b3;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #0056b3;
}

.dropdown-menu a i {
    width: 16px;
    text-align: center;
    font-size: 0.9em;
}

/* Responsive Header */
@media (max-width: 768px) {
    .main-header {
        display: none;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
    }

    .logo-container {
        width: 100%;
        margin-bottom: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 15px;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }

    .main-menu.active {
        display: flex;
    }

    .main-nav {
        flex-direction: column;
        width: 100%;
        gap: 5px;
        text-align: left;
    }

    .main-nav>a {
        display: flex;
        padding: 12px 15px;
        border-radius: 4px;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown .dropdown-toggle {
        width: 100%;
        padding: 12px 15px;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid #007bff;
        margin: 5px 0 5px 15px;
        padding: 5px 0;
        background: #f8f9fa;
    }

    .dropdown-menu a {
        padding: 10px 15px;
    }

    .header-actions {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    .header-actions .btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .page-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
        gap: 12px;
    }

    .page-header h1 {
        font-size: 1.45em;
        gap: 8px;
        line-height: 1.2;
    }

    .section-header {
        margin-bottom: 16px;
        gap: 10px;
    }

    .section-header h2 {
        font-size: 1.15em;
    }

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

    .stat-card {
        padding: 16px;
    }

    .job-control-section,
    .jobs-section {
        padding: 18px;
        border-radius: 14px;
    }

    .filter-controls {
        padding: 15px;
        gap: 14px;
    }

    .profile-filter,
    .read-filter {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .profile-filter label,
    .read-filter label {
        width: 100%;
        margin-bottom: 4px;
    }

    .profile-link,
    .filter-link {
        width: 100%;
        justify-content: center;
    }

    .job-form-grid,
    .jobs-grid,
    .brief-grid,
    .error-stats,
    .feed-stats-grid,
    .info-cards {
        grid-template-columns: 1fr;
    }

    .feed-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .job-card,
    .brief-card,
    .feed-card,
    .info-card,
    .stat-card {
        min-width: 0;
    }

    .history-table {
        min-width: 780px;
    }

    .history-table th,
    .history-table td {
        padding: 12px 10px;
    }

    .pagination {
        padding: 14px;
    }

    .pagination-buttons {
        gap: 5px;
    }

    .page-btn {
        min-width: 34px;
        padding: 8px 10px;
    }

    .main-content {
        padding-top: 12px;
        padding-bottom: 122px;
    }

    .mobile-app-shell {
        display: block;
        position: sticky;
        top: 0;
        z-index: 1100;
        margin: 0 0 12px;
    }

    .mobile-app-bar {
        background: rgba(255,255,255,0.94);
        backdrop-filter: blur(12px);
        border: 1px solid #dee2e6;
        border-radius: 16px;
        padding: 10px 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        padding: 8px;
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(12px);
        border: 1px solid #dee2e6;
        border-radius: 18px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        z-index: 1200;
    }

    .mobile-bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-height: 56px;
        padding: 8px 6px;
        border-radius: 14px;
        color: #495057;
        text-decoration: none;
        font-size: 0.72rem;
        line-height: 1.1;
    }

    .mobile-bottom-nav__item i {
        font-size: 1.05rem;
    }

.mobile-bottom-nav__item.active {
    background: #e7f1ff;
    color: #0d6efd;
    font-weight: 600;
}

.mobile-bottom-nav__item.disabled {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}

    .mobile-nav-drawer {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1300;
    }

    .mobile-nav-drawer.active {
        display: block;
    }

    .mobile-nav-drawer__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
    }

    .mobile-nav-drawer__panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(86vw, 340px);
        height: 100%;
        background: #ffffff;
        border-left: 1px solid #dee2e6;
        box-shadow: -12px 0 24px rgba(0,0,0,0.15);
        padding: 16px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .mobile-nav-drawer__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-nav-drawer__close {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid #dee2e6;
        background: #f8f9fa;
        color: #212529;
    }

    .mobile-nav-drawer__section {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid #eef1f5;
    }

    .mobile-nav-drawer__section a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 12px;
        text-decoration: none;
        color: #212529;
        background: #f8f9fa;
        border: 1px solid #eef1f5;
    }

.mobile-nav-drawer__section a i {
        width: 20px;
        text-align: center;
        color: #0d6efd;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }
}

.mobile-nav-drawer__item-disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #9aa1ad;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
}

.mobile-nav-drawer__item-disabled i {
    width: 20px;
    text-align: center;
    color: #9aa1ad;
}

.mobile-nav-drawer__theme-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #dbe4f5;
    background: #eef4ff;
    color: #0d3b87;
    font-weight: 600;
}

@media (max-width: 480px) {
    .container {
        margin: 0;
        border-radius: 0;
        padding: 12px;
        padding-bottom: 118px;
    }

    .page-header {
        margin-bottom: 16px;
    }

    .page-header h1 {
        font-size: 1.25em;
    }

    .section-header h2 {
        font-size: 1.05em;
    }

    .job-control-section,
    .jobs-section {
        padding: 14px;
    }

    .filter-controls {
        padding: 12px;
        gap: 12px;
    }

    .brief-grid,
    .jobs-grid,
    .job-form-grid,
    .feed-stats-grid,
    .info-cards,
    .stats-grid,
    .error-stats {
        gap: 12px;
    }

    .feed-cards-grid {
        grid-template-columns: 1fr;
    }

    .history-table {
        min-width: 640px;
    }

    .history-table th,
    .history-table td {
        padding: 10px 8px;
        font-size: 0.82em;
    }

    .pagination {
        margin-top: 18px;
        padding: 12px;
    }

    .pagination-info {
        font-size: 0.85em;
    }

    .mobile-bottom-nav {
        left: 8px;
        right: 8px;
        gap: 4px;
        padding: 6px;
        bottom: max(8px, env(safe-area-inset-bottom));
    }

    .mobile-bottom-nav__item {
        min-height: 52px;
        padding: 6px 4px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-value {
        font-size: 1.6em;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.2em;
    }
}

/* --- End Header Styling --- */


h1 {
    color: #343a40;
    /* Darker heading */
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.8em;
}

h2 {
    color: #495057;
    margin-top: 1.5em;
}

h3 {
    color: #6c757d;
    margin-top: 1.2em;
}

.timestamp {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.brief-content {
    margin-top: 20px;
}

/* --- Article List Styling --- */
.article-list {
    list-style-type: none;
    /* Remove default bullets */
    padding-left: 0;
    margin-top: 20px;
}

/* Simple article list in brief view (migrated from simple_list.css) */
.article-list-simple {
    list-style: none;
    padding-left: 0;
}

.article-list-simple li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.article-list-simple .impact-score {
    margin-right: 10px;
    font-size: 0.85em;
    width: 24px;
    height: 24px;
    line-height: 24px;
}

.article-list-simple a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.article-list-simple a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.articles-mobile-only {
    display: none;
}

.articles-desktop-only {
    display: block;
}

.articles-mobile-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.articles-mobile-row {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.articles-mobile-row label {
    font-size: 0.8em;
    font-weight: 600;
    color: #6c757d;
}

.articles-mobile-row select,
.articles-mobile-row input[type="search"] {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 10px 12px;
    box-sizing: border-box;
}

.articles-mobile-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.articles-mobile-segment {
    text-decoration: none;
    text-align: center;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    color: #495057;
    background: #fff;
    font-size: 0.82em;
}

.articles-mobile-segment.active {
    background: #e7f1ff;
    border-color: #0d6efd;
    color: #0d6efd;
    font-weight: 600;
}

.articles-mobile-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.articles-mobile-list {
    display: grid;
    gap: 10px;
}

.article-mobile-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.article-mobile-card__top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.article-mobile-card__title {
    display: block;
    color: #212529;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.article-mobile-card__meta {
    color: #6c757d;
    font-size: 0.82em;
    margin-bottom: 10px;
}

.article-mobile-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.article-mobile-card__cta {
    min-height: 40px;
    min-width: 90px;
    font-size: 0.82em;
    padding: 8px 10px;
}

.article-mobile-card .btn-mark-read {
    margin-left: auto;
}

.article-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f1f1;
    /* Light separator */
}

.article-item:last-child {
    border-bottom: none;
}

.article-link-wrapper {
    display: block;
    margin-bottom: 4px;
}

.article-link,
.article-link-original {
    display: inline;
    text-decoration: none;
    color: #0056b3;
    /* Slightly darker blue for links */
    font-weight: 500;
    /* Slightly bolder titles */
}

.article-link:hover,
.article-link-original:hover {
    text-decoration: underline;
    color: #003d80;
}

.article-meta {
    font-size: 0.85em;
    color: #6c757d;
    /* Gray for metadata */
    display: block;
    /* Put metadata on new line */
}

/* --- End Article List Styling --- */

/* --- Article List Image Styling --- */
.article-item {
    display: flex;
    /* Use flexbox for layout */
    align-items: flex-start;
    /* Align items to the top */
    gap: 15px;
    /* Space between image and text */
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f1f1;
}

.article-item:last-child {
    border-bottom: none;
}

.article-image-container {
    flex-shrink: 0;
    /* Prevent image container from shrinking */
    width: 100px;
    /* Fixed width for image/placeholder */
    height: 75px;
    /* Fixed height */
    overflow: hidden;
    /* Hide parts of image that don't fit */
    border-radius: 4px;
    background-color: #f0f0f0;
    /* BG for container while image loads */
}

.article-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cover the area, cropping if needed */
    border-radius: 4px;
}

.article-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    /* Grey background */
    color: #6c757d;
    /* Muted text color */
    font-size: 0.8em;
    text-align: center;
    border-radius: 4px;
    box-sizing: border-box;
    /* Include padding/border in element's total width/height */
    border: 1px dashed #ced4da;
    /* Optional dashed border */
}

.placeholder-icon {
    width: 24px;
    /* Adjust icon size */
    height: 24px;
    margin-bottom: 4px;
    opacity: 0.6;
}

.article-text-content {
    flex-grow: 1;
    /* Allow text content to take remaining space */
    /* No specific styles needed unless required */
}

/* --- End Article List Image Styling --- */


/* --- Article Detail Image Styling --- */
.article-detail-image-container {
    margin-bottom: 25px;
    /* Space below image */
    max-width: 400px;
    /* Limit max width on detail page */
    margin-left: auto;
    /* Center the container */
    margin-right: auto;
}

.article-detail-image {
    display: block;
    width: 100%;
    height: auto;
    /* Maintain aspect ratio */
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.article-detail-placeholder {
    height: 200px;
    /* Give placeholder a decent height */
    font-size: 1em;
}

.article-detail-placeholder .placeholder-icon {
    width: 40px;
    height: 40px;
}


/* Basic styling for Markdown elements */
p {
    margin-bottom: 1em;
}

ul:not(.article-list),
ol {
    /* Only apply margin to non-article lists */
    margin-left: 20px;
    margin-bottom: 1em;
}

li:not(.article-item) {
    /* Only apply margin to non-article list items */
    margin-bottom: 0.5em;
}

strong,
b {
    font-weight: bold;
}

em,
i {
    font-style: italic;
}

code {
    background-color: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
}

pre {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.9em;
}

pre code {
    background-color: transparent;
    padding: 0;
}

blockquote {
    border-left: 4px solid #ccc;
    padding-left: 15px;
    margin-left: 0;
    color: #555;
    font-style: italic;
}

/* --- Pagination Styling --- */
.pagination {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.95em;
}

.page-link {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-link:hover {
    background-color: #e9ecef;
    color: #0056b3;
    border-color: #ced4da;
}

.page-link.disabled {
    color: #6c757d;
    pointer-events: none;
    /* Make it non-clickable */
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.page-info {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 10px;
    color: #495057;
    font-weight: 500;
}

/* article page */
.article-details dt {
    font-weight: bold;
    margin-top: 1em;
    color: #343a40;
}

/* Style for the collapsible header (dt) */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    /* Puts text left, icon right */
    align-items: center;
}

/* Style for the icon container */
.toggle-icon-container {
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    color: #6c757d;
    /* Muted icon color */
    display: inline-flex;
    align-items: center;
}

.toggle-icon-container:hover {
    background-color: #e9ecef;
    color: #007bff;
    /* Highlight on hover */
}

/* Style for the SVG icons themselves */
.toggle-icon-container svg {
    width: 16px;
    height: 16px;
}

.article-details dd {
    margin-left: 0;
    /* Reset browser default indent */
    margin-bottom: 0.8em;
    color: #495057;
    padding-left: 1em;
    /* Add our own indent */
    border-left: 3px solid #e9ecef;
    /* Subtle left border */
}

.article-details dd a {
    /* Style link within details */
    color: #0056b3;
    text-decoration: none;
}

.article-details dd a:hover {
    text-decoration: underline;
}

.content-block {
    /* Common style for summary/raw */
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 0.95em;
    line-height: 1.5;
    margin-top: 5px;
    /* Space from the <dt> */
}

.content-block.raw-content pre {
    white-space: pre-wrap;
    /* CSS3 */
    white-space: -moz-pre-wrap;
    /* Mozilla, since 1999 */
    white-space: -pre-wrap;
    /* Opera 4-6 */
    white-space: -o-pre-wrap;
    /* Opera 7 */
    word-wrap: break-word;
    /* Internet Explorer 5.5+ */
    max-height: 400px;
    /* Limit height */
    overflow-y: auto;
    /* Add scrollbar if needed */
    margin: 0;
    /* Reset default pre margin */
    background-color: transparent;
    /* Inherit from parent */
    padding: 0;
    /* Reset default pre padding */
    border: none;
    /* Reset default pre border */
    font-size: 0.9em;
    /* Slightly smaller for dense text */
}

/* --- Impact Score Styling --- */
.impact-score {
    display: inline-block;
    /* Changed from inline to inline-block for padding/margin */
    padding: 3px 8px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 10px;
    /* Rounded corners */
    color: #fff;
    /* Default white text */
    margin-right: 8px;
    /* Space between badge and title */
    min-width: 1.5em;
    /* Ensure single digits have decent width */
    text-align: center;
    vertical-align: middle;
    /* Align better with text */
    line-height: 1.2;
    /* Adjust line height for padding */
}

/* Default / Unknown */
.impact-score.score-unknown {
    background-color: #adb5bd;
    color: #fff;
}

/* Grey */

/* Color Scale (Example - adjust colors as desired) */
.impact-score.score-1,
.impact-score.score-2 {
    background-color: #28a745;
}

/* Green */
.impact-score.score-3,
.impact-score.score-4 {
    background-color: #198754;
}

/* Darker Green */
.impact-score.score-5,
.impact-score.score-6 {
    background-color: #ffc107;
    color: #333;
}

/* Yellow (darker text) */
.impact-score.score-7,
.impact-score.score-8 {
    background-color: #fd7e14;
}

/* Orange */
.impact-score.score-9,
.impact-score.score-10 {
    background-color: #dc3545;
}

/* Red */

/* Adjust positioning slightly on the article list item */
.article-item .impact-score {
    /* Optional: Tweak alignment if needed */
    position: relative;
    top: -1px;
}

/* --- Read Status Badge --- */
.read-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75em;
    font-weight: bold;
    border-radius: 10px;
    color: #fff;
    background-color: #28a745;
    margin-left: 8px;
    margin-right: 8px;
    vertical-align: middle;
}

/* --- Mark as Read Button --- */
.btn-mark-read {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.85em;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s;
}

.btn-mark-read:hover {
    background-color: #5a6268;
}

.btn-mark-read i {
    margin-right: 4px;
}

.filter-sort-form {
    display: flex;
    flex-direction: column;
    /* Stack sections vertically */
    gap: 10px;
    /* Space between sections */
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.form-section {
    /* Base styles for sections within the form if needed */
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping */
    gap: 15px;
    /* Space between profile and search */
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- Search Filter Styling --- */
.search-filter {
    display: flex;
    align-items: center;
    flex-grow: 1;
    /* Allow search to take more space */
    background-color: #fff;
    /* White background */
    border: 1px solid #ced4da;
    border-radius: 20px;
    /* Rounded corners */
    padding: 0px 5px 0px 12px;
    /* Padding left for text, less right for button */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.search-filter input[type="search"] {
    border: none;
    outline: none;
    padding: 8px 5px;
    font-size: 0.95em;
    flex-grow: 1;
    /* Input takes available space */
    background: transparent;
    min-width: 150px;
    /* Minimum width */
}

/* Hide browser's default cancel button */
.search-filter input[type="search"]::-webkit-search-cancel-button,
.search-filter input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}


.btn-search {
    background: none;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    color: #6c757d;
}

.btn-search:hover {
    color: #007bff;
}

.btn-search svg {
    /* Style embedded SVG */
    display: block;
    /* Remove extra space below SVG */
    width: 18px;
    height: 18px;
}

.btn-clear-search {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.4em;
    line-height: 1;
    padding: 0 8px;
    cursor: pointer;
    text-decoration: none;
    margin-left: 4px;
    /* Space from search button */
}

.btn-clear-search:hover {
    color: #dc3545;
    /* Red on hover */
}

/* --- Collapsible Date Filter Styling --- */
.date-filter-toggle {
    background-color: transparent;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px 0;
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
}

.date-filter-toggle:hover {
    text-decoration: underline;
}

.toggle-icon {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
    width: 1em;
    /* Fixed width */
    text-align: center;
}

.date-filter-content {
    /* display: none; */
    /* Set inline style initially */
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background-color: #fff;
    /* White background inside */
    margin-top: -10px;
    /* Pull up slightly */
    display: flex;
    /* Use flex for layout inside */
    flex-direction: column;
    gap: 15px;
    /* Space between date inputs and presets */
}

/* Ensure date inputs and presets display nicely within collapsible */
.date-filter-content .date-inputs,
.date-filter-content .preset-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sort-link:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.sort-link.active {
    font-weight: bold;
    color: #0056b3;
    /* Darker blue for active */
    background-color: #d6eaff;
    /* Light blue background for active */
}

.sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.8em;
    /* Make indicator slightly smaller */
    color: #343a40;
    /* Dark color for indicator */
}

/* --- Feed Profile Filter & Badge Styling --- */
.brief-item {
    position: relative;
    padding-left: 40px;
    transition: opacity 0.2s ease;
}

.brief-item.read {
    opacity: 0.7;
}

.brief-item.read .brief-link {
    color: #6c757d;
}

/* Read toggle button */
.read-toggle-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.2em;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.read-toggle-btn:hover {
    color: #007bff;
}

.brief-item.read .read-toggle-btn {
    color: #28a745;
}

/* Scoped read toggles to avoid leaking absolute positioning to card layouts */
.brief-card-read-toggle,
.brief-mobile-read-toggle {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
}

.brief-mobile-read-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f3f5;
    color: #495057;
}

.brief-mobile-read-toggle:hover {
    background: #e9ecef;
    color: #0d6efd;
}

.profile-badge {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.8em;
    font-weight: 500;
    border-radius: 4px;
    background-color: #6c757d;
    /* Default grey */
    color: #fff;
    margin-left: 8px;
    vertical-align: middle;
}

.profile-badge.list-badge {
    /* Smaller badge on list items */
    font-size: 0.7em;
    padding: 1px 5px;
    margin-right: 5px;
    /* Space before impact score */
    margin-left: 0;
}

.relevance-notice {
    font-weight: bold;
    color: #17a2b8;
    /* Teal color or similar */
    font-size: 0.9em;
}

.sort-link-disabled {
    color: #adb5bd;
    /* Lighter grey for disabled */
    text-decoration: none;
    margin-left: 5px;
    cursor: default;
}

/* --- Flash Message Styling --- */
.flash-messages {
    margin-bottom: 15px;
}

.flash {
    padding: 10px 15px;
    margin-bottom: 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.9em;
}

.flash-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.flash-error {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.flash-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.flash-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* For general info */

/* Filters Form Styling */
.filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filters>div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filters label {
    font-weight: 500;
    font-size: 0.9em;
    color: #495057;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95em;
    background-color: white;
    transition: border-color 0.15s ease-in-out;
}

.filters select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

.filters.filter-unified {
    display: block;
    gap: 0;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 12px;
}

.filters.filter-unified > div {
    min-width: 0;
    gap: 0;
}

/* --- Add Article Form Styling --- */
.add-article-form {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: .5rem;
    font-weight: 500;
    font-size: 0.9em;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none;
    /* For select */
    border-radius: .25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    box-sizing: border-box;
    /* Include padding and border in the element's total width and height */
}

.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.form-text {
    display: block;
    margin-top: .25rem;
    font-size: .8em;
    color: #6c757d;
}

/* Base button styles */
.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 10px 20px;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    /* For the submit button */
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-warning {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

.btn-warning:hover {
    color: #000;
    background-color: #ffca2c;
    border-color: #ffc720;
}

.btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    color: #fff;
    background-color: #157347;
    border-color: #146c43;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}

/* --- Header Action Button Styling --- */
.btn-add-article {
    color: #198754;
    /* Green text */
    background-color: #e8f3ed;
    /* Light green background */
    border: 1px solid #a3d0b9;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Space between icon and text */
    margin: 0;
    /* Override any margin from .btn */
}

.btn-add-article:visited {
    color: #198754;
}

.btn-add-article:hover {
    color: #fff;
    background-color: #198754;
    /* Solid green on hover */
    border-color: #198754;
}

/* --- Status Page Styling --- */
.status-section {
    margin-bottom: 40px;
}

.status-section h3 {
    color: #495057;
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.status-total {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #495057;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.status-table thead {
    background-color: #f8f9fa;
}

.status-table th,
.status-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.status-table th {
    font-weight: 600;
    color: #495057;
}

.status-table tbody tr:hover {
    background-color: #f8f9fa;
}

.count-cell {
    font-weight: 600;
    font-size: 1.1em;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-0 {
    background-color: #e9ecef;
    color: #495057;
}

.status-badge.status-10 {
    background-color: #cfe2ff;
    color: #084298;
}

.status-badge.status-20 {
    background-color: #fff3cd;
    color: #664d03;
}

.status-badge.status-25 {
    background-color: #e7d6ff;
    color: #4a148c;
}

.status-badge.status-30 {
    background-color: #cff4fc;
    color: #055160;
}

.status-badge.status-40 {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-badge.status-99 {
    background-color: #f8d7da;
    color: #842029;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-fill.status-0 {
    background-color: #6c757d;
}

.progress-fill.status-10 {
    background-color: #0d6efd;
}

.progress-fill.status-20 {
    background-color: #ffc107;
}

.progress-fill.status-30 {
    background-color: #0dcaf0;
}

.progress-fill.status-40 {
    background-color: #198754;
}

.progress-fill.status-99 {
    background-color: #dc3545;
}



.status-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* --- Status by Feed Styling --- */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
}

.view-toggle .btn-active {
    background-color: #0d6efd;
    color: white;
}

.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.feed-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

.feed-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #212529;
}

.feed-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stats-card {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}

.total-count {
    margin-bottom: 15px;
    font-size: 1em;
    color: #495057;
}

.compact-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.compact-status-table th,
.compact-status-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.compact-status-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.compact-status-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge-small {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
}

.status-badge-small.status-0 {
    background-color: #e9ecef;
    color: #495057;
}

.status-badge-small.status-10 {
    background-color: #cfe2ff;
    color: #084298;
}

.status-badge-small.status-20 {
    background-color: #fff3cd;
    color: #664d03;
}

.status-badge-small.status-30 {
    background-color: #cff4fc;
    color: #055160;
}

.status-badge-small.status-40 {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-badge-small.status-99 {
    background-color: #f8d7da;
    color: #842029;
}

.percent-cell {
    text-align: right;
    color: #6c757d;
}

.no-data {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* --- Auto-refresh Toggle --- */
.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.auto-refresh-toggle label {
    font-weight: 500;
    color: #495057;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #0d6efd;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 1px #0d6efd;
}

/* --- Jobs Control Page Styling --- */
.job-control-panel {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.job-control-panel h3 {
    margin-top: 0;
    color: #495057;
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.job-form {
    background-color: white;
    padding: 20px;
    border-radius: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.checkbox-label span {
    flex: 1;
}

.checkbox-label .help-text {
    display: block;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

.action-buttons {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    justify-content: center;
    align-items: flex-start;
}

.action-column {
    flex: 1;
    max-width: 300px;
}

.action-column h4 {
    text-align: center;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.action-column .btn {
    width: 100%;
    margin-bottom: 10px;
}

.action-divider {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #dee2e6, transparent);
    margin: 30px 0;
    min-height: 200px;
}

.btn-all {
    opacity: 0.9;
    font-weight: 600;
}

.btn-all:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Pending articles info */
.pending-articles-info {
    margin: 15px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0056b3;
}

.pending-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    background-color: white;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pending-badge i {
    font-size: 1.1em;
}

.pending-badge strong {
    color: #212529;
    font-size: 1.1em;
}

.pending-process {
    border-left: 3px solid #ffc107;
}

.pending-process i {
    color: #ffc107;
}

.pending-rate {
    border-left: 3px solid #17a2b8;
}

.pending-rate i {
    color: #17a2b8;
}

.btn-action {
    padding: 12px 20px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-scrape {
    background-color: #0dcaf0;
    color: white;
}

.btn-scrape:hover {
    background-color: #0aa2c0;
}

.btn-process {
    background-color: #6f42c1;
    color: white;
}

.btn-process:hover {
    background-color: #5a32a3;
}

.btn-rate {
    background-color: #fd7e14;
    color: white;
}

.btn-rate:hover {
    background-color: #dc6502;
}

.btn-generate {
    background-color: #198754;
    color: white;
}

.btn-generate:hover {
    background-color: #146c43;
}

.jobs-section {
    margin-bottom: 30px;
}

.jobs-section h3 {
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.jobs-table th,
.jobs-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.jobs-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.jobs-table tbody tr:hover {
    background-color: #f8f9fa;
}

.action-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.action-badge.action-scrape {
    background-color: #cff4fc;
    color: #055160;
}

.action-badge.action-process {
    background-color: #e0cffc;
    color: #432874;
}

.action-badge.action-rate {
    background-color: #ffe5d0;
    color: #984c0c;
}

.action-badge.action-generate {
    background-color: #d1e7dd;
    color: #0f5132;
}

.origin-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.origin-badge.origin-web {
    background-color: #e7e7ff;
    color: #4a4a9e;
}

.origin-badge.origin-cli {
    background-color: #fff8e7;
    color: #9e8e4a;
}

.status-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-indicator.status-running {
    background-color: #cff4fc;
    color: #055160;
    animation: pulse 2s infinite;
}

.status-indicator.status-completed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-indicator.status-failed {
    background-color: #f8d7da;
    color: #842029;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.progress-container {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
    transition: width 0.3s ease;
    border-radius: 12px;
}



.article-count {
    display: block;
    font-size: 0.8em;
    color: #6c757d;
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.error-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #dc3545;
    font-size: 0.9em;
}

#message-container {
    margin-top: 20px;
}

.message {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.message-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #198754;
}

.message-error {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

.message-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.message-info {
    background-color: #cff4fc;
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

/* Global Toasts */
.toast-root {
    position: fixed;
    right: 14px;
    top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1400;
    max-width: min(92vw, 420px);
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #dbe4f5;
    background: #ffffff;
    color: #1f2937;
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.14);
    animation: toastEnter .2s ease-out;
}

.toast-info { border-left: 4px solid #0dcaf0; }
.toast-success { border-left: 4px solid #198754; }
.toast-warning { border-left: 4px solid #ffc107; }
.toast-error { border-left: 4px solid #dc3545; }

.toast-message {
    font-size: 0.9em;
    line-height: 1.35;
}

.toast-close {
    min-height: 28px;
    min-width: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 1em;
    line-height: 1;
}

.toast-leave {
    animation: toastLeave .2s ease-in forwards;
}

@keyframes toastEnter {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastLeave {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
}

@media (max-width: 768px) {
    .toast-root {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: none;
    }
}

/* ============================================
   DARK THEME OVERRIDES
   ============================================ */
[data-theme="dark"] body {
    background: #0f1115;
    color: #e7eaf0;
}

[data-theme="dark"] .container,
[data-theme="dark"] .main-header,
[data-theme="dark"] .job-control-section,
[data-theme="dark"] .jobs-section,
[data-theme="dark"] .status-section,
[data-theme="dark"] .feed-section,
[data-theme="dark"] .section,
[data-theme="dark"] .form-section,
[data-theme="dark"] .article-mobile-card,
[data-theme="dark"] .brief-mobile-card,
[data-theme="dark"] .status-mobile-card,
[data-theme="dark"] .history-card,
[data-theme="dark"] .mobile-nav-drawer__panel,
[data-theme="dark"] .mobile-sticky-actionbar,
[data-theme="dark"] .mobile-action-sheet,
[data-theme="dark"] .filter-unified,
[data-theme="dark"] .briefings-mobile-filters,
[data-theme="dark"] .articles-mobile-filters {
    background: #161a22 !important;
    color: #e7eaf0;
    border-color: #2a3040 !important;
}

[data-theme="dark"] .brief-card,
[data-theme="dark"] .brief-card-body,
[data-theme="dark"] .brief-card-action,
[data-theme="dark"] .brief-card-footer,
[data-theme="dark"] .article-item,
[data-theme="dark"] .article-image-container,
[data-theme="dark"] .article-text-content,
[data-theme="dark"] .search-filter,
[data-theme="dark"] .search-filter input,
[data-theme="dark"] .status-table thead,
[data-theme="dark"] .compact-status-table thead,
[data-theme="dark"] .status-table,
[data-theme="dark"] .compact-status-table,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .feed-card,
[data-theme="dark"] .profile-link,
[data-theme="dark"] .filter-link,
[data-theme="dark"] .profile-link.active,
[data-theme="dark"] .filter-link.active {
    background: #161a22 !important;
    color: #e7eaf0 !important;
    border-color: #2a3040 !important;
}

[data-theme="dark"] .profile-link.active,
[data-theme="dark"] .filter-link.active,
[data-theme="dark"] .filter-chip.active,
[data-theme="dark"] .filter-segment.active {
    background: #193255 !important;
    color: #eaf2ff !important;
    border-color: #2f5f9d !important;
}

[data-theme="dark"] .main-nav > a:hover,
[data-theme="dark"] .nav-dropdown .dropdown-toggle:hover,
[data-theme="dark"] .dropdown-menu a:hover {
    background-color: #1f2532 !important;
    color: #eaf2ff !important;
}

[data-theme="dark"] .status-table thead th,
[data-theme="dark"] .compact-status-table thead th,
[data-theme="dark"] .status-table th,
[data-theme="dark"] .compact-status-table th {
    background: #1b2230 !important;
    color: #dbe2ee !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] p,
[data-theme="dark"] label,
[data-theme="dark"] .toggle-label,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .status-mobile-card__desc,
[data-theme="dark"] .status-mobile-card__meta,
[data-theme="dark"] .article-meta,
[data-theme="dark"] .form-text,
[data-theme="dark"] .help-text {
    color: #c7ceda !important;
}

[data-theme="dark"] .logo,
[data-theme="dark"] .main-nav > a,
[data-theme="dark"] .dropdown-toggle,
[data-theme="dark"] .dropdown-menu a,
[data-theme="dark"] .article-link,
[data-theme="dark"] .article-link-original {
    color: #d8deea !important;
}

[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .toast-item,
[data-theme="dark"] .history-table,
[data-theme="dark"] .history-table thead,
[data-theme="dark"] .table-responsive {
    background: #12161d !important;
    border-color: #2a3040 !important;
    color: #e7eaf0;
}

[data-theme="dark"] .history-table th,
[data-theme="dark"] .history-table td,
[data-theme="dark"] .compact-status-table th,
[data-theme="dark"] .compact-status-table td,
[data-theme="dark"] .status-table th,
[data-theme="dark"] .status-table td {
    border-color: #2a3040 !important;
    color: #dbe2ee;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: #0f141b !important;
    border-color: #2a3040 !important;
    color: #e7eaf0 !important;
}

[data-theme="dark"] .btn,
[data-theme="dark"] .page-btn,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .filter-segment,
[data-theme="dark"] .mobile-feed-chip,
[data-theme="dark"] .mobile-bottom-nav__item,
[data-theme="dark"] .mobile-nav-drawer__section a,
[data-theme="dark"] .mobile-nav-drawer__theme-toggle {
    border-color: #3b4458 !important;
}

[data-theme="dark"] .mobile-bottom-nav,
[data-theme="dark"] .mobile-app-bar {
    background: rgba(22, 26, 34, 0.95) !important;
    border-color: #2a3040 !important;
}

[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-state p,
[data-theme="dark"] .pagination-info,
[data-theme="dark"] .meta-item,
[data-theme="dark"] .timestamp {
    color: #9da7b8 !important;
}

/* Additional dark-mode coverage for remaining light components */
[data-theme="dark"] .filter-sort-form,
[data-theme="dark"] .date-filter-content,
[data-theme="dark"] .add-article-form,
[data-theme="dark"] .filters,
[data-theme="dark"] .content-block,
[data-theme="dark"] .article-details dd,
[data-theme="dark"] .search-filter,
[data-theme="dark"] .article-image-placeholder,
[data-theme="dark"] .auto-refresh-control,
[data-theme="dark"] .checkbox-group,
[data-theme="dark"] .action-buttons-section,
[data-theme="dark"] .pending-articles-info,
[data-theme="dark"] .jobs-table,
[data-theme="dark"] .jobs-table th,
[data-theme="dark"] .jobs-table td,
[data-theme="dark"] .job-control-panel,
[data-theme="dark"] .job-card,
[data-theme="dark"] .job-card-header,
[data-theme="dark"] .job-card-footer,
[data-theme="dark"] .job-metric,
[data-theme="dark"] .progress-message,
[data-theme="dark"] .progress-bar-container,
[data-theme="dark"] .history-table-wrapper,
[data-theme="dark"] .error-detail-row,
[data-theme="dark"] .status-legend,
[data-theme="dark"] .feed-card-icon,
[data-theme="dark"] .stat-mini,
[data-theme="dark"] .articles-mobile-segment,
[data-theme="dark"] .briefings-mobile-chip,
[data-theme="dark"] .briefings-mobile-segment,
[data-theme="dark"] .mobile-app-bar__action,
[data-theme="dark"] .mobile-nav-drawer__close,
[data-theme="dark"] .mobile-nav-drawer__item-disabled,
[data-theme="dark"] .dropdown-theme-toggle,
[data-theme="dark"] .page-link,
[data-theme="dark"] .btn-pagination,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-mark-read,
[data-theme="dark"] .read-badge,
[data-theme="dark"] .impact-score,
[data-theme="dark"] .progress-container,
[data-theme="dark"] .skeleton-card,
[data-theme="dark"] .skeleton-line,
[data-theme="dark"] .error-message,
[data-theme="dark"] .error-traceback summary {
    background: #1b2230 !important;
    color: #dbe2ee !important;
    border-color: #2f3a4d !important;
}

[data-theme="dark"] .jobs-table tbody tr:hover,
[data-theme="dark"] .history-row:hover,
[data-theme="dark"] .page-link:hover,
[data-theme="dark"] .sort-link:hover,
[data-theme="dark"] .btn-pagination:hover,
[data-theme="dark"] .toggle-icon-container:hover {
    background: #222b3a !important;
    color: #eaf2ff !important;
}

[data-theme="dark"] .status-badge,
[data-theme="dark"] .status-badge-small,
[data-theme="dark"] .origin-badge,
[data-theme="dark"] .profile-badge,
[data-theme="dark"] .read-badge,
[data-theme="dark"] .impact-score {
    border-color: #3a465a !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .card-header,
[data-theme="dark"] .card-body,
[data-theme="dark"] .table,
[data-theme="dark"] .table-responsive,
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-hover,
[data-theme="dark"] .input-group,
[data-theme="dark"] .provider-item,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .btn-outline-secondary,
[data-theme="dark"] .form-check,
[data-theme="dark"] .form-check-label {
    background: #161a22 !important;
    color: #dbe2ee !important;
    border-color: #2f3a4d !important;
}

[data-theme="dark"] code {
    background: #0f141d !important;
    color: #dbe2ee !important;
    border-color: #2f3a4d !important;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] small.text-muted {
    color: #9ba8bc !important;
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .table thead,
[data-theme="dark"] .table thead th,
[data-theme="dark"] .table th,
[data-theme="dark"] .table td,
[data-theme="dark"] .table tbody tr {
    border-color: #2f3a4d !important;
    color: #dbe2ee !important;
}

[data-theme="dark"] .table-light td,
[data-theme="dark"] .table-light th,
[data-theme="dark"] .table-light {
    background: #1b2230 !important;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background: #222b3a !important;
}

[data-theme="dark"] .filter-unified__label,
[data-theme="dark"] .briefings-mobile-filter-label,
[data-theme="dark"] .articles-mobile-row label {
    color: #9ba8bc !important;
}

[data-theme="dark"] .filters.filter-unified,
[data-theme="dark"] .filter-unified .sort-link,
[data-theme="dark"] .filter-unified .sort-indicator {
    color: #dbe2ee !important;
}

/* Alert styles (alternative naming) */
.alert {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #198754;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
    border-left: 4px solid #ffc107;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
    border-left: 4px solid #0dcaf0;
}

/* --- Pagination Styling --- */
.pagination {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-pagination {
    padding: 8px 12px;
    background-color: #ffffff;
    color: #0d6efd;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-pagination:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.btn-pagination.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    font-weight: 600;
    cursor: default;
}

/* ============================================ */
/* RESPONSIVE DESIGN - MOBILE FIRST            */
/* ============================================ */

/* Tablets and below (768px) */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 0;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }

    .main-nav {
        flex-direction: column;
        gap: 10px;
        margin-left: 0;
        width: 100%;
    }

    .main-nav a {
        text-align: center;
        padding: 10px;
        border-bottom: none;
        background-color: #f8f9fa;
        border-radius: 4px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }

    /* Tables responsive */
    .jobs-table {
        font-size: 0.85em;
    }

    .jobs-table th,
    .jobs-table td {
        padding: 8px 4px;
    }

    /* Hide less important columns on mobile */
    .jobs-table th:nth-child(6),
    .jobs-table td:nth-child(6) {
        display: none;
    }

    /* Hide actions column on tablets */
    .jobs-table th:nth-child(7),
    .jobs-table td:nth-child(7) {
        display: none;
    }

    /* Stack action buttons vertically */
    .action-buttons {
        flex-direction: column;
        gap: 20px;
    }

    .action-column {
        max-width: 100%;
    }

    .action-divider {
        width: 100%;
        height: 2px;
        min-height: 2px;
        margin: 0;
        background: linear-gradient(to right, transparent, #dee2e6, transparent);
    }

    .btn-action {
        width: 100%;
    }

    /* Status page grid */
    .status-grid {
        grid-template-columns: 1fr !important;
    }

    /* Progress bar adjustments */
    .progress-container {
        height: 20px;
    }

    .progress-text {
        font-size: 0.7em;
    }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        margin: 0;
        padding: 10px;
    }

    h1 {
        font-size: 1.3em;
    }

    h2 {
        font-size: 1.1em;
    }

    /* Make tables scrollable horizontally */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .jobs-table {
        min-width: 500px;
        font-size: 0.8em;
    }

    /* Hide origin column on small mobile */
    .jobs-table th:nth-child(3),
    .jobs-table td:nth-child(3) {
        display: none;
    }

    /* Smaller badges */
    .action-badge,
    .origin-badge,
    .status-indicator,
    .profile-badge {
        padding: 3px 8px;
        font-size: 0.75em;
    }

    /* Smaller action buttons */
    .btn-small {
        padding: 4px 8px;
        font-size: 0.7em;
    }

    /* Pagination mobile */
    .pagination-controls {
        gap: 4px;
    }

    .btn-pagination {
        padding: 6px 8px;
        font-size: 0.8em;
    }

    /* Auto-refresh toggle */
    .auto-refresh-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Form groups */
    .form-group label {
        font-size: 0.9em;
    }

    .form-control {
        font-size: 14px;
    }

    /* Buttons */
    .btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .btn-action {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    /* Article cards */
    .article-card {
        padding: 12px;
    }

    .article-title {
        font-size: 1em;
    }

    /* Brief content */
    .brief-content {
        padding: 15px;
        font-size: 0.95em;
    }
}

/* Large tablets and small desktops (992px to 1200px) */
@media (min-width: 992px) and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

/* Large desktops (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .jobs-table {
        font-size: 1em;
    }
}

/* Print styles */
@media print {

    .main-header,
    .main-nav,
    .status-actions,
    .job-control-panel,
    .auto-refresh-toggle {
        display: none;
    }

    .container {
        max-width: 100%;
        box-shadow: none;
    }

    body {
        background-color: white;
    }
}

/* --- Modern Jobs Interface Styles --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    margin: 0;
    color: #212529;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 i {
    color: #0d6efd;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #0d6efd;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 0.9em;
    color: #495057;
    white-space: nowrap;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.stat-icon.running {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: white;
}

.stat-icon.info {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.stat-label {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

/* Job Control Section */
.job-control-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1400px) {
    .job-control-section {
        padding: 35px 40px;
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: #0d6efd;
}

.section-header .badge {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Form Grid */
.job-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

@media (min-width: 1400px) {
    .job-form-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feed-selection-column {
    grid-column: 1 / -1;
    /* Full width for feed selection */
}

/* Feed Cards Grid - Touch Friendly */
.feed-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

@media (min-width: 1600px) {
    .feed-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.feed-card {
    position: relative;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 120px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.feed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #0d6efd;
}

.feed-card:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-color: #0d6efd;
}

.feed-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.feed-card.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-color: #0d6efd;
    color: white;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
    animation: feedCardPulse 2s ease-in-out infinite;
}

@keyframes feedCardPulse {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
    }

    50% {
        box-shadow: 0 8px 24px rgba(13, 110, 253, 0.4);
    }
}

@keyframes feedCardBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

.feed-card.active {
    animation: feedCardPulse 2s ease-in-out infinite, feedCardBounce 0.3s ease-out;
}

.feed-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #495057;
    transition: all 0.3s ease;
}

.feed-card.active .feed-card-icon {
    background: white;
    color: #0d6efd;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.feed-card-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.feed-card-name {
    font-weight: 600;
    font-size: 0.95em;
    color: #212529;
    word-break: break-word;
}

.feed-card.active .feed-card-name {
    color: white;
}

.feed-card-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.stat-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75em;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.feed-card.active .stat-mini {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.feed-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2em;
    color: #198754;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.feed-card.active .feed-card-check {
    opacity: 1;
    transform: scale(1);
    color: white;
}

/* Improve touch target sizes */
@media (hover: none) and (pointer: coarse) {
    .feed-card {
        min-height: 140px;
        padding: 20px;
    }

    .feed-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .feed-card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8em;
    }
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #6c757d;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 0.85em;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.checkbox-group {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.checkbox-label {
    flex: 1;
}

.checkbox-label small {
    display: block;
    color: #856404;
    margin-top: 4px;
    font-style: italic;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid;
}

.info-card.pending {
    border-left-color: #ffc107;
}

.info-card.rating {
    border-left-color: #17a2b8;
}

.info-card i {
    font-size: 1.5em;
}

.info-card.pending i {
    color: #ffc107;
}

.info-card.rating i {
    color: #17a2b8;
}

.info-card div {
    display: flex;
    flex-direction: column;
}

.info-card strong {
    font-size: 1.4em;
    color: #212529;
}

.info-card span {
    font-size: 0.85em;
    color: #6c757d;
}

/* Action Buttons Section */
.action-buttons-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

@media (min-width: 1600px) {
    .action-buttons-section {
        padding: 30px 35px;
        gap: 40px;
    }
}

@media (max-width: 1024px) {
    .action-buttons-section {
        grid-template-columns: 1fr;
    }

    .divider-vertical {
        display: none;
    }
}

.action-group h4 {
    text-align: center;
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 1600px) {
    .buttons-grid {
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .buttons-grid {
        grid-template-columns: 1fr;
    }
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .feed-card.active,
    .progress-bar::after,
    .toast-item,
    .mobile-bottom-nav,
    .mobile-nav-drawer__panel,
    .action-btn,
    .btn-view-brief,
    .stat-card,
    .job-card,
    .brief-card {
        animation: none !important;
        transition: none !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.action-btn:focus-visible,
.btn-small:focus-visible,
.btn-mark-read:focus-visible,
.btn-view-brief:focus-visible,
.mobile-feed-chip:focus-visible,
.mobile-bottom-nav__item:focus-visible,
.mobile-nav-drawer__section a:focus-visible,
.sort-link:focus-visible,
.profile-link:focus-visible,
.filter-link:focus-visible,
.filter-chip:focus-visible,
.filter-segment:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.action-btn i {
    font-size: 1.5em;
}

.action-btn span {
    font-size: 0.95em;
}

.action-btn small {
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.9;
}

.action-btn.scrape {
    background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%);
    color: white;
}

.action-btn.process {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
    color: white;
}

.action-btn.rate {
    background: linear-gradient(135deg, #fd7e14 0%, #dc6502 100%);
    color: white;
}

.action-btn.generate {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    color: white;
}

.action-btn.all {
    opacity: 0.95;
    font-weight: 700;
}

.divider-vertical {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #ced4da, transparent);
    min-height: 200px;
}

/* Jobs Grid */
.jobs-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (min-width: 1400px) {
    .jobs-section {
        padding: 35px 40px;
    }
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}

.jobs-skeleton-grid {
    margin-bottom: 16px;
}

.skeleton-card {
    border: 1px solid #e9ecef;
    box-shadow: none;
}

.skeleton-line {
    height: 12px;
    border-radius: 8px;
    background: linear-gradient(90deg, #eef1f5 0%, #f7f9fc 50%, #eef1f5 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.2s linear infinite;
}

.skeleton-line.w-20 { width: 20%; }
.skeleton-line.w-35 { width: 35%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-55 { width: 55%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-line.w-100 { width: 100%; }

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (min-width: 1920px) {
    .jobs-grid {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

.job-card {
    background: white;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.job-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    z-index: 1;
}

.job-card.active {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.job-card-header {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.job-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    min-height: 32px;
    min-width: 32px;
}

.action-badge i {
    font-size: 0.85em;
}

.action-badge.scrape {
    background-color: #cff4fc;
    color: #055160;
}

.action-badge.process {
    background-color: #e0cffc;
    color: #432874;
}

.action-badge.rate {
    background-color: #ffe5d0;
    color: #984c0c;
}

.action-badge.generate {
    background-color: #d1e7dd;
    color: #0f5132;
}

.action-badge.small {
    padding: 6px 10px;
    font-size: 0.75em;
    min-height: 28px;
    min-width: 28px;
}

.profile-badge {
    background-color: #e7e7ff;
    color: #4a4a9e;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.profile-badge i {
    font-size: 0.85em;
}

.profile-badge.small {
    padding: 6px 10px;
    font-size: 0.75em;
    min-height: 28px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    min-height: 32px;
    min-width: 32px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-badge i {
    font-size: 0.85em;
}

.status-badge.running {
    background-color: #cff4fc;
    color: #055160;
}

.status-badge.completed {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-badge.failed {
    background-color: #f8d7da;
    color: #842029;
}

.job-card-body {
    padding: 15px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-section {
    margin-bottom: 12px;
    position: relative;
}

.progress-bar-container {
    position: relative;
    width: 100%;
    height: 28px;
    background-color: #e9ecef;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
    transition: width 0.5s ease;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    display: block;
    position: static;
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
    margin: 0;
    padding: 0;
    text-align: left;
}

.progress-message {
    font-size: 0.85em;
    color: #6c757d;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.progress-message i {
    color: #0d6efd;
}

.job-metric {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
}

.job-metric i {
    color: #0d6efd;
}

.job-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item i {
    color: #adb5bd;
}

.job-card-footer {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.btn-small.danger {
    background-color: #dc3545;
    color: white;
}

.btn-small.danger:hover {
    background-color: #bb2d3b;
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4em;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 1.1em;
    margin: 10px 0;
    color: #495057;
}

.empty-state small {
    font-size: 0.9em;
}

/* History Table */
.history-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.history-table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: sticky;
    top: 0;
}

.history-table th {
    padding: 16px 14px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.history-table td {
    padding: 16px 14px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
}

@media (min-width: 1600px) {
    .history-table th {
        padding: 18px 16px;
        font-size: 0.95em;
    }

    .history-table td {
        padding: 18px 16px;
        font-size: 0.95em;
    }
}

.history-row:hover {
    background-color: #f8f9fa;
}

.history-row.completed {
    background-color: rgba(25, 135, 84, 0.03);
}

.history-row.failed {
    background-color: rgba(220, 53, 69, 0.03);
}

.history-table .number {
    text-align: center;
    font-weight: 600;
}

.history-table .duration {
    text-align: center;
    font-family: monospace;
}

.history-table .timestamp {
    color: #6c757d;
    font-size: 0.85em;
}

.error-detail-row {
    background-color: #fff3cd !important;
}

.error-message {
    padding: 12px;
    color: #856404;
    font-size: 0.85em;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.error-message i {
    margin-top: 2px;
}

.origin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8em;
    font-weight: 600;
}

.origin-badge.small {
    padding: 3px 8px;
    font-size: 0.75em;
}

.history-mobile {
    display: none;
}

.jobs-mobile-only {
    display: none;
}

.jobs-page-container {
    overflow-x: clip;
}

.jobs-desktop-only {
    display: block;
}

.mobile-stack {
    align-items: center;
}

.mobile-feed-scroller {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0 10px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.mobile-feed-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    background: #fff;
    color: #495057;
    padding: 10px 14px;
    white-space: nowrap;
    min-height: 42px;
    flex: 0 0 auto;
}

.mobile-feed-chip.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.mobile-feed-summary {
    margin-bottom: 14px;
}

.mobile-controls-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.mobile-action-sheet {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.mobile-sticky-actionbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(87px + env(safe-area-inset-bottom));
    z-index: 1150;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    margin-top: 6px;
    border-radius: 14px;
    border: 1px solid #dbe4f5;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 22px rgba(14, 30, 66, 0.12);
    width: auto;
    box-sizing: border-box;
}

.mobile-sticky-actionbar__feed {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #0d3b87;
    background: #e7f1ff;
    border: 1px solid #cfe2ff;
    border-radius: 999px;
    padding: 8px 10px;
    max-width: 45%;
    overflow: hidden;
}

.mobile-sticky-actionbar__feed span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-sticky-actionbar__btn {
    flex: 1;
    min-height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.jobs-mobile-only,
.jobs-mobile-only * {
    max-width: 100%;
}

.mobile-action-sheet h4 {
    margin: 0 0 10px;
    font-size: 0.95em;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.btn-compact {
    padding: 8px 10px;
    font-size: 0.85em;
}

.mobile-info-cards {
    grid-template-columns: 1fr;
    gap: 8px;
}

.history-cards {
    display: grid;
    gap: 12px;
}

.history-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.history-card.completed {
    border-color: rgba(25, 135, 84, 0.32);
    background: rgba(25, 135, 84, 0.04);
}

.history-card.failed {
    border-color: rgba(220, 53, 69, 0.3);
    background: rgba(220, 53, 69, 0.04);
}

.history-card__top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.history-status {
    margin-left: auto;
}

.history-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85em;
    color: #495057;
    margin-bottom: 8px;
}

.history-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.pagination-info {
    font-size: 0.9em;
    color: #6c757d;
}

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    background-color: white;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.page-btn:hover {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    transform: translateY(-1px);
}

.page-btn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    font-weight: 600;
}

#message-container {
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .job-form-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .divider-vertical {
        display: none;
    }

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

    .feed-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        justify-content: stretch;
        align-items: stretch;
    }

    .auto-refresh-control {
        width: 100%;
        justify-content: space-between;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 10px;
        padding: 8px 10px;
        box-sizing: border-box;
        gap: 8px;
    }

    .toggle-label {
        font-size: 0.82em;
        white-space: normal;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 10px 8px;
        gap: 8px;
        border-radius: 10px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        font-size: 0.95em;
        flex: 0 0 auto;
    }

    .stat-content {
        min-width: 0;
    }

    .stat-value {
        font-size: 1.05em;
        line-height: 1.1;
    }

    .stat-label {
        font-size: 0.68em;
        line-height: 1.15;
        letter-spacing: 0.02em;
    }

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

    .pagination {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .feed-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .jobs-desktop-only {
        display: none;
    }

    .jobs-mobile-only {
        display: block;
        overflow-x: clip;
    }

    .history-desktop {
        display: none;
    }

    .history-mobile {
        display: grid;
    }

    .job-card {
        border-radius: 14px;
    }

    .job-card-header {
        padding: 12px;
        min-height: 54px;
    }

    .job-card-body {
        padding: 12px;
        gap: 10px;
    }

    .job-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .job-card-footer {
        padding: 10px 12px;
    }

    .btn-small {
        min-height: 42px;
        width: 100%;
        justify-content: center;
    }

    .mobile-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .action-btn {
        min-height: 56px;
        border-radius: 12px;
        gap: 5px;
        width: 100%;
        box-sizing: border-box;
    }

    .action-btn i {
        font-size: 1.2em;
    }

    .action-btn span {
        font-size: 0.86em;
        line-height: 1.2;
    }

    .action-btn small {
        display: none;
    }

    .header-actions .btn {
        width: 100%;
        min-height: 42px;
        padding: 8px 10px;
        box-sizing: border-box;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

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

    .feed-card {
        min-height: 130px;
    }

    .history-card {
        padding: 10px;
        border-radius: 10px;
    }

    .history-card__meta {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 10px;
    }

    .history-status {
        margin-left: 0;
    }

    .mobile-action-grid {
        grid-template-columns: 1fr;
    }

    .mobile-sticky-actionbar {
        flex-direction: column;
        align-items: stretch;
        left: 8px;
        right: 8px;
        bottom: calc(81px + env(safe-area-inset-bottom));
        width: auto;
    }

    .mobile-sticky-actionbar__feed {
        max-width: 100%;
        justify-content: center;
    }
}

/* ============================================
   BRIEFING CARDS - Modern Grid Layout
   ============================================ */

.brief-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* Enforce desktop briefing grid columns */
@media (min-width: 1025px) {
    .brief-grid.briefings-desktop-only {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 24px;
    }
}

.briefings-mobile-only {
    display: none;
}

.briefings-desktop-only {
    display: block;
}

.briefings-mobile-filters {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

.briefings-mobile-filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.briefings-mobile-filter-row:last-child {
    margin-bottom: 0;
}

.briefings-mobile-filter-label {
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c757d;
}

.briefings-mobile-chip-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.briefings-mobile-chip {
    flex: 0 0 auto;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.85em;
    text-decoration: none;
    color: #495057;
    background: #fff;
}

.briefings-mobile-chip.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.briefings-mobile-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.briefings-mobile-segment {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    text-decoration: none;
    color: #495057;
    background: #fff;
    font-size: 0.84em;
}

.briefings-mobile-segment.active {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #e7f1ff;
    font-weight: 600;
}

.briefings-mobile-list {
    gap: 12px;
}

.brief-mobile-card {
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.brief-mobile-card.read {
    opacity: 0.82;
    background: #f8f9fa;
}

.brief-mobile-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.brief-mobile-card__title {
    font-size: 1em;
    line-height: 1.35;
    margin: 0 0 10px;
    color: #24292e;
}

.brief-mobile-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8em;
    color: #6c757d;
    margin-bottom: 12px;
}

.brief-mobile-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.brief-mobile-card__cta {
    width: 100%;
    min-height: 44px;
}

.brief-card {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.brief-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #c8d0d8;
}

.brief-card.read {
    opacity: 0.75;
    background: #f8f9fa;
}

.brief-card.read:hover {
    opacity: 0.9;
}

/* Card Header */
.brief-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.brief-card.read .brief-card-header {
    background: linear-gradient(135deg, #868e96 0%, #6c757d 100%);
}

.brief-card-header .read-toggle-btn {
    position: relative;
    left: 0;
    top: 0;
    transform: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 1em;
    padding: 6px 10px;
    transition: all 0.2s ease;
}

.brief-card-header .read-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.brief-card-header .profile-badge {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 10px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0;
}

.brief-date {
    margin-left: auto;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.95;
}

.brief-date i {
    font-size: 0.9em;
}

/* Card Body */
.brief-card-body {
    padding: 20px;
    flex-grow: 1;
}

.brief-title {
    margin: 0 0 16px 0;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.4;
    color: #24292e;
    cursor: default;
}

.brief-card.read .brief-title {
    color: #6c757d;
}

/* Make the entire card subtly interactive */
.brief-card {
    cursor: default;
}

.brief-card:hover .brief-title {
    color: #667eea;
}

.brief-card.read:hover .brief-title {
    color: #868e96;
}

/* Card Footer */
.brief-card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85em;
    color: #6c757d;
    flex-wrap: wrap;
}

.brief-card-footer span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.brief-card-footer i {
    font-size: 0.9em;
    opacity: 0.7;
}

.brief-id {
    color: #868e96;
    font-weight: 500;
}

.brief-time {
    color: #495057;
}

.brief-model {
    color: #667eea;
    font-weight: 500;
    background: #f0f3ff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

/* Card Action */
.brief-card-action {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: center;
}

.btn-view-brief {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 180px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-view-brief:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.brief-card.read .btn-view-brief {
    background: linear-gradient(135deg, #868e96 0%, #6c757d 100%);
}

.brief-card.read .btn-view-brief:hover {
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.3;
    display: block;
}

.empty-state p {
    font-size: 1.1em;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .brief-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 1024px) {
    .status-table {
        display: none;
    }

    .status-mobile-cards {
        display: block;
    }

    .sort-link:hover,
    .profile-link:hover,
    .filter-link:hover,
    .filter-chip:hover,
    .filter-segment:hover,
    .mobile-feed-chip:hover,
    .mobile-bottom-nav__item:hover,
    .btn-view-brief:hover,
    .action-btn:hover,
    .btn-small:hover,
    .feed-card:hover,
    .nav-dropdown .dropdown-toggle:hover,
    .dropdown-menu a:hover {
        transform: none;
        box-shadow: none;
    }

    .articles-desktop-only {
        display: none;
    }

    .articles-mobile-only {
        display: block;
    }

    .briefings-desktop-only,
    .filter-controls.briefings-desktop-only,
    .brief-grid.briefings-desktop-only {
        display: none;
    }

    .briefings-mobile-only,
    section.briefings-mobile-only,
    .briefings-mobile-list.briefings-mobile-only {
        display: block;
    }

    .briefings-mobile-list.briefings-mobile-only {
        display: grid;
    }

    .container {
        padding-bottom: calc(132px + env(safe-area-inset-bottom));
    }

    .brief-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .brief-card-header {
        flex-wrap: wrap;
    }

    .brief-date {
        margin-left: 0;
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .brief-card-body {
        padding: 16px;
    }

    .brief-title {
        font-size: 1.05em;
    }

    .brief-card-footer {
        font-size: 0.8em;
        gap: 12px;
    }

    .btn-view-brief {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .briefings-mobile-segmented {
        grid-template-columns: 1fr;
    }

    .brief-mobile-card {
        padding: 10px;
    }

    .brief-mobile-card__title {
        font-size: 0.95em;
    }
}

/* ============================================
   PAGE HEADER - Intelligence Briefings
   ============================================ */

.page-title-section {
    margin-bottom: 30px;
}

.page-title-section h2 {
    margin-bottom: 8px;
    font-size: 2em;
    color: #24292e;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title-section h2 i {
    color: #667eea;
}

.page-subtitle {
    color: #6c757d;
    font-size: 1.05em;
    margin: 0;
    font-weight: 400;
}

/* ============================================
   FILTER CONTROLS - Enhanced Responsiveness
   ============================================ */

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
}

.profile-filter,
.read-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-filter label,
.read-filter label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
    margin-right: 5px;
}

.profile-link,
.filter-link {
    text-decoration: none;
    color: #495057;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid #dee2e6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.profile-link:hover,
.filter-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.profile-link.active,
.filter-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.profile-link.active:hover,
.filter-link.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .page-title-section h2 {
        font-size: 1.75em;
    }

    .page-subtitle {
        font-size: 1em;
    }

    .brief-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .filter-controls {
        padding: 16px;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .page-title-section {
        margin-bottom: 20px;
    }

    .page-title-section h2 {
        font-size: 1.5em;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .page-subtitle {
        font-size: 0.95em;
    }

    .filter-controls {
        padding: 15px;
        gap: 15px;
    }

    .profile-filter,
    .read-filter {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .profile-filter label,
    .read-filter label {
        width: 100%;
        margin-bottom: 5px;
    }

    .profile-link,
    .filter-link {
        padding: 10px 16px;
        width: 100%;
        justify-content: center;
    }

    .brief-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .brief-card-header {
        padding: 10px 12px;
    }

    .brief-card-body {
        padding: 16px;
    }

    .brief-card-action {
        padding: 0 16px 16px 16px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .container {
        padding: 15px;
        margin: 10px auto;
        padding-bottom: calc(138px + env(safe-area-inset-bottom));
    }

    .page-title-section h2 {
        font-size: 1.3em;
    }

    .page-title-section h2 i {
        font-size: 0.9em;
    }

    .page-subtitle {
        font-size: 0.9em;
    }

    .filter-controls {
        padding: 12px;
        gap: 12px;
    }

    .profile-link,
    .filter-link {
        font-size: 0.85em;
        padding: 8px 12px;
    }

    .brief-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .brief-card-header .read-toggle-btn {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .brief-date {
        margin-left: 0;
        width: 100%;
    }

    .brief-title {
        font-size: 1em;
    }

    .brief-card-footer {
        font-size: 0.75em;
        gap: 10px;
    }

    .btn-view-brief {
        padding: 10px 14px;
        font-size: 0.85em;
    }

    .empty-state i {
        font-size: 3em;
    }

    .empty-state p {
        font-size: 1em;
    }
}

@media (min-width: 1280px) {
    .brief-grid.briefings-desktop-only {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Mobile Extra Small */
@media (max-width: 360px) {
    .page-title-section h2 {
        font-size: 1.2em;
    }

    .brief-card-body {
        padding: 12px;
    }

    .brief-card-action {
        padding: 0 12px 12px 12px;
    }

    .brief-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ============================================
   ERROR LOGS PAGE STYLES
   ============================================ */

.error-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card.critical {
    border-left-color: #dc3545;
}

.stat-card.high {
    border-left-color: #fd7e14;
}

.stat-card.medium {
    border-left-color: #ffc107;
}

.stat-card.warning {
    border-left-color: #17a2b8;
}

.stat-card h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.error-item {
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid #6c757d;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s;
}

.error-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error-item.critical {
    border-left-color: #dc3545;
}

.error-item.high {
    border-left-color: #fd7e14;
}

.error-item.medium {
    border-left-color: #ffc107;
}

.error-item.warning {
    border-left-color: #17a2b8;
}

.error-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.error-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.severity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.severity-badge.critical {
    background: #dc3545;
    color: white;
}

.severity-badge.high {
    background: #fd7e14;
    color: white;
}

.severity-badge.medium {
    background: #ffc107;
    color: #000;
}

.severity-badge.warning {
    background: #17a2b8;
    color: white;
}

.error-timestamp {
    font-size: 12px;
    color: #666;
}

.error-context {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.error-message {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #d63384;
    word-break: break-word;
}

.error-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 10px 0;
    font-size: 13px;
}

.error-detail {
    display: flex;
    flex-direction: column;
}

.error-detail strong {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.error-detail span {
    color: #333;
}

.error-traceback {
    margin-top: 10px;
}

.error-traceback summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    user-select: none;
    transition: background 0.2s ease;
}

.error-traceback summary:hover {
    background: #e9ecef;
}

.error-traceback pre {
    margin: 10px 0 0 0;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
}

.no-errors {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-errors h2 {
    color: #28a745;
    margin-bottom: 10px;
}

.no-errors i {
    font-size: 4em;
    color: #28a745;
    opacity: 0.3;
    margin-bottom: 20px;
}

/* Responsive adjustments for error logs */
@media (max-width: 768px) {
    .error-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .error-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .error-stats {
        grid-template-columns: 1fr;
    }

    .stat-card .value {
        font-size: 24px;
    }
}
