/* Gulf States Regs Copilot - UI Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px; /* Expanded for calendar room */
    width: 95vw;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

header {
    background: linear-gradient(135deg, #7a8ced 0%, #8561ab 100%);
    color: white;
    padding: 24px 30px;
    text-align: center;
    border-radius: 12px 12px 0 0;
}

header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.auth-section {
    padding: 40px;
    text-align: center;
}

.auth-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.auth-section input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    margin: 20px auto;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    display: block;
}

.auth-section button {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-section button:hover {
    background: #5568d3;
}

.chat-section {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    max-height: 800px;
}

.chat-section.auto-height {
    height: auto;
    max-height: none;
    min-height: 0;
}

.filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    gap: 12px;
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filters label {
    font-weight: 500;
    white-space: nowrap;
}

.filters select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 8px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

.system-message {
    padding: 15px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1565c0;
}

.message {
    margin-bottom: 25px;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    text-align: right;
}

.message.user .bubble {
    background: #667eea;
    color: white;
    display: inline-block;
    max-width: 80%;
    text-align: left;
}

.message.assistant .bubble {
    background: white;
    border: 1px solid #e0e0e0;
    display: inline-block;
    max-width: 85%;
}

.bubble {
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.bubble .question-text,
.bubble .answer-text {
    line-height: 1.6;
}

/* --- Sources drawer (collapsible) --- */
.sources-drawer {
    margin-top: 14px;
    border-top: 1px solid #e0e0e0;
    padding-top: 8px;
}

.sources-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: background 0.2s;
}

.sources-toggle:hover {
    background: #f5f5f5;
}

.sources-chevron::after {
    content: '\25B6';
    font-size: 10px;
    transition: transform 0.2s;
    display: inline-block;
}

.sources-drawer.open .sources-chevron::after {
    transform: rotate(90deg);
}

.sources-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sources-drawer.open .sources-content {
    max-height: 2000px;
}

/* --- Citation cards --- */
.citation-card {
    padding: 10px 12px;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
}

.citation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.citation-ref-label {
    color: #667eea;
    white-space: nowrap;
}

.citation-doc-title {
    font-weight: 500;
    color: #333;
}

.jurisdiction-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
}

.citation-quote {
    font-style: italic;
    color: #555;
    margin: 6px 0;
    padding-left: 8px;
    border-left: 2px solid #ddd;
    line-height: 1.5;
}

.citation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    gap: 8px;
    flex-wrap: wrap;
}

.citation-meta-text {
    font-size: 12px;
    color: #888;
}

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

