:root {
    --color-primary: #621224;
    --color-secondary: #F3EDE1;
    --color-accent: #C4A78B;
    --color-charcoal: #343434;
    --color-muted: #7A7A7A;
    --color-surface: #FFFFFF;
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.08);
    --font-display: "Playfair Display", "Times New Roman", serif;
    --font-sans: "Inter", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

.hidden {
    display: none !important;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--color-secondary);
    color: var(--color-charcoal);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.muted {
    color: var(--color-muted);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar {
    background: linear-gradient(180deg, #3f0b18, #621224);
    color: var(--color-secondary);
    padding: 32px 28px 48px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.brand-copy span {
    font-size: 18px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-section label,
.sidebar-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.75);
}

.sidebar input {
    margin-top: 8px;
    width: 100%;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 15px;
}

.ghost-button {
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: inherit;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ghost-button:hover,
.ghost-button:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.sidebar-greeting {
    margin: 0 0 2px;
    font-weight: 600;
}

.sidebar-hint {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin: 8px 0 0;
}

.sidebar-status {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}

.master-only.hidden {
    display: none;
}

.selected-influencer {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    padding: 14px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.selected-influencer[data-empty="true"] {
    border-color: rgba(255, 255, 255, 0.28);
}

.selected-influencer-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.selected-influencer-name {
    margin: 0;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.selected-influencer-meta {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
}

.selected-influencer-hint {
    margin: 10px 0 0;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 8px;
    color: rgba(255, 255, 255, 0.78);
}

.selected-influencer-hint[data-tone="warning"] {
    color: #ffd166;
}

.selected-influencer-hint[data-tone="success"] {
    color: #8fffd6;
}

.selected-influencer.attention {
    outline: 2px solid #ffd166;
    outline-offset: 3px;
    transition: outline 0.2s ease;
}

.sidebar-list,
.workflow-step-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-list button,
.workflow-step button {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border 0.2s ease;
}

.sidebar-list button:hover,
.sidebar-list button:focus-visible,
.workflow-step button:hover,
.workflow-step button:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

.sidebar-list button span,
.workflow-step button span {
    display: block;
}

.sidebar-list button small,
.workflow-step button small {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.workflow-step.active button {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
}

.tag-cloud {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}

.content {
    background: var(--color-secondary);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0; /* Prevent flex item from overflowing */
}

.workflow-hero {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 28px 32px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.hero-badges .badge {
    background: var(--color-primary);
    color: var(--color-secondary);
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.active-influencer {
    margin-top: 8px;
    color: var(--color-primary);
    font-size: 17px;
    font-weight: 700;
}

.stage-panel {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    overflow-x: auto; /* Allow horizontal scroll if needed */
    min-width: 0; /* Prevent flex/grid overflow */
}

.stage-panel.hidden {
    display: none;
}

.profile-header {
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.25em;
    color: var(--color-muted);
}

.header-meta {
    display: flex;
    gap: 24px;
}

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

.nav-button {
    border: 1px solid rgba(52, 52, 52, 0.2);
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 140px;
}

.nav-button:hover,
.nav-button:focus-visible {
    background: rgba(196, 167, 139, 0.2);
}

.nav-button .nav-title {
    font-size: 14px;
}

.nav-button small {
    color: var(--color-muted);
    font-weight: 500;
}

.navigator-panel {
    margin: 20px 0;
    padding: 18px;
    background: #fff5ef;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
}

.navigator-panel.collapsed {
    padding: 12px 14px;
}

/* When collapsed, show only search input, hide everything else */
.navigator-panel.collapsed .navigator-filters,
.navigator-panel.collapsed .navigator-buttons,
.navigator-panel.collapsed .navigator-list,
.navigator-panel.collapsed .navigator-footer {
    display: none;
}

.navigator-panel.collapsed .navigator-controls {
    margin-top: 12px;
}

.navigator-panel.collapsed #navigatorSearch {
    width: 100%;
}

/* When collapsed AND has active search, show results list */
.navigator-panel.collapsed.has-search .navigator-list {
    display: block;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 12px;
}

.navigator-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.current-chip,
.neighbor-chip {
    background: #fff;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    min-width: 180px;
}

.current-chip span {
    display: block;
    color: var(--color-muted);
    font-size: 13px;
}

.current-chip strong,
.neighbor-chip strong {
    display: block;
    font-size: 18px;
    margin-top: 4px;
}

.neighbor-chip .eyebrow {
    margin-bottom: 4px;
}

/* Elegant influencer quick-select dropdown */
.influencer-select-wrapper {
    flex: 1;
    max-width: 280px;
}

.influencer-quick-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.influencer-quick-select:hover {
    border-color: var(--wine);
}

.influencer-quick-select:focus {
    outline: none;
    border-color: var(--wine);
    box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.1);
}

.influencer-quick-select option {
    padding: 8px 12px;
}

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

.navigator-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.navigator-controls input[type="search"] {
    flex: 1;
}

.navigator-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.navigator-blacklist-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    cursor: pointer;
    user-select: none;
}

.navigator-blacklist-toggle input[type="checkbox"] {
    cursor: pointer;
}

.navigator-blacklist-toggle:hover {
    color: var(--text-primary, #333);
}

.navigator-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

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

.navigator-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: box-shadow 0.2s ease, border 0.2s ease;
}

.navigator-chip:hover,
.navigator-chip:focus-visible {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    border-color: rgba(157, 89, 63, 0.4);
}

.navigator-chip.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(157, 89, 63, 0.25);
}

.navigator-chip small {
    display: block;
    color: var(--color-muted);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-value {
    font-size: 28px;
    margin: 6px 0 0;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.details-grid article {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
}

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

.inline-action {
    border: none;
    background: none;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.inline-action:hover,
.inline-action:focus-visible {
    background: rgba(98, 18, 36, 0.1);
}

.definition-list {
    margin: 0;
}

.definition-list dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-muted);
    margin-top: 12px;
}

.definition-list dd {
    margin: 4px 0 0;
    font-size: 15px;
}

.sub-panel {
    margin-top: 28px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}

.panel-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.panel-hint {
    max-width: 340px;
    text-align: right;
    color: var(--color-muted);
    font-size: 13px;
    margin: 0;
}

.link-button {
    background: none;
    border: none;
    color: var(--color-primary);
    padding: 0;
    font-weight: 600;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
    text-decoration: underline;
}

.ghost-button.prominent {
    border: 1px solid rgba(98, 18, 36, 0.35);
    color: var(--color-primary);
    font-weight: 700;
}

.task-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: left;
}

.task-chip small {
    color: rgba(255, 255, 255, 0.75);
}

.sidebar-note {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    margin: 0;
}

.task-row.done td {
    text-decoration: line-through;
    color: var(--color-muted);
}

.task-row.overdue td {
    color: #b3261e;
    font-weight: 600;
}

.task-row.upcoming td {
    color: #b38600;
    font-weight: 600;
}

.task-due {
    cursor: pointer;
    position: relative;
}

.task-editable {
    cursor: text;
    outline: none;
    transition: background 0.15s ease;
}

.task-editable:hover {
    background: rgba(196, 167, 139, 0.08);
}

.task-editable:focus {
    background: rgba(196, 167, 139, 0.15);
    box-shadow: inset 0 0 0 1px rgba(98, 18, 36, 0.25);
}

.task-due-picker {
    position: fixed;
    display: none;
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    transition: opacity 0.15s ease;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
}

.task-row.done input[type="checkbox"] {
    accent-color: var(--color-muted);
}

.form-field select {
    width: 100%;
}

.danger-button {
    background: rgba(244, 67, 54, 0.12);
    color: #6d1110;
    border: 1px solid rgba(244, 67, 54, 0.35);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-bottom: 16px;
}

.filters-bar .search-box {
    flex: 1;
    min-width: 200px;
}

.filters-bar .search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    background: var(--color-bg);
}

.filters-bar .search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(196, 167, 139, 0.2);
}

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

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-muted);
    white-space: nowrap;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 13px;
    background: var(--color-bg);
    min-width: 120px;
}

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

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

.data-table thead {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: var(--color-muted);
}

.data-table th,
.data-table td {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: rgba(196, 167, 139, 0.1);
}

/* Clickable table rows */
.data-table tbody tr.clickable-row {
    cursor: pointer;
}

.data-table tbody tr.clickable-row:hover {
    background: rgba(98, 18, 36, 0.08);
}

.data-table tbody tr.clickable-row:active {
    background: rgba(98, 18, 36, 0.12);
}

/* Table links - styled for visibility and interaction */
.data-table a.table-link,
a.table-link,
.table-link {
    color: var(--wine);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.data-table a.table-link:hover,
a.table-link:hover,
.table-link:hover {
    color: var(--wine-dark, #4a0d1a);
    text-decoration: underline;
}

.data-table a.table-link:visited,
a.table-link:visited {
    color: var(--wine);
}

/* Sortable table headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.data-table th.sortable:hover {
    background-color: rgba(98, 18, 36, 0.08);
}

.data-table th.sortable:active {
    background-color: rgba(98, 18, 36, 0.12);
}

.data-table th .sort-indicator {
    font-size: 10px;
    vertical-align: middle;
    transition: opacity 0.15s ease;
}

/* Stat items in breakdown lists (non-clickable) */
.dashboard-list li.stat-item {
    cursor: default;
    opacity: 0.95;
}

.dashboard-list li.stat-item:hover {
    background: transparent;
}

/* OmniFocus-style task layout */
.task-checkbox {
    width: 60px;
    padding: 8px 12px !important;
    vertical-align: top;
}

.task-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.task-flag {
    display: inline-block;
    margin-right: 6px;
    font-size: 14px;
    opacity: 0.9;
}

.task-main {
    padding: 8px 12px !important;
    cursor: pointer;
}

.task-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.task-title {
    flex: 1;
    min-width: 180px;
    font-size: 15px;
    padding: 2px 6px;
    border-radius: 4px;
}

.task-due {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.task-due:hover {
    background: rgba(196, 167, 139, 0.15);
}

.task-project {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(98, 18, 36, 0.08);
    color: var(--color-primary);
    font-weight: 600;
    white-space: nowrap;
}

.task-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
    transition: opacity 0.15s ease;
}

.task-tags-row.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin-top: 0;
}

.task-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(196, 167, 139, 0.2);
    color: var(--color-charcoal);
    border: 1px solid rgba(196, 167, 139, 0.4);
    cursor: pointer;
    transition: all 0.15s ease;
}

.task-tag:hover {
    background: rgba(196, 167, 139, 0.35);
    border-color: rgba(196, 167, 139, 0.6);
}

.task-tag-add {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(98, 18, 36, 0.08);
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px dashed rgba(98, 18, 36, 0.3);
}

.task-tag-add:hover {
    background: rgba(98, 18, 36, 0.15);
    border-color: rgba(98, 18, 36, 0.5);
}

.task-row.flagged .task-checkbox {
    background: rgba(255, 193, 7, 0.05);
}

/* Tasks layout with perspectives sidebar */
.tasks-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    min-height: 600px;
}

.perspectives-sidebar {
    background: rgba(98, 18, 36, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid rgba(98, 18, 36, 0.1);
}

.perspectives-header {
    margin-bottom: 12px;
}

.perspectives-header h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-muted);
    margin: 0;
}

.perspectives-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perspective-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    color: var(--color-charcoal);
    width: 100%;
}

.perspective-item:hover {
    background: rgba(98, 18, 36, 0.08);
}

.perspective-item.active {
    background: var(--color-primary);
    color: var(--color-secondary);
    font-weight: 600;
}

.perspective-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.perspective-label {
    flex: 1;
    font-size: 14px;
}

