/**
 * 4What Digital - Dashboard Styles
 * Extends the main styles.css with dashboard-specific components
 */

/* ============================================
   DASHBOARD CURSOR FIX
   Override the custom cursor from main styles
   ============================================ */
html:has(body.dashboard-body),
html:has(body.dashboard-body) *,
body.dashboard-body {
    cursor: auto !important;
    overflow-x: hidden;
}

/* Force normal cursor on ALL elements in dashboard */
body.dashboard-body,
body.dashboard-body *,
body.dashboard-body *::before,
body.dashboard-body *::after {
    cursor: auto !important;
}

/* Override any inline styles or late-loaded cursor settings */
.dashboard-body * {
    cursor: inherit !important;
}

.dashboard-body {
    cursor: default !important;
}

/* Pointer cursor for interactive elements */
body.dashboard-body a,
body.dashboard-body button,
body.dashboard-body select,
body.dashboard-body input[type="submit"],
body.dashboard-body input[type="button"],
body.dashboard-body input[type="checkbox"],
body.dashboard-body input[type="radio"],
body.dashboard-body .action-btn,
body.dashboard-body .sidebar-link,
body.dashboard-body .filter-tab,
body.dashboard-body .project-card,
body.dashboard-body .task-item,
body.dashboard-body .task-checkbox,
body.dashboard-body .sidebar-logout,
body.dashboard-body .btn,
body.dashboard-body .mobile-menu-btn,
body.dashboard-body [role="button"],
body.dashboard-body label {
    cursor: pointer !important;
}

/* Text cursor for text inputs */
body.dashboard-body input[type="text"],
body.dashboard-body input[type="email"],
body.dashboard-body input[type="password"],
body.dashboard-body input[type="search"],
body.dashboard-body input[type="date"],
body.dashboard-body textarea {
    cursor: text !important;
}

/* Hide custom cursor elements if they exist */
body.dashboard-body .cursor-dot,
body.dashboard-body .cursor-outline {
    display: none !important;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* ============================================
   SIDEBAR
   ============================================ */
.dashboard-sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 1px solid var(--glass-border);
    border-radius: 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--brand-red);
    letter-spacing: 0.1em;
    margin-left: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Manrope', sans-serif;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
    border-left: 2px solid var(--brand-red);
    margin-left: -2px;
}

.sidebar-link svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.sidebar-link.active svg,
.sidebar-link:hover svg {
    opacity: 1;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Syncopate', sans-serif;
    font-size: 0.625rem;
    font-weight: 700;
    color: white;
}

.user-avatar.small {
    width: 28px;
    height: 28px;
    font-size: 0.5rem;
}

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

.user-name {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.user-role {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    color: var(--text-muted);
}

.sidebar-logout {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-logout:hover {
    color: var(--brand-red);
}

/* ============================================
   MOBILE HEADER
   ============================================ */
.dashboard-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 101;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.2s;
}

.mobile-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    flex: 1;
}

.header-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--brand-red);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    display: block;
}

.dashboard-header h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 0.25rem;
}

.header-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.header-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.header-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
}

/* ============================================
   STATS CARDS
   ============================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-stats.four-col {
    grid-template-columns: repeat(4, 1fr);
}

.stat-card {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-card.compact {
    padding: 1rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.orange { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.stat-icon.green { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); }
.stat-icon.red { background: rgba(190, 30, 45, 0.1); color: var(--brand-red); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.green { color: var(--accent-green); }
.stat-value.orange { color: var(--accent-orange); }
.stat-value.red { color: var(--brand-red); }

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-change {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    margin-top: auto;
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--brand-red); }
.stat-change.neutral { color: var(--text-muted); }

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.dashboard-card {
    padding: 1.5rem;
}

.dashboard-card.span-2 {
    grid-column: span 2;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--brand-red);
    letter-spacing: 0.05em;
}

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

.card-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
}

.card-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* ============================================
   TASK LIST
   ============================================ */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    transition: background 0.2s;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.task-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-status.pending { background: var(--accent-orange); }
.task-status.in-progress { background: var(--accent-blue); }
.task-status.completed { background: var(--accent-green); }