.view-source-btn {
    display: inline-block;
    padding: 4px 10px;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.view-source-btn:hover {
    background: #5568d3;
    text-decoration: none;
}

.copy-quote-btn {
    display: inline-block;
    padding: 4px 10px;
    background: none;
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #667eea;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.copy-quote-btn:hover {
    background: #667eea;
    color: white;
}

.copy-quote-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Doc type chips on citation cards */
.doc-type-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.doc-type-bulletin {
    background: #fff3cd;
    color: #856404;
}

.doc-type-regulation {
    background: #d1ecf1;
    color: #0c5460;
}

.doc-type-guidance {
    background: #d4edda;
    color: #155724;
}

.doc-type-statute {
    background: #f8d7da;
    color: #721c24;
}

.meta-info {
    margin-top: 10px;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 11px;
    color: #666;
}

.error-message {
    padding: 15px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 4px;
    color: #c62828;
}

.chat-form {
    padding: 20px;
    background: white;
    border-top: 2px solid #e0e0e0;
}

.chat-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.chat-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.form-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.form-actions button[type="submit"] {
    background: #667eea;
    color: white;
    flex: 1;
}

.form-actions button[type="submit"]:hover {
    background: #5568d3;
}

.form-actions button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.form-actions button[type="button"] {
    background: #f5f5f5;
    color: #666;
}

.form-actions button[type="button"]:hover {
    background: #e0e0e0;
}

.budget-info {
    padding: 8px 20px;
    background: #fff8e1;
    border-top: 1px solid #ffecb3;
    font-size: 12px;
    color: #f57f17;
    text-align: center;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Citation refs in answer text --- */
.citation-ref {
    color: #667eea;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-cited {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-fallback {
    background: #fff3e0;
    color: #e65100;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* --- Suggestion chips --- */
.suggestions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
    line-height: 1.4;
}

.suggestion-chip:hover {
    background: #e0e0e0;
}

.narrow-label {
    font-size: 12px;
    color: #888;
    align-self: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.narrow-chip {
    background: none;
    border: 1px solid #667eea;
    color: #667eea;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.narrow-chip:hover {
    background: #667eea;
    color: white;
}

/* --- Search meta line (always visible) --- */
.meta-search {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* --- Diagnostics footer (hidden by default) --- */
.meta-diagnostics {
    margin-top: 6px;
    padding: 6px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 11px;
    color: #999;
    font-family: monospace;
}

/* --- Diagnostics toggle in filters bar --- */
.diagnostics-label {
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.diagnostics-label input[type="checkbox"] {
    margin-right: 4px;
    vertical-align: middle;
}

/* --- Active jurisdiction pill --- */
.active-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.active-pill-all {
    background: #e3f2fd;
    color: #1565c0;
}

.active-pill-filtered {
    background: #fff3e0;
    color: #e65100;
}

/* --- Jurisdiction hint below input --- */
.jurisdiction-hint {
    font-size: 12px;
    color: #888;
    padding: 4px 0 0;
}

/* --- Filters right group --- */
.filters-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Filter bar buttons --- */
.filter-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* --- Coverage Panel --- */
.coverage-panel {
    padding: 12px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    animation: fadeIn 0.2s;
}

.coverage-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.coverage-totals {
    font-size: 12px;
    color: #888;
}

.coverage-refresh {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #667eea;
    padding: 0 4px;
}

.coverage-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.coverage-table th {
    text-align: left;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    padding: 4px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.coverage-table td {
    padding: 4px 8px;
    font-size: 13px;
}

.coverage-types {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.type-chip {
    font-size: 11px;
    padding: 2px 8px;
    background: #e8eaf6;
    color: #3949ab;
    border-radius: 10px;
}

.coverage-loading {
    padding: 8px;
    color: #888;
    font-size: 12px;
}

/* --- Demo Panel --- */
.demo-panel {
    padding: 12px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    animation: fadeIn 0.2s;
    max-height: 350px;
    overflow-y: auto;
}

.demo-category {
    margin-bottom: 12px;
}

.demo-category-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #667eea;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.demo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.demo-chip {
    background: white;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    line-height: 1.4;
}

.demo-chip:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* --- Library Panel --- */
.library-panel {
    padding: 12px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    animation: fadeIn 0.2s;
    max-height: 400px;
    overflow-y: auto;
}

.library-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

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

.library-search {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 200px;
}

.library-filters select {
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.library-table td {
    vertical-align: middle;
}

.library-table td:first-child {
    max-width: 350px;
    word-break: break-word;
}

/* --- Auto-route banner --- */
.auto-route-banner {
    padding: 8px 12px;
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
    color: #795548;
    margin-bottom: 10px;
    animation: fadeIn 0.3s;
}

/* --- Operator Console --- */
.operator-panel {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
    font-size: 13px;
    font-family: monospace;
}

.operator-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.operator-header strong {
    font-size: 14px;
    color: #a78bfa;
}

.op-subtitle {
    font-size: 11px;
    color: #666;
    flex: 1;
}

.op-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

.op-close-btn:hover {
    color: #fff;
}

.op-section {
    margin-bottom: 14px;
}

.op-section-title {
    font-size: 11px;
    font-weight: 600;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.op-corpus-totals {
    color: #aaa;
    margin-bottom: 6px;
    font-size: 12px;
}

.op-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.op-table th,
.op-table td {
    text-align: left;
    padding: 3px 8px;
    border-bottom: 1px solid #2a2a3e;
}

.op-table th {
    color: #888;
    font-weight: normal;
}

.op-table td {
    color: #ccc;
}

.op-metric-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.op-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    padding: 8px;
    background: #0d0d1a;
    border-radius: 6px;
}

.op-metric-val {
    font-size: 18px;
    font-weight: 700;
    color: #a78bfa;
}

.op-metric-lbl {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    text-align: center;
}

.op-eval-row {
    font-size: 11px;
    color: #777;
    margin-bottom: 6px;
    display: flex;
    gap: 12px;
}

.op-refresh-btn {
    background: #2a1a5e;
    color: #a78bfa;
    border: 1px solid #4a2a8e;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
}

.op-refresh-btn:hover {
    background: #3a2a7e;
}

.operator-loading,
.operator-error {
    color: #888;
    padding: 8px;
}

.operator-error {
    color: #f87171;
}

/* ===========================================================================
   Phase 7 — Exhibit Tracker
   =========================================================================== */

/* Tab bar */
.app-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #fafafa;
    padding: 0 24px;
    gap: 8px;
}

.app-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 14px 20px;
    margin-bottom: -2px;
    font-size: 15px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.app-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.app-tab:hover:not(.active) {
    color: #555;
}

/* #tab-chat must continue to flex-column so the message list scrolls correctly */
#tab-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Requests tab container */
#tab-requests {
    padding: 0;
    min-height: 400px;
}

.req-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
    flex-wrap: wrap;
}

.req-toolbar strong {
    font-size: 15px;
    flex: 1;
}

#req-list-content {
    padding: 16px 20px;
    overflow-x: auto;
}

.req-list-row {
    cursor: pointer;
}

.req-list-row:hover td {
    background: #f0f4ff;
}

/* Upload form */
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    max-width: 560px;
}

.upload-form .field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-form label:not(.file-upload-label) {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.upload-form input[type="text"],
.upload-form input[type="date"],
.upload-form select {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.file-upload-label {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1.5px solid #667eea;
    border-radius: 6px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-label:hover {
    background: #667eea;
    color: white;
}

#file-name-display {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.upload-form input:focus,
.upload-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.upload-error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #fcc;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

/* Detail / tracker */
.req-detail-meta {
    padding: 8px 20px;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
    background: #fefefe;
}

.req-exhibits-wrap {
    padding: 16px 20px;
    overflow-x: auto;
}

.req-tracker-table {
    min-width: 900px;
}

.req-raw-cell,
.req-plain-cell {
    max-width: 200px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    color: #333;
}

.req-plain-cell {
    font-style: italic;
}

/* Tracker enhancements */
.req-summary-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.due-danger {
    color: #dc2626;
    font-weight: 600;
}

.due-warn {
    color: #ea580c;
    font-weight: 600;
}

.due-normal {
    color: #64748b;
}

.ws-active-row td {
    background: #ebf5ff !important;
}

.workspace-edit label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.workspace-edit input,
.workspace-edit select,
.workspace-edit textarea {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.workspace-edit textarea {
    resize: vertical;
}

/* ===========================================================================
   Phase 8 — Exhibit Workspace Panel
   =========================================================================== */

/* Detail body: single column by default; two-column when workspace is open */
.req-detail-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.req-detail-body.has-workspace {
    flex-direction: row;
    align-items: flex-start;
}

.req-detail-body.has-workspace #req-exhibits-wrap {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: auto;
}

/* Workspace panel (Centered Modal) */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.workspace-panel {
    width: 800px;
    max-width: 90vw;
    height: 90vh;
    max-height: 800px;
    background: #fafbff;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: scaleIn 0.2s ease;
}

.workspace-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Delete Confirmation Modal */
.delete-modal {
    width: 450px;
    max-width: 90vw;
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease;
}

.delete-modal-header {
    border-bottom: 1px solid #fee2e2;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.delete-modal-body p {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.delete-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.confirm-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-top: 8px;
    box-sizing: border-box;
    transition: all 0.2s;
}

.confirm-input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #e5e7eb !important;
    border-color: #e5e7eb !important;
    color: #9ca3af !important;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.workspace-title {
    font-weight: 700;
    font-size: 14px;
}

.workspace-header .op-close-btn {
    color: rgba(255, 255, 255, 0.8);
}

.workspace-header .op-close-btn:hover {
    color: white;
}

.workspace-meta {
    padding: 8px 14px;
    font-size: 12px;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
}

.workspace-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid #e0e0e0;
    background: #f5f7ff;
    flex-shrink: 0;
}

.ws-action-btn {
    background: white;
    border: 1.5px solid #667eea;
    border-radius: 6px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.ws-action-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.ws-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Result tabs */
.ws-result-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #fafafa;
    padding: 0 6px;
    flex-shrink: 0;
}

.ws-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 7px 10px;
    margin-bottom: -2px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
}

.ws-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Results area */
.ws-results {
    overflow: hidden;
}

.ws-pane {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
}

.ws-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.ws-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.ws-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ws-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    padding: 16px 0;
    font-size: 13px;
}

.ws-error {
    color: #ef4444;
    font-size: 12px;
    padding: 8px 0;
}

.ws-answer-text {
    color: #222;
    margin-bottom: 10px;
}

.ws-latency {
    font-size: 11px;
    color: #aaa;
    margin-top: 6px;
}

.ws-inferred-note {
    font-size: 11px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 4px 8px;
    margin-bottom: 8px;
}

/* Evidence checklist */
.ws-checklist-header {
    margin-bottom: 8px;
    font-size: 13px;
}

.ws-cat-desc {
    color: #666;
    font-weight: normal;
    font-size: 12px;
}

.ws-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ws-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.5;
}

