/* ===================================
   MissionBoard Design System
   =================================== */

:root {
    /* Colors */
    --primary-blue: #2563eb;
    --primary-blue-light: #eff6ff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --bg-hover: #f3f4f6;

    /* Status Colors */
    --status-green: #22c55e;
    --status-green-bg: #dcfce7;
    --status-yellow: #eab308;
    --status-yellow-bg: #fef9c3;
    --status-red: #ef4444;
    --status-red-bg: #fee2e2;
    --status-orange: #f97316;
    --status-orange-bg: #ffedd5;
    --status-purple: #a855f7;
    --status-purple-bg: #f3e8ff;
    --status-blue: #3b82f6;
    --status-blue-bg: #dbeafe;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Sidebar */
    --sidebar-width: 240px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-main);
}

/* App Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-close {
    display: none;
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-tagline {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md) 0;
}

.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.nav-item a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
}

.nav-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.nav-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.nav-item a:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active a {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px;
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 180;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
}

.header-search {
    display: none;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

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

.header-actions {
    display: none;
}

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

.brand-link {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand-link:hover {
    text-decoration: none;
}

.brand-tagline {
    display: none;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
    margin-left: auto;
}

.user-info {
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    color: #1f2937;
    font-weight: 600;
    white-space: nowrap;
}

.user-info .separator {
    color: #9ca3af;
    margin: 0 6px;
    font-weight: 400;
}

.user-info .user-role {
    color: #6b7280;
    font-weight: 400;
}

.user-name-short {
    display: none;
}

.logout-link {
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.logout-link:hover {
    text-decoration: underline;
}

@media (min-width: 960px) {
    .header-brand {
        display: none;
    }
}

@media (max-width: 1024px) {
    .brand-tagline {
        display: none;
    }
}

@media (max-width: 768px) {
    .brand-full { display: none; }
    .brand-short { display: inline; }
    .user-name-full { display: none; }
    .user-name-short { display: inline; }
}

@media (min-width: 769px) {
    .brand-short { display: none; }
}

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    position: relative;
    border-radius: 8px;
}

.header-btn:hover {
    background: #f3f4f6;
}

.header-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background-color: var(--status-red);
    border-radius: 50%;
    color: #fff;
    display: none;
    font-size: 10px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.notification-wrap {
    position: relative;
}

.notification-dropdown {
    position: fixed;
    top: 72px;
    right: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: normal;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
    z-index: 2000;
    display: none;
}

.notification-dropdown.open {
    display: block;
}

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

.notification-header strong {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.notification-mark-read {
    border: none;
    background: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.notification-list {
    display: grid;
}

.notification-item {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fff;
    overflow: hidden;
}

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

.notification-item.unread {
    background: #eff6ff;
}

.notification-item.urgent {
    border-left: 3px solid #ef4444;
}

.notification-item.attention {
    border-left: 3px solid #f59e0b;
}

.notification-item-icon {
    font-size: 16px;
    line-height: 1;
    margin-top: 2px;
}

.notification-item-body {
    min-width: 0;
    flex: 1;
    max-width: 100%;
}

.notification-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-message {
    margin-top: 2px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    display: block;
}

.notification-item-time {
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.notification-empty {
    padding: 20px 14px;
    font-size: 13px;
    color: #6b7280;
}

@media (max-width: 768px) {
    .notification-dropdown {
        right: -8px;
        width: min(320px, calc(100vw - 24px));
    }
}

.header-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.header-link:hover {
    text-decoration: underline;
}

.user-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Content */
.content {
    padding: var(--spacing-xl);
    flex: 1;
}

.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.page-description {
    color: var(--text-secondary);
}

