/* CU Compliance News - Stylesheet */

:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b5f;
    --secondary-color: #57837b;
    --accent-color: #c38154;
    --texas-color: #bf5700;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --success-color: #2e7d32;
    --warning-color: #ed6c02;
    --error-color: #d32f2f;
}

/* Dark mode */
[data-theme="dark"] {
    --primary-color: #3d9cc9;
    --primary-dark: #2d7ea8;
    --secondary-color: #7ab3a9;
    --accent-color: #d9a676;
    --texas-color: #e67d22;
    --background: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #e8e8e8;
    --text-muted: #a0a0a0;
    --border-color: #2d3a5a;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
}

[data-theme="dark"] .navbar {
    background-color: #0f0f23;
}

[data-theme="dark"] .sidebar-section {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .article-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .footer {
    background-color: #0f0f23;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.5);
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}
.sidebar-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sidebar-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.stat-list {
    list-style: none;
}

.stat-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-list li:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

.filter-list {    list-style: none;    max-height: 150px;    overflow-y: auto;}

.filter-list li a {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-list li a:hover {
    background-color: var(--background);
}

.filter-list li a.active {
    background-color: var(--primary-color);
    color: white;
}

/* Deadline Alerts */
.deadline-alerts {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert-danger {
    background: #ffebee;
    border-left: 4px solid #c62828;
    color: #b71c1c;
}

.alert-warning {
    background: #fff3e0;
    border-left: 4px solid #ef6c00;
    color: #e65100;
}

.alert strong {
    margin-right: 0.5rem;
}

.alert-item {
    color: inherit;
    text-decoration: none;
}

.alert-item:hover {
    text-decoration: underline;
}

.alert-item .deadline {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-left: 0.25rem;
}

.alert .more-link {
    color: inherit;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--primary-dark);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Article Cards */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.article-card.read {
    opacity: 0.7;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.article-meta .source {
    color: var(--primary-color);
    font-weight: 500;
}

.article-meta .date {
    color: var(--text-muted);
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.article-title a {
    color: var(--text-color);
    text-decoration: none;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-summary {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
}

/* Category Badges */
.category {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.cat-rules { background: #e3f2fd; color: #1565c0; }
.cat-guidance { background: #e8f5e9; color: #2e7d32; }
.cat-proposals { background: #fff3e0; color: #ef6c00; }
.cat-enforcement { background: #ffebee; color: #c62828; }
.cat-commentary { background: #f3e5f5; color: #7b1fa2; }
.cat-security { background: #fce4ec; color: #c2185b; }

/* Texas Badge */
.texas-badge {
    background: var(--texas-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* New Badge */
.new-badge {
    background: var(--success-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

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

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

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

.btn-star {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 1.1rem;
    line-height: 1;
}

.btn-star:hover {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
    color: #ffc107;
}

.btn-star.starred {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
}

.btn-star .star-icon {
    display: inline-block;
}

/* Stat link in sidebar */
.stat-link {
    color: inherit;
    text-decoration: none;
}

.stat-link:hover {
    color: var(--primary-color);
}

.stat-link:hover .stat-value {
    color: var(--primary-color);
}

/* Article View */
.article-view {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.article-view h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.article-view .author {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.article-summary-box,
.texas-reason-box,
.action-items-box {
    background: var(--background);
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.texas-reason-box {
    border-left-color: var(--texas-color);
}

.action-items-box {
    border-left-color: var(--accent-color);
}

.article-summary-box h3,
.texas-reason-box h3,
.action-items-box h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.article-content {
    margin-top: 2rem;
}

.article-content h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.content-text {
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
}

/* Action Items */
.action-list {
    list-style: none;
}

.action-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.action-list li.completed .action-desc {
    text-decoration: line-through;
    color: var(--text-muted);
}

.action-checkbox {
    background: none;
    border: none;
    cursor: pointer;
    font-family: monospace;
    font-size: 1rem;
}

.action-deadline {
    font-size: 0.875rem;
    color: var(--warning-color);
}

.priority-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.priority-high { background: #ffebee; color: #c62828; }
.priority-medium { background: #fff3e0; color: #ef6c00; }
.priority-low { background: #e8f5e9; color: #2e7d32; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--background);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: none;
}

tr.completed {
    opacity: 0.6;
}

tr.disabled {
    opacity: 0.5;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active { background: #e8f5e9; color: #2e7d32; }
.status-disabled { background: #f5f5f5; color: #9e9e9e; }

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

.stat-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Category Chart */
.category-breakdown {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.category-breakdown h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.category-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.category-name {
    width: 120px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.bar-container {
    flex: 1;
    height: 24px;
    background: var(--background);
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s;
}

.category-count {
    width: 50px;
    text-align: right;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .sidebar-section {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 1rem;
    }

    .article-view {
        padding: 1rem;
    }
}

/* Accessibility - Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Focus States for Keyboard Navigation */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Inline Forms */
.inline-form {
    display: inline;
}

/* Expandable Original Content */
.article-original-content {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.original-content-inner {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.original-content-inner::-webkit-scrollbar {
    width: 8px;
}

.original-content-inner::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.original-content-inner::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.original-content-inner::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Error Page */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
}

.error-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 500px;
}

.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-message {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.error-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Article summary box h2 styling (for accessibility update) */
.article-summary-box h2,
.texas-reason-box h2,
.action-items-box h2 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    .article-actions,
    .article-footer,
    .pagination,
    .skip-link {
        display: none !important;
    }

    .dashboard {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0d47a1;
        --text-color: #000000;
        --background: #ffffff;
        --border-color: #000000;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Keyboard Navigation */
.article-card.keyboard-selected {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 4px 12px rgba(26, 95, 122, 0.2);
}

/* Keyboard Help Modal */
.keyboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.keyboard-modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.keyboard-modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.shortcut-list {
    margin-bottom: 1.5rem;
}

.shortcut {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.shortcut:last-child {
    border-bottom: none;
}

kbd {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    min-width: 2rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ============ Compliance Calendar ============ */
.calendar-page {
    max-width: 1500px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin: 0;
}

.calendar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

/* Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* Two-column layout: event list left, calendar right */
.calendar-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Calendar container */
.calendar-main {
    min-width: 0;
}

#calendar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Sidebar - left column */
.calendar-sidebar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 1rem;
}

.calendar-sidebar h2 {
    font-size: 1.1rem;
    margin: 0 0 0.25rem 0;
    color: var(--text-color);
}

.sidebar-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem 0;
}

/* Event groups */
.event-group {
    margin-bottom: 1.25rem;
}

.event-group:last-child {
    margin-bottom: 0;
}

.event-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

/* Individual event items */
.event-list-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.event-list-title {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.15rem;
}

.event-list-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
}

.event-list-authority {
    color: var(--primary-color);
    font-weight: 600;
}

.event-list-freq {
    color: var(--text-muted);
}

.event-list-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.event-list-link {
    font-size: 0.72rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-block;
    margin-top: 0.2rem;
}

.event-list-link:hover {
    text-decoration: underline;
}

/* FullCalendar dark mode overrides */
.fc-dark .fc-theme-standard td,
.fc-dark .fc-theme-standard th,
.fc-dark .fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-color);
}

.fc-dark .fc-col-header-cell {
    background: var(--background);
}

.fc-dark .fc-daygrid-day-number,
.fc-dark .fc-list-day-text,
.fc-dark .fc-list-day-side-text {
    color: var(--text-color);
}

.fc-dark .fc-button-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.fc-dark .fc-button-primary:hover {
    background-color: var(--primary-dark, #134d63);
}

.fc-dark .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--primary-dark, #134d63);
}

.fc-dark .fc-day-today {
    background: rgba(61, 156, 201, 0.1) !important;
}

.fc-dark .fc-toolbar-title {
    color: var(--text-color);
}

.fc-dark .fc-list-event:hover td {
    background: var(--background);
}

.fc-dark .fc-list-empty {
    background: var(--card-bg);
}

/* Event modal */
.event-modal[hidden] { display: none !important; }
.event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.event-modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.event-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

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

.event-modal-content h2 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: var(--primary-dark, #134d63);
    padding-right: 2rem;
}

.event-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.event-date {
    color: var(--text-muted);
}

.event-authority {
    font-weight: 600;
    color: var(--primary-color);
}

.event-category-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--background);
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.event-recurrence {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.event-modal-content p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* Calendar responsive */
@media (max-width: 1024px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .calendar-sidebar {
        position: static;
        max-height: none;
        order: 2;
    }
    .calendar-main {
        order: 1;
    }
}

@media (max-width: 600px) {
    #calendar {
        padding: 0.5rem;
    }
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media print {
    .calendar-actions,
    .calendar-legend,
    .event-modal[hidden] { display: none !important; }
.event-modal {
        display: none !important;
    }
}


/* ============ Event-Triggered Compliance Page ============ */
.triggers-page {
    max-width: 960px;
    margin: 0 auto;
}

.triggers-intro {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.trigger-group {
    margin-bottom: 2rem;
}

.trigger-group-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
}

.trigger-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.trigger-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.trigger-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
}

.trigger-authority {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    padding: 0.15rem 0.5rem;
    background: rgba(61, 156, 201, 0.1);
    border-radius: 4px;
}

.trigger-card-trigger,
.trigger-card-deadline {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.trigger-card-trigger strong,
.trigger-card-deadline strong {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 5rem;
    display: inline-block;
}

.trigger-card-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0.5rem 0 0.25rem 0;
}

@media (max-width: 600px) {
    .trigger-card-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* FullCalendar list view date header rows */
.fc .fc-list-day-cushion {
    background: var(--background, #f5f5f5) !important;
}

.fc-dark .fc-list-day-cushion {
    background: var(--background, #1a1a2e) !important;
}