.ws-checkbox {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #667eea;
}

.ws-checklist-item:has(.ws-checkbox:checked) {
    opacity: 0.55;
    text-decoration: line-through;
}

.ws-checklist-note {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Cover note */
.ws-cover-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: #555;
}

.ws-cover-note {
    width: 100%;
    font-family: monospace;
    font-size: 11px;
    line-height: 1.6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px;
    resize: vertical;
    background: white;
    color: #1f2937;
}

.ws-cover-note:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.ws-cover-note-disclaimer {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 6px;
    font-style: italic;
}

/* Row highlight when workspace is open for that exhibit */
.ws-active-row {
    background: #f0f4ff !important;
    outline: 2px solid #667eea;
    outline-offset: -1px;
}

/* Workspace open button next to Edit */
.ex-action-cell {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    align-items: center;
}

.ws-open-btn {
    background: white;
    border: 1px solid #667eea;
    border-radius: 4px;
    color: #667eea;
    font-size: 13px;
    padding: 2px 6px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}

.ws-open-btn:hover {
    background: #667eea;
    color: white;
}

/* Phase 9 — Packet section */
.packet-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f4ff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.packet-ready-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.packet-dl-btn {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.packet-dl-btn:hover {
    background: #5a67d8;
}

/* --- Phase 9: Compliance Calendar --- */
.calendar-layout {
    display: flex;
    min-height: 700px;
    height: auto;
    position: relative;
    overflow: visible; /* Avoid clipping sidebar/panels if they expand */
}

/* Polished header and day cells */
.fc .fc-col-header-cell-cushion {
    padding: 10px 0 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.fc .fc-daygrid-day-number {
    padding: 8px 10px !important;
    font-size: 14px !important;
    color: #475569 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.fc-day-today {
    background-color: #f0f7ff !important;
}

/* Ensure Calendar takes full width always */
.calendar-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevent flex blowout */
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 16px;
    transition: flex 0.3s ease;
}

.calendar-sidebar {
    width: 350px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 15px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 20;
}

.calendar-sidebar.collapsed {
    transform: translateX(105%);
    opacity: 0;
    pointer-events: none;
}

.sidebar-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: 15;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.toggle-sidebar-btn {
    align-self: center;
    z-index: 200;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.toggle-sidebar-btn:hover {
    background: #5a67d8;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.calendar-title-group h2 {
    font-size: 20px;
    color: #333;
}

.btn-primary {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    padding: 6px 12px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.legend-dropdown-wrapper {
    position: relative;
}

.calendar-legend-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 50;
    min-width: 150px;
}

.calendar-legend-dropdown.hidden {
    display: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

#calendar-container {
    flex: 1;
    min-height: 700px; /* Taller calendar */
}

/* Upcoming Sidebar */
.calendar-sidebar h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
}

.upcoming-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: #fff;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.upcoming-filter-btn {
    flex: 1;
    padding: 4px;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    color: #666;
}