/* Help Section */
.help-section {
    margin-bottom: var(--spacing-lg);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.help-section summary {
    padding: var(--spacing-md);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.help-section summary::-webkit-details-marker {
    display: none;
}

.help-section summary::before {
    content: "▶";
    font-size: 10px;
    transition: transform var(--transition);
}

.help-section[open] summary::before {
    transform: rotate(90deg);
}

.help-content {
    padding: 0 var(--spacing-md) var(--spacing-md);
    color: var(--text-secondary);
}

/* Status Cards */
.status-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.status-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
    border-top: 3px solid transparent;
}

.status-card.status-purple {
    border-top-color: var(--status-purple);
}

.status-card.status-orange {
    border-top-color: var(--status-orange);
}

.status-card.status-red {
    border-top-color: var(--status-red);
}

.status-card.status-blue {
    border-top-color: var(--status-blue);
}

.status-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.status-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Section Cards */
.section-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.section-icon {
    width: 20px;
    height: 20px;
}

.section-icon.warning-icon {
    color: var(--status-orange);
}

.section-icon.clock-icon {
    color: var(--status-red);
}

.section-icon.stale-icon {
    color: var(--status-red);
}

.section-icon.tasks-icon {
    color: var(--status-blue);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-message {
    color: var(--text-muted);
    font-size: 14px;
}

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

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.data-table td {
    color: var(--text-secondary);
}

.data-table tr:hover {
    background-color: var(--bg-hover);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green {
    background-color: var(--status-green-bg);
    color: #166534;
}

.badge-yellow {
    background-color: var(--status-yellow-bg);
    color: #854d0e;
}

.badge-red {
    background-color: var(--status-red-bg);
    color: #991b1b;
}

.badge-due {
    background-color: var(--status-red-bg);
    color: var(--status-red);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background-color: var(--bg-hover);
}

/* Toggle Buttons */
.toggle-group {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.toggle-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg-white);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.toggle-btn.active {
    background-color: var(--text-primary);
    color: white;
}

.toggle-btn:hover:not(.active) {
    background-color: var(--bg-hover);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-blue);
    background-color: var(--bg-white);
}

.tab-icon {
    width: 16px;
    height: 16px;
}

/* User Card */
.user-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--primary-blue-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-info-email {
    font-size: 13px;
    color: var(--primary-blue);
}

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

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.empty-state-message {
    font-size: 14px;
}

/* Alert Section */
.alert-section {
    background-color: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.alert-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.alert-section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.alert-section-icon {
    width: 18px;
    height: 18px;
    color: var(--status-orange);
}

.alert-section-arrow {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: transform var(--transition);
}

.alert-section.open .alert-section-arrow {
    transform: rotate(180deg);
}

/* Metric Cards */
.metric-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.metric-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
}

.metric-number {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.metric-number.red {
    color: var(--status-red);
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Action Button */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.action-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

/* Checkbox */
.checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
    .status-cards,
    .metric-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .main {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .header-search {
        display: none;
    }

    .header-actions {
        gap: var(--spacing-md);
    }

    .admin-link {
        display: none;
    }

    .user-menu {
        display: none;
    }

    .status-cards,
    .metric-cards {
        grid-template-columns: 1fr 1fr;
    }

    .content {
        padding: var(--spacing-md);
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .status-cards,
    .metric-cards {
        grid-template-columns: 1fr;
    }

    .toggle-group {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Profile Card */
.profile-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--spacing-lg);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar svg {
    width: 32px;
    height: 32px;
    color: var(--primary-blue);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.profile-role {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Metric Cards - Updated */
.metric-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.metric-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.metric-card.metric-warning .metric-value {
    color: var(--status-orange);
}

.metric-card.metric-info .metric-value {
    color: var(--primary-blue);
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Tabs Container */
.tabs-container {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-main);
    overflow-x: auto;
    margin-bottom: 0;
}

.tab {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--status-green);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Empty State */
.empty-state {
    padding: var(--spacing-2xl);
    text-align: center;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--text-secondary);
}

/* Additional Badge Colors */
.badge-purple {
    background-color: var(--status-purple-bg);
    color: #7e22ce;
}

.badge-blue {
    background-color: var(--status-blue-bg);
    color: #1d4ed8;
}

.badge-gray {
    background-color: #f3f4f6;
    color: #4b5563;
}

/* Intake Grid */
.intake-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.intake-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition);
}

.intake-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.intake-card-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    background-color: var(--primary-blue-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intake-card-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-blue);
}

.intake-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.intake-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

/* Intake List */
.intake-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.intake-filters {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.intake-filters .form-select {
    min-width: 160px;
}

.intake-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.intake-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.intake-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    display: grid;
    gap: var(--spacing-sm);
}

.intake-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.intake-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.intake-item-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.intake-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intake-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
}

/* Global Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

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

/* My Tasks */
.read-only-banner {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: var(--spacing-md);
}

.tasks-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.summary-card .summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-card .summary-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.summary-card .summary-message {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.summary-card:hover {
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.summary-card.summary-urgent {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.summary-card.summary-alert {
    border-left: 4px solid #ef4444;
}

.summary-card.summary-warning {
    border-left: 4px solid #f59e0b;
}

.tasks-filters {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.tasks-filters .form-select {
    min-width: 160px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.task-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card.overdue {
    border-color: #f87171;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.task-card.due-today {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.task-card.priority-high {
    border-left: 4px solid #f59e0b;
}

.task-card.priority-critical {
    border-left: 4px solid #ef4444;
}

.task-card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.task-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.task-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

.task-due {
    color: #6b7280;
}

.task-card.overdue .task-due {
    color: #ef4444;
    font-weight: 600;
}

.task-card.due-today .task-due {
    color: #f97316;
    font-weight: 600;
}

.task-priority {
    font-weight: 600;
    color: #6b7280;
}

.task-priority.badge {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.task-priority.badge-critical,
.task-priority.badge-high {
    color: #ef4444;
}

.task-status-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    font-size: 11px;
    padding: 4px 8px;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
}

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

.task-link {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.task-link:hover {
    color: #2563eb;
}

.task-link.danger:hover {
    color: #dc2626;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 4px;
}

.empty-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Executive Modal */
.exec-modal {
    border-radius: 22px;
}

.exec-modal .modal-header {
    padding: 28px 36px;
    border-bottom: 1px solid #e5e7eb;
}

.exec-modal .modal-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.exec-modal .modal-body {
    padding: 28px 36px 16px 36px;
}

.exec-modal .modal-footer {
    padding: 18px 36px 28px 36px;
    background: #f8fafc;
}

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

.exec-form-group {
    display: grid;
    gap: 10px;
}

.exec-form-group.full {
    grid-column: 1 / -1;
}

.exec-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
}

.exec-input,
.exec-select,
.exec-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 15px;
    color: #111827;
    background: #fff;
}

.field-error {
    font-size: 13px;
    color: #ef4444;
    font-weight: 600;
}

.agency-select {
    position: relative;
    width: 100%;
}

.agency-input {
    padding-right: 44px;
}

.agency-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
}

.agency-clear.visible {
    opacity: 1;
    pointer-events: auto;
}

.agency-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    z-index: 40;
    padding: 6px 0;
}

.agency-dropdown.hidden {
    display: none;
}

.agency-option {
    padding: 10px 14px;
    font-size: 14px;
    color: #111827;
    cursor: pointer;
}

.agency-option:hover,
.agency-option.active {
    background: #f3f4f6;
}

.agency-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: #6b7280;
}

.exec-textarea {
    min-height: 140px;
    resize: vertical;
}

.exec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.exec-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #fff;
}

.exec-tag input {
    margin: 0;
}

.exec-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin: 6px 0 4px;
}

.exec-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.intake-rules {
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 60%);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
}

.rules-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.rules-list {
    list-style: disc;
    padding-left: 20px;
    color: var(--text-secondary);
    display: grid;
    gap: 8px;
}

/* Intake dense banner */
.intake-banner {
    border: 1px solid var(--border-color);
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    margin-bottom: var(--spacing-md);
}

.intake-banner h3 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 6px;
}