.task-info {
    flex: 1;
    min-width: 0;
}

.task-title {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.task-priority {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.task-priority.high { background: rgba(190, 30, 45, 0.1); color: var(--brand-red); }
.task-priority.medium { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.task-priority.low { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* ============================================
   CHART PLACEHOLDER
   ============================================ */
.chart-placeholder {
    padding: 1rem 0;
}

.chart-placeholder.large {
    min-height: 200px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 150px;
    padding: 0 1rem;
}

.chart-bars.dual {
    gap: 1.5rem;
}

.chart-bar {
    width: 40px;
    background: linear-gradient(to top, var(--brand-red), rgba(190, 30, 45, 0.3));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: all 0.3s;
}

.chart-bar:hover {
    filter: brightness(1.2);
}

.chart-bar.active {
    background: linear-gradient(to top, var(--brand-red), rgba(190, 30, 45, 0.6));
    box-shadow: 0 0 20px rgba(190, 30, 45, 0.3);
}

.chart-bar span {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.chart-bar-group {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    position: relative;
}

.chart-bar-group span {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.chart-bar.revenue {
    width: 20px;
    background: linear-gradient(to top, var(--accent-green), rgba(34, 197, 94, 0.3));
}

.chart-bar.expense {
    width: 20px;
    background: linear-gradient(to top, var(--brand-red), rgba(190, 30, 45, 0.3));
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.green { background: var(--accent-green); }
.legend-dot.red { background: var(--brand-red); }
.legend-dot.blue { background: var(--accent-blue); }

.chart-note {
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2rem;
}

.chart-line {
    height: 120px;
    padding: 1rem;
}

.chart-line svg {
    width: 100%;
    height: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    margin-top: 0.5rem;
}

.chart-labels span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ============================================
   CONTENT QUEUE
   ============================================ */
.content-queue,
.invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item,
.invoice-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.queue-type {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--brand-red);
    background: rgba(190, 30, 45, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.queue-info,
.invoice-info {
    flex: 1;
}

.queue-title,
.invoice-number {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.queue-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.queue-status.awaiting { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.queue-status.approved { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); }
.queue-status.generating { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }

.invoice-client {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.invoice-amount {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.invoice-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.invoice-status.paid { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); }
.invoice-status.pending { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.invoice-status.overdue { background: rgba(190, 30, 45, 0.1); color: var(--brand-red); }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 0.25rem;
}

.filter-tabs.small {
    gap: 0.125rem;
}

.filter-tab {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.filter-tabs.small .filter-tab {
    padding: 0.35rem 0.75rem;
    font-size: 0.6rem;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.filter-tab.active {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
}

.filter-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.filter-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    width: 180px;
}

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

.filter-search input:focus {
    outline: none;
}

/* ============================================
   PROJECTS GRID
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card.add-new {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    border: 2px dashed var(--glass-border);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.project-card.add-new:hover {
    border-color: var(--brand-red);
    background: rgba(190, 30, 45, 0.05);
}

.add-new-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.add-new-content svg {
    opacity: 0.5;
}

.add-new-content span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

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

.project-client {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.project-status.active { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); }
.project-status.completed { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.project-status.on-hold { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.project-description {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.project-progress {
    margin-top: 0.5rem;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brand-red);
    border-radius: 2px;
    transition: width 0.3s;
}

.progress-fill.complete {
    background: var(--accent-green);
}

.progress-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    display: block;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.project-tasks {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.project-due {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--brand-red);
}

.project-due.completed {
    color: var(--accent-green);
}

.project-due.on-hold {
    color: var(--accent-orange);
}

/* ============================================
   EXPENSE & SOURCE LISTS
   ============================================ */
.expense-list,
.source-list,
.page-list,
.device-list,
.client-revenue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.expense-item,
.source-item,
.page-item,
.device-item,
.client-revenue-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.expense-info,
.source-info {
    flex: 1;
}

.expense-category,
.source-name {
    display: block;
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.expense-bar,
.source-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.expense-fill,
.source-fill {
    height: 100%;
    background: var(--brand-red);
    border-radius: 2px;
}

.expense-amount,
.source-percent {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: right;
}

.page-item {
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.page-path {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.page-views {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.device-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.device-item svg {
    color: var(--text-muted);
}

.device-name {
    flex: 1;
    font-size: 0.85rem;
}

.device-percent {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
    color: var(--brand-red);
}

.client-revenue-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.client-name {
    flex: 1;
    font-size: 0.85rem;
}

.client-amount {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-right: 1rem;
}

.client-percent {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 35px;
    text-align: right;
}

/* ============================================
   INVOICE TABLE
   ============================================ */
.invoice-table {
    display: flex;
    flex-direction: column;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr 1fr 0.8fr 0.8fr;
    gap: 1rem;
    padding: 0.75rem 0;
    align-items: center;
}

.table-header {
    border-bottom: 1px solid var(--glass-border);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
}

.table-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.col-invoice strong {
    color: var(--text-primary);
}

.col-client {
    color: var(--text-secondary);
}

.col-amount {
    font-family: 'Syncopate', sans-serif;
    font-weight: 700;
}

.col-date,
.col-due {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.status-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-badge.paid { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); }
.status-badge.pending { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.status-badge.overdue { background: rgba(190, 30, 45, 0.1); color: var(--brand-red); }

.col-actions {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    background: none;
    border: none;
    padding: 0.35rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.action-btn.warning:hover {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
}

.action-btn.approve:hover {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.action-btn.edit:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

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

/* ============================================
   AI CONTENT PAGE
   ============================================ */
.ai-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.ai-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ai-status-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-status-value {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.ai-status-value.active {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-green);
}

.content-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--brand-red);
}

.form-textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    min-height: 100px;
    resize: vertical;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--brand-red);
}

.form-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-red);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.review-log {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.review-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 2px solid transparent;
}

.review-item.improvement {
    border-left-color: var(--accent-green);
}

.review-item.hallucination {
    border-left-color: var(--accent-orange);
}

.review-icon {
    flex-shrink: 0;
}

.review-item.improvement .review-icon {
    color: var(--accent-green);
}

.review-item.hallucination .review-icon {
    color: var(--accent-orange);
}

.review-content {
    flex: 1;
}

.review-type {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.review-item.improvement .review-type {
    color: var(--accent-green);
}

.review-item.hallucination .review-type {
    color: var(--accent-orange);
}

.review-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.review-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.content-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.content-type {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.content-type.blog { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.content-type.ad { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.content-type.web { background: rgba(190, 30, 45, 0.1); color: var(--brand-red); }

.content-info {
    flex: 1;
    min-width: 0;
}

.content-title {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-client {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.content-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.content-date,
.content-words {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.content-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.content-status.awaiting { background: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.content-status.approved { background: rgba(34, 197, 94, 0.1); color: var(--accent-green); }
.content-status.generating {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.generating-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.content-actions {
    display: flex;
    gap: 0.25rem;
}

.performance-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    text-align: center;
}

.metric-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.green {
    color: var(--accent-green);
}

.metric-period {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ============================================
   STATUS DOT
   ============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .dashboard-card.span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    .dashboard-mobile-header {
        display: flex;
    }

    .dashboard-main {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(60px + 1rem);
    }

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

    .dashboard-stats.four-col {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .filter-search {
        width: 100%;
    }

    .filter-search input {
        width: 100%;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .col-date,
    .col-due,
    .col-client,
    .col-actions {
        display: none;
    }

    .ai-status-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .ai-status-item {
        flex: 1 1 45%;
    }

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

    .content-item {
        flex-wrap: wrap;
    }

    .content-meta {
        order: 5;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--glass-border);
    }

    .content-actions {
        order: 4;
    }

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

@media (max-width: 480px) {
    .dashboard-stats.four-col {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   PROJECT DETAIL PAGE
   ============================================ */
.breadcrumb {
    margin-bottom: 1rem;
}

.breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--brand-red);
}

.project-detail-header {
    align-items: flex-start;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-direction: row;
}

.project-status-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.project-status-badge.completed {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.project-status-badge.on-hold {
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
}

/* Project Stats Row */
.project-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.project-stat .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.project-stat .stat-icon.completed {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.project-stat .stat-icon.in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.project-stat .stat-icon.due {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
}

.project-stat .stat-value {
    font-size: 1.25rem;
}

/* Progress Section */
.project-progress-section {
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.progress-percentage {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-red);
}

.progress-bar.large {
    height: 8px;
    border-radius: 4px;
}

/* Tasks Section */
.tasks-section {
    margin-top: 2rem;
}

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

.section-header h2 {
    font-size: 1.25rem;
}

.filter-bar.compact {
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tasks-list .task-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.tasks-list .task-item:hover {
    transform: translateX(4px);
}

.tasks-list .task-item.completed {
    opacity: 0.6;
}

.tasks-list .task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.tasks-list .task-item.in-progress {
    border-left: 3px solid var(--accent-blue);
}

/* Task Checkbox */
.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--glass-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: var(--brand-red);
    background: rgba(190, 30, 45, 0.1);
}

.task-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.checkbox-inner {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: transparent;
    transition: background 0.2s;
}

.task-checkbox:hover .checkbox-inner {
    background: rgba(190, 30, 45, 0.3);
}

/* Task Content */
.tasks-list .task-content {
    flex: 1;
    min-width: 0;
}

.tasks-list .task-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tasks-list .task-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.task-assignee.unassigned {
    color: var(--text-muted);
}

.assignee-avatar {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    font-weight: 600;
    color: white;
}

.task-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.task-date.in-progress {
    color: var(--accent-blue);
}

.task-status-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.task-status-badge.in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.tasks-list .task-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.tasks-list .task-item:hover .task-actions {
    opacity: 1;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 480px;
    margin: 1rem;
    padding: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

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

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-form .form-group label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.modal-form input,
.modal-form select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    border-radius: 4px;
}

.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--brand-red);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* ============================================
   NOTIFICATION
   ============================================ */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-green);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================
   PROJECT DETAIL RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .project-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   FINANCE PAGE SPECIFIC
   ============================================ */
.fixed-costs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.fixed-costs-header h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.fixed-costs-total {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-red);
}

.fixed-costs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fixed-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.cost-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cost-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* Contractor Table */
.contractor-table {
    display: flex;
    flex-direction: column;
}

.contractor-header {
    display: grid;
    grid-template-columns: 1fr 0.5fr 0.7fr;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contractor-row {
    display: grid;
    grid-template-columns: 1fr 0.5fr 0.7fr;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.8rem;
}

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

.contractor-row.total {
    border-top: 1px solid var(--glass-border);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-weight: 600;
}

.contractor-name {
    color: var(--text-secondary);
}

.contractor-hours {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.contractor-cost {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
    text-align: right;
}

.contractor-row.total .contractor-name {
    color: var(--text-primary);
}

.contractor-row.total .contractor-cost {
    color: var(--brand-red);
    font-weight: 700;
}

/* Enhanced Contractor Table with Edit */
.contractor-header,
.contractor-row {
    grid-template-columns: 1fr 0.5fr 0.7fr auto;
}

.contractor-row .action-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.contractor-row:hover .action-btn {
    opacity: 1;
}

/* Fixed Cost Item with Actions */
.fixed-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.cost-actions .action-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.fixed-cost-item:hover .action-btn {
    opacity: 1;
}

/* ============================================
   XERO INTEGRATION STYLES
   ============================================ */
.xero-panel {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.xero-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.xero-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

.xero-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.xero-status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.xero-status-text.connected {
    color: var(--accent-green);
}

.xero-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.xero-last-sync {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Xero Summary Cards */
.xero-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.summary-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-value.green {
    color: var(--accent-green);
}

.summary-value.orange {
    color: var(--accent-orange);
}

/* Xero List Items */
.xero-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.xero-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.xero-contact {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xero-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.xero-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.xero-status.paid,
.xero-status.authorised {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.xero-status.pending,
.xero-status.submitted {
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
}

.xero-status.overdue {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
}

/* Reconciliation Panel */
.reconciliation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.reconciliation-item {
    text-align: center;
}

.reconciliation-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.reconciliation-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.reconciliation-value.green {
    color: var(--accent-green);
}

.reconciliation-value.orange {
    color: var(--accent-orange);
}

/* Button Variants */
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
}

.btn-danger {
    background: rgba(190, 30, 45, 0.2);
    color: var(--brand-red);
    border: 1px solid var(--brand-red);
}

.btn-danger:hover {
    background: var(--brand-red);
    color: white;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Toast Error State */
.notification.error {
    background: var(--brand-red);
}

@media (max-width: 768px) {
    .project-detail-header {
        flex-direction: column;
        gap: 1rem;
    }

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

    .project-stats-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header .btn {
        width: 100%;
    }

    .tasks-list .task-item {
        flex-wrap: wrap;
    }

    .tasks-list .task-actions {
        opacity: 1;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--glass-border);
    }

    .task-status-badge {
        order: -1;
        margin-left: auto;
    }

    .modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ============================================
   AI CONTENT PAGE STYLES
   ============================================ */

/* AI Status Bar */
.ai-status-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.ai-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ai-status-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-status-value {
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.ai-status-value.active {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-green);
}

.ai-status-value .status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Content Form */
.content-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-select,
.form-input,
.form-textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-red);
    background: rgba(255, 255, 255, 0.05);
}

.form-select option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
}

/* Review Log */
.review-log {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.review-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.review-item.improvement {
    border-left-color: var(--accent-green);
}

.review-item.hallucination {
    border-left-color: var(--accent-orange);
}

.review-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-item.improvement .review-icon {
    color: var(--accent-green);
}

.review-item.hallucination .review-icon {
    color: var(--accent-orange);
}

.review-content {
    flex: 1;
    min-width: 0;
}

.review-type {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.review-item.improvement .review-type {
    color: var(--accent-green);
}

.review-item.hallucination .review-type {
    color: var(--accent-orange);
}

.review-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.review-time {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Content List */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.content-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    transition: all 0.2s;
}

.content-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.content-type {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.content-type.blog-post,
.content-type.blog {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.content-type.ad-copy,
.content-type.ad {
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
}

.content-type.social-media,
.content-type.social {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.content-type.email {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.content-type.web-copy,
.content-type.web {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
}

.content-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.content-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-client {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.content-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}

.content-date,
.content-words {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-align: right;
}

.content-status {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-status.awaiting {
    background: rgba(249, 115, 22, 0.1);
    color: var(--accent-orange);
}

.content-status.approved {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
}

.content-status.generating {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.content-status.needs_attention {
    background: rgba(190, 30, 45, 0.1);
    color: var(--brand-red);
}

.generating-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.content-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Performance Metrics */
.performance-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.metric-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.green {
    color: var(--accent-green);
}

.metric-period {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* Preview Modal Styles */
.modal.large {
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.large .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.5rem;
}

.modal.large .modal-footer {
    flex-shrink: 0;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.preview-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.preview-meta span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

.preview-content {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.preview-content h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.preview-content h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 1rem 0 0.5rem;
}

.preview-content h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0.5rem;
}

.preview-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.preview-content ul,
.preview-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.preview-content li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

.preview-content strong {
    color: var(--text-primary);
}

.preview-review {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.review-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.review-summary strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.review-issues ul,
.review-suggestions ul {
    margin-left: 1rem;
    margin-bottom: 1rem;
}

.review-issues li {
    color: var(--accent-orange);
}

.review-suggestions li {
    color: var(--accent-blue);
}

.review-approved {
    color: var(--accent-green);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

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

@media (max-width: 768px) {
    .ai-status-bar {
        gap: 1rem;
    }

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

    .content-item {
        flex-wrap: wrap;
    }

    .content-info {
        flex: 1 1 100%;
        order: 1;
    }

    .content-type {
        order: 0;
    }

    .content-meta {
        flex-direction: row;
        gap: 1rem;
        order: 2;
    }

    .content-status {
        order: 3;
    }

    .content-actions {
        order: 4;
        margin-left: auto;
    }

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

/* ============================================
   FINANCE PAGE - DRAFT MODE & NEW COMPONENTS
   ============================================ */

/* Draft Banner */
.draft-banner {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.draft-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.draft-info svg {
    color: #ffc107;
}

.draft-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffc107;
    letter-spacing: 0.1em;
}

.draft-changes {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.draft-actions {
    display: flex;
    gap: 0.75rem;
}

/* Client List */
.client-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
}

.client-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem;
    align-items: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.client-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.client-row .client-name {
    font-weight: 500;
}

.client-row .client-cost,
.client-row .client-invoice {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.client-row .client-profit {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.client-row .client-profit.positive {
    color: var(--success);
}

.client-row .client-profit.negative {
    color: var(--error);
}

.client-actions {
    display: flex;
    gap: 0.25rem;
}

.action-btn.delete {
    color: var(--text-secondary);
}

.action-btn.delete:hover {
    color: var(--error);
}

/* Allocation Grid */
.allocation-table-wrapper {
    overflow-x: auto;
    margin: -0.5rem;
    padding: 0.5rem;
}

.allocation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.allocation-table th,
.allocation-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.allocation-table th {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

.allocation-table .sub-header th {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.1);
}

.allocation-table .sticky-col {
    position: sticky;
    left: 0;
    background: var(--dark-bg);
    z-index: 1;
}

.allocation-table .internal-col {
    background: rgba(138, 43, 226, 0.05);
    color: var(--text-secondary);
}

.allocation-table td.editable {
    cursor: pointer;
    transition: background 0.2s;
}

.allocation-table td.editable:hover {
    background: rgba(138, 43, 226, 0.1);
}

.allocation-table .totals-row {
    background: rgba(255, 255, 255, 0.02);
}

.allocation-table .totals-row td {
    border-top: 2px solid var(--glass-border);
    font-weight: 600;
}

.allocation-table .contractor-name {
    font-weight: 500;
}

/* Client Profitability Chart */
.profitability-bars {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profitability-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profitability-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profitability-label .client-name {
    font-weight: 500;
}

.profitability-label .profit-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.profitability-label .profit-value.positive {
    color: var(--success);
}

.profitability-label .profit-value.negative {
    color: var(--error);
}

.profitability-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bar-label {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    width: 50px;
    text-transform: uppercase;
}

.bar {
    height: 8px;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bar.cost-bar {
    background: linear-gradient(90deg, #ef5350, #f44336);
}

.bar.invoice-bar {
    background: linear-gradient(90deg, #66bb6a, #4caf50);
}

.bar-value {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 70px;
}

/* Allocation Context in Modal */
.allocation-context {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
}

.allocation-context .context-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.allocation-context .context-value {
    font-weight: 600;
    color: var(--accent);
}

/* Form Row for Period Creation */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Header Right Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Contractor Table */
.contractor-table {
    display: flex;
    flex-direction: column;
}

.contractor-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}

.contractor-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem;
    align-items: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.contractor-row:hover:not(.total) {
    background: rgba(255, 255, 255, 0.02);
}

.contractor-row.total {
    border-top: 1px solid var(--glass-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-weight: 600;
}

.contractor-name {
    font-weight: 500;
}

.contractor-hours,
.contractor-cost {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Fixed Costs Header */
.fixed-costs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.fixed-costs-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.fixed-costs-total {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: 600;
}

.fixed-costs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fixed-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.cost-name {
    font-size: 0.9rem;
}

.cost-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cost-amount {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Finance Page Responsive */
@media (max-width: 768px) {
    .draft-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .draft-info {
        flex-wrap: wrap;
        justify-content: center;
    }

    .client-list-header,
    .client-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem;
    }

    .client-list-header span:nth-child(n+4),
    .client-row .client-profit,
    .client-row .client-actions {
        grid-column: span 1;
    }

    .allocation-table {
        font-size: 0.75rem;
    }

    .allocation-table th,
    .allocation-table td {
        padding: 0.35rem 0.5rem;
    }

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

    .profitability-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ============================================
   PERIOD NAVIGATION
   ============================================ */

.period-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.period-nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

.period-nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.period-selector-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.period-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    min-width: 150px;
}

.period-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 2px;
}

.period-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.period-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.period-tab.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.period-tab.active:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.period-tab.overview-tab {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.period-tab.overview-tab.active {
    background: linear-gradient(135deg, var(--accent-blue), #8b5cf6);
    border-color: transparent;
}

.period-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Period tab scrolling indicators */
.period-tabs::-webkit-scrollbar {
    height: 4px;
}

.period-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.period-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Mobile period navigation */
@media (max-width: 768px) {
    .period-navigation {
        flex-direction: column;
        align-items: stretch;
    }

    .period-nav-left {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid var(--glass-border);
    }

    .period-nav-right {
        justify-content: space-between;
    }

    .period-selector {
        flex: 1;
    }

    .period-tab {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }
}

/* ============================================
   OVERVIEW MODE STYLES
   ============================================ */

/* Overview periods table */
.overview-periods-table {
    width: 100%;
}

.overview-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.75fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.overview-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.75fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s ease;
}

.overview-row.clickable {
    cursor: pointer;
}

.overview-row.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.overview-row.total {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.period-name {
    font-weight: 500;
}

.period-profit.positive,
.client-profit.positive {
    color: var(--success-color, #10b981);
}

.period-profit.negative,
.client-profit.negative {
    color: var(--danger-color, #ef4444);
}

.overview-hint {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Overview client summary */
.overview-client-summary {
    width: 100%;
}

.client-summary-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.75fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.client-summary-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.75fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.client-summary-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

/* Overview message */
.overview-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Period selector styling for Overview */
#period-selector option[data-type="overview"] {
    font-weight: 600;
    background-color: rgba(59, 130, 246, 0.1);
}

#period-selector option[data-type="template"] {
    color: var(--text-muted);
    font-style: italic;
}

/* Refresh overview button */
#refresh-overview-btn {
    margin-left: 0.5rem;
}

/* Responsive adjustments for Overview */
@media (max-width: 768px) {
    .overview-header,
    .overview-row,
    .client-summary-header,
    .client-summary-row {
        grid-template-columns: 1fr 1fr;
        font-size: 0.85rem;
    }

    .overview-header span:nth-child(n+4),
    .overview-row span:nth-child(n+4),
    .client-summary-header span:nth-child(n+4),
    .client-summary-row span:nth-child(n+4) {
        display: none;
    }
}

/* ============================================
   OVERVIEW MODE DEDICATED CONTENT
   ============================================ */

/* Overview content container */
.overview-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Overview grid for side-by-side panels */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

/* Cost Distribution Component */
.cost-distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.distribution-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.distribution-label {
    font-weight: 500;
    color: var(--text-primary);
}

.distribution-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.distribution-bar {
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

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

.distribution-fill.contractor {
    background: linear-gradient(90deg, var(--brand-red), rgba(190, 30, 45, 0.7));
}

.distribution-fill.fixed {
    background: linear-gradient(90deg, #3b82f6, rgba(59, 130, 246, 0.7));
}

.distribution-pct {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}

.cost-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 0.5rem;
}

.cost-total-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.cost-total-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Client Performance Component */
.client-performance-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.client-perf-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.75fr;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.client-perf-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 0.75fr;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    align-items: center;
    font-size: 0.9rem;
}

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

.client-perf-row.total {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    border-radius: 0 0 8px 8px;
}

.client-perf-row .col-client {
    font-weight: 500;
    color: var(--text-primary);
}

.client-perf-row .col-revenue {
    color: #10b981;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

.client-perf-row .col-costs {
    color: var(--brand-red);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

.client-perf-row .col-profit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.client-perf-row .col-profit.positive {
    color: #10b981;
}

.client-perf-row .col-profit.negative {
    color: var(--brand-red);
}

.client-perf-row .col-margin {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.client-perf-row .col-margin.good {
    color: #10b981;
}

.client-perf-row .col-margin.okay {
    color: #f59e0b;
}

.client-perf-row .col-margin.bad {
    color: var(--brand-red);
}

/* Responsive Client Performance */
@media (max-width: 768px) {
    .client-perf-header,
    .client-perf-row {
        grid-template-columns: 1.5fr 1fr 1fr;
        font-size: 0.8rem;
    }

    .client-perf-header .col-costs,
    .client-perf-header .col-margin,
    .client-perf-row .col-costs,
    .client-perf-row .col-margin {
        display: none;
    }
}