.perspective-count {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.perspective-item.active .perspective-count {
    background: rgba(255, 255, 255, 0.25);
    color: var(--color-secondary);
}

.perspectives-divider {
    height: 1px;
    background: rgba(98, 18, 36, 0.15);
    margin: 8px 0;
}

.tasks-main {
    flex: 1;
}

/* Review status widget */
.review-status {
    margin-top: 16px;
    padding: 12px;
    background: rgba(196, 167, 139, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(196, 167, 139, 0.2);
}

.review-status-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-muted);
    margin: 0 0 4px 0;
}

.review-status-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-charcoal);
    margin: 0;
}

/* Tag editor modal */
.tag-editor-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 60px;
    padding: 12px;
    border: 1px solid rgba(52, 52, 52, 0.15);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.01);
}

.tag-editor-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(196, 167, 139, 0.2);
    color: var(--color-charcoal);
    border: 1px solid rgba(196, 167, 139, 0.4);
}

.tag-editor-item button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-muted);
    font-weight: bold;
    font-size: 14px;
    transition: all 0.15s ease;
}

.tag-editor-item button:hover {
    background: rgba(244, 67, 54, 0.15);
    color: #b3261e;
}

.composer {
    border: 1px solid rgba(52, 52, 52, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.composer-row label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted);
}

.composer-row input,
.composer-row textarea,
.composer-row select,
.command-header input,
.form-field input,
.form-field textarea,
.form-field select,
.sidebar input {
    border: 1px solid rgba(52, 52, 52, 0.15);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--color-charcoal);
    background: #fff;
}

.composer-row textarea,
.form-field textarea {
    resize: vertical;
}

.composer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.composer-actions .spacer {
    flex: 1;
}

/* Email autocomplete dropdown */
.email-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--color-border-soft);
}

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

.autocomplete-item:hover {
    background: #f5f5f5;
}

.autocomplete-name {
    font-weight: 500;
    color: var(--color-charcoal);
}

.autocomplete-email {
    font-size: 12px;
    color: var(--color-muted);
    flex: 1;
}

.autocomplete-type {
    font-size: 11px;
    color: white;
    background: var(--color-primary);
    padding: 2px 6px;
    border-radius: 3px;
}