.intake-banner ul {
    list-style: disc;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 13px;
    display: grid;
    gap: 4px;
}

.intake-controls.dense {
    align-items: stretch;
}

.intake-filters.dense {
    gap: 8px;
}

.intake-filters.dense .form-select {
    min-width: 140px;
    padding: 8px 10px;
    font-size: 13px;
}

.intake-actions.dense .btn {
    padding: 8px 12px;
}

@media (max-width: 960px) {
    .intake-banner {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 960px) {
    .intake-item {
        grid-template-columns: 2fr 1fr auto;
        align-items: center;
    }
    .intake-item-main {
        padding-right: var(--spacing-sm);
    }
}

/* Attention Summary */
.attention-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.attention-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    text-align: center;
    border-left: 4px solid transparent;
}

.attention-card.attention-critical {
    border-left-color: var(--status-red);
}

.attention-card.attention-warning {
    border-left-color: var(--status-yellow);
}

.attention-card.attention-stale {
    border-left-color: var(--text-muted);
}

.attention-count {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
}

.attention-critical .attention-count {
    color: var(--status-red);
}

.attention-warning .attention-count {
    color: var(--status-yellow);
}

.attention-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.attention-description {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Attention Section */
.attention-section {
    margin-bottom: var(--spacing-xl);
}

.section-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
}