.upcoming-filter-btn.active {
    background: #667eea;
    color: white;
}

.upcoming-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #ccc;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.upcoming-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.upcoming-item.overdue {
    border-color: #fca5a5;
    background: #fef2f2;
}

.upcoming-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.upcoming-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.upcoming-item-date {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}

.upcoming-item.overdue .upcoming-item-date {
    color: #ef4444;
    font-weight: 600;
}

.upcoming-item-meta {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: #888;
}

/* Side Panels & Modals */
.panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
}

.side-panel {
    width: 400px;
    background: white;
    height: 100%;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.2s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.side-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
}

.side-panel-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ob-detail-group {
    margin-bottom: 16px;
}

.ob-detail-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
    font-weight: 600;
}

.ob-detail-value {
    font-size: 14px;
    color: #333;
}

.ob-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}

.ob-history-table th, .ob-history-table td {
    border: 1px solid #e0e0e0;
    padding: 6px;
    text-align: left;
}

.ob-history-table th {
    background: #f5f5f5;
    color: #666;
}

/* Centered Modal */
.ob-modal {
    background: white;
    width: 500px;
    border-radius: 8px;
    margin: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.ob-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ob-modal form {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ob-modal form label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 500;
    gap: 4px;
}

.ob-modal form input, .ob-modal form select, .ob-modal form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.ob-modal form input:focus, .ob-modal form select:focus, .ob-modal form textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-save {
    background-color: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background-color: #5a67d8;
}

/* Badges */
.obligation-type-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.jurisdiction-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #e2e8f0;
    color: #475569;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.jurisdiction-badge.LA {
    background: #dc2626; /* Red */
    color: #ffffff;
}