.primary-button,
.secondary-button {
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

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

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-button.danger {
    background: #c0392b;
    color: white;
}

.primary-button.danger:hover {
    background: #a93226;
}

.secondary-button {
    background: rgba(52, 52, 52, 0.08);
    color: var(--color-charcoal);
}

.status-pill {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: rgba(52, 52, 52, 0.05);
    color: var(--color-charcoal);
}

.status-pill[data-tone="success"] {
    background: rgba(100, 181, 106, 0.2);
    color: #245c2c;
}

.status-pill[data-tone="danger"] {
    background: rgba(244, 67, 54, 0.2);
    color: #6d1110;
}

.status-pill[data-tone="warning"] {
    background: rgba(255, 183, 77, 0.25);
    color: #8a5700;
}

.status-pill:empty {
    display: none;
}

.interaction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.interaction-card {
    border: 1px solid rgba(52, 52, 52, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
}

.interaction-card h3 {
    margin: 0;
    font-size: 16px;
}

.interaction-card p {
    margin: 4px 0;
    font-size: 14px;
}

.finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.finance-column {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 20px;
}

.renewal-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.renewal-card {
    border: 1px solid rgba(52, 52, 52, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.renewal-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.referral-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-card {
    border: 1px solid rgba(52, 52, 52, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(98, 18, 36, 0.02);
}

.referral-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.referral-meta small {
    color: var(--color-muted);
}

.referral-payout {
    text-align: right;
}

.referral-payout strong {
    font-size: 18px;
    display: block;
}

.badge-soft {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(98, 18, 36, 0.08);
    color: var(--color-primary);
    font-size: 12px;
}

.empty-state {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(52, 52, 52, 0.05);
    font-size: 14px;
    color: var(--color-muted);
}

.empty-state.inline {
    margin: 0;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.report-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 16px;
    min-width: 0;
}

.report-metric {
    font-size: 30px;
    margin: 6px 0 2px;
}

.report-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    min-width: 0;
}

.report-panel {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-md);
    padding: 14px;
    min-width: 0;
    overflow-x: auto;
}

.report-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-list li {
    border: 1px dashed rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: #fffdf9;
}

.report-list strong {
    display: block;
    margin-bottom: 4px;
}

.report-list small {
    color: var(--color-muted);
}

.report-chart {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-top: 12px;
}

.report-chart .bar {
    flex: 1;
    min-height: 30px;
    background: linear-gradient(180deg, #621224, #c4a78b);
    border-radius: 6px 6px 0 0;
}

.report-chart.line {
    gap: 6px;
}

.report-chart.line span {
    flex: 1;
    height: 6px;
    background: #c4a78b;
    border-radius: 3px;
    position: relative;
}

.report-chart.line span::after {
    content: "";
    position: absolute;
    top: -6px;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #621224;
}

.report-chart.mini-cards {
    gap: 10px;
}

.report-chart .mini-card {
    flex: 1;
    height: 60px;
    border-radius: 8px;
    background: repeating-linear-gradient(
        135deg,
        rgba(98, 18, 36, 0.08),
        rgba(98, 18, 36, 0.08) 10px,
        rgba(196, 167, 139, 0.18) 10px,
        rgba(196, 167, 139, 0.18) 20px
    );
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.command-palette {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.command-palette.hidden {
    display: none;
}

.command-panel {
    width: min(640px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.command-header {
    display: flex;
    gap: 12px;
}

.command-results {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(52, 52, 52, 0.08);
    border-radius: var(--radius-md);
}

.command-result {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(52, 52, 52, 0.08);
    cursor: pointer;
}

.command-result:last-child {
    border-bottom: none;
}

.command-result.active {
    background: rgba(196, 167, 139, 0.18);
}

.command-result span {
    display: block;
}

.command-result small {
    color: var(--color-muted);
}

.command-result.empty {
    cursor: default;
    color: var(--color-muted);
}

.command-hint {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    font-size: 12px;
    color: var(--color-muted);
}

.action-modal {
    position: fixed;
    inset: 0;
    background: rgba(52, 52, 52, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1900;
    overflow: hidden; /* Prevent backdrop from scrolling - scroll happens inside action-panel */
}

.action-modal.hidden {
    display: none;
}

/* Generic Modal Styles */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(52, 52, 52, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    width: min(480px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-height: 90vh;
    overflow-y: auto;
}

/* Forms directly inside modal-content need padding */
.modal-content > form {
    padding: 20px 24px;
}

.modal-content > form .form-grid {
    margin-bottom: 16px;
}

.modal-content > form .form-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.modal-content.modal-large {
    width: min(720px, 100%);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

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

.modal-body h4 {
    margin: 16px 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.modal-body h4:first-child {
    margin-top: 0;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--color-muted);
    margin: 0 0 16px;
}

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

.close-button:hover {
    color: var(--color-charcoal);
}

/* Supervisor List Styles */
.supervisor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.supervisor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--color-secondary);
    border-radius: var(--radius-sm);
}

.supervisor-item .supervisor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.supervisor-item .supervisor-name {
    font-weight: 500;
}

.supervisor-item .supervisor-since {
    font-size: 12px;
    color: var(--color-muted);
}

.add-supervisor-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-supervisor-form .form-select {
    flex: 1;
}

/* Offboard Styles */
.offboard-section {
    margin-bottom: 16px;
}

.offboard-section-header {
    padding: 10px 12px;
    background: var(--color-secondary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.offboard-section-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.offboard-list {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.offboard-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

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

.offboard-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
}

.offboard-item .item-title {
    flex: 1;
}

.offboard-item .item-status {
    font-size: 12px;
    color: var(--color-muted);
}

.transfer-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.transfer-options label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Form Actions in Modal */
.modal .form-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-end;
}

/* Credentials Display */
.credentials-display {
    background: var(--color-secondary);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

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

.credential-row:last-child {
    margin-bottom: 0;
}

.credential-row code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.warning-text {
    color: #b45309;
    font-size: 13px;
    background: #fef3c7;
    padding: 12px;
    border-radius: var(--radius-sm);
}

/* Checkbox field */
.checkbox-field {
    flex-direction: row !important;
    align-items: center;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.action-panel {
    width: min(720px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 16px;
}

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

.form-field label {
    font-size: 13px;
    color: var(--color-muted);
}

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

.feedback-form .panel-actions {
    justify-content: flex-start;
    gap: 12px;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2937;
}

.section-hint {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
}

.templates-list {
    min-height: 60px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 12px;
}

.placeholder-text {
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

/* Template Items */
.template-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.template-item:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.template-info {
    flex: 1;
}

.template-info strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.template-info p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.template-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.template-editor {
    margin-bottom: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
}

.template-editor .template-actions {
    margin-top: 12px;
}

.dev-feedback-list {
    margin-top: 18px;
    width: 100%;
    display: block;
}

.feedback-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: block;
    width: 100%;
    text-align: left;
    margin-inline: 0;
    padding-inline: 0;
}

.feedback-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: #fff;
    display: block;
    width: 100%;
    margin: 0 0 10px 0;
    text-align: left;
    box-sizing: border-box;
}

.feedback-card.status-open {
    background: #f0f7ff;
    border-left: 4px solid #3b82f6;
}

.feedback-card.status-in-progress {
    background: #fff7ed;
    border-left: 4px solid #f59e0b;
}

.feedback-card.status-done {
    background: #ecfdf3;
    border-left: 4px solid #22c55e;
}

.feedback-card.status-closed {
    background: #f5f5f5;
    border-left: 4px solid #9ca3af;
}

.feedback-card select[data-dev-feedback-status] {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-card.status-open select[data-dev-feedback-status] {
    background: #f0f7ff;
    color: #1d4ed8;
}

.feedback-card.status-in-progress select[data-dev-feedback-status] {
    background: #fff7ed;
    color: #b45309;
}

.feedback-card.status-done select[data-dev-feedback-status] {
    background: #ecfdf3;
    color: #15803d;
}

.feedback-card.status-closed select[data-dev-feedback-status] {
    background: #f5f5f5;
    color: #555;
}

.dev-feedback-list,
.feedback-list {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.feedback-card .panel-hint,
.feedback-card p,
.feedback-card textarea {
    max-width: 100%;
    width: 100%;
    white-space: normal;
}

.feedback-title {
    margin: 0 0 4px;
    font-weight: 700;
}

.feedback-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--color-muted);
}

.feedback-meta .badge-soft {
    background: rgba(98, 18, 36, 0.08);
    color: var(--color-primary);
}

.feedback-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.feedback-actions button {
    border: 1px solid rgba(52, 52, 52, 0.2);
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
}

.feedback-actions .save-dirty {
    background: #7a1224;
    color: #fff;
    border-color: #7a1224;
    box-shadow: 0 0 0 2px rgba(122, 18, 36, 0.2);
}

.save-response-btn.save-dirty {
    background: #7a1224;
    color: #fff;
    border-color: #7a1224;
    box-shadow: 0 0 0 2px rgba(122, 18, 36, 0.2);
}

.form-field input,
.form-field select,
.form-field textarea {
    border: 1px solid rgba(52, 52, 52, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 14px;
}

.action-status,
.sidebar-status {
    min-height: 18px;
}

.action-status[data-tone="danger"] {
    color: #c62828;
}

.action-status[data-tone="success"] {
    color: #2e7d32;
}

.action-status[data-tone="info"] {
    color: #6a1b9a;
}

.action-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.action-footer .spacer {
    flex: 1;
}

.login-screen {
    position: fixed;
    inset: 0;
    background: rgba(52, 52, 52, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.login-screen.hidden {
    display: none;
}

.login-panel {
    width: min(480px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-heading {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 8px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--color-muted);
}

.login-field input {
    border: 1px solid rgba(52, 52, 52, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 16px;
}

.login-status {
    min-height: 20px;
    font-size: 14px;
    color: var(--color-muted);
}

.login-status.error {
    color: #b3261e;
}

.login-status.success {
    color: #1f7a4f;
}

.edit-drawer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: flex-end;
    z-index: 1100;
    padding: 24px;
}

.edit-drawer.hidden {
    display: none;
}

.drawer-panel {
    width: min(420px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.drawer-body {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-field label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-muted);
}

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

/* ==================== CLOSED ITEMS SLIDE-OUT PANEL ==================== */

.closed-items-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: min(480px, 90vw);
    height: 100vh;
    background: var(--color-surface);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.closed-items-drawer.open {
    right: 0;
}

.closed-items-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

.closed-items-overlay.open {
    opacity: 1;
    visibility: visible;
}

.closed-items-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg);
}

.closed-items-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.closed-items-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.closed-items-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.closed-items-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.closed-items-section {
    margin-bottom: 24px;
}

.closed-items-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.closed-item {
    padding: 12px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--color-border);
    opacity: 0.75;
    transition: opacity 0.15s, border-color 0.15s;
}

.closed-item:hover {
    opacity: 1;
    border-color: var(--color-accent);
}

.closed-item-title {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.closed-item-meta {
    font-size: 12px;
    color: var(--color-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.closed-item-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.closed-item-badge.completed {
    background: var(--color-success-bg, #dcfce7);
    color: var(--color-success, #166534);
}

.closed-item-badge.paid {
    background: var(--color-success-bg, #dcfce7);
    color: var(--color-success, #166534);
}

.closed-item-badge.departed {
    background: var(--color-muted-bg, #f3f4f6);
    color: var(--color-muted);
}

.closed-item-badge.resolved {
    background: var(--color-info-bg, #dbeafe);
    color: var(--color-info, #1e40af);
}

.closed-items-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-muted);
}

.closed-items-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.btn-view-closed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-view-closed:hover {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-accent);
}

/* Tablet and small laptop screens */
@media (max-width: 1280px) {
    .layout {
        grid-template-columns: 260px 1fr;
    }

    .sidebar {
        padding: 24px 20px 40px;
    }

    .content {
        padding: 28px;
    }

    .finance-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Medium screens - narrower sidebar */
@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 220px 1fr;
    }

    .sidebar {
        padding: 20px 16px 32px;
        gap: 20px;
    }

    .sidebar-section label,
    .sidebar-label {
        font-size: 11px;
    }

    .brand-mark {
        font-size: 22px;
        padding: 8px 10px;
    }

    .brand-copy span {
        font-size: 14px;
    }

    .content {
        padding: 20px;
    }

    .profile-header {
        grid-template-columns: 1fr;
    }

    .profile-heading {
        flex-direction: column;
    }

    .header-meta {
        flex-wrap: wrap;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

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

    .edit-drawer {
        justify-content: center;
    }

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

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

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

/* Smaller screens - single column reports */
@media (max-width: 768px) {
    .report-grid {
        grid-template-columns: 1fr;
    }

    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .report-period-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Small screens - collapsible sidebar */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 16px 20px;
        gap: 16px;
        max-height: none;
    }

    .sidebar .brand {
        flex: 0 0 auto;
    }

    .sidebar-section {
        flex: 0 0 auto;
    }

    .sidebar-section.search-section {
        flex: 1 1 200px;
        min-width: 150px;
        max-width: 300px;
    }

    .sidebar-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sidebar-list {
        display: none;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    .content {
        padding: 16px;
    }

    .sidebar {
        padding: 12px 16px;
        gap: 12px;
    }

    .sidebar .brand {
        gap: 10px;
    }

    .brand-mark {
        font-size: 20px;
        padding: 6px 8px;
    }

    .brand-copy span {
        font-size: 12px;
    }

    .sidebar-section.search-section {
        flex: 1 1 100%;
        max-width: none;
    }

    .workflow-step-list {
        font-size: 14px;
    }

    .sidebar-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .content {
        padding: 12px;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .dashboard-card {
        padding: 16px;
    }
}

/* Modal Responsiveness - ensure modals work on all screen sizes */
@media (max-width: 768px) {
    .action-modal {
        padding: 12px;
    }

    .action-panel {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 24px);
        border-radius: var(--radius-md);
    }

    .action-panel,
    .action-panel[style*="max-width"] {
        max-width: 100% !important;
    }

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

    .action-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .action-footer button {
        flex: 1 1 auto;
        min-width: 100px;
    }

    /* Case type modal buttons */
    .case-type-options {
        flex-direction: column;
    }

    .case-type-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .action-modal {
        padding: 8px;
    }

    .action-panel {
        padding: 16px;
        max-height: calc(100vh - 16px);
    }

    .action-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .action-header h3 {
        font-size: 1.1rem;
    }

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

    .form-row > * {
        flex: none;
        width: 100%;
    }

    .action-footer {
        flex-direction: column;
    }

    .action-footer button {
        width: 100%;
    }

    /* Ensure text inputs don't overflow */
    input, select, textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Ensure tables are scrollable on small screens */
@media (max-width: 900px) {
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.dashboard-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dashboard-card.alert {
    border-left: 4px solid #DC2626;
}

.dashboard-card.action {
    border-left: 4px solid #F59E0B;
}

.dashboard-card.success {
    border-left: 4px solid #10B981;
}

.dashboard-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dashboard-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.dashboard-card .card-description {
    margin: 0;
    font-size: 14px;
    color: var(--color-muted);
}

.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.dashboard-list li {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.dashboard-list li:hover {
    background: rgba(98, 18, 36, 0.05);
    cursor: pointer;
}

/* Clickable list items with navigation */
.dashboard-list li[data-id] {
    cursor: pointer;
    position: relative;
}

.dashboard-list li[data-id]:hover {
    background: rgba(98, 18, 36, 0.12);
    transform: translateX(2px);
}

.dashboard-list li[data-id]::after {
    content: '→';
    opacity: 0;
    transition: opacity 0.2s ease;
    margin-left: 8px;
    color: var(--color-burgundy);
}

.dashboard-list li[data-id]:hover::after {
    opacity: 1;
}

.dashboard-list li .item-name {
    font-weight: 500;
    color: var(--color-charcoal);
}

.dashboard-list li .item-meta {
    font-size: 12px;
    color: var(--color-muted);
}

.dashboard-tabs {
    display: flex;
    gap: 8px;
    margin: 4px 0;
}

.tab-button {
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-muted);
}

.tab-button.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.tab-button:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
}

.badge-alert {
    background: #FEE2E2;
    color: #991B1B;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-soft {
    background: #F3F4F6;
    color: #6B7280;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-neutral {
    background: #E5E7EB;
    color: #374151;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

/* Clickable badge counters in dashboard cards */
.dashboard-card .card-header [class^="badge-"][data-view-all],
.dashboard-card .card-header [class*=" badge-"][data-view-all] {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card .card-header [class^="badge-"][data-view-all]:hover,
.dashboard-card .card-header [class*=" badge-"][data-view-all]:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Clickable summary stats in dashboard header rows */
.dashboard-summary-row .stat-value[data-view-all] {
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
}

.dashboard-summary-row .stat-value[data-view-all]:hover {
    transform: scale(1.05);
    color: var(--primary-color);
}

/* View All Modal */
.view-all-panel {
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.view-all-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.view-all-list {
    max-height: none !important;
    padding-right: 8px;
}

.view-all-list li {
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, transform 0.15s ease;
}

.view-all-list li:hover {
    background: rgba(98, 18, 36, 0.08);
    transform: translateX(4px);
}

/* Small ghost button for table actions */
.ghost-button.small {
    padding: 4px 10px;
    font-size: 12px;
    min-height: auto;
}

/* Converted opportunity row styling */
tr.converted {
    opacity: 0.7;
    background-color: #f9fafb;
}

tr.converted td {
    color: #6b7280;
}

/* ============================================================
   ROLE-BASED DASHBOARD STYLES
   ============================================================ */

/* Dashboard Summary Row - Key metrics at a glance */
.dashboard-summary-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dashboard-summary-row.financial {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.summary-stat {
    flex: 1;
    min-width: 140px;
    background: white;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.summary-stat.large {
    padding: 20px 24px;
}

.summary-stat.alert {
    border-color: #FCA5A5;
    background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%);
}

.summary-stat.action {
    border-color: #FCD34D;
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
}

.summary-stat.success {
    border-color: #6EE7B7;
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-charcoal);
    line-height: 1.2;
}

.summary-stat.large .stat-value {
    font-size: 32px;
}

.stat-value.currency {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

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

/* Dashboard Card Wide Variant */
.dashboard-card.wide {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .dashboard-card.wide {
        grid-column: span 1;
    }
}

/* Dashboard Quick Access Section (Phase 17) */
.dashboard-quick-access {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.dashboard-quick-access h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.quick-access-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--color-surface);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.quick-access-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-access-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), #3f0b18);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 8px;
}

.quick-access-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 4px;
}

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

@media (max-width: 768px) {
    .quick-access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Master View Styles (Phase 17) */
.master-view-grid {
    grid-template-columns: repeat(3, 1fr);
}

.master-view-details {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ranked-list {
    counter-reset: rank;
    list-style: none;
    padding: 0;
}

.ranked-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.ranked-list li::before {
    counter-increment: rank;
    content: counter(rank);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #e5e7eb;
    color: var(--color-charcoal);
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
}

@media (max-width: 900px) {
    .master-view-grid {
        grid-template-columns: 1fr;
    }
}

/* Chart Container (legacy - overridden by Chart.js integration styles below) */
.chart-placeholder {
    color: var(--color-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Roster Summary Grid (for CEO Dashboard) */
.roster-summary-grid {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.roster-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
}

.roster-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-charcoal);
}

.roster-label {
    display: block;
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Aging Grid (for Finance Dashboard) */
.aging-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.aging-bucket {
    text-align: center;
    padding: 12px 8px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.aging-bucket.warning {
    background: #FFFBEB;
    border-color: #FCD34D;
}

.aging-bucket.alert {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.aging-bucket.critical {
    background: #FEE2E2;
    border-color: #F87171;
}

.aging-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-charcoal);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.aging-label {
    display: block;
    font-size: 10px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
}

/* Dashboard List Item with Status Indicator */
.dashboard-list li.sla-warning {
    border-left: 3px solid #F59E0B;
    padding-left: 12px;
}

.dashboard-list li.sla-breach {
    border-left: 3px solid #EF4444;
    padding-left: 12px;
    background: #FEF2F2;
}

.dashboard-list li .sla-indicator {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.sla-indicator.warning {
    background: #FEF3C7;
    color: #92400E;
}

.sla-indicator.breach {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive adjustments for summary row */
@media (max-width: 768px) {
    .dashboard-summary-row {
        flex-direction: column;
    }

    .summary-stat {
        min-width: 100%;
    }

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

/* ============================================================
   DELIVERABLE / EXECUTION WORKFLOW STYLES
   ============================================================ */

/* Deliverable filters */
.deliverable-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.deliverable-filters select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: white;
    min-width: 160px;
}

/* Deliverable detail modal content */
.deliverable-detail-content {
    padding: 0 24px 24px;
}

.deliverable-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--radius-md);
}

.deliverable-info-grid .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deliverable-info-grid label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
}

.deliverable-info-grid span {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-charcoal);
}

.deliverable-section {
    margin-bottom: 20px;
}

.deliverable-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.deliverable-specs {
    font-size: 14px;
    color: var(--color-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Asset upload area */
.asset-upload-area {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: var(--radius-md);
    padding: 20px;
}

.asset-preview {
    text-align: center;
    padding: 12px;
}

.asset-preview a {
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
}

.asset-preview a:hover {
    text-decoration: underline;
}

.asset-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-charcoal);
    margin-bottom: 6px;
    margin-top: 12px;
}

.asset-form label:first-child {
    margin-top: 0;
}

.asset-form input,
.asset-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
}

.asset-form input:focus,
.asset-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

/* Approval feedback box */
.approval-feedback-box {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: var(--radius-md);
    padding: 16px;
}

.approval-feedback-box p {
    font-size: 14px;
    color: #92400E;
    margin-bottom: 8px;
}

.approval-feedback-box small {
    font-size: 12px;
    color: #B45309;
}

/* Review options */
.review-options {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.review-options .ghost-button {
    flex: 1;
    justify-content: center;
}

.ghost-button.success {
    border-color: #10B981;
    color: #059669;
}

.ghost-button.success:hover {
    background: #ECFDF5;
}

.ghost-button.warning {
    border-color: #F59E0B;
    color: #D97706;
}

.ghost-button.warning:hover {
    background: #FFFBEB;
}

.ghost-button.danger {
    border-color: #EF4444;
    color: #DC2626;
}

.ghost-button.danger:hover {
    background: #FEF2F2;
}

/* Metrics grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-item label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
}

.metric-item input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: right;
}

/* Deliverable table action buttons */
.deliverable-actions {
    display: flex;
    gap: 8px;
}

.deliverable-actions .ghost-button {
    padding: 4px 8px;
    font-size: 12px;
}

/* Approval status badges in table */
.approval-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.approval-badge.not-submitted {
    background: #F3F4F6;
    color: #6B7280;
}

.approval-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.approval-badge.approved {
    background: #D1FAE5;
    color: #065F46;
}

.approval-badge.revision {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .deliverable-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .review-options {
        flex-direction: column;
    }
}

/* ============================================================
   MESSAGING SYSTEM STYLES
   ============================================================ */

.messaging-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    height: calc(100vh - 300px);
    min-height: 500px;
}

.thread-list-panel {
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.thread-search-box {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.thread-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.thread-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.thread-filters {
    padding: 8px 12px 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.thread-filter-select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background-color: white;
    color: var(--color-charcoal);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.thread-filter-select:hover {
    border-color: #9ca3af;
}

.thread-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.thread-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.thread-item {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.thread-item:hover {
    background-color: #f9fafb;
}

.thread-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.thread-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.thread-meta {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.thread-info {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
}

.thread-messages {
    font-weight: 500;
}

.thread-last-sender {
    color: #9ca3af;
}

.thread-detail-panel {
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill the grid cell height */
}

.thread-detail {
    /* Normal flow layout - reply box follows messages naturally */
}

.thread-detail-header {
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.thread-detail-title h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #111827;
}

.thread-badges {
    display: flex;
    gap: 8px;
}

.thread-detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.thread-status-select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.thread-messages {
    margin-bottom: 20px;
    flex: 1 1 auto; /* Allow to grow/shrink */
    min-height: 0; /* Allow flexbox shrinking */
}

.message {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #f9fafb;
}

.message-user {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.message-ai {
    background-color: #f0fdf4;
    border-left: 3px solid #10b981;
}

.message-system {
    background-color: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.message-header strong {
    font-size: 14px;
    color: #111827;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
}

.message-body {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
}

.thread-reply-box {
    border-top: 2px solid #e5e7eb;
    padding-top: 16px;
    padding-bottom: 16px;
    margin-top: 16px;
}

.thread-reply-box textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}

.thread-reply-box button {
    padding: 10px 20px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.thread-reply-box button:hover {
    background-color: #2563eb;
}

/* Badge variations for categories */
.badge-bug {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-feature {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-enhancement {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-question {
    background-color: #fef3c7;
    color: #92400e;
}

/* Badge variations for priority */
.badge-priority-blocking,
.badge-priority-critical {
    background-color: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

.badge-priority-high {
    background-color: #fed7aa;
    color: #9a3412;
}

.badge-priority-normal {
    background-color: #e5e7eb;
    color: #374151;
}

.badge-priority-low {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Status badges */
.badge-status-open {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-status-resolved {
    background-color: #e0e7ff;
    color: #5b21b6;
}

.badge-status-closed {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* Make thread items more obviously clickable */
.thread-item {
    user-select: none;
}

.thread-item:active {
    background-color: #e5e7eb;
}

.thread-item.selected {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

/* Cases Panel Filters */
.case-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.case-filters select {
    flex: 1;
    max-width: 250px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    color: var(--color-charcoal);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.case-filters select:hover {
    border-color: #9ca3af;
}

.case-filters select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Case table styling */
#caseTable tr.converted {
    opacity: 0.7;
    background-color: #f3f4f6;
}

/* Approval table styling */
#approvalTable tr.overdue {
    background-color: #fef2f2;
}

#approvalTable tr.overdue:hover {
    background-color: #fee2e2;
}

/* Badge variants for case types */
.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-muted {
    background: #F3F4F6;
    color: #6B7280;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Small button variant */
.ghost-button.small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Detail Modal */
.detail-panel {
    max-width: 600px;
}

.detail-content {
    padding: 16px 0;
}

.detail-grid {
    display: grid;
    gap: 12px;
}

.detail-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    flex: 0 0 140px;
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
}

.detail-value {
    flex: 1;
    color: var(--color-charcoal);
    font-size: 14px;
}

.detail-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.stage-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stage-history-list li {
    padding: 6px 0;
    font-size: 13px;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
}

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

/* ==================== INSTRUCTIONS MODAL STYLING ==================== */
/* Elegant, professional styling for the help/instructions modal */

#instructionsModal .action-panel {
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fefefe 0%, #f9fafb 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

#instructionsModal .action-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 16px;
    margin-bottom: 8px;
}

#instructionsModal #instructionsTitle {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-charcoal);
    letter-spacing: -0.01em;
    margin: 0;
}

#instructionsModal #instructionsSubtitle {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-sage);
    margin-bottom: 4px;
}

#instructionsModal #instructionsBody {
    flex: 1;
    overflow-y: auto;
    padding: 20px 4px 20px 0;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #374151;
}

#instructionsModal #instructionsBody p {
    margin: 0;
}

#instructionsModal #instructionsBody strong {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--color-charcoal);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

/* Custom scrollbar for instructions */
#instructionsModal #instructionsBody::-webkit-scrollbar {
    width: 6px;
}

#instructionsModal #instructionsBody::-webkit-scrollbar-track {
    background: transparent;
}

#instructionsModal #instructionsBody::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

#instructionsModal #instructionsBody::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

#instructionsModal .action-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 16px;
    margin-top: 8px;
}

#instructionsModal .action-footer .primary-button {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 10px 24px;
}

/* ============================================ */
/* Case Type / Profile Type Selection Modal    */
/* ============================================ */
.case-type-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
}

.case-type-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 20px 24px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.case-type-button:hover {
    border-color: var(--color-sage);
    background: #f0f7f4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.case-type-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.case-type-icon {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.case-type-title {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--color-charcoal);
}

.case-type-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.case-type-hint {
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    margin-top: 8px;
}

.case-type-hint p {
    margin: 0;
    font-size: 0.8125rem;
    color: #92400e;
    line-height: 1.5;
}

.case-type-hint strong {
    color: #78350f;
}

/* ============================================ */
/* Stripe & Closing Sequence Styles            */
/* ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(52, 52, 52, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 2000;
}

.modal-overlay .modal {
    position: relative;
    inset: auto;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

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

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

.invoice-summary {
    background: #f9fafb;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.invoice-summary p {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--color-muted);
}

.warning-box {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #92400e;
}

.warning-box strong {
    color: #78350f;
}

/* Stripe status indicators */
.stripe-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.stripe-status.draft {
    background: #f3f4f6;
    color: #6b7280;
}

.stripe-status.open {
    background: #dbeafe;
    color: #1e40af;
}

.stripe-status.paid {
    background: #dcfce7;
    color: #166534;
}

.stripe-status.uncollectible,
.stripe-status.void {
    background: #fee2e2;
    color: #991b1b;
}

.stripe-status::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Case closing summary card */
.closing-summary-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.closing-summary-card h4 {
    margin: 0 0 12px;
    color: #166534;
    font-size: 16px;
}

.closing-summary-card .summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.closing-summary-card .stat {
    text-align: center;
}

.closing-summary-card .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #166534;
}

.closing-summary-card .stat-label {
    font-size: 12px;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Invoice Actions */
.invoice-actions {
    white-space: nowrap;
}

.invoice-actions .ghost-button {
    margin-left: 4px;
    padding: 4px 8px;
    font-size: 11px;
}

.invoice-actions .create-stripe-btn {
    background: #635bff;
    color: white;
    border-color: #635bff;
}

.invoice-actions .create-stripe-btn:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

.invoice-actions .sync-stripe-btn {
    background: #f0f0ff;
    color: #635bff;
    border-color: #635bff;
}

.invoice-actions .mark-paid-btn {
    background: #dcfce7;
    color: #166534;
    border-color: #22c55e;
}

.invoice-actions .mark-paid-btn:hover {
    background: #bbf7d0;
}

/* Close Case Button */
.close-case-btn {
    background: #f0fdf4;
    color: #166534;
    border-color: #22c55e;
}

.close-case-btn:hover {
    background: #dcfce7;
}

/* ========================================
   Dashboard Bubbles (Manager Mockup Style)
   ======================================== */

.dashboard-bubbles-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .dashboard-bubbles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .dashboard-bubbles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .dashboard-bubbles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dashboard-bubble {
    background: #621224; /* Manager's burgundy color */
    color: white;
    border-radius: 20px;
    padding: 24px 16px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

.dashboard-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(98, 18, 36, 0.25);
}

.dashboard-bubble.alert {
    background: #991B1B;
}

.dashboard-bubble.action {
    background: #1E40AF;
}

.dashboard-bubble.success {
    background: #166534;
}

.dashboard-bubble.warning {
    background: #92400E;
}

.dashboard-bubble.prominent {
    background: linear-gradient(135deg, #621224 0%, #8B1538 100%);
    border: 2px dashed rgba(255,255,255,0.3);
}

.bubble-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bubble-content.clickable {
    cursor: pointer;
}

.bubble-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.bubble-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.3;
}

.bubble-icon {
    font-size: 28px;
    opacity: 0.9;
}

.bubble-secondary {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
}

/* Panel Section Styling */
.panel-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border-soft);
}

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

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.table-filters {
    display: flex;
    gap: 8px;
}

.table-filters select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 13px;
    background: white;
}

.table-filters .filter-input {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 14px;
    min-width: 200px;
}

.table-filters .filter-select {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 14px;
    background: white;
}

/* ========================================
   Profiles View Toggle
   ======================================== */

.view-toggle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.view-toggle-group {
    display: flex;
    gap: 4px;
    background: #f1f1f1;
    border-radius: var(--radius-sm);
    padding: 4px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-toggle-btn:hover {
    color: var(--color-charcoal);
    background: rgba(255, 255, 255, 0.5);
}

.view-toggle-btn.active {
    background: white;
    color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
}

.view-toggle-info {
    font-size: 13px;
    color: var(--color-muted);
}

/* ========================================
   Profiles Table View
   ======================================== */

.profiles-table-view {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

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

.profiles-table-view .panel-header h2 {
    margin: 0;
    font-size: 20px;
}

.profiles-table-view .table-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.profiles-table-view .table-container {
    overflow-x: auto;
}

.profiles-table-view .table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--color-muted);
}

#profilesTable {
    width: 100%;
}

#profilesTable tbody tr {
    cursor: pointer;
}

#profilesTable tbody tr:hover {
    background: rgba(98, 18, 36, 0.04);
}

#profilesTable .profile-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

#profilesTable .profile-type-badge.talent {
    background: #e3f2fd;
    color: #1565c0;
}

#profilesTable .profile-type-badge.brand {
    background: #f3e5f5;
    color: #7b1fa2;
}

#profilesTable .profile-type-badge.agency {
    background: #e8f5e9;
    color: #2e7d32;
}

#profilesTable .profile-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

#profilesTable .profile-status-badge.active,
#profilesTable .profile-status-badge.signed {
    background: #e8f5e9;
    color: #2e7d32;
}

#profilesTable .profile-status-badge.prospect,
#profilesTable .profile-status-badge.lead {
    background: #fff3e0;
    color: #e65100;
}

#profilesTable .profile-status-badge.inactive,
#profilesTable .profile-status-badge.archived {
    background: #f5f5f5;
    color: #757575;
}

/* Quick Filter Chips */
.quick-filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    background: white;
    border-radius: 20px;
    font-size: 13px;
    color: var(--color-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-chip.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.filter-chip svg {
    width: 14px;
    height: 14px;
}

/* Email Inbox Placeholder */
.email-inbox-placeholder {
    background: #f9fafb;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    color: var(--color-muted);
}

/* ========================================
   Opportunity Closure Modal
   ======================================== */

.closure-body {
    padding: 0 24px 24px;
}

.closure-subtitle {
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 20px;
}

.closure-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .closure-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.closure-option {
    cursor: pointer;
}

.closure-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.closure-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border);
    background: white;
    transition: all 0.15s ease;
    text-align: center;
    min-height: 100px;
}

.closure-option-card:hover {
    border-color: var(--color-muted);
    background: #f9fafb;
}

.closure-option input[type="radio"]:checked + .closure-option-card {
    border-color: var(--accent);
    background: #EEF2FF;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.closure-option-card.success {
    border-color: #22c55e;
}

.closure-option input[type="radio"]:checked + .closure-option-card.success {
    background: #f0fdf4;
    border-color: #16a34a;
}

.closure-option-card.alert {
    border-color: #ef4444;
}

.closure-option input[type="radio"]:checked + .closure-option-card.alert {
    background: #fef2f2;
    border-color: #dc2626;
}

.closure-option-card.action {
    border-color: #3b82f6;
}

.closure-option input[type="radio"]:checked + .closure-option-card.action {
    background: #eff6ff;
    border-color: #2563eb;
}

.closure-option-card.warning {
    border-color: #f59e0b;
}

.closure-option input[type="radio"]:checked + .closure-option-card.warning {
    background: #fffbeb;
    border-color: #d97706;
}

.closure-option-card.danger {
    border-color: #dc2626;
}

.closure-option input[type="radio"]:checked + .closure-option-card.danger {
    background: #fef2f2;
    border-color: #b91c1c;
}

.closure-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.closure-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 4px;
}

.closure-desc {
    font-size: 11px;
    color: var(--color-muted);
    line-height: 1.3;
}

.closure-detail-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-soft);
}

.closure-detail-section .form-field {
    margin-bottom: 16px;
}

.closure-detail-section .form-field:last-child {
    margin-bottom: 0;
}

/* Case Type Toggle in Closure Modal */
.case-type-toggle {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.case-type-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f9fafb;
    border: 1px solid var(--color-border-soft);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.case-type-option:hover {
    background: #f3f4f6;
}

.case-type-option input[type="radio"] {
    margin: 0;
}

.case-type-option input[type="radio"]:checked + .case-type-label {
    font-weight: 600;
    color: var(--color-primary);
}

.case-type-label {
    font-size: 13px;
    color: var(--color-charcoal);
}

/* Blacklist Targets in Closure Modal */
.blacklist-targets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.blacklist-target-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid var(--color-border-soft);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.blacklist-target-option:hover {
    background: #fef2f2;
    border-color: #fecaca;
}

.blacklist-target-option input[type="checkbox"]:checked + .blacklist-target-info {
    color: #b91c1c;
}

.blacklist-target-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.blacklist-target-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-charcoal);
}

.blacklist-target-type {
    font-size: 11px;
    color: var(--color-muted);
}

/* ========================================
   Flagging Modal
   ======================================== */

.flag-body {
    padding: 0 24px 24px;
}

.flag-subtitle {
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 20px;
}

.flag-toggle-section {
    margin-bottom: 20px;
}

.toggle-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-charcoal);
}

.toggle-switch {
    position: relative;
    width: 48px;
    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.3s;
    border-radius: 26px;
}

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

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

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

/* Checkbox label styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
}

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

/* ========================================
   RS Dashboard Styles
   ======================================== */

.rs-dashboard-table {
    margin-top: 16px;
}

.rs-dashboard-table th {
    background: #30492D; /* RS green color */
    color: white;
}

/* ========================================
   BC Dashboard Styles
   ======================================== */

.bc-dashboard-table {
    margin-top: 16px;
}

.bc-dashboard-table th {
    background: #CB6CE6; /* BC pink/magenta color */
    color: white;
}

/* ========================================
   Roster Dashboard Styles
   ======================================== */

.roster-dashboard-table {
    margin-top: 16px;
}

.roster-dashboard-table th {
    background: #621224; /* Burgundy */
    color: white;
}

/* Flag indicator in tables */
.flag-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #dc2626;
    font-size: 14px;
}

.flag-indicator::before {
    content: '\26A0'; /* Warning triangle */
}

/* Age indicator (for stale items) */
.age-indicator {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.age-indicator.stale {
    background: #fef2f2;
    color: #dc2626;
}

.age-indicator.warning {
    background: #fffbeb;
    color: #d97706;
}

.age-indicator.normal {
    background: #f3f4f6;
    color: #6b7280;
}

/* ========================================
   Negotiation Brief Modal
   ======================================== */

.brief-body {
    padding: 0 24px 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.brief-subtitle {
    font-size: 14px;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.brief-version {
    font-size: 12px;
    color: var(--color-muted);
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
}

.brief-help {
    margin-bottom: 20px;
}

.brief-help details {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0;
}

.brief-help summary {
    font-size: 13px;
    color: var(--color-primary);
    cursor: pointer;
    padding: 10px 14px;
    font-weight: 500;
}

.brief-help summary:hover {
    background: #f1f5f9;
}

.brief-help .help-content {
    padding: 0 14px 14px;
    font-size: 13px;
    color: var(--color-charcoal);
}

.brief-help .help-content p {
    margin: 0 0 10px;
    line-height: 1.5;
}

.brief-help .help-content ul {
    margin: 0;
    padding-left: 20px;
}

.brief-help .help-content li {
    margin-bottom: 4px;
}

.brief-type-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.brief-type-option {
    flex: 1;
    cursor: pointer;
}

.brief-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.brief-type-label {
    display: block;
    padding: 12px 16px;
    text-align: center;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.brief-type-option input[type="radio"]:checked + .brief-type-label {
    border-color: var(--accent);
    background: #EEF2FF;
    color: var(--accent);
}

.brief-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border-soft);
}

.brief-section h4 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.form-grid.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 4px;
}

.approval-check-row {
    margin-bottom: 8px;
}

.authorization-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brief-history-list {
    background: #f9fafb;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    max-height: 150px;
    overflow-y: auto;
}

.brief-history-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-soft);
    font-size: 13px;
}

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

.brief-history-item .version-label {
    font-weight: 600;
    color: var(--color-charcoal);
}

.brief-history-item .version-date {
    color: var(--color-muted);
    margin-left: 8px;
}

/* Enhanced Brief History Items */
.brief-history-item {
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.brief-history-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.brief-history-item.active {
    background: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    padding: 0 6px;
    background: var(--color-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

.version-type {
    font-weight: 500;
    color: var(--color-charcoal);
}

.version-fee {
    margin-left: auto;
    font-weight: 600;
    color: var(--color-success);
}

.history-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--color-muted);
}

/* Dashboard Metrics Row */
.dashboard-grid.metrics-row {
    margin-top: 24px;
    margin-bottom: 24px;
}

.dashboard-card.metric-card {
    text-align: center;
    padding: 20px;
}

.dashboard-card.metric-card .card-header {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dashboard-card.metric-card .card-header h3 {
    font-size: 13px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-charcoal);
    line-height: 1;
}

.dashboard-card.metric-card.success .metric-value {
    color: var(--color-success);
}

.dashboard-card.metric-card.warning .metric-value {
    color: var(--color-warning-dark);
}

.dashboard-card.metric-card.alert .metric-value {
    color: var(--color-danger);
}

.metric-detail {
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 4px;
}

/* Stage badges */
.stage-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-border);
    color: var(--color-charcoal);
}

.stage-badge.stage-discovery { background: #e0e7ff; color: #3730a3; }
.stage-badge.stage-initial-contact { background: #dbeafe; color: #1e40af; }
.stage-badge.stage-negotiation { background: #fef3c7; color: #92400e; }
.stage-badge.stage-contract-review { background: #fed7aa; color: #c2410c; }
.stage-badge.stage-signing { background: #bbf7d0; color: #166534; }
.stage-badge.stage-onboarding { background: #a7f3d0; color: #047857; }
.stage-badge.stage-proposal { background: #e9d5ff; color: #7c3aed; }
.stage-badge.stage-contract-signing { background: #d1fae5; color: #059669; }
.stage-badge.stage-production { background: #fce7f3; color: #be185d; }
.stage-badge.stage-execution { background: #cffafe; color: #0891b2; }

/* Unpaid deal indicator */
td.unpaid {
    color: var(--color-muted);
    font-style: italic;
}

/* ========================================
   Color Variants for Dashboard Bubble Grids
   ======================================== */

/* RS Bubbles - Green theme */
.rs-bubbles .dashboard-bubble {
    background: #30492D;
}

.rs-bubbles .dashboard-bubble:hover {
    box-shadow: 0 8px 20px rgba(48, 73, 45, 0.25);
}

.rs-bubbles .dashboard-bubble.alert {
    background: #7f1d1d;
}

.rs-bubbles .dashboard-bubble.action {
    background: #1e40af;
}

.rs-bubbles .dashboard-bubble.warning {
    background: #92400e;
}

/* BC Bubbles - Pink/Magenta theme */
.bc-bubbles .dashboard-bubble {
    background: #8B1538;
}

.bc-bubbles .dashboard-bubble:hover {
    box-shadow: 0 8px 20px rgba(203, 108, 230, 0.25);
}

.bc-bubbles .dashboard-bubble.alert {
    background: #7f1d1d;
}

.bc-bubbles .dashboard-bubble.action {
    background: #1e40af;
}

.bc-bubbles .dashboard-bubble.success {
    background: #166534;
}

/* Roster Bubbles - Burgundy theme (default) */
.roster-bubbles .dashboard-bubble {
    background: #621224;
}

/* Global Bubbles - Burgundy theme (default) */
.global-bubbles .dashboard-bubble {
    background: #621224;
}

/* ==================== NEW MODAL STYLES (Session 10) ==================== */

/* Workflow Progress Steps */
.workflow-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    margin-bottom: 24px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.progress-step .step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.progress-step.active .step-number {
    background: #621224;
    color: white;
}

.progress-step.active .step-label {
    color: #621224;
    font-weight: 600;
}

.progress-step.completed .step-number {
    background: #166534;
    color: white;
}

.progress-step.completed .step-label {
    color: #166534;
}

/* Onboarding Progress */
.onboarding-progress {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
}

/* Radio Card Selection */
.radio-group-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.radio-card {
    display: block;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-card:hover {
    border-color: var(--color-accent);
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card input[type="radio"]:checked + .card-content {
    color: var(--color-primary);
}

.radio-card:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(98, 18, 36, 0.05);
}

.radio-card .card-content strong {
    display: block;
    margin-bottom: 4px;
}

.radio-card .card-content p {
    margin: 0;
    font-size: 13px;
    color: var(--color-muted);
}

/* Redline History */
.redline-history {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fafafa;
}

.redline-history .empty-message {
    color: var(--color-muted);
    font-style: italic;
    margin: 0;
}

.redline-entry {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.redline-entry:last-child {
    border-bottom: none;
}

.redline-date {
    font-size: 11px;
    color: var(--color-muted);
    margin-right: 8px;
}

.redline-user {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary);
}

.redline-note {
    margin: 4px 0 0 0;
    font-size: 13px;
}

/* Input with Button */
.input-with-button {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.input-with-button textarea,
.input-with-button input {
    flex: 1;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Info Box */
.info-box {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0;
    background: #f0f9ff;
    border-left: 3px solid #0284c7;
}

.info-box.warning {
    background: #fef3c7;
    border-left-color: #d97706;
}

.info-box.alert {
    background: #fee2e2;
    border-left-color: #dc2626;
}

.info-box p {
    margin: 0;
    font-size: 13px;
}

.info-box ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    font-size: 13px;
}

.progress-connector {
    width: 40px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    margin-bottom: 20px;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 8px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-button.active {
    background: #621224;
    color: white;
}

.tab-content {
    animation: fadeIn 0.2s ease;
}

.tab-content.hidden {
    display: none;
}

/* Form Sections */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

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

.form-section h4 {
    margin: 0 0 16px 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* Form Grid */
.form-grid {
    display: grid;
    gap: 16px;
}

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

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

.form-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-field.col-span-2 {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .form-grid.cols-2,
    .form-grid.cols-3,
    .form-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .form-field.col-span-2 {
        grid-column: span 1;
    }
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-group.multi-col {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #621224;
}

/* Asset Checklist */
.asset-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

/* Review Actions */
.review-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.review-status-box {
    padding: 16px;
    background: #fef3c7;
    border-radius: 6px;
    margin-bottom: 16px;
}

.review-status-box .review-pending {
    margin: 0;
    color: #92400e;
    font-weight: 500;
}

/* Additional Address Items */
.additional-address-item {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.address-list {
    margin-bottom: 16px;
}

/* Blacklist Entries */
.blacklist-entries {
    margin-bottom: 16px;
}

.blacklist-entry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fee2e2;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
}

.blacklist-brand {
    font-size: 14px;
    color: #991b1b;
}

.blacklist-entry .ghost-button.small {
    padding: 2px 6px;
    font-size: 12px;
}

/* Analytics Tab (Phase 8) */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.analytics-date {
    font-size: 12px;
    color: #6b7280;
}

.analytics-upload-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.upload-status {
    font-size: 13px;
    color: #059669;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.analytics-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.analytics-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.analytics-card {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.analytics-card h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.analytics-platforms {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.platform-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.platform-icon {
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: #621224;
    padding: 4px 8px;
    border-radius: 4px;
}

.platform-stat .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

/* Demographics Bars */
.demographics-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-bar {
    display: grid;
    grid-template-columns: 45px 1fr 40px;
    align-items: center;
    gap: 8px;
}

.demo-label {
    font-size: 12px;
    color: #6b7280;
}

.bar-container {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #621224, #993355);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.demo-value {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: right;
}

/* Gender Split */
.gender-split {
    margin-top: 8px;
}

.gender-bar {
    display: flex;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.gender-fill.female {
    background: linear-gradient(90deg, #f472b6, #ec4899);
}

.gender-fill.male {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.gender-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

/* Locations List */
.locations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.locations-list li {
    padding: 4px 0;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

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

/* Metric Boxes */
.metric-box {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.metric-box .metric-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-box .metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

/* Field Help Text */
.field-help {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    font-style: italic;
}

/* Brief Sections (Negotiation Brief Modal) */
.brief-section {
    margin-bottom: 24px;
}

.brief-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brief-history-list {
    max-height: 150px;
    overflow-y: auto;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

/* Authorization Grid */
.authorization-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Modal Form */
.modal-form {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Form Hints */
.form-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* Action Footer Improvements */
.action-footer .spacer {
    flex: 1;
}

/* Content Posting Workflow Specific */
.content-posting-workflow {
    padding: 0;
}

.content-posting-workflow .modal-form {
    padding: 20px;
}

/* Closure Conditional Sections */
.closure-conditional {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 16px;
}

.closure-conditional.hidden {
    display: none;
}

/* Closure Type Options */
.closure-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.closure-type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.closure-type-option:hover {
    border-color: #621224;
    background: #fdf2f4;
}

.closure-type-option input[type="radio"] {
    margin-top: 2px;
    accent-color: #621224;
}

.closure-type-option .option-content {
    flex: 1;
}

.closure-type-option .option-label {
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
}

.closure-type-option .option-description {
    font-size: 12px;
    color: #6b7280;
}

/* Flagging Priority Radio Buttons */
.flag-priority-options {
    display: flex;
    gap: 16px;
}

.flag-priority-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Ghost Button Variants */
.ghost-button.success {
    color: #166534;
    border-color: #166534;
}

.ghost-button.success:hover {
    background: #dcfce7;
}

.ghost-button.warning {
    color: #92400e;
    border-color: #92400e;
}

.ghost-button.warning:hover {
    background: #fef3c7;
}

.ghost-button.danger {
    color: #991b1b;
    border-color: #991b1b;
}

.ghost-button.danger:hover {
    background: #fee2e2;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.metric-item label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.metric-item input {
    width: 100%;
}

/* Empty State in Modals */
.empty-state {
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
    padding: 12px 0;
}

/* ==================== EMAIL INBOX STYLES ==================== */

.email-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.email-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.email-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.email-tab.active {
    color: #621224;
    border-bottom-color: #621224;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #621224;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

.email-tab-content {
    display: none;
}

.email-tab-content.active {
    display: block;
}

.inbox-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 16px;
}

.inbox-filters {
    display: flex;
    gap: 12px;
}

.inbox-search {
    flex: 1;
    max-width: 300px;
}

.inbox-search input {
    width: 100%;
}

.inbox-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 400px;
}

@media (max-width: 1024px) {
    .inbox-layout {
        grid-template-columns: 1fr;
    }
}

.email-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.email-list-item {
    display: grid;
    grid-template-columns: 24px 24px 150px 1fr 30px 80px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.email-list-item:hover {
    background: #f9fafb;
}

.email-list-item.unread {
    background: #fff;
    font-weight: 600;
}

.email-list-item.unread .email-sender,
.email-list-item.unread .subject-text {
    color: var(--color-charcoal);
}

.email-list-item.selected {
    background: rgba(107, 44, 80, 0.1);
    border-left: 3px solid var(--color-primary);
    padding-left: 13px;
}

.email-list-item.selected.unread {
    background: rgba(107, 44, 80, 0.12);
}

.email-checkbox input {
    width: 16px;
    height: 16px;
}

.email-star button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #d1d5db;
}

.email-star.starred button {
    color: #f59e0b;
}

.email-sender {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-subject {
    display: flex;
    gap: 8px;
    overflow: hidden;
}

.subject-text {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-snippet {
    color: #6b7280;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-attachment {
    font-size: 14px;
}

.email-date {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

.email-preview {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.email-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #9ca3af;
}

.email-preview-content {
    padding: 20px;
}

.email-preview-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.email-preview-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.email-preview-meta {
    display: flex;
    justify-content: space-between;
    color: #6b7280;
    font-size: 13px;
}

.preview-to {
    color: #6b7280;
    font-size: 13px;
    margin-top: 4px;
}

.email-preview-body {
    min-height: 200px;
    line-height: 1.6;
}

.email-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    margin-top: 16px;
}

/* Email conversation thread */
.email-conversation-thread {
    margin-top: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.conversation-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.conversation-messages {
    max-height: 300px;
    overflow-y: auto;
}

.conversation-message {
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
}

.conversation-message:last-child {
    margin-bottom: 0;
}

.conversation-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.conversation-message-from {
    font-weight: 500;
    color: var(--color-charcoal);
}

.conversation-message-date {
    color: var(--color-muted);
}

.conversation-message-body {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-message-body.expanded {
    max-height: none;
}

.conversation-expand-btn {
    font-size: 12px;
    color: var(--color-primary);
    cursor: pointer;
    margin-top: 4px;
}

.composer-row.inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Email loading state */
.email-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6b7280;
}

.email-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Compose status pill */
.status-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 12px;
}

.status-pill:empty {
    display: none;
}

.status-pill.sending {
    background: #dbeafe;
    color: #1e40af;
}

.status-pill.success {
    background: #dcfce7;
    color: #166534;
}

.status-pill.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Delete draft button */
.delete-draft-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.delete-draft-btn:hover {
    opacity: 1;
}

/* Email preview actions spacer */
.email-preview-actions .spacer {
    flex: 1;
}

/* Inline action button (template manager) */
.inline-action {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    text-decoration: underline;
}

.inline-action:hover {
    color: #3f0b18;
}

/* Email labels */
.email-labels {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.email-label {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e5e7eb;
    color: #374151;
}

.email-label.brand { background: #dbeafe; color: #1e40af; }
.email-label.talent { background: #dcfce7; color: #166534; }
.email-label.opportunity { background: #fef3c7; color: #92400e; }
.email-label.contract { background: #f3e8ff; color: #7c3aed; }

/* ==================== TALENT PAYOUT STYLES ==================== */

.payouts-dashboard .dashboard-card.metric {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.payouts-dashboard .metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.payout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.payout-column {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

#payoutBalanceTable {
    width: 100%;
}

#payoutBalanceTable th,
#payoutBalanceTable td {
    padding: 12px 8px;
    font-size: 13px;
}

#payoutBalanceTable .text-success {
    color: #16a34a;
}

#payoutBalanceTable .text-right {
    text-align: right;
    font-family: 'SF Mono', Consolas, monospace;
}

#payoutBalanceTable .text-center {
    text-align: center;
}

#payoutBalanceTable .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

#payoutBalanceTable .badge-success {
    background: #dcfce7;
    color: #166534;
}

#payoutBalanceTable .badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.ghost-button.small {
    padding: 4px 12px;
    font-size: 12px;
}

.ghost-button.small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#payoutHistoryTable {
    width: 100%;
}

#payoutHistoryTable code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Payout modal styles */
#payoutModal .form-group {
    margin-bottom: 16px;
}

#payoutModal .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

#payoutModal .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

#payoutModal .text-muted {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* ==================== RENEWALS STYLES ==================== */

.renewals-bubbles .dashboard-bubble {
    background: #621224;
}

.renewal-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-month h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
}

.timeline-item.urgent {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.timeline-date {
    font-weight: 600;
    color: #374151;
    min-width: 60px;
}

.timeline-label {
    color: #6b7280;
}

.date-urgent {
    color: #dc2626;
    font-weight: 600;
}

.tag-chip {
    display: inline-block;
    padding: 2px 8px;
    background: #e5e7eb;
    color: #374151;
    border-radius: 4px;
    font-size: 12px;
}

/* ==================== REPORTS STYLES ==================== */

.report-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.report-period-selector {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.period-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.period-btn:hover {
    color: #374151;
}

.period-btn.active {
    background: white;
    color: #621224;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-date-range.hidden {
    display: none;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.change-positive {
    color: #16a34a;
}

.change-negative {
    color: #dc2626;
}

/* Funnel Chart */
.funnel-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
}

.funnel-stage {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, #621224 0%, #8B1538 100%);
    color: white;
    border-radius: 4px;
    width: calc(var(--width, 100%));
    margin: 0 auto;
}

.funnel-label {
    font-size: 13px;
}

.funnel-value {
    font-weight: 600;
}

/* Status Breakdown */
.status-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
}

.status-row {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    gap: 12px;
    align-items: center;
}

.status-label {
    font-size: 13px;
    color: #374151;
}

.status-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: #e5e7eb;
}

.status-segment {
    height: 100%;
}

.status-segment.active {
    background: #3b82f6;
}

.status-segment.pending {
    background: #f59e0b;
}

.status-segment.completed {
    background: #22c55e;
}

.status-total {
    font-weight: 600;
    text-align: right;
}

.status-legend {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.legend-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-item .dot.active {
    background: #3b82f6;
}

.legend-item .dot.pending {
    background: #f59e0b;
}

.legend-item .dot.completed {
    background: #22c55e;
}

/* Leaderboard */
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.leaderboard-item .rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.leaderboard-item .name {
    color: #374151;
}

.leaderboard-item .value {
    font-weight: 600;
    color: #621224;
}

/* Category Breakdown */
.category-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
}

.category-row {
    display: grid;
    grid-template-columns: 160px 1fr 80px;
    gap: 12px;
    align-items: center;
}

.category-label {
    font-size: 13px;
    color: #374151;
}

.category-bar {
    height: 20px;
    background: linear-gradient(90deg, #621224 0%, #8B1538 100%);
    border-radius: 4px;
}

.category-value {
    font-weight: 600;
    text-align: right;
}

/* Performance Stats */
.performance-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 0;
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #621224;
}

.stat-item .stat-label {
    font-size: 12px;
    color: #6b7280;
}

/* Deadline List */
.deadline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.deadline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.deadline-item.urgent .deadline-date {
    color: #dc2626;
    font-weight: 600;
}

.deadline-item.warning .deadline-date {
    color: #d97706;
    font-weight: 600;
}

.deadline-date {
    min-width: 80px;
    font-size: 13px;
    color: #6b7280;
}

.deadline-label {
    flex: 1;
    font-size: 14px;
}

/* ==================== CONTRACT TEMPLATE PICKER ==================== */

.template-picker {
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.template-picker h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.template-card:hover {
    border-color: #621224;
    box-shadow: 0 2px 8px rgba(98, 18, 36, 0.1);
}

.template-icon {
    font-size: 28px;
}

.template-name {
    font-weight: 500;
    color: #111827;
    font-size: 14px;
}

.template-desc {
    font-size: 12px;
    color: #6b7280;
}

/* ==================== CALENDAR STYLES ==================== */

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

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-nav h3 {
    margin: 0;
    min-width: 150px;
    text-align: center;
}

.calendar-view-toggles {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.view-btn:hover {
    color: #374151;
}

.view-btn.active {
    background: white;
    color: #621224;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-placeholder {
    padding: 20px;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-week-header span {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 8px;
}

.calendar-day.weekend {
    background: #f9fafb;
}

.day-number {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-event {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-event.deliverable {
    background: #dbeafe;
    color: #1e40af;
}

.cal-event.meeting {
    background: #dcfce7;
    color: #166534;
}

.cal-event.deadline {
    background: #fee2e2;
    color: #991b1b;
}

.cal-event.event {
    background: #fef3c7;
    color: #92400e;
}

.cal-event.renewal {
    background: #f3e8ff;
    color: #7c3aed;
}

.calendar-note {
    margin-top: 16px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
}

/* Agenda List */
.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agenda-day h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #621224;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.agenda-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-event {
    display: grid;
    grid-template-columns: 100px 100px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.agenda-event.clickable:hover {
    background: #f3f4f6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.agenda-time {
    font-size: 13px;
    color: #6b7280;
}

.agenda-type {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.agenda-type.deliverable {
    background: #dbeafe;
    color: #1e40af;
}

.agenda-type.meeting {
    background: #dcfce7;
    color: #166534;
}

.agenda-type.deadline {
    background: #fee2e2;
    color: #991b1b;
}

.agenda-type.renewal {
    background: #f3e8ff;
    color: #7c3aed;
}

.agenda-title {
    font-size: 14px;
    color: #374151;
}

/* Week View */
.calendar-week-view {
    background: white;
}

.calendar-week-view .calendar-week-header span.today {
    color: var(--color-primary);
    font-weight: 700;
}

.calendar-week-view .calendar-day {
    min-height: 200px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.calendar-week-view .calendar-day:hover {
    background-color: #f3f4f6;
}

.calendar-week-view .calendar-day.today {
    background: #fffbeb;
}

.calendar-week-view .calendar-day.today .day-number {
    background: var(--color-primary);
    color: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Day View */
.calendar-day-view {
    padding: 20px;
    background: white;
}

.day-view-header {
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.day-view-header h3 {
    margin: 0;
    font-family: var(--font-display);
    color: var(--color-charcoal);
}

.day-view-events {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.day-event-card {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-event-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.day-event-card .event-type-badge {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

.day-event-card .event-time {
    font-size: 13px;
    color: #6b7280;
}

.day-event-card h4 {
    margin: 0;
    font-size: 16px;
    color: var(--color-charcoal);
}

/* Agenda View */
.calendar-agenda-view {
    padding: 20px;
    background: white;
}

.agenda-date-group {
    margin-bottom: 24px;
}

.agenda-date-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.agenda-date-group h4.today {
    color: var(--color-primary);
    background: #fffbeb;
    padding: 8px 12px;
    margin: 0 -12px 12px;
    border-radius: 6px;
}

.agenda-item {
    display: grid;
    grid-template-columns: 80px 100px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.agenda-item:hover {
    background: #e5e7eb;
}

.agenda-item .time {
    font-size: 13px;
    color: #6b7280;
}

.agenda-item .type-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    color: white;
}

.agenda-item .title {
    font-size: 14px;
    color: #374151;
}

.agenda-item .action-btn {
    font-size: 12px;
    padding: 4px 10px;
}

/* Calendar Event Time */
.cal-event .event-time {
    font-size: 10px;
    display: block;
    margin-bottom: 2px;
    opacity: 0.8;
}

/* Calendar Month View enhancements */
.calendar-month-view {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
}

.calendar-month-view .calendar-day {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.calendar-month-view .calendar-day:hover {
    background-color: #f3f4f6;
}

.calendar-month-view .calendar-day.other-month {
    background: #f3f4f6;
}

.calendar-month-view .calendar-day.other-month .day-number {
    color: #9ca3af;
}

.calendar-month-view .calendar-day.today {
    background: #fffbeb;
}

.calendar-month-view .calendar-day.today .day-number {
    background: var(--color-primary);
    color: white;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* More events indicator */
.more-events {
    font-size: 11px;
    color: #6b7280;
    padding: 4px;
    text-align: center;
    cursor: pointer;
}

.more-events:hover {
    color: var(--color-primary);
}

/* Calendar clickable events */
.cal-event {
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.cal-event:hover {
    filter: brightness(0.95);
    transform: translateX(2px);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 16px;
}

.filter-bar select,
.filter-bar input[type="search"] {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.filter-bar input[type="search"] {
    min-width: 200px;
}

/* ==================== UTILITY CLASSES ==================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Priority badges for troubleshooting */
.badge-critical,
.priority-critical .item-meta { background: #dc2626; color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-high,
.priority-high .item-meta { background: #f97316; color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-medium,
.priority-medium .item-meta { background: #f59e0b; color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-low,
.priority-low .item-meta { background: #9ca3af; color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* Roster table styling */
.roster-dashboard-table td { vertical-align: middle; }
.roster-dashboard-table .text-center { text-align: center; }
.roster-dashboard-table .text-right { text-align: right; font-family: monospace; }

/* ==================== EMAIL-TO-CASE MODALS ==================== */

/* Link Case Modal - Case option cards */
.link-case-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: white;
}

.link-case-option:hover {
    border-color: var(--color-primary);
    background: rgba(98, 18, 36, 0.02);
}

.link-case-option.selected {
    border-color: var(--color-primary);
    background: rgba(98, 18, 36, 0.05);
    box-shadow: 0 0 0 2px rgba(98, 18, 36, 0.1);
}

.link-case-option .case-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.link-case-option .case-icon.bc { background: #dbeafe; }
.link-case-option .case-icon.rs { background: #fce7f3; }

.link-case-option .case-details {
    flex: 1;
}

.link-case-option .case-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.link-case-option .case-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Case Type Selection Buttons */
.case-type-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.case-type-btn {
    flex: 1;
    padding: 20px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.case-type-btn:hover {
    border-color: var(--color-primary);
    background: rgba(98, 18, 36, 0.02);
}

.case-type-btn.selected {
    border-color: var(--color-primary);
    background: rgba(98, 18, 36, 0.05);
    box-shadow: 0 0 0 3px rgba(98, 18, 36, 0.1);
}

.case-type-btn .type-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.case-type-btn .type-label {
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.case-type-btn .type-desc {
    font-size: 12px;
    color: #6b7280;
}

/* AI Extraction Toggle */
.ai-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 12px;
}

.ai-toggle-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.ai-toggle-row .ai-icon {
    font-size: 18px;
}

.ai-toggle-row .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-toggle-row input:checked + .toggle-switch {
    background: var(--color-primary);
}

.ai-toggle-row .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.ai-toggle-row input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

.ai-toggle-row input {
    display: none;
}

/* Email visibility badge in toolbar */
#emailVisibilityIndicator.badge {
    font-size: 11px;
    padding: 4px 10px;
}

#emailVisibilityIndicator.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* ========================================
   PDF Preview Modal Styles
   ======================================== */
.pdf-preview-panel {
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.pdf-preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #e5e5e5;
}

/* PDF-like document container */
.pdf-document {
    background: white;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
}

.pdf-document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-primary);
}

.pdf-logo {
    max-width: 180px;
}

.pdf-logo h1 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--color-primary);
    margin: 0;
}

.pdf-logo p {
    font-size: 11px;
    color: var(--color-muted);
    margin: 4px 0 0;
}

.pdf-doc-info {
    text-align: right;
}

.pdf-doc-type {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 8px;
}

.pdf-doc-number {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.pdf-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.pdf-party h3 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-muted);
    margin: 0 0 8px;
    font-weight: 600;
}

.pdf-party-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
}

.pdf-party-detail {
    font-size: 11px;
    color: #666;
    margin: 2px 0;
}

.pdf-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 4px;
}

.pdf-meta-item label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-muted);
    margin-bottom: 4px;
}

.pdf-meta-item span {
    font-size: 13px;
    font-weight: 500;
}

/* Invoice line items table */
.pdf-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.pdf-items-table th {
    background: var(--color-primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-items-table th:last-child,
.pdf-items-table td:last-child {
    text-align: right;
}

.pdf-items-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
}

.pdf-items-table .item-description {
    font-weight: 500;
}

.pdf-items-table .item-detail {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* Invoice totals */
.pdf-totals {
    width: 300px;
    margin-left: auto;
    margin-bottom: 40px;
}

.pdf-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.pdf-totals-row.total {
    border-bottom: 2px solid var(--color-primary);
    border-top: 2px solid var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 0;
    margin-top: 8px;
}

/* Contract sections */
.pdf-section {
    margin-bottom: 32px;
}

.pdf-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

.pdf-section p {
    margin: 8px 0;
}

.pdf-section ul {
    margin: 8px 0;
    padding-left: 20px;
}

.pdf-section li {
    margin: 4px 0;
}

/* Payment details box */
.pdf-payment-details {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 32px;
}

.pdf-payment-details h4 {
    margin: 0 0 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-primary);
}

.pdf-payment-row {
    display: flex;
    font-size: 11px;
    margin: 4px 0;
}

.pdf-payment-row label {
    width: 120px;
    color: var(--color-muted);
}

/* Signatures section */
.pdf-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #ddd;
}

.pdf-signature-block {
    padding-top: 60px;
    border-top: 1px solid #333;
}

.pdf-signature-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.pdf-signature-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.pdf-signature-title {
    font-size: 11px;
    color: #666;
}

.pdf-signature-date {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

/* Footer */
.pdf-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 10px;
    color: var(--color-muted);
    text-align: center;
}

.pdf-footer p {
    margin: 4px 0;
}

/* Status watermark */
.pdf-status-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 72px;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.08;
    pointer-events: none;
    white-space: nowrap;
}

.pdf-document {
    position: relative;
    overflow: hidden;
}

@media print {
    .pdf-preview-panel .action-header,
    .pdf-preview-panel .action-footer {
        display: none;
    }

    .pdf-preview-content {
        background: white;
        padding: 0;
    }

    .pdf-document {
        box-shadow: none;
        margin: 0;
        padding: 40px;
    }
}

/* ============================================================
   MOBILE NAVIGATION - Hamburger Menu
   ============================================================ */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: var(--color-primary, #6b2c50);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mobile-menu-toggle:focus {
    outline: 2px solid var(--color-primary, #6b2c50);
    outline-offset: 2px;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        flex-direction: column; /* Reset from row at 900px breakpoint */
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .content {
        margin-left: 0;
        padding-top: 60px; /* Space for hamburger button */
    }
}

/* ============================================================
   MOBILE BREAKPOINTS - iPhone (375px) and minimum (320px)
   ============================================================ */

/* iPhone SE / Small phones (375px) */
@media (max-width: 375px) {
    /* Base typography adjustments */
    body {
        font-size: 14px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    /* Touch-friendly minimum sizes (44px minimum) */
    button,
    .btn,
    .filter-item,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Navigation adjustments */
    .sidebar {
        width: 100%;
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 12px;
    }

    /* Header adjustments */
    .viewer-header {
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .viewer-header .logo-area {
        flex: 1;
    }

    .viewer-header .auth-area {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }

    /* Card layouts */
    .card-grid,
    .profile-grid,
    .case-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card,
    .profile-card {
        padding: 12px;
    }

    /* Table adjustments */
    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }

    /* Modal adjustments */
    .modal-content,
    .action-panel {
        width: calc(100% - 24px);
        max-width: none;
        margin: 12px;
        max-height: calc(100vh - 24px);
    }

    .action-header,
    .action-body,
    .action-footer {
        padding: 12px;
    }

    /* Form elements */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 13px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 12px;
        min-height: 44px;
    }

    /* Filter bar */
    .filter-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-item {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }

    /* Email list compact */
    .email-list-item {
        grid-template-columns: 24px 1fr 60px;
        padding: 10px 12px;
    }

    .email-sender {
        display: none;
    }

    /* Tabs scrollable */
    .tabs-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 10px 16px;
    }

    /* Toast positioning */
    #toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
}

/* Minimum viewport (320px) */
@media (max-width: 320px) {
    body {
        font-size: 13px;
    }

    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 1rem; }

    /* Even more compact padding */
    .main-content {
        padding: 8px;
    }

    .card,
    .profile-card {
        padding: 10px;
    }

    .action-header,
    .action-body,
    .action-footer {
        padding: 10px;
    }

    /* Single column filter */
    .filter-item {
        flex: 1 1 100%;
    }

    /* Truncate long text */
    .profile-name,
    .case-title,
    .contract-title {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide non-essential columns */
    .data-table .hide-on-tiny {
        display: none;
    }

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

    .action-footer .btn {
        width: 100%;
    }

    /* Compact email list */
    .email-list-item {
        grid-template-columns: 1fr 50px;
    }

    .email-checkbox,
    .email-star {
        display: none;
    }
}

/* ============================================================
   MOBILE CSS FIXES - Additional responsive breakpoints
   ============================================================ */

/* ---------------------------------------------
   1. CALENDAR - Mobile responsive views
   --------------------------------------------- */
@media (max-width: 768px) {
    .calendar-week-header {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-week-header span {
        padding: 8px 4px;
        font-size: 10px;
    }

    .calendar-week,
    .calendar-month-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }

    .day-number {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .cal-event {
        padding: 2px 4px;
        font-size: 9px;
    }

    /* Agenda view adjustments */
    .agenda-event {
        grid-template-columns: 70px 80px 1fr;
        padding: 8px;
        gap: 8px;
    }

    .agenda-event .agenda-actions {
        display: none;
    }
}

@media (max-width: 600px) {
    /* Switch calendar to 3-day view on small screens */
    .calendar-week-header {
        display: none;
    }

    .calendar-week,
    .calendar-month-grid {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    .calendar-day {
        min-height: auto;
        padding: 12px;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
    }

    .calendar-day .day-number {
        min-width: 40px;
        font-weight: 600;
        margin-bottom: 0;
    }

    .day-events {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .cal-event {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Collapse weekend days in compact view - show they exist but save space */
    .calendar-week .calendar-day.weekend,
    .calendar-month-grid .calendar-day.weekend {
        max-height: 40px;
        min-height: 40px;
        overflow: hidden;
        opacity: 0.6;
        background: #f3f4f6;
        position: relative;
    }

    /* Visual indicator for collapsed weekends */
    .calendar-week .calendar-day.weekend::after,
    .calendar-month-grid .calendar-day.weekend::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 12px;
        background: linear-gradient(to bottom, transparent, #f3f4f6);
        pointer-events: none;
    }

    /* Show agenda view hint */
    .calendar-container::after {
        content: 'Scroll for more days';
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 11px;
        color: #9ca3af;
        background: #f9fafb;
        border-top: 1px solid #e5e7eb;
    }

    /* Agenda view stacks fully */
    .agenda-event {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .agenda-time {
        font-weight: 600;
    }

    .agenda-type {
        display: inline-block;
        width: auto;
    }
}

/* ---------------------------------------------
   2. TABLES - Visual scroll indicator and mobile improvements
   --------------------------------------------- */
/* Add visual scroll indicator to table wrappers */
.data-table-wrapper {
    position: relative;
}

/* Right fade gradient indicating more content */
.data-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Show gradient when table is scrollable and not scrolled to end */
.data-table-wrapper.is-scrollable::after {
    opacity: 1;
}

.data-table-wrapper.scrolled-end::after {
    opacity: 0;
}

/* Left fade when scrolled */
.data-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.data-table-wrapper.scrolled-start::before {
    opacity: 0;
}

.data-table-wrapper.is-scrollable:not(.scrolled-start)::before {
    opacity: 1;
}

@media (max-width: 600px) {
    /* Reduce table min-width on very small screens */
    .data-table {
        min-width: 400px;
    }

    /* Hide non-essential columns on tiny screens */
    .data-table .hide-on-tiny,
    .data-table th.hide-on-tiny,
    .data-table td.hide-on-tiny {
        display: none;
    }

    /* Compact table cells */
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* Scroll hint for tables */
    .data-table-wrapper::after {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .data-table {
        min-width: 320px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
}

/* ---------------------------------------------
   3. MESSAGING LAYOUT - Responsive stacking
   --------------------------------------------- */
@media (max-width: 768px) {
    .messaging-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: auto;
    }

    .thread-list-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 300px;
        overflow-y: auto;
    }

    .message-panel {
        min-height: 400px;
    }

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

    .thread-filter-select {
        flex: 1 1 45%;
    }
}

@media (max-width: 480px) {
    .thread-list-panel {
        max-height: 250px;
    }

    .thread-filters {
        flex-direction: column;
    }

    .thread-filter-select {
        flex: 1 1 100%;
    }

    .thread-item {
        padding: 10px;
    }
}

/* ---------------------------------------------
   4. ANALYTICS GRID - Mobile collapse
   --------------------------------------------- */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-grid.cols-3,
    .analytics-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .analytics-grid,
    .analytics-grid.cols-2,
    .analytics-grid.cols-3,
    .analytics-grid.cols-4 {
        grid-template-columns: 1fr;
    }

    .analytics-card {
        padding: 12px;
    }

    .analytics-card h5 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .analytics-platforms {
        flex-wrap: wrap;
        gap: 12px;
    }

    .platform-stat {
        flex: 1 1 40%;
        min-width: 80px;
    }
}

/* ---------------------------------------------
   5. ROSTER SUMMARY GRID - Flex wrap and mobile sizing
   --------------------------------------------- */
.roster-summary-grid {
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .roster-summary-grid {
        gap: 12px;
    }

    .roster-stat {
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
    }

    .roster-value {
        font-size: 20px;
    }

    .roster-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .roster-summary-grid {
        gap: 8px;
    }

    .roster-stat {
        flex: 1 1 calc(50% - 4px);
        min-width: 100px;
        padding: 10px;
    }

    .roster-value {
        font-size: 18px;
    }
}

@media (max-width: 320px) {
    .roster-stat {
        flex: 1 1 100%;
    }
}

/* Table Pagination */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    flex-wrap: wrap;
    gap: 8px;
}
.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pagination-current {
    padding: 0 8px;
    font-weight: 500;
}
.pagination-size {
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #212529);
}
.pagination-info {
    font-size: 0.8rem;
}

/* ============================================================
   SKELETON LOADING STATES
   ============================================================ */

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

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text.wide { width: 80%; }
.skeleton-text.medium { width: 60%; }
.skeleton-text.narrow { width: 40%; }
.skeleton-text.full { width: 100%; }

.skeleton-heading {
    height: 22px;
    width: 50%;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-stat {
    height: 36px;
    width: 60px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.skeleton-badge {
    height: 20px;
    width: 28px;
    border-radius: 10px;
}

.skeleton-chart {
    height: 200px;
    width: 100%;
    border-radius: var(--radius-sm, 4px);
    margin-top: 12px;
}

.skeleton-card {
    padding: 16px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid #e5e7eb;
    background: #fff;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.skeleton-row:last-child { border-bottom: none; }

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 100px;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.skeleton-summary-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.skeleton-summary-stat {
    flex: 1;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

/* Dashboard skeleton overlay */
.skeleton-overlay {
    position: relative;
}

.skeleton-overlay .skeleton-container {
    display: block;
}

.skeleton-overlay .real-content {
    display: none;
}

.skeleton-overlay.loaded .skeleton-container {
    display: none;
}

.skeleton-overlay.loaded .real-content {
    display: block;
}

/* Global loading bar at top of page */
.global-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    background: #e5e7eb;
    overflow: hidden;
    display: none;
}

.global-loading-bar.active {
    display: block;
}

.global-loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #621224, transparent);
    animation: loading-bar 1.2s ease-in-out infinite;
}

@keyframes loading-bar {
    0% { left: -40%; }
    100% { left: 100%; }
}

/* Skeleton for dashboard summary row */
.skeleton-dashboard-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.skeleton-dashboard-summary .skeleton-summary-stat {
    flex: 1;
    padding: 20px 16px;
}

/* Skeleton for dashboard grid cards */
.skeleton-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.skeleton-dashboard-grid .skeleton-card {
    min-height: 200px;
}

/* ============================================================
   CHART.JS INTEGRATION STYLES
   ============================================================ */

.chart-container {
    height: 250px;
    position: relative;
}

.chart-container canvas {
    max-height: 100%;
}

.chart-container.tall {
    height: 300px;
}

.chart-container.compact {
    height: 180px;
}

/* Mini chart in summary card */
.mini-chart-container {
    height: 120px;
    position: relative;
    margin-top: 8px;
}

.mini-chart-container canvas {
    max-height: 100%;
}

/* Chart legend override for dark theme cards */
.dashboard-card.alert .chart-container canvas,
.dashboard-card.alert .mini-chart-container canvas {
    filter: brightness(1.1);
}