.section-indicator.critical {
    background-color: var(--status-red);
}

.section-indicator.warning {
    background-color: var(--status-yellow);
}

.section-indicator.stale {
    background-color: var(--text-muted);
}

/* Item styling in tables */
.item-name {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.item-type {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.days-overdue {
    color: var(--status-red);
    font-weight: 500;
}

.stale-days {
    color: var(--text-muted);
}

/* Action buttons */
.action-btn.action-urgent {
    background-color: var(--status-red-bg);
    border-color: var(--status-red);
    color: var(--status-red);
}

.action-btn.action-urgent:hover {
    background-color: var(--status-red);
    color: white;
}

/* Load more button */
.load-more-btn {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-blue);
    cursor: pointer;
    transition: all var(--transition);
}

.load-more-btn:hover {
    background-color: var(--primary-blue-light);
}

/* Responsive for new components */
@media (max-width: 1024px) {
    .intake-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .attention-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

    .attention-summary {
        grid-template-columns: 1fr;
    }

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

    .tabs {
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 13px;
    }

    .profile-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ===================================
   Additional Styles for New Pages
   =================================== */

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-main);
    border-radius: 8px;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 18px;
    height: 18px;
}

.activity-icon.green {
    background-color: var(--status-green-bg);
    color: var(--status-green);
}

.activity-icon.yellow {
    background-color: var(--status-yellow-bg);
    color: var(--status-yellow);
}

.activity-icon.red {
    background-color: var(--status-red-bg);
    color: var(--status-red);
}

.activity-icon.blue {
    background-color: var(--status-blue-bg);
    color: var(--status-blue);
}