.jurisdiction-badge.MS {
    background: #2563eb; /* Blue */
    color: #ffffff;
}

.source-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.source-link-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* Suggestion Banner */
.suggestion-banner {
    display: flex;
    align-items: center;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    gap: 12px;
}

.suggestion-icon {
    font-size: 20px;
}

.suggestion-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.suggestion-content strong {
    font-size: 14px;
    color: #92400e;
}

.suggestion-content span {
    font-size: 13px;
    color: #b45309;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .filters {
        flex-wrap: wrap;
    }

    .filters-left {
        flex-wrap: wrap;
    }

    /* Workspace stacks below table on narrow screens */
    .req-detail-body.has-workspace {
        flex-direction: column;
    }

    .workspace-panel {
        width: 100%;
        min-width: unset;
        border-left: none;
        border-top: 2px solid #667eea;
        position: static;
        max-height: 60vh;
    }

    /* Calendar */
    .calendar-layout {
        flex-direction: column;
    }
    
    .calendar-sidebar {
        width: 100%;
    }
}

/* ── Calendar Jurisdiction Selector ── */
.cal-jurisdiction-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-jur-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}

.cal-jur-select {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.cal-jur-select:focus {
    outline: none;
    border-color: #667eea;
}

/* ── Jurisdiction badges on calendar events ── */
.cal-jur-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
    margin-right: 3px;
    flex-shrink: 0;
}

.cal-jur-badge-LA {
    background: #dc2626; /* Red */
    color: #fff;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cal-jur-badge-MS {
    background: #2563eb; /* Blue */
    color: #fff;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cal-jur-badge-BOTH {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ── Conditional event event styling ── */
.cal-event-conditional {
    border-style: dashed !important;
    opacity: 0.85;
}

.cal-event-conditional .fc-event-main {
    background: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.08) 4px,
        rgba(255,255,255,0.08) 8px
    );
}

/* Conditional pill in side panel / upcoming sidebar */
.cal-conditional-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 4px;
}

/* ── Event content wrapper ── */
.cal-event-inner {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    overflow: hidden;
    width: 100%;
    line-height: 1.25;
}

.cal-event-title {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    font-size: 11px;
    flex: 1;
    min-width: 0;
}

/* ── Triggered Obligations Panel ── */
.triggered-panel {
    margin-top: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
}

.triggered-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    flex-wrap: wrap;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.triggered-header:hover {
    background-color: #f1f5f9;
}

.triggered-chevron::after {
    content: '\25B6';
    font-size: 10px;
    color: #64748b;
    display: inline-block;
    transition: transform 0.2s;
    transform: rotate(90deg);
}

.triggered-panel.collapsed .triggered-chevron::after {
    transform: rotate(0deg);
}