.activity-content p {
    margin-bottom: var(--spacing-xs);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Section Link */
.section-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.section-link:hover {
    text-decoration: underline;
}

/* Status Bars */
.status-bars {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.status-bar-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.status-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Agency Grid */
.agency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.agency-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.agency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.agency-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.agency-stats {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.agency-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-value.green { color: var(--status-green); }
.stat-value.yellow { color: var(--status-yellow); }
.stat-value.red { color: var(--status-red); }

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.agency-lead {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.filter-search {
    min-width: 220px;
    flex: 0 1 320px;
}

.jump-to-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.jump-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.jump-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.jump-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.project-list {
    display: grid;
    gap: var(--spacing-md);
}

.project-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-lg);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.project-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.project-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.meta-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meta-value {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-primary);
}

.meta-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.project-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.health-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.health-dot.badge-green { background: #22c55e; }
.health-dot.badge-yellow { background: #f59e0b; }
.health-dot.badge-red { background: #ef4444; }
.health-dot.badge-blue { background: #3b82f6; }

.search-panel {
    position: fixed;
    top: 96px;
    right: 32px;
    width: min(480px, calc(100% - 64px));
    max-height: 70vh;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
    padding: 16px;
    z-index: 100;
    display: none;
    overflow: auto;
}

/* Project Detail Enhancements */
.project-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin: var(--spacing-lg) 0;
}

.project-summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: var(--spacing-md);
}

.project-summary-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.project-summary-value.summary-zero {
    opacity: 0.35;
}

.project-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-top: 6px;
}
.project-summary-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.project-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.project-meta .card {
    text-align: center;
    padding: 18px;
}

.project-meta .form-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.project-meta .form-select,
.project-meta .form-input {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
}

.project-meta #projectDueDate {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.status-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
}

.status-on_track { background: #22c55e; }
.status-at_risk { background: #f59e0b; }
.status-blocked { background: #ef4444; }
.status-completed { background: #3b82f6; }
.status-new { background: #3b82f6; }
.status-under_review { background: #f59e0b; }
.status-approved { background: #22c55e; }
.status-declined { background: #ef4444; }
.status-need_info { background: #f59e0b; }
.status-on_hold { background: #6b7280; }

.due-tag {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 999px;
    padding: 4px 8px;
}

.due-today {
    border-color: #ef4444;
    color: #991b1b;
    font-weight: 700;
}

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

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

.section-card .inline-actions .form-input,
.section-card .inline-actions .form-select {
    min-height: 38px;
    border-radius: 10px;
}

.section-card .inline-actions .btn {
    min-height: 38px;
    padding: 0 16px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tag.open {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.tag.resolved {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.section-card .data-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.section-card .data-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.section-card .data-table tr:hover {
    background: #f8fafc;
}

.section-card .data-table td:first-child {
    font-weight: 600;
}

/* Task Cards */
.task-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    background: #ffffff;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.task-card:hover {
    background: #f9fafb;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.task-row {
    display: flex;
    gap: 14px;
}

.task-check input {
    width: 18px;
    height: 18px;
}

.task-body {
    flex: 1;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}

.task-title:hover {
    text-decoration: underline;
}

.task-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.task-status {
    margin-top: 8px;
}

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

.task-card.priority-critical { border-left: 4px solid #ef4444; }
.task-card.priority-high { border-left: 4px solid #f59e0b; }
.task-card.priority-medium { border-left: 4px solid #cbd5f5; }
.task-card.priority-low { border-left: 4px solid #e5e7eb; }

.task-completed {
    opacity: 0.7;
}

.task-completed .task-title {
    text-decoration: line-through;
}

.task-toggle {
    margin-top: 12px;
}

.progress-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.progress-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: #93c5fd;
    transition: width 0.3s ease;
}

.progress-low { color: #ef4444; }
.progress-mid { color: #f59e0b; }
.progress-high { color: #3b82f6; }
.progress-full { color: #22c55e; }

.progress-bar-fill.progress-low { background: #ef4444; }
.progress-bar-fill.progress-mid { background: #f59e0b; }
.progress-bar-fill.progress-high { background: #3b82f6; }
.progress-bar-fill.progress-full { background: #22c55e; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.detail-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.team-block {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.team-field {
    display: grid;
    gap: 4px;
}
.team-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.team-field .form-input,
.team-field .chip-input {
    height: 44px;
    min-height: 44px;
}

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

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #3b82f6;
    margin-right: 2px;
}
.priority-dot.priority-low { background: #9ca3af; }
.priority-dot.priority-medium { background: #3b82f6; }
.priority-dot.priority-high { background: #f59e0b; }
.priority-dot.priority-critical { background: #ef4444; }

.status-new { background: #9ca3af; }
.status-under_review { background: #3b82f6; }
.status-approved { background: #22c55e; }
.status-declined { background: #ef4444; }
.status-need_info { background: #f59e0b; }
.status-on_hold { background: #6b7280; }

.chip-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    min-height: 48px;
}
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}
.chip button {
    border: none;
    background: transparent;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
.chip-text {
    border: none;
    outline: none;
    flex: 1;
    min-width: 140px;
    font-size: 14px;
    padding: 8px 0;
}

.chip-readonly .chip button {
    display: none;
}

.chip-readonly .chip-text {
    display: none;
}

.markdown-toggle {
    display: flex;
    gap: 8px;
}
.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}
.markdown-preview {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 14px;
    color: #1f2937;
}

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

.planning-grid > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.planning-grid .form-label {
    text-align: center;
    width: 100%;
}

.plan-banner {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 600;
}

.planning-grid .form-input {
    width: 100%;
    min-height: 160px;
}

#planningSection {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

#planningSection .section-title {
    font-size: 18px;
}

#planningSection .meta-note {
    font-size: 13px;
    color: #475569;
}

.planning-section {
    background: #f8fafc;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.planning-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.planning-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.planning-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

.planning-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.planning-grid-new {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 12px;
}

.planning-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.planning-question {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111827;
    margin-bottom: 6px;
}

.planning-help {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.planning-input {
    min-height: 220px;
}

.planning-locked-box {
    display: none;
    min-height: 220px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    color: #111827;
    font-size: 14px;
    white-space: pre-wrap;
}

.planning-info {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 12px;
    color: #1e3a8a;
    font-size: 13px;
}

.planning-info-icon {
    font-size: 16px;
}

@media (max-width: 1200px) {
    .planning-grid-new {
        grid-template-columns: 1fr;
    }
}

.field-note {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #b45309;
    background: #fff7ed;
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
}

.detail-card .form-select,
.detail-card .form-input {
    height: 44px;
    font-size: 15px;
    background: #ffffff;
}

.section-card textarea.form-input {
    min-height: 260px;
}

.section-card textarea.notes-area {
    min-height: 240px;
}
.task-menu {
    position: relative;
    margin-left: auto;
}
.task-menu-trigger {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
}
.task-menu-list {
    position: absolute;
    right: 0;
    top: 40px;
    min-width: 140px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    padding: 6px;
    display: none;
    z-index: 20;
}
.task-menu-list.open {
    display: block;
}
.task-menu-list button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}
.task-menu-list button:hover {
    background: #f3f4f6;
}
.discoveries-section,
.updates-section {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 20px;
}

.updates-section {
    background: #f9fafb;
}

.tasks-section {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    padding: 20px;
}

.discovery-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #ffffff;
}

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

.discovery-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #111827;
}

.discovery-icon {
    font-size: 18px;
}

.discovery-notes {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.discovery-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

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

.action-btn.action-success {
    border-color: #bbf7d0;
    color: #166534;
    background: #ecfdf3;
}

.empty-inline {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 10px 0;
}

.search-panel.active {
    display: block;
}

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

.search-panel-title {
    font-weight: 600;
    color: #111827;
}

.search-close {
    border: 1px solid #d1d5db;
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.search-status {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
}

.search-group {
    margin-bottom: 16px;
}

.search-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
}

.search-result {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #111827;
    border: 1px solid transparent;
}

.search-result:hover {
    border-color: #e5e7eb;
    background: #f9fafb;
}

.search-result-title {
    font-weight: 600;
    font-size: 14px;
}

.search-result-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--bg-white);
    cursor: pointer;
}

/* Ongoing Grid */
.ongoing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.ongoing-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.ongoing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.ongoing-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.ongoing-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.ongoing-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: 13px;
    color: var(--text-secondary);
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--border-color);
}

.ongoing-footer {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.next-occurrence {
    font-size: 13px;
    color: var(--text-secondary);
}

.next-occurrence.overdue {
    color: var(--status-red);
    font-weight: 500;
}

/* Help Cards */
.help-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.help-card.collapsed .help-card-body {
    display: none;
}

.inline-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

.workflow-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.workflow-item {
    padding: 16px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.workflow-item h3 {
    font-size: 15px;
    margin-bottom: 6px;
}

.workflow-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

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

.checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.checklist input {
    width: 18px;
    height: 18px;
}

.help-card h2 {
    font-size: 18px;
    margin-bottom: var(--spacing-md);
}

.help-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.help-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.help-muted {
    color: var(--text-secondary);
    margin-top: 6px;
}

.role-toggle {
    display: inline-flex;
    gap: 8px;
}

.role-toggle .btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.quick-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.quick-3-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f9fafb;
}

.quick-3-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dashed #9ca3af;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: 120%;
    background: #111827;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.faq-search {
    min-width: 220px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
}

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

.success-item {
    padding: 12px 14px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-weight: 600;
    font-size: 14px;
}

.help-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.help-step {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-main);
    border-radius: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 15px;
    margin-bottom: var(--spacing-xs);
}

.step-content p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Status Definitions */
.status-definitions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.status-def {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.status-def p {
    margin: 0;
    font-size: 14px;
}

/* Concept Grid */
.concept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.concept-item {
    padding: var(--spacing-md);
    background-color: var(--bg-main);
    border-radius: 8px;
}

.concept-item h3 {
    font-size: 15px;
    margin-bottom: var(--spacing-xs);
}

.concept-item p {
    font-size: 13px;
    margin: 0;
}

/* FAQ Items */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    padding-top: var(--spacing-md);
    font-size: 14px;
}

@media (max-width: 1000px) {
    .quick-3 {
        grid-template-columns: 1fr;
    }
    .success-list {
        grid-template-columns: 1fr;
    }
    .workflow-list {
        grid-template-columns: 1fr;
    }
    .checklist {
        grid-template-columns: 1fr;
    }
}

/* Runbook Grid */
.runbook-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.runbook-category h2 {
    font-size: 16px;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-blue);
}

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

.runbook-item {
    border-bottom: 1px solid var(--border-color);
}

.runbook-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    color: var(--text-primary);
    text-decoration: none;
}

.runbook-item a:hover {
    color: var(--primary-blue);
}

.runbook-title {
    font-weight: 500;
}

.runbook-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Admin Actions */
.admin-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.admin-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
}

.admin-action-btn:hover {
    background-color: var(--primary-blue-light);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.admin-action-btn svg {
    width: 24px;
    height: 24px;
}

/* System Status */
.system-status {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--bg-main);
    border-radius: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.green { background-color: var(--status-green); }
.status-dot.yellow { background-color: var(--status-yellow); }
.status-dot.red { background-color: var(--status-red); }

.status-text {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
}

/* User Cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive for new pages */
@media (max-width: 1024px) {
    .agency-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

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

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

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

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

    .admin-actions {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
}
/* ===== Animations: Global ===== */
* {
    box-sizing: border-box;
}

button,
a,
input,
select,
textarea,
.card,
.project-card,
.task-card,
.intake-item,
.modal {
    transition-property: transform, opacity, box-shadow, border-color, background-color;
    transition-duration: 150ms;
    transition-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Buttons */
button,
.btn {
    transform: translateZ(0);
}

button:hover:not(:disabled),
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

button:active:not(:disabled),
.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:focus-visible,
.btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Cards */
.card,
.project-card,
.task-card,
.intake-item {
    transform: translateZ(0);
}

.card:hover,
.project-card:hover,
.task-card:hover,
.intake-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

/* Page load */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content {
    animation: fadeInUp 400ms ease-out;
}

/* Page transitions */
body {
    transition: opacity 240ms ease, transform 240ms ease;
}

body.page-exit {
    opacity: 0;
    transform: translateY(6px);
}

.content.pjax-out {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.content.pjax-in {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.content.pjax-in.pjax-in-active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered cards */
.project-grid .project-card,
.task-list .task-card,
.intake-list .intake-item {
    opacity: 0;
    animation: fadeInUp 400ms ease-out forwards;
}

.project-grid .project-card:nth-child(1),
.task-list .task-card:nth-child(1),
.intake-list .intake-item:nth-child(1) { animation-delay: 0ms; }
.project-grid .project-card:nth-child(2),
.task-list .task-card:nth-child(2),
.intake-list .intake-item:nth-child(2) { animation-delay: 50ms; }
.project-grid .project-card:nth-child(3),
.task-list .task-card:nth-child(3),
.intake-list .intake-item:nth-child(3) { animation-delay: 100ms; }
.project-grid .project-card:nth-child(4),
.task-list .task-card:nth-child(4),
.intake-list .intake-item:nth-child(4) { animation-delay: 150ms; }
.project-grid .project-card:nth-child(5),
.task-list .task-card:nth-child(5),
.intake-list .intake-item:nth-child(5) { animation-delay: 200ms; }
.project-grid .project-card:nth-child(6),
.task-list .task-card:nth-child(6),
.intake-list .intake-item:nth-child(6) { animation-delay: 250ms; }

.project-grid .project-card:nth-child(n+13),
.task-list .task-card:nth-child(n+13),
.intake-list .intake-item:nth-child(n+13) {
    animation-delay: 0ms;
    opacity: 1;
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-overlay.active {
    animation: fadeIn 200ms ease-out;
}

.modal {
    animation: modalFadeIn 200ms ease-out;
}

/* Empty state fade */
.empty-state {
    animation: fadeIn 400ms ease-out;
}

/* Toasts */
@keyframes slideInRight {
    from { transform: translateX(320px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(320px); opacity: 0; }
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
    animation: slideInRight 220ms ease-out;
    font-size: 14px;
    color: #111827;
}

.toast.hiding {
    animation: slideOutRight 220ms ease-out;
}

.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }

/* Task completion */
@keyframes taskComplete {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 0.7; }
}

.task-card.completed {
    animation: taskComplete 240ms ease-out forwards;
    opacity: 0.7;
}

.task-card.completed .task-title {
    text-decoration: line-through;
}

/* Task Sidebar Panel */
.task-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.2);
    z-index: 280;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.task-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.task-sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -6px 0 24px rgba(15, 23, 42, 0.14);
    z-index: 281;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.task-sidebar-panel.open {
    transform: translateX(0);
}

.task-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.task-sidebar-header h3 {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.task-sidebar-close {
    border: none;
    background: none;
    color: #6b7280;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.task-sidebar-body {
    padding: 16px;
    overflow-y: auto;
    display: grid;
    gap: 14px;
}

.task-sidebar-field {
    display: grid;
    gap: 6px;
}

.task-sidebar-field label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
}

.task-sidebar-input,
.task-sidebar-select,
.task-sidebar-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #111827;
    background: #fff;
}

.task-sidebar-input:focus,
.task-sidebar-select:focus,
.task-sidebar-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.task-sidebar-textarea {
    min-height: 120px;
    resize: vertical;
}

.task-sidebar-title-display {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    cursor: text;
}

.task-sidebar-title-display:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.task-sidebar-actions {
    display: flex;
    gap: 10px;
}

.task-sidebar-actions .btn {
    flex: 1;
}

.task-sidebar-note-hint {
    font-size: 12px;
    color: #6b7280;
}

.task-sidebar-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.task-sidebar-section h4 {
    margin: 0 0 8px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.task-step-list,
.task-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.task-step-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1f2937;
}

.task-step-item.done .text {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-step-delete {
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
}

.task-step-item:hover .task-step-delete {
    opacity: 1;
}

.task-step-add {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.task-step-add input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.task-step-add button {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: #111827;
    font-size: 13px;
    cursor: pointer;
}

.task-step-progress {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.task-activity-item {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

.task-activity-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.task-activity-time {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.task-activity-text {
    font-size: 13px;
    color: #374151;
}

@media (max-width: 768px) {
    .task-sidebar-panel {
        width: 100%;
    }
}