.triggered-title {
    font-weight: 700;
    font-size: 13px;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.triggered-subtitle {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

.triggered-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 2000px; /* large enough for content */
    overflow: hidden;
}

.triggered-panel.collapsed .triggered-list {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.triggered-empty {
    font-size: 13px;
    color: #94a3b8;
    padding: 4px 0;
    font-style: italic;
}

.triggered-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.triggered-item:hover {
    background: #f8fafc;
}

.triggered-item-name {
    font-weight: 500;
    color: #334155;
    flex: 1;
}

.triggered-item-meta {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ── FullCalendar UI Overrides ── */

/* 1. Event title wrapping and readability */
.fc-event, .fc-event-title-container, .fc-event-title {
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
}

.fc-daygrid-event {
    align-items: flex-start !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    min-height: 1.5em; /* ensures multi-line wrapped text has space */
}

/* Add a bit of gap between wrapped text lines */
.fc-event-title {
    padding-top: 2px;
}

/* 2. Theme the toolbar buttons (Month, Week, Prev/Next) to match the brand */
.fc-button-primary {
    background-color: #667eea !important;
    border-color: #667eea !important;
    text-transform: capitalize !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.fc-button-primary:hover {
    background-color: #5a67d8 !important;
    border-color: #5a67d8 !important;
}

.fc-button-primary:disabled {
    background-color: #a3b0f5 !important;
    border-color: #a3b0f5 !important;
    opacity: 0.8;
}

.fc-button-primary:focus {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.4) !important;
}

/* Active button state (current view) */
.fc-button-primary:not(:disabled).fc-button-active,
.fc-button-primary:not(:disabled):active {
    background-color: #434190 !important;
    border-color: #434190 !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Today button: special neutral styling */
.fc-today-button {
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

.fc-today-button:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

.fc-toolbar-title {
    font-weight: 700 !important;
    color: #2d3748 !important;
}

/* ── Obligation Detail Enrichment Sections ── */

/* Shared section card base */
.ob-enrichment-section {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
}

/* Section label row (icon + title + optional pill) */
.ob-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}

/* ── 1. Source Notes — gray card ── */
.ob-source-notes {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
}

.ob-source-notes .ob-section-label {
    color: #64748b;
}

.ob-source-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ob-source-row {
    display: flex;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.ob-source-row-key {
    flex: 0 0 120px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 11px;
    padding-top: 1px;
    white-space: nowrap;
}

.ob-source-row-val {
    color: #334155;
    flex: 1;
    word-break: break-word;
}

/* ── 2. AI Overview — amber tint ── */
.ob-ai-overview {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #f59e0b;
}

.ob-ai-overview .ob-section-label {
    color: #92400e;
}

.ob-ai-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    color: #b45309;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ob-ai-overview-text {
    color: #78350f;
    font-size: 13px;
    line-height: 1.5;
}

.ob-ai-placeholder {
    color: #a16207;
    font-style: italic;
    font-size: 12px;
}

.ob-ai-attribution {
    margin-top: 6px;
    font-size: 10px;
    color: #b45309;
    font-style: italic;
    opacity: 0.8;
}

/* ── 3. Operational Note — teal tint ── */
.ob-op-note {
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-left: 3px solid #14b8a6;
}

.ob-op-note .ob-section-label {
    color: #0f766e;
}

.ob-op-note-text {
    color: #134e4a;
    font-size: 13px;
    line-height: 1.5;
}

.ob-op-placeholder {
    color: #0d9488;
    font-style: italic;
    font-size: 12px;
}

/* Divider before editable fields */
.ob-edit-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 16px 0 14px;
}
/* --- Phase 13: Mobile Responsiveness --- */

@media (max-width: 1024px) {
    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
    
    header {
        border-radius: 0;
        padding: 16px;
    }
    
    body {
        padding: 0;
    }
}

@media (max-width: 768px) {
    .app-tabs {
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .app-tab {
        flex: 0 0 auto;
        padding: 10px 15px;
    }
    
    .calendar-layout {
        flex-direction: column;
        min-height: auto;
    }
    
    .calendar-main {
        width: 100%;
        padding: 10px;
    }
    
    .calendar-sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        box-shadow: none !important;
        border-top: 1px solid #e2e8f0;
        margin-top: 20px;
        display: block !important;
        z-index: 10;
    }

    /* Force show sidebar on mobile since absolute toggle is awkward */
    #calendar-sidebar.collapsed {
        display: block !important;
    }

    .sidebar-backdrop {
        display: none !important;
    }
    
    #toggle-sidebar-btn {
        display: none !important;
    }

    /* Tables */
    .requests-table-container, 
    .obligations-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .requests-table,
    .obligations-table {
        min-width: 600px;
    }
}
