/* Page-specific styles */

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    padding: var(--space-md);
}

.login-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.login-logo img {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
}

.login-logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
}

.login-logo p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
}

/* Dashboard */
.project-link {
    color: var(--color-primary);
    font-weight: 500;
}

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

.db-hero {
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-xl);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.db-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    flex-wrap: wrap;
}

.db-hero-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.db-hero-left .user-avatar,
.db-hero-left .user-avatar-photo {
    flex-shrink: 0;
}

.db-hero-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-hero-greeting {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

.db-hero-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.db-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.db-hero-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.15s ease;
    text-decoration: none;
    letter-spacing: -0.005em;
    cursor: pointer;
    line-height: 1;
}

.db-hero-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-hero-action-primary {
    background: var(--color-primary);
    color: white;
    border: 1px solid var(--color-primary);
    box-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);
}

.db-hero-action-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.db-hero-action-primary:active {
    box-shadow: 0 0 0 rgba(99, 102, 241, 0.1);
}

.db-hero-action-outline {
    background: var(--color-white);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.db-hero-action-outline:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

.db-hero-action-outline:active {
    background: var(--color-border-light);
}

.db-hero-alert {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--color-danger-bg);
    border: 1px solid #F5C6CB;
    border-radius: 20px;
    color: var(--color-danger);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.db-summary-strip {
    display: flex;
    align-items: center;
    padding: 0 var(--space-xl);
    height: 48px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border-light);
    gap: var(--space-lg);
    overflow-x: auto;
}

.db-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.db-summary-num {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.db-summary-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}

.db-summary-sep {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    flex-shrink: 0;
}

.db-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.db-kpi {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--color-text);
    transition: box-shadow var(--transition), transform var(--transition);
    position: relative;
    overflow: hidden;
}

.db-kpi::before {
    display: none;
}

.db-kpi:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.db-kpi-blue::before   { background: #3B82F6; }
.db-kpi-amber::before  { background: #F59E0B; }
.db-kpi-red::before    { background: #EF4444; }
.db-kpi-green::before  { background: #22C55E; }
.db-kpi-slate::before  { background: #94A3B8; }
.db-kpi-purple::before { background: #8B5CF6; }

.db-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.db-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.db-kpi-blue  .db-kpi-icon,
.db-kpi-amber .db-kpi-icon,
.db-kpi-red   .db-kpi-icon,
.db-kpi-green .db-kpi-icon,
.db-kpi-slate .db-kpi-icon,
.db-kpi-purple .db-kpi-icon { background: var(--color-bg); color: var(--color-text-muted); }

.db-kpi-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-radius: 10px;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.db-kpi-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.db-kpi-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.db-kpi-desc {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-bottom: var(--space-md);
}

.db-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.db-pill {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 2px 10px;
}

.db-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) 0;
    color: var(--color-text-muted);
}

.db-empty-state p {
    font-size: var(--font-size-sm);
}

.db-status-layout {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.db-status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.db-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-bar-head {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    flex-shrink: 0;
}

.db-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.db-bar-name {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.db-bar-track {
    flex: 1;
    height: 6px;
    background: var(--color-border-light);
    border-radius: 3px;
    overflow: hidden;
}

.db-bar-fill {
    height: 100%;
    border-radius: 3px;
    min-width: 3px;
    transition: width 0.4s ease;
}

.db-bar-val {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text);
    min-width: 22px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.db-bar-pct {
    font-size: 10px;
    color: var(--color-text-muted);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.db-donut-wrap {
    position: relative;
    flex-shrink: 0;
    width: 148px;
    height: 148px;
}

.db-donut {
    width: 148px;
    height: 148px;
    transform: rotate(-90deg);
}

.db-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-donut-num {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.db-donut-text {
    font-size: 10px;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-chart-svg {
    display: block;
    width: 100%;
    overflow: visible;
}

.db-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

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

.db-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.db-cat-num {
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.db-cat-track {
    height: 4px;
    background: var(--color-border-light);
    border-radius: 2px;
    overflow: hidden;
}

.db-cat-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    min-width: 4px;
}

.db-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.db-count-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--color-primary);
    color: white;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
}

.db-proj-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.db-proj-id {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
    text-decoration: none;
}

.db-proj-id:hover {
    text-decoration: underline;
}

.db-proj-name {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-weight: 500;
}

.db-badge-sm {
    font-size: 10px;
    padding: 1px 6px;
}

.db-row-link {
    cursor: pointer;
}

.db-row-link:hover td {
    background: #F8FAFD;
}

.db-due-cell {
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.db-due-overdue {
    color: var(--color-danger);
    font-weight: 600;
}

.db-due-soon {
    color: var(--color-warning);
}

.db-due-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.db-due-tag-red {
    background: #FEF2F2;
    color: #DC2626;
}

.db-due-tag-amber {
    background: #FFFBEB;
    color: #D97706;
}

@media (max-width: 1100px) {
    .db-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .db-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .db-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    .db-grid-2 {
        grid-template-columns: 1fr;
    }
    .db-hero-content {
        padding: var(--space-md) var(--space-lg);
    }
    .db-hero-greeting {
        font-size: var(--font-size-lg);
    }
    .db-summary-strip {
        padding: 0 var(--space-lg);
        gap: var(--space-md);
    }
    .db-cat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .db-status-layout {
        flex-direction: column;
        gap: var(--space-lg);
    }
    .db-donut-wrap,
    .db-donut {
        width: 130px;
        height: 130px;
    }
}

@media (max-width: 480px) {
    .db-kpi-grid {
        grid-template-columns: 1fr;
    }
    .db-cal {
        max-width: 100%;
    }
    .db-cat-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes dbFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes dbStrokeDraw {
    from { stroke-dasharray: 0 100; }
}

@keyframes dbBarGrow {
    from { opacity: 0; transform: scaleY(0); }
}

@keyframes dbWidthGrow {
    from { transform: scaleX(0); }
}

.db-hero {
    animation: dbFadeUp 0.3s ease-out both;
}

.db-kpi-grid .db-kpi {
    animation: dbFadeUp 0.35s ease-out both;
}

.db-kpi-grid .db-kpi:nth-child(2) { animation-delay: 0.06s; }
.db-kpi-grid .db-kpi:nth-child(3) { animation-delay: 0.12s; }
.db-kpi-grid .db-kpi:nth-child(4) { animation-delay: 0.18s; }

.db-donut circle {
    animation: dbStrokeDraw 0.7s ease-out both;
}

.db-donut circle:nth-child(2) { animation-delay: 0.08s; }
.db-donut circle:nth-child(3) { animation-delay: 0.16s; }
.db-donut circle:nth-child(4) { animation-delay: 0.24s; }
.db-donut circle:nth-child(5) { animation-delay: 0.32s; }

.db-chart-svg rect {
    animation: dbBarGrow 0.5s ease-out both;
    transform-box: fill-box;
    transform-origin: bottom center;
}

.db-status-layout .db-bar-fill {
    animation: dbWidthGrow 0.6s ease-out both;
    transform-origin: left center;
}

.db-cat-grid .db-cat-fill {
    animation: dbWidthGrow 0.5s ease-out 0.2s both;
    transform-origin: left center;
}

.db-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
}

.db-trend-up {
    background: #F0FDF4;
    color: #16A34A;
}

.db-trend-down {
    background: #FEF2F2;
    color: #DC2626;
}

.db-action-center {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.db-action-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    border: 1px solid;
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: box-shadow var(--transition), transform var(--transition);
    flex: 1;
    min-width: 180px;
}

.db-action-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.db-action-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-action-icon svg {
    width: 16px;
    height: 16px;
}

.db-action-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.db-action-count {
    font-weight: 700;
    font-size: var(--font-size-md);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.db-action-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    opacity: 0.8;
}

.db-action-chevron {
    flex-shrink: 0;
    opacity: 0.4;
}

.db-action-chevron svg {
    width: 16px;
    height: 16px;
}


.db-action-warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.db-action-warning .db-action-icon {
    background: #FEF3C7;
    color: #D97706;
}

.db-action-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

.db-action-info .db-action-icon {
    background: #DBEAFE;
    color: #2563EB;
}

.db-activity-list {
    display: flex;
    flex-direction: column;
}

.db-activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-light);
}

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

.db-activity-item:hover .db-activity-text strong {
    text-decoration: underline;
}

.db-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.db-activity-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.db-activity-text {
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.db-activity-text strong {
    font-weight: 600;
    color: var(--color-primary);
    margin-right: 4px;
}

.db-activity-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

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

.db-range-toggle {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.db-range-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: var(--color-white);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
}

.db-range-btn:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.db-range-btn.active {
    background: var(--color-primary);
    color: white;
}

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

.db-volume-body {
    padding-bottom: var(--space-sm);
}

.db-volume-chart {
    width: 100%;
}

.db-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.db-export-btn:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-text-muted);
}

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

@media (prefers-reduced-motion: reduce) {
    .db-kpi-grid .db-kpi,
    .db-hero,
    .db-donut circle,
    .db-chart-svg rect,
    .db-status-layout .db-bar-fill,
    .db-cat-grid .db-cat-fill {
        animation: none;
    }
}

@media (max-width: 480px) {
    .db-action-center {
        flex-direction: column;
    }
    .db-action-item {
        min-width: 0;
    }
}

/* Announcements */
.db-postit-section {
    margin-bottom: var(--space-lg);
}

.db-ann-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.db-ann-card {
    position: relative;
    display: flex;
    align-items: stretch;
    background: var(--ann-bg, #FFFBEB);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    color: var(--ann-text, #78350F);
}

.db-ann-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.db-ann-accent-bar {
    width: 4px;
    flex-shrink: 0;
    background: var(--ann-accent, #F59E0B);
}

.db-ann-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-md) var(--space-md) var(--space-sm) var(--space-md);
    gap: var(--space-xs);
    min-width: 0;
}

.db-ann-content {
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.55;
    flex: 1;
    word-break: break-word;
}

.db-ann-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.db-ann-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    margin-top: 4px;
}

.db-ann-meta {
    font-size: 10px;
    opacity: 0.55;
    font-weight: 500;
}

.db-ann-expiry {
    font-size: 10px;
    opacity: 0.45;
    font-style: italic;
}

.db-ann-delete-form {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
}

.db-ann-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    color: inherit;
    transition: opacity 0.2s, background 0.2s;
}

.db-ann-card:hover .db-ann-close {
    opacity: 1;
}

.db-ann-close:hover {
    background: rgba(0,0,0,0.14);
    opacity: 1;
}

.db-postit-form-wrap {
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

.db-postit-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.db-postit-form-top {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.db-postit-input {
    width: 100%;
    height: 36px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-family: inherit;
    background: var(--color-white);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition);
}

.db-postit-input:focus {
    border-color: var(--color-primary);
}

.db-postit-form-opts {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.db-postit-colors {
    display: flex;
    align-items: center;
    gap: 4px;
}

.db-postit-color-opt {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    outline: 2px solid transparent;
    outline-offset: 1px;
    transition: outline-color 0.15s, transform 0.15s;
}

.db-postit-color-opt input {
    display: none;
}

.db-postit-color-opt:hover {
    transform: scale(1.15);
}

.db-postit-color-opt.active {
    outline-color: var(--swatch-accent, var(--color-text));
    transform: scale(1.1);
}

.db-postit-expires {
    height: 28px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-family: inherit;
    background: var(--color-white);
    color: var(--color-text);
    outline: none;
}

.db-postit-form-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.db-postit-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px var(--space-md);
    background: none;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    align-self: flex-start;
}

.db-postit-add-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* Volume Summary Stats */
.db-vol-stats {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    gap: var(--space-lg);
}

.db-vol-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.db-vol-stat-val {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.db-vol-stat-lbl {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Hero Meta Row */
.db-hero-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.db-hero-role-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 12px 5px 8px;
    border-radius: 20px;
    background-color: var(--role-accent, #64748B);
    border: 1px solid var(--role-border, #64748B);
    color: white;
    cursor: default;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.db-role-entering {
    opacity: 0;
}

.db-hero-role-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--role-shadow, rgba(0,0,0,0.08));
}

.db-hero-role-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--role-shimmer, rgba(255,255,255,0.25)), transparent);
    animation: dbRoleShimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dbRoleShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.db-role-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke-width: 2.5;
}

.db-role-text {
    position: relative;
    z-index: 1;
}

.db-role-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.db-role-admin:hover .db-role-icon {
    animation: dbIconBounce 0.4s ease;
}

.db-role-fullaccess:hover .db-role-icon-gold {
    animation: dbFaCycle 16s ease-in-out infinite, dbFaIconGold 16s ease-in-out infinite, dbIconCrownPulse 0.5s ease;
}

.db-role-fullaccess:hover .db-role-icon-purple {
    animation: dbFaCycle 16s ease-in-out infinite, dbFaIconPurple 16s ease-in-out infinite, dbIconLockShake 0.4s ease;
}

@keyframes dbIconCrownPulse {
    0%, 100% { transform: scale(1.2); }
    50%      { transform: scale(1.45); }
}

@keyframes dbIconLockShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-2px); }
    40%      { transform: translateX(2px); }
    60%      { transform: translateX(-1.5px); }
    80%      { transform: translateX(1.5px); }
}

.db-role-approver:hover .db-role-icon {
    animation: dbIconPop 0.35s ease;
}

.db-role-payroll:hover .db-role-icon {
    animation: dbIconFlip 0.4s ease;
}

.db-role-accountant:hover .db-role-icon {
    animation: dbIconSwing 0.4s ease;
}

.db-role-member:hover .db-role-icon {
    animation: dbIconNod 0.35s ease;
}

@keyframes dbIconBounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-3px) scale(1.15); }
    60% { transform: translateY(1px) scale(0.95); }
}

@keyframes dbIconSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes dbIconPop {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.3); }
    70% { transform: scale(0.9); }
}

@keyframes dbIconFlip {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes dbIconSwing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(12deg); }
    75% { transform: rotate(-12deg); }
}

@keyframes dbIconNod {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.db-role-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--role-border);
    pointer-events: none;
    z-index: 10;
    animation: dbParticleBurst 0.6s ease-out forwards;
}

@keyframes dbParticleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--px), var(--py)) scale(0);
    }
}

.db-role-admin {
    --role-accent: #8B6DB5;
    --role-border: #634989;
    --role-shadow: rgba(99,73,137,0.25);
    --role-shimmer: rgba(255,255,255,0.22);
}

.db-role-payroll {
    --role-accent: #22C55E;
    --role-border: #15803D;
    --role-shadow: rgba(21,128,61,0.2);
    --role-shimmer: rgba(255,255,255,0.25);
}

.db-role-approver {
    --role-accent: #3B82F6;
    --role-border: #1D4ED8;
    --role-shadow: rgba(29,78,216,0.2);
    --role-shimmer: rgba(255,255,255,0.25);
}

.db-role-accountant {
    --role-accent: #4E8A5C;
    --role-border: #3c6547;
    --role-shadow: rgba(60,101,71,0.25);
    --role-shimmer: rgba(255,255,255,0.2);
}

.db-role-fullaccess {
    --role-accent: #F59E0B;
    --role-border: #D97706;
    --role-shadow: rgba(245,158,11,0.22);
    --role-shimmer: rgba(255,255,255,0.2);
    animation: dbFaCycle 16s ease-in-out infinite, dbFaGlow 16s ease-in-out infinite;
    border-width: 1.5px;
}

.db-role-fullaccess:hover {
    transform: translateY(-1px);
}

@keyframes dbFaGlow {
    0%, 20%   { box-shadow: 0 3px 12px rgba(245,158,11,0.3); }
    25%, 45%  { box-shadow: 0 3px 12px rgba(220,38,38,0.25); }
    50%, 70%  { box-shadow: 0 3px 12px rgba(245,158,11,0.3); }
    75%, 95%  { box-shadow: 0 3px 12px rgba(220,38,38,0.25); }
    100%      { box-shadow: 0 3px 12px rgba(245,158,11,0.3); }
}

.db-role-fullaccess::after {
    animation: dbFaShimmerPos 4s ease-in-out infinite;
}

@keyframes dbFaShimmerPos {
    0%   { left: -100%; }
    100% { left: 200%; }
}

.db-role-icon-wrap {
    position: relative;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.db-role-icon-wrap .db-role-icon {
    position: absolute;
    inset: 0;
    width: 16px;
    height: 16px;
    transition: none;
    overflow: visible;
}

.db-role-icon-gold {
    animation: dbFaCycle 16s ease-in-out infinite, dbFaIconGold 16s ease-in-out infinite;
    transform: scale(1.2);
}

.db-role-icon-purple {
    animation: dbFaCycle 16s ease-in-out infinite, dbFaIconPurple 16s ease-in-out infinite;
}

@keyframes dbFaIconGold {
    0%, 20%   { opacity: 1; }
    25%, 45%  { opacity: 0; }
    50%, 70%  { opacity: 1; }
    75%, 95%  { opacity: 0; }
    100%      { opacity: 1; }
}

@keyframes dbFaIconPurple {
    0%, 20%   { opacity: 0; }
    25%, 45%  { opacity: 1; }
    50%, 70%  { opacity: 0; }
    75%, 95%  { opacity: 1; }
    100%      { opacity: 0; }
}

.db-role-fullaccess .db-role-text {
    animation: dbFaCycle 16s ease-in-out infinite;
}

@keyframes dbFaCycle {
    0%, 20%   { color: white; border-color: #D97706; background-color: #F59E0B; }
    25%, 45%  { color: white; border-color: #B91C1C; background-color: #DC2626; }
    50%, 70%  { color: white; border-color: #D97706; background-color: #F59E0B; }
    75%, 95%  { color: white; border-color: #B91C1C; background-color: #DC2626; }
    100%      { color: white; border-color: #D97706; background-color: #F59E0B; }
}


.db-role-member {
    --role-accent: #4F52B2;
    --role-border: #3B3D8F;
    --role-shadow: rgba(79,82,178,0.25);
    --role-shimmer: rgba(255,255,255,0.25);
}

.db-role-barista {
    --role-accent: #7B4B2A;
    --role-border: #5C3516;
    --role-shadow: rgba(123,75,42,0.25);
    --role-shimmer: rgba(255,255,255,0.2);
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaGlow 16s ease-in-out infinite;
    border-width: 1.5px;
}

.db-role-barista:hover {
    transform: translateY(-1px);
}

.db-role-barista .db-role-icon-gold {
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaIconA 16s ease-in-out infinite;
    transform: scale(1.1);
}

.db-role-barista .db-role-icon-purple {
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaIconB 16s ease-in-out infinite;
}

.db-role-barista .db-role-text-wrap {
    position: relative;
    display: inline-block;
}

.db-role-barista .db-role-text-a {
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaIconA 16s ease-in-out infinite;
}

.db-role-barista .db-role-text-b {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaIconB 16s ease-in-out infinite;
}

.db-role-barista::after {
    animation: dbFaShimmerPos 4s ease-in-out infinite;
}

.db-role-barista:hover .db-role-icon-gold {
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaIconA 16s ease-in-out infinite, dbIconPop 0.4s ease;
}

.db-role-barista:hover .db-role-icon-purple {
    animation: dbBaristaCycle 16s ease-in-out infinite, dbBaristaIconB 16s ease-in-out infinite, dbIconSteam 0.6s ease;
}

@keyframes dbBaristaCycle {
    0%, 20%   { color: white; border-color: #3B3D8F; background-color: #4F52B2; }
    25%, 45%  { color: white; border-color: #5C3516; background-color: #7B4B2A; }
    50%, 70%  { color: white; border-color: #3B3D8F; background-color: #4F52B2; }
    75%, 95%  { color: white; border-color: #5C3516; background-color: #7B4B2A; }
    100%      { color: white; border-color: #3B3D8F; background-color: #4F52B2; }
}

@keyframes dbBaristaGlow {
    0%, 20%   { box-shadow: 0 3px 12px rgba(79,82,178,0.3); }
    25%, 45%  { box-shadow: 0 3px 12px rgba(123,75,42,0.35); }
    50%, 70%  { box-shadow: 0 3px 12px rgba(79,82,178,0.3); }
    75%, 95%  { box-shadow: 0 3px 12px rgba(123,75,42,0.35); }
    100%      { box-shadow: 0 3px 12px rgba(79,82,178,0.3); }
}

@keyframes dbBaristaIconA {
    0%, 20%   { opacity: 1; }
    25%, 45%  { opacity: 0; }
    50%, 70%  { opacity: 1; }
    75%, 95%  { opacity: 0; }
    100%      { opacity: 1; }
}

@keyframes dbBaristaIconB {
    0%, 20%   { opacity: 0; }
    25%, 45%  { opacity: 1; }
    50%, 70%  { opacity: 0; }
    75%, 95%  { opacity: 1; }
    100%      { opacity: 0; }
}

@keyframes dbIconSteam {
    0%, 100% { transform: scale(1.1) translateY(0); }
    30%      { transform: scale(1.1) translateY(-3px); }
    60%      { transform: scale(1.15) translateY(-1px); }
}

.db-role-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 10px 14px;
    min-width: 200px;
    cursor: default;
    text-transform: none;
    letter-spacing: 0;
}

.db-hero-role-badge:hover .db-role-tooltip {
    display: block;
    animation: dbFadeUp 0.15s ease-out both;
}

.db-role-tooltip-title {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--role-accent, var(--role-border));
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border-light);
}

.db-role-tooltip-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.db-role-tooltip-list li {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}

.db-role-tooltip-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--role-accent, var(--role-border));
    opacity: 0.5;
}

.db-hero-alert-warn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--color-warning-bg);
    border: 1px solid #FDE68A;
    border-radius: 20px;
    color: var(--color-warning);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .db-ann-grid {
        grid-template-columns: 1fr 1fr;
    }
    .db-vol-stats {
        gap: var(--space-md);
        padding: var(--space-sm) var(--space-md);
    }
}

@media (max-width: 480px) {
    .db-ann-grid {
        grid-template-columns: 1fr;
    }
}

/* Quick-action dropdown */
.db-qa-col {
    width: 40px;
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
}

.db-qa-wrap {
    position: relative;
    display: inline-block;
}

.db-qa-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all var(--transition);
}

.db-qa-btn:hover,
.db-qa-btn.open {
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text);
}

.db-qa-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 9999;
    overflow: hidden;
}

.db-qa-menu.open {
    display: block;
}

.db-qa-item {
    display: block;
    width: 100%;
    padding: 8px var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    font-family: inherit;
}

.db-qa-item:hover {
    background: var(--color-bg);
}

/* Global Search Modal */
.search-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.search-modal.open {
    display: flex;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
}

.search-dialog {
    position: relative;
    z-index: 1;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    overflow: hidden;
}

.search-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

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

.search-field {
    flex: 1;
    border: none;
    outline: none;
    font-size: var(--font-size-md);
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
}

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

.search-esc {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    font-family: inherit;
}

.search-results {
    max-height: 360px;
    overflow-y: auto;
}

.search-hint {
    padding: var(--space-lg);
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.search-group-label {
    padding: 8px var(--space-md) 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px var(--space-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition);
}

.search-result-item:hover,
.search-result-item.focused {
    background: var(--color-bg);
}

.search-result-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.search-result-icon svg {
    width: 14px;
    height: 14px;
}

.search-result-body {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-sub {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.search-result-item .badge {
    flex-shrink: 0;
    font-size: 10px;
    padding: 1px 6px;
}

.search-kbd-hint {
    padding: 8px var(--space-md);
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.search-kbd-hint kbd {
    font-size: 10px;
    padding: 1px 5px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    background: var(--color-bg);
    font-family: inherit;
}

/* Hero Topbar */
.db-hero-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px var(--space-xl);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border-light);
}

.db-hero-topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.db-topbar-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22C55E;
    flex-shrink: 0;
    animation: dbPulseGlow 2s ease-in-out infinite;
}

@keyframes dbPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { box-shadow: 0 0 0 3px rgba(34,197,94,0); }
}

.db-hero-topbar-datestr {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.db-hero-topbar-sep {
    color: var(--color-border);
    font-size: var(--font-size-xs);
}

.db-hero-topbar-extra {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.db-hero-topbar-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-hero-topbar-tz {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.db-hero-topbar-clock {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.db-hero-headline {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0 0 6px;
    animation: dbFadeUp 0.45s ease-out both;
    animation-delay: 0.05s;
}

.db-hero-greet {
    color: var(--color-text-muted);
    font-weight: 600;
}

.db-hero-firstname {
    cursor: default;
    color: var(--color-text);
}

.db-hero-lastname {
    display: inline;
}

.db-hero-lastname span {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    transition-delay: calc(var(--i) * 0.035s + 0.04s);
}

.db-hero-firstname:hover ~ .db-hero-lastname span,
.db-hero-lastname:hover span {
    opacity: 1;
    transform: translateY(0);
}

.db-hero-content {
    padding: var(--space-xl) var(--space-xl);
}

/* KPI Card Accents — icon-only color, no border */

.db-kpi-bar {
    height: 5px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    margin-top: auto;
    overflow: hidden;
    flex-shrink: 0;
    transition: height 0.2s ease;
}

.db-kpi:hover .db-kpi-bar {
    height: 6px;
}

.db-kpi-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
}

.db-kpi-blue   .db-kpi-bar-fill { background: #EF4444; }
.db-kpi-amber  .db-kpi-bar-fill { background: #F59E0B; }
.db-kpi-red    .db-kpi-bar-fill { background: #EF4444; }
.db-kpi-green  .db-kpi-bar-fill { background: #22C55E; }
.db-kpi-slate  .db-kpi-bar-fill { background: #22C55E; }
.db-kpi-purple .db-kpi-bar-fill { background: #3B82F6; }

.db-kpi:hover .db-kpi-bar-fill {
    filter: brightness(1.08);
}

.db-kpi-blue:hover  .db-kpi-icon  { background: #FEF2F2; color: #EF4444; }
.db-kpi-blue:hover  .db-kpi-value { color: #EF4444; }
.db-kpi-amber:hover .db-kpi-icon  { background: #FFFBEB; color: #D97706; }
.db-kpi-amber:hover .db-kpi-value { color: #D97706; }
.db-kpi-slate:hover .db-kpi-icon  { background: #F0FDF4; color: #16A34A; }
.db-kpi-slate:hover .db-kpi-value { color: #16A34A; }
.db-kpi-purple:hover .db-kpi-icon  { background: #EFF6FF; color: #2563EB; }
.db-kpi-purple:hover .db-kpi-value { color: #2563EB; }

.db-kpi-footnote {
    font-size: 10px;
    color: var(--color-text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    margin-top: 8px;
}

/* Quick Access Shortcuts */
.db-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.db-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: var(--space-md) var(--space-sm);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 600;
    transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    text-align: center;
    position: relative;
}

.db-shortcut:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46,123,196,0.10);
}

.db-shortcut-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.db-shortcut-icon svg {
    width: 20px;
    height: 20px;
}

.db-shortcut:hover .db-shortcut-icon {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.db-shortcut-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1;
}

.db-shortcut-count {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--color-text-muted);
    color: white;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.db-shortcut-count-warn { background: var(--color-warning); }
.db-shortcut-count-green { background: #22C55E; }

/* Rich Text Editor */
.db-rte {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-white);
    transition: border-color var(--transition);
}

.db-rte:focus-within {
    border-color: var(--color-primary);
}

.db-rte-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
}

.db-rte-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: 700;
    font-size: var(--font-size-sm);
    font-family: inherit;
    transition: all var(--transition);
}

.db-rte-btn:hover,
.db-rte-btn.active {
    background: var(--color-white);
    border-color: var(--color-border);
    color: var(--color-text);
}

.db-rte-btn svg {
    width: 13px;
    height: 13px;
}

.db-rte-sep {
    width: 1px;
    height: 18px;
    background: var(--color-border);
    margin: 0 2px;
    flex-shrink: 0;
}

.db-rte-editor {
    min-height: 64px;
    max-height: 180px;
    overflow-y: auto;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    outline: none;
    line-height: 1.6;
    font-family: inherit;
}

.db-rte-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-muted);
    pointer-events: none;
}

.db-rte-editor a {
    color: var(--color-primary);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .db-shortcuts {
        grid-template-columns: repeat(4, 1fr);
    }
    .db-hero-topbar {
        padding: 6px var(--space-lg);
    }
    .db-hero-content {
        padding: var(--space-lg) var(--space-lg);
    }
}

@media (max-width: 480px) {
    .db-shortcuts {
        grid-template-columns: repeat(3, 1fr);
    }
    .db-hero-headline {
        font-size: var(--font-size-xl);
    }
}

/* Topbar search trigger */
.topbar-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.topbar-search-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

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

.topbar-search-btn kbd {
    font-size: 10px;
    padding: 1px 5px;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    background: var(--color-white);
    font-family: inherit;
    color: var(--color-text-muted);
}

/* Project detail */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
}

.detail-section {
    margin-bottom: var(--space-lg);
}

.detail-section h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-border);
}

.detail-row {
    display: flex;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-label {
    width: 140px;
    flex-shrink: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.detail-value {
    font-size: var(--font-size-sm);
    flex: 1;
}

/* Status workflow buttons */
.status-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Assignment list */
.assignment-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.assignment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg);
    border-radius: var(--radius-md);
}

.assignment-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.assignment-percentage {
    font-weight: 600;
    color: var(--color-primary);
}

.badge-lead {
    background-color: #E0E7FF;
    color: #3730A3;
}

.btn-make-lead {
    font-size: 11px;
    padding: 2px 8px;
    background-color: #E0E7FF;
    color: #3730A3;
    border: 1px solid #C7D2FE;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.btn-make-lead:hover {
    background-color: #C7D2FE;
}

.btn-remove-lead {
    font-size: 11px;
    padding: 2px 8px;
    background-color: var(--color-bg);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.btn-remove-lead:hover {
    background-color: #FDEDEC;
    color: #E74C3C;
    border-color: #E74C3C;
}

.assignment-item-dimmed {
    opacity: 0.5;
}

.assignment-item-dimmed:hover {
    opacity: 0.7;
}

.alloc-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

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

.alloc-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.alloc-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.alloc-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: background-color 0.15s;
}

.alloc-row:hover {
    background-color: var(--color-bg-subtle);
}

.alloc-row-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.alloc-row-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alloc-row-role {
    display: inline-flex;
    margin-left: 6px;
    vertical-align: middle;
}

.alloc-row-values {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 12px;
}

.alloc-pct {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 52px;
    text-align: right;
}

.alloc-amt {
    font-size: 12px;
    color: var(--color-text-muted);
    min-width: 90px;
    text-align: right;
}

.alloc-status {
    flex-shrink: 0;
}

.alloc-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.alloc-input-group input {
    width: 72px;
    text-align: right;
    font-size: 13px;
    padding: 4px 8px;
}

.alloc-input-group .alloc-pct-sign {
    font-size: 12px;
    color: var(--color-text-muted);
}

.alloc-fund {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-top: var(--space-sm);
    background-color: var(--color-bg-subtle);
    border-radius: var(--radius-md);
    gap: 10px;
}

.alloc-fund-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.alloc-fund-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.alloc-fund-values {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 12px;
}

.alloc-warnings {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    padding-left: 46px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

.radio-option input[type="radio"] {
    accent-color: var(--color-primary);
}

.involvement-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-weight: 500;
    margin-left: 4px;
}

.involvement-working {
    background-color: #E8F8F0;
    color: #27AE60;
}

.involvement-supervising {
    background-color: #EBF5FB;
    color: #2E7BC4;
}

/* Finance overview */
.finance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    transition: background-color var(--transition);
}

.file-item:hover {
    background-color: var(--color-bg);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary-light);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    flex-shrink: 0;
}

.file-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.file-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

/* Drive breadcrumb */
.drive-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
    overflow-x: auto;
    white-space: nowrap;
}

.drive-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-primary);
    text-decoration: none;
}

.drive-breadcrumb a:hover {
    text-decoration: underline;
}

.drive-breadcrumb-sep {
    color: var(--color-text-muted);
}

.drive-breadcrumb-current {
    font-weight: 600;
    color: var(--color-text);
}

/* Drive toolbar */
.drive-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.drive-new-folder {
    display: none;
    align-items: center;
    gap: var(--space-xs);
}

.drive-new-folder.active {
    display: flex;
}

.drive-new-folder input[type="text"] {
    width: 200px;
}

/* Folder items */
.folder-item {
    cursor: pointer;
}

.folder-item:hover {
    background-color: #FFFBEB;
}

.folder-icon {
    background-color: #FEF3C7;
    color: #F59E0B;
}

.folder-rename-form {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}

.folder-rename-form.hidden {
    display: none;
}

.drive-download-all-form {
    display: inline;
}

.drive-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    background-color: var(--color-bg);
}

.drive-selection-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.drive-select-all {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    user-select: none;
}

.drive-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.drive-selection-count {
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    font-weight: 500;
}

.file-check {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: var(--space-xs);
}

.file-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.file-item-selected {
    background-color: var(--color-primary-light);
}

.file-item[data-file-id] {
    display: flex;
    align-items: center;
}

.file-item[data-file-id] .file-info {
    flex: 1;
}

#downloadSelectedForm {
    display: inline;
}

#btnDownloadSelected:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btnDownloadSelected svg,
.drive-download-all-form .btn svg,
.drive-toolbar .btn svg {
    vertical-align: -2px;
    margin-right: 2px;
}

/* File version badge */
.file-version-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    margin-left: 4px;
    border-radius: 9999px;
    background-color: #EDE9FE;
    color: #7C3AED;
    vertical-align: middle;
    white-space: nowrap;
}

/* File internal note */
.file-internal-note {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: var(--font-size-xs);
    color: #64748B;
    background-color: #F1F5F9;
    border-radius: var(--radius-sm);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* File meta edit overlay */
.file-meta-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.file-meta-overlay.show {
    display: flex;
}

.file-meta-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-width: 90vw;
    padding: var(--space-lg);
}

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

.file-meta-panel-header h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin: 0;
}

.file-meta-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.file-meta-preset-btn,
.file-meta-note-btn {
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    background: #fff;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.file-meta-preset-btn:hover,
.file-meta-note-btn:hover {
    background: #EDE9FE;
    border-color: #7C3AED;
    color: #7C3AED;
}

.file-meta-note-btn.active {
    background: #7C3AED;
    border-color: #7C3AED;
    color: #fff;
}

.drive-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--color-text);
    color: var(--color-white);
    padding: 8px 20px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10000;
    pointer-events: none;
}

.drive-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Error page */
.error-page {
    text-align: center;
    padding: var(--space-2xl);
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.error-page p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

/* Share page (public drive) */
.share-page {
    min-height: 100vh;
    background-color: var(--color-bg);
}

.share-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.share-header img {
    width: 32px;
    height: 32px;
}

.share-header h1 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.share-content {
    max-width: 800px;
    margin: var(--space-lg) auto;
    padding: 0 var(--space-md);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    margin-bottom: var(--space-md);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: var(--color-text-muted);
    margin: 0 auto var(--space-md);
}

.upload-zone p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.upload-zone .upload-btn-text {
    color: var(--color-primary);
    font-weight: 500;
    cursor: pointer;
}

/* File Preview */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 600;
    display: none;
    flex-direction: column;
}

.preview-overlay.show {
    display: flex;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.preview-title {
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.preview-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-shrink: 0;
    margin-left: var(--space-md);
}

.preview-actions a {
    color: #fff;
    font-size: var(--font-size-xs);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
    transition: background var(--transition);
}

.preview-actions a:hover {
    background: rgba(255, 255, 255, 0.25);
}

.preview-close {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
    font-family: inherit;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: var(--space-md);
}

.preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--radius-md);
    background: #fff;
}

.preview-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.preview-audio-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-text {
    background: #fff;
    color: #1e293b;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    max-width: 900px;
    width: 100%;
    max-height: 100%;
    overflow: auto;
    font-size: 13px;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.preview-unsupported {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    text-align: center;
}

.preview-unsupported p {
    margin-top: var(--space-md);
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

.preview-loading {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

.btn-preview {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-lg);
}

.profile-tab {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color var(--transition);
    font-family: inherit;
}

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

.profile-tab.active {
    color: var(--color-primary);
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px 1px 0 0;
}

.profile-tab-content {
    display: none;
}

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

.settings-scroll {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.settings-card {
    animation: dbFadeUp 0.3s ease-out both;
}

.settings-card:nth-child(2) { animation-delay: 0.04s; }
.settings-card:nth-child(3) { animation-delay: 0.08s; }
.settings-card:nth-child(4) { animation-delay: 0.12s; }
.settings-card:nth-child(5) { animation-delay: 0.16s; }

.settings-card-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.settings-card-actions {
    display: flex;
    justify-content: flex-start;
}

.settings-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--space-lg) 0;
}

.settings-section-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

/* Language detail chips on Profile tab */
.profile-lang-chip-detailed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 14px;
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.profile-lang-chip-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.profile-lang-chip-info .lang-flag {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.profile-lang-levels {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-lang-level {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Dashboard Hero Balance Zone — Premium */
.db-balance-premium {
    padding: var(--space-md);
    gap: 8px;
    border-left: none;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.12);
    position: relative;
    overflow: hidden;
}

.db-balance-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-primary), #818cf8);
    border-radius: 4px 0 0 4px;
}

.db-balance-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
}

.db-balance-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.db-balance-amount-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.db-balance-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.db-balance-currency {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.db-balance-stats {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 12px;
    color: var(--color-text-muted);
}

.db-balance-trend-up {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #ECFDF5;
    color: #059669;
}

.db-balance-trend-down {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #FEF2F2;
    color: #DC2626;
}

.db-balance-bank {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.db-balance-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    align-self: flex-start;
}

.db-balance-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.db-balance-btn-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.db-balance-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary);
}

.db-balance-link:hover {
    text-decoration: underline;
}

.db-balance-last {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Dashboard Hero Title Prefix */
.db-hero-title-prefix {
    color: inherit;
    font-weight: 600;
}

.upload-progress {
    margin-top: var(--space-md);
}

.progress-bar {
    height: 6px;
    background-color: var(--color-border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ── Settings Sub-tabs ── */
.settings-subtabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
}

.settings-subtab {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color var(--transition);
    font-family: inherit;
}

.settings-subtab:hover {
    color: var(--color-text);
}

.settings-subtab.active {
    color: var(--color-primary);
}

.settings-subtab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px 1px 0 0;
}

.settings-subtab-content {
    display: none;
}

.settings-subtab-content.active {
    display: block;
}

/* ── Settings Section Headings ── */
.settings-section-heading {
    margin-bottom: var(--space-md);
}

.settings-section-heading h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 2px;
}

.settings-section-heading p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Account Locked State ── */
.account-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    min-height: 300px;
}

.account-locked-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    color: var(--color-text-muted);
}

.account-locked-icon svg {
    width: 36px;
    height: 36px;
}

.account-locked h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 var(--space-sm);
}

.account-locked p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-lg);
    max-width: 360px;
    line-height: 1.5;
}

/* ── Login History Table ── */
.login-history-table {
    width: 100%;
    border-collapse: collapse;
}

.login-history-table th {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.login-history-table td {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.login-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.login-status-success {
    background: #F0FDF4;
    color: #16A34A;
}

.login-status-failed {
    background: #FEF2F2;
    color: #DC2626;
}

/* ── Verify Modal Error ── */
.verify-modal-error {
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    margin-top: var(--space-sm);
    display: none;
}

.verify-modal-error.show {
    display: block;
}

@media (max-width: 768px) {
    .settings-subtabs {
        gap: 0;
    }

    .settings-subtab {
        padding: var(--space-sm) var(--space-sm);
        font-size: var(--font-size-xs);
    }

    .account-locked {
        padding: var(--space-xl) var(--space-md);
        min-height: 200px;
    }

    .account-locked-icon {
        width: 64px;
        height: 64px;
    }

    .account-locked-icon svg {
        width: 28px;
        height: 28px;
    }

    .login-history-table th,
    .login-history-table td {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-xs);
    }
}

/* Activity Calendar – compact stamp grid */
.db-cal {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-width: 320px;
}

.db-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.db-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.db-cal-cell {
    width: 100%;
    aspect-ratio: 1;
    max-width: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    transition: transform 0.12s ease;
}

.db-cal-cell:hover:not(.db-cal-empty) {
    transform: scale(1.15);
    z-index: 1;
}

.db-cal-day {
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
}

.db-cal-empty {
    background: transparent;
}

.db-cal-none {
    background: #E2E8F0;
}

.db-cal-none .db-cal-day {
    color: #94A3B8;
}

.db-cal-active {
    background: #3B82F6;
}

.db-cal-active .db-cal-day {
    color: #fff;
}

.db-cal-login {
    background: #22C55E;
}

.db-cal-login .db-cal-day {
    color: #fff;
}

.db-cal-leave {
    background: #EF4444;
}

.db-cal-leave .db-cal-day {
    color: #fff;
}


.db-cal-today {
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
}

.db-cal-future {
    opacity: 0.4;
}

.db-cal-weekend.db-cal-none {
    background: #D5DBE4;
}

.db-cal-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px var(--space-sm);
    font-size: 10px;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-top: var(--space-xs);
}

.db-cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.db-cal-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.db-cal-swatch.db-cal-active { background: #3B82F6; }
.db-cal-swatch.db-cal-login { background: #22C55E; }
.db-cal-swatch.db-cal-leave { background: #EF4444; }

.db-cal-swatch.db-cal-none { background: #E2E8F0; }



/* Goal Modal + Generic Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

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

.modal-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.modal-header h3 {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border-light);
}

/* Goals Page */

.gt-overview {
    margin-bottom: var(--space-lg);
}

.gt-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.gt-hero-period {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
}

.gt-hero-earned {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.gt-hero-currency {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.gt-hero-target {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    margin-bottom: var(--space-md);
}

.gt-hero-progress-bar {
    height: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.gt-hero-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--color-primary);
    transition: width 0.8s ease;
}

.gt-hero-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--color-text-muted);
}

.gt-hero-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.gt-hero-badges {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}

.gt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.gt-kpi {
    padding: var(--space-sm);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    text-align: center;
}

.gt-kpi-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.gt-kpi-unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.gt-kpi-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.gt-time-track {
    margin-top: auto;
}

.gt-time-track-bar {
    height: 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    overflow: visible;
    position: relative;
}

.gt-time-track-elapsed {
    height: 100%;
    border-radius: 3px;
    background: var(--color-border);
    transition: width 0.8s ease;
}

.gt-time-track-marker {
    position: absolute;
    top: -4px;
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border: 2px solid var(--color-white);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: var(--shadow-sm);
    transition: left 0.8s ease;
}

.gt-time-track-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.gt-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.gt-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.gt-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gt-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.gt-stat-unit {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.gt-stat-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.gt-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.gt-cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: var(--space-xs) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gt-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.gt-cal-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    padding: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-light);
    background: var(--color-white);
    transition: all var(--transition);
    cursor: default;
    min-height: 64px;
    position: relative;
}

.gt-cal-cell:hover:not(.gt-cal-empty) {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.gt-cal-empty {
    border-color: transparent;
    background: transparent;
}

.gt-cal-day {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
}

.gt-cal-amount {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.gt-cal-pct {
    font-size: 9px;
    font-weight: 600;
    color: var(--color-text-muted);
    line-height: 1;
    margin-top: 1px;
}

.gt-cal-no-rev {
    color: var(--color-text-muted);
    font-weight: 400;
}

.gt-cal-today {
    border-color: var(--color-primary);
    border-width: 2px;
    box-shadow: 0 0 0 1px var(--color-primary-light);
}

.gt-cal-today .gt-cal-day {
    color: var(--color-primary);
}

.gt-cal-future {
    opacity: 0.35;
    background: var(--color-bg);
    border-style: dashed;
}

.gt-cal-zero {
    background: var(--color-bg);
}

.gt-cal-l1 { background: #DBEAFE; }
.gt-cal-l2 { background: #93C5FD; }
.gt-cal-l3 { background: #60A5FA; }
.gt-cal-l4 { background: #3B82F6; }
.gt-cal-l1 .gt-cal-amount,
.gt-cal-l1 .gt-cal-pct { color: #1E40AF; }
.gt-cal-l2 .gt-cal-amount,
.gt-cal-l2 .gt-cal-pct { color: #1E3A8A; }
.gt-cal-l3 .gt-cal-amount,
.gt-cal-l3 .gt-cal-day,
.gt-cal-l3 .gt-cal-pct { color: #FFF; }
.gt-cal-l4 .gt-cal-amount,
.gt-cal-l4 .gt-cal-day,
.gt-cal-l4 .gt-cal-pct { color: #FFF; }

.gt-cal-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-light);
}

.gt-cal-legend-label {
    font-size: 11px;
    color: var(--color-text-muted);
}

.gt-cal-legend-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.06);
}

.gt-cal-zero-box { background: var(--color-bg); }
.gt-cal-l1-box { background: #DBEAFE; }
.gt-cal-l2-box { background: #93C5FD; }
.gt-cal-l3-box { background: #60A5FA; }
.gt-cal-l4-box { background: #3B82F6; }

.gt-analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.gt-analytics-card {
    min-width: 0;
}

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

.gt-stats-table td {
    padding: 10px var(--space-md);
    font-size: 13px;
    border-bottom: 1px solid var(--color-border-light);
}

.gt-stats-table tr:last-child td {
    border-bottom: none;
}

.gt-stats-table td:first-child {
    color: var(--color-text-secondary);
}

.gt-health-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.gt-health-main {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.gt-health-score-ring {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.gt-ring-svg {
    width: 100%;
    height: 100%;
}

.gt-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gt-ring-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.gt-ring-label {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.gt-health-metrics {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.gt-health-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gt-health-metric-bar {
    height: 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.gt-health-metric-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.gt-health-metric-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-muted);
}

.gt-health-alert {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-warning-bg);
    border: 1px solid rgba(243, 156, 18, 0.2);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: #92400E;
}

.goal-contrib-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--color-border-light);
}

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

.goal-contrib-info {
    min-width: 140px;
    display: flex;
    flex-direction: column;
}

.goal-contrib-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.goal-contrib-amount {
    font-size: 11px;
    color: var(--color-text-muted);
}

.goal-contrib-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.goal-contrib-bar {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.goal-contrib-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--color-primary);
    transition: width 0.4s ease;
}

.goal-contrib-pct {
    font-size: 12px;
    font-weight: 600;
    min-width: 36px;
    text-align: right;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .gt-hero {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    .gt-hero-earned {
        font-size: 26px;
    }
    .gt-hero-badges {
        justify-content: flex-start;
    }
    .gt-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .gt-analytics-row {
        grid-template-columns: 1fr;
    }
    .gt-cal-cell {
        min-height: 48px;
        padding: 2px;
    }
    .gt-cal-amount {
        font-size: 8px;
    }
    .gt-cal-pct {
        font-size: 7px;
    }
    .gt-health-main {
        flex-direction: column;
        gap: var(--space-md);
    }
    .goal-contrib-row {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .goal-contrib-info {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .gt-stats-row {
        grid-template-columns: 1fr;
    }
    .gt-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }
}

/* Forecast Scenarios */
.gt-forecast-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.gt-forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.gt-forecast-card {
    padding: var(--space-md);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    background: var(--color-white);
}

.gt-forecast-conservative { border-left: 3px solid #F59E0B; }
.gt-forecast-ontarget { border-left: 3px solid var(--color-success); }
.gt-forecast-stretch { border-left: 3px solid var(--color-primary); }

.gt-forecast-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.gt-forecast-daily {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.gt-forecast-daily span {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.gt-forecast-projected {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: var(--space-xs) 0 var(--space-sm);
}

.gt-forecast-bar-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.gt-forecast-bar {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    overflow: visible;
    position: relative;
}

.gt-forecast-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.gt-forecast-bar-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 12px;
    background: var(--color-text);
    transform: translateX(-50%);
    border-radius: 1px;
}

.gt-forecast-bar-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 36px;
    text-align: right;
}

.gt-forecast-whatif {
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
}

.gt-forecast-whatif-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
    display: block;
}

.gt-forecast-whatif-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    color: var(--color-text);
    flex-wrap: wrap;
}

.gt-forecast-whatif-input {
    width: 120px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.gt-forecast-whatif-arrow {
    color: var(--color-text-muted);
    font-size: 16px;
}

.gt-forecast-whatif-result {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

/* Projection Table */
.gt-proj-reset-banner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: #FFFBEB;
    border-bottom: 1px solid #FDE68A;
    font-size: 13px;
    color: #92400E;
}

.gt-proj-trajectory-bar {
    height: 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.gt-proj-trajectory-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--color-primary);
    transition: width 0.6s ease;
    opacity: 0.6;
}

/* Revenue Trend Chart */
.gt-trend-legend {
    display: flex;
    gap: var(--space-md);
    font-size: 12px;
    color: var(--color-text-muted);
}

.gt-trend-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gt-trend-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.gt-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--space-md);
    height: 200px;
    padding-bottom: var(--space-lg);
}

.gt-trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.gt-trend-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    position: relative;
}

.gt-trend-bar {
    width: 40%;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s ease;
    min-height: 2px;
}

.gt-trend-bar-target {
    background: #E2E8F0;
}

.gt-trend-bar-actual {
    background: var(--color-primary);
}

.gt-trend-icon {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.gt-trend-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.gt-trend-amount {
    font-size: 10px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Day-of-Week Performance */
.gt-dow-chart {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.gt-dow-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 0;
}

.gt-dow-name {
    width: 36px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.gt-dow-bar-wrap {
    flex: 1;
    min-width: 0;
}

.gt-dow-bar {
    height: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.gt-dow-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--color-primary);
    transition: width 0.6s ease;
}

.gt-dow-avg {
    width: 70px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.gt-dow-count {
    width: 50px;
    text-align: right;
    font-size: 11px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.gt-dow-best .gt-dow-name { color: var(--color-success); }
.gt-dow-best .gt-dow-avg { color: var(--color-success); }

.gt-dow-insight {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: #166534;
}

/* Auto-Reset Stepper */
.gt-reset-stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin-bottom: var(--space-lg);
    position: relative;
}

.gt-reset-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.gt-reset-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: all 0.3s ease;
}

.gt-reset-step-info {
    margin-top: var(--space-sm);
}

.gt-reset-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.gt-reset-step-sub {
    font-size: 11px;
    color: var(--color-text-muted);
}

.gt-reset-step-detail {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.gt-reset-connector {
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    width: calc(100% - 32px);
    height: 3px;
    border-radius: 2px;
    z-index: 0;
}

.gt-reset-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.gt-reset-compare-card {
    flex: 1;
    max-width: 220px;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    text-align: center;
}

.gt-reset-compare-before {
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.gt-reset-compare-after {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
}

.gt-reset-compare-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.gt-reset-compare-before .gt-reset-compare-label { color: #991B1B; }
.gt-reset-compare-after .gt-reset-compare-label { color: #166534; }

.gt-reset-compare-value {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.gt-reset-compare-before .gt-reset-compare-value { color: #DC2626; text-decoration: line-through; }
.gt-reset-compare-after .gt-reset-compare-value { color: #16A34A; }

.gt-reset-compare-note {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.gt-reset-compare-arrow {
    flex-shrink: 0;
}

.gt-reset-rules {
    padding: var(--space-md);
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-md);
}

.gt-reset-rules-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    font-weight: 600;
    color: #1E40AF;
    margin-bottom: var(--space-sm);
}

.gt-reset-rules-list {
    margin: 0;
    padding-left: var(--space-lg);
    font-size: 12px;
    color: #1E3A8A;
    line-height: 1.8;
}

/* Achievements Badges */
.gt-badge-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.gt-badge-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.gt-badge-earned {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
}

.gt-badge-earned:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-sm);
}

.gt-badge-locked {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    opacity: 0.6;
}

.gt-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gt-badge-icon-locked {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.gt-badge-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}

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

.gt-badge-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: var(--space-md) 0;
}

/* Goals Premium - Responsive */
@media (max-width: 768px) {
    .gt-forecast-grid {
        grid-template-columns: 1fr;
    }
    .gt-trend-chart {
        height: 160px;
        gap: var(--space-sm);
    }
    .gt-trend-bar {
        width: 45%;
    }
    .gt-dow-avg {
        width: 60px;
        font-size: 12px;
    }
    .gt-dow-count {
        display: none;
    }
    .gt-reset-stepper {
        flex-direction: column;
        gap: var(--space-md);
    }
    .gt-reset-connector {
        display: none;
    }
    .gt-reset-step {
        flex-direction: row;
        text-align: left;
        gap: var(--space-sm);
    }
    .gt-reset-step-info {
        margin-top: 0;
    }
    .gt-reset-comparison {
        flex-direction: column;
    }
    .gt-reset-compare-card {
        max-width: 100%;
        width: 100%;
    }
    .gt-reset-compare-arrow svg {
        transform: rotate(90deg);
    }
    .gt-badge-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .gt-forecast-whatif-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .gt-forecast-whatif-input {
        width: 100%;
    }
    .gt-trend-chart {
        height: 140px;
    }
}

/* Commission Pending Badge */
.commission-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

/* Confirmation Modal */
.confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.confirm-modal.show {
    display: flex;
}

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

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Team Goal Widget */
.db-goal-widget {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.db-goal-widget-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.db-goal-widget-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.db-goal-widget-acceptance {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Leaderboard */
.lb-podium {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    align-items: flex-end;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.lb-podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg) var(--space-xl);
    min-width: 180px;
    flex: 1;
    max-width: 240px;
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}

.lb-podium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.lb-podium-gold {
    border-color: #F5B942;
    background: linear-gradient(180deg, #FFFBEB 0%, var(--color-white) 100%);
    order: 2;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

.lb-podium-silver {
    border-color: #B0BEC5;
    background: linear-gradient(180deg, #F8F9FA 0%, var(--color-white) 100%);
    order: 1;
}

.lb-podium-bronze {
    border-color: #D4A574;
    background: linear-gradient(180deg, #FFF5EB 0%, var(--color-white) 100%);
    order: 3;
}

.lb-podium-rank {
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.lb-podium-gold .lb-podium-rank { color: #D49A2A; }
.lb-podium-silver .lb-podium-rank { color: #7F8C8D; }
.lb-podium-bronze .lb-podium-rank { color: #B8734A; }

.lb-podium-avatar {
    margin-bottom: var(--space-sm);
}

.lb-podium-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
    margin-bottom: var(--space-xs);
}

.lb-podium-earnings {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
}

.lb-podium-currency {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-muted);
}

.lb-podium-projects {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.lb-user-cell {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.lb-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.lb-rank-1 { background: #F5B942; }
.lb-rank-2 { background: #B0BEC5; }
.lb-rank-3 { background: #D4A574; }

.lb-row-me {
    background: var(--color-primary-light);
}

.lb-row-me:hover {
    background: var(--color-primary-light) !important;
}

@media (max-width: 640px) {
    .lb-podium {
        flex-direction: column;
        align-items: stretch;
    }

    .lb-podium-card {
        max-width: 100%;
        order: unset !important;
    }

    .lb-podium-gold,
    .lb-podium-silver,
    .lb-podium-bronze {
        order: unset !important;
    }
}

/* Suspension Card */
.suspension-active-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: #991b1b;
}

.suspension-active-banner strong {
    display: block;
    margin-bottom: 4px;
}

.suspension-active-banner p {
    margin: 2px 0;
    font-size: var(--font-size-sm);
}

.suspension-active-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #dc2626;
}

/* Documents Page */
.doc-category-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.doc-category-tab {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    background: var(--color-bg-card);
    transition: all 0.15s;
}

.doc-category-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.doc-category-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.doc-badge-contract { background: #dbeafe; color: #1e40af; }
.doc-badge-knowledgebase { background: #dcfce7; color: #166534; }
.doc-badge-manual { background: #fef3c7; color: #92400e; }
.doc-badge-file { background: #f1f5f9; color: #475569; }

.doc-content-preview {
    max-height: 120px;
    overflow: hidden;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.doc-form-card {
    margin-bottom: var(--space-lg);
}

/* Fund Transfer Page */
.ft-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.ft-type-user_transfer { background: #dbeafe; color: #1e40af; }
.ft-type-subscription { background: #f3e8ff; color: #6b21a8; }
.ft-type-expense { background: #fef3c7; color: #92400e; }

.ft-status-pending { color: #d97706; }
.ft-status-approved { color: #16a34a; }
.ft-status-rejected { color: #dc2626; }

.ft-section {
    margin-bottom: var(--space-lg);
}

.ft-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Calendar Page */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    cursor: pointer;
    color: var(--color-text);
    transition: all 0.15s;
}

.cal-nav-btn:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
}

.cal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    min-width: 200px;
    text-align: center;
}

.cal-view-toggle {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cal-view-btn {
    padding: 6px 16px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border: none;
    background: var(--color-bg-card);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.15s;
}

.cal-view-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cal-grid-header {
    padding: 8px 4px;
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.cal-day {
    min-height: 100px;
    padding: 4px;
    border-right: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg-card);
    position: relative;
}

.cal-day:nth-child(7n) {
    border-right: none;
}

.cal-day-num {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 2px 6px;
}

.cal-day.cal-today .cal-day-num {
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-full);
    display: inline-block;
}

.cal-day.cal-other-month {
    background: var(--color-bg);
    opacity: 0.5;
}

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.cal-event-pill {
    display: block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    cursor: pointer;
}

.cal-event-pill.cal-ev-deadline { background: #fee2e2; color: #991b1b; }
.cal-event-pill.cal-ev-task { background: #dbeafe; color: #1e40af; }
.cal-event-pill.cal-ev-subscription { background: #f3e8ff; color: #6b21a8; }
.cal-event-pill.cal-ev-reminder { background: #fef3c7; color: #92400e; }
.cal-event-pill.cal-ev-custom { background: #dcfce7; color: #166534; }

.cal-event-list {
    margin-top: var(--space-lg);
}

.cal-event-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

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

.cal-event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-event-dot.cal-ev-deadline { background: #ef4444; }
.cal-event-dot.cal-ev-task { background: #3b82f6; }
.cal-event-dot.cal-ev-subscription { background: #a855f7; }
.cal-event-dot.cal-ev-reminder { background: #f59e0b; }
.cal-event-dot.cal-ev-custom { background: #22c55e; }

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

.cal-event-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
}

.cal-event-time {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .cal-day {
        min-height: 60px;
    }

    .cal-event-pill {
        font-size: 9px;
        padding: 1px 4px;
    }

    .cal-title {
        font-size: var(--font-size-lg);
        min-width: auto;
    }
}

/* Countdown Timer */
.countdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.countdown-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
}

.countdown-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.countdown-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.countdown-overdue {
    color: var(--color-danger);
}

.countdown-progress {
    height: 8px;
    background: var(--color-border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

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

.countdown-progress-overdue {
    background: var(--color-danger);
}

.countdown-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Active indicator */
.user-active-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    animation: active-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes active-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Avatar Stack */
.avatar-stack {
    display: flex;
    align-items: center;
    gap: 4px;
}

.avatar-tooltip-wrap {
    position: relative;
    flex-shrink: 0;
}

.avatar-tooltip-wrap .user-avatar {
    border: 2px solid var(--color-white);
    box-shadow: 0 0 0 1px var(--color-border);
    transition: transform 0.15s;
}

.avatar-tooltip-wrap:hover .user-avatar {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.avatar-tooltip-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-white);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.avatar-tooltip-wrap:hover::after {
    opacity: 1;
}

.avatar-more {
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.btn-icon:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text);
}

.btn-icon.text-danger:hover {
    background: #FEF2F2;
    color: #DC2626;
}

/* Bulk Action Bar */
.bulk-action-bar {
    background: var(--color-white);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-md);
}

.bulk-action-bar form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-count {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    min-width: 80px;
}

tr.row-done td input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

/* Checklist */
.checklist-progress {
    height: 4px;
    background: var(--color-bg-subtle);
    border-radius: 2px;
    overflow: hidden;
}

.checklist-progress-bar {
    height: 100%;
    background: var(--color-success);
    border-radius: 2px;
    transition: width 0.3s;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
    position: relative;
}

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

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

.checklist-item.completed .checklist-drag-handle {
    visibility: hidden;
}

.checklist-item.dragging {
    opacity: 0.4;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
}

.checklist-drop-indicator {
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
    margin: -1px 0;
}

.checklist-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-height: 20px;
    color: var(--color-text-muted);
    opacity: 0;
    cursor: grab;
    flex-shrink: 0;
    padding-top: 2px;
    transition: opacity 0.15s;
}

.checklist-item:hover .checklist-drag-handle {
    opacity: 0.4;
}

.checklist-drag-handle:hover {
    opacity: 0.8 !important;
}

.checklist-drag-handle:active {
    cursor: grabbing;
}

.checklist-check {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    padding-top: 2px;
}

.checklist-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

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

.checklist-main-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checklist-title {
    flex: 1;
    font-size: var(--font-size-sm);
    min-width: 0;
    word-break: break-word;
    cursor: text;
    padding: 1px 2px;
    border-radius: var(--radius-sm);
}

.checklist-title:hover {
    background: var(--color-bg-subtle);
}

.checklist-title-input {
    font-size: var(--font-size-sm);
    padding: 1px 4px;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    outline: none;
    width: 100%;
    font-family: inherit;
}

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

.checklist-assignee {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
}

.checklist-assignee:hover {
    box-shadow: 0 0 0 2px var(--color-primary-light, #93c5fd);
    border-radius: 50%;
}

.checklist-assignee-empty {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px dashed var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    opacity: 0;
    transition: opacity 0.15s;
}

.checklist-item:hover .checklist-assignee-empty {
    opacity: 1;
}

.checklist-due {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.checklist-due:hover {
    background: var(--color-border-light, #e2e8f0);
}

.checklist-due.overdue {
    background: #FEF2F2;
    color: #DC2626;
}

.checklist-due-add {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity 0.15s;
}

.checklist-item:hover .checklist-due-add {
    opacity: 1;
}

.checklist-due-add:hover {
    background: var(--color-bg-subtle);
}

.checklist-actions-wrap {
    position: relative;
}

.checklist-actions-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity 0.15s;
}

.checklist-item:hover .checklist-actions-btn {
    opacity: 1;
}

.checklist-actions-btn:hover {
    background: var(--color-bg-subtle);
}

.checklist-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.15));
    z-index: 50;
    min-width: 150px;
    padding: 4px 0;
}

.checklist-actions-menu.show {
    display: block;
}

.checklist-actions-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    text-align: left;
}

.checklist-actions-menu button:hover {
    background: var(--color-bg-subtle);
}

.checklist-actions-menu button.text-danger {
    color: var(--color-danger);
}

.checklist-notes-preview {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checklist-notes-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checklist-notes-modal-content {
    background: var(--color-bg);
    border-radius: var(--radius-lg, 8px);
    padding: 20px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.15));
}

.checklist-notes-modal-content h4 {
    margin: 0 0 12px 0;
    font-size: var(--font-size-base);
}

.checklist-notes-modal-content textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 12px;
    resize: vertical;
}

.checklist-notes-modal-content .modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.checklist-member-picker {
    position: fixed;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.15));
    z-index: 100;
    min-width: 200px;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

.checklist-member-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.checklist-member-picker-item:hover {
    background: var(--color-bg-subtle);
}

.checklist-member-picker-item.unassign {
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
}

.checklist-due-picker {
    position: fixed;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0,0,0,0.15));
    z-index: 100;
    padding: 8px;
}

.checklist-due-picker input[type="date"] {
    font-size: var(--font-size-sm);
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.checklist-due-picker .due-picker-btns {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.checklist-add {
    display: flex;
    gap: 8px;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.team-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 8px);
    padding: var(--space-lg);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.team-card:hover {
    border-color: var(--color-primary-light, #93c5fd);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.team-card-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.team-card-status {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--color-bg);
}

.team-card-status.online {
    background: var(--color-success);
}

.team-card-status.away {
    background: var(--color-warning);
}

.team-card-identity {
    min-width: 0;
    flex: 1;
}

.team-card-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-card-username {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 1px;
}

.team-card-role {
    margin-bottom: var(--space-sm);
}

.team-role-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.team-role-member {
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
}

.team-role-admin {
    background: #EFF6FF;
    color: #1E40AF;
}

.team-role-payroll {
    background: #F0FDF4;
    color: #166534;
}

.team-role-approver {
    background: #FFF7ED;
    color: #C2410C;
}

.team-role-accountant {
    background: #FAF5FF;
    color: #7C3AED;
}

.team-role-full-access {
    background: linear-gradient(135deg, #EFF6FF, #FAF5FF);
    color: #4338CA;
}

.team-card-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: var(--space-sm);
}

.team-card-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: var(--space-md);
}

.team-skill-tag {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 20px;
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-light, #e2e8f0);
}

.team-card-stats {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light, #f1f5f9);
}

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

.team-stat-value {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.team-stat-label {
    font-size: 10px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

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

/* Rich Text Editor */
.rich-text-toolbar {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.rich-text-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
}

.rich-text-toolbar button:hover {
    background: var(--color-white);
    color: var(--color-text);
}

.rich-text-toolbar .toolbar-sep {
    width: 1px;
    background: var(--color-border);
    margin: 4px 4px;
}

.rich-text-editor {
    min-height: 120px;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    outline: none;
}

.rich-text-editor:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Involvement Options */
.involvement-options {
    display: flex;
    gap: var(--space-md);
}

.involvement-option {
    flex: 1;
    cursor: pointer;
}

.involvement-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.involvement-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all 0.15s;
}

.involvement-option input:checked + .involvement-card {
    border-color: var(--color-primary);
    background: #EFF6FF;
}

.involvement-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-subtle);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
}

.involvement-option input:checked + .involvement-card .involvement-icon {
    background: var(--color-primary);
    color: var(--color-white);
}

.involvement-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.involvement-text strong {
    font-size: var(--font-size-sm);
}

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

.text-danger {
    color: #DC2626;
}

@media (max-width: 640px) {
    .involvement-options {
        flex-direction: column;
    }
}

/* Tag Picker */
.tag-picker {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-white);
    min-height: 40px;
    cursor: text;
}

.tag-picker:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tag-picker-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-bg-subtle);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px 2px 8px;
    border-radius: var(--radius-sm);
}

.tag-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.tag-chip button:hover {
    background: var(--color-danger);
    color: var(--color-white);
}

.tag-picker-input {
    border: none;
    outline: none;
    background: none;
    font-size: var(--font-size-sm);
    flex: 1;
    min-width: 120px;
    padding: 2px 0;
}

.tag-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 20;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.tag-picker-option {
    padding: 8px 12px;
    font-size: var(--font-size-sm);
    cursor: pointer;
}

.tag-picker-option:hover {
    background: var(--color-bg-subtle);
}

.tag-picker-create {
    color: var(--color-primary);
    font-weight: 500;
}

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-suggestion-chip {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}

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

.tag-suggestion-chip.active {
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    text-decoration: line-through;
    cursor: default;
    border-color: var(--color-border);
}

/* Due Date Shorthand */
.due-date-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.due-date-shorthand-wrap {
    position: relative;
    flex-shrink: 0;
}

.due-date-shorthand {
    max-width: 180px;
    font-family: var(--font-mono, monospace);
    letter-spacing: 1px;
    text-align: center;
}

.due-date-hint {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: var(--font-size-sm);
    letter-spacing: 1px;
    color: var(--color-text-muted);
    opacity: 0.4;
    pointer-events: none;
    display: none;
}

.involvement-options-compact .involvement-card {
    padding: var(--space-sm) var(--space-md);
}

.involvement-options-compact .involvement-text span {
    font-size: var(--font-size-xs);
}

@media (max-width: 768px) {
    .create-involvement-team-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════════════ */
/* Detail Page - Colored Text (no badges)     */
/* ═══════════════════════════════════════════ */
.detail-text-colored {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.detail-tags-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.detail-tag-text {
    font-weight: 500;
    color: var(--color-primary);
    font-size: var(--font-size-sm);
}

.detail-tag-sep {
    color: var(--color-text-muted);
    margin: 0 2px;
}

/* ═══════════════════════════════════════════ */
/* Detail Timeline Tab (compact countdown)    */
/* ═══════════════════════════════════════════ */
.detail-timeline-tab {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    overflow: hidden;
}

.detail-timeline-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.detail-timeline-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-timeline-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.detail-timeline-value {
    font-size: var(--font-size-base);
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.detail-timeline-sep {
    width: 1px;
    height: 32px;
    background: var(--color-border);
    flex-shrink: 0;
}

.detail-timeline-dates {
    margin-left: auto;
    display: flex;
    gap: var(--space-lg);
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════ */
/* Assignment List - text-based roles         */
/* ═══════════════════════════════════════════ */
.assignment-role-text {
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.assignment-action-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 500;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.assignment-action-link:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}

.assignment-action-link.text-danger {
    color: var(--color-danger);
}

.assignment-action-link.text-danger:hover {
    background: var(--color-danger-bg);
}

/* ═══════════════════════════════════════════ */
/* Checklist Notes Modal - Enhanced           */
/* ═══════════════════════════════════════════ */
.checklist-notes-enhanced {
    max-width: 600px;
    width: 90vw;
}

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

.notes-modal-header h4 {
    margin: 0;
}

.notes-char-count {
    font-size: 12px;
    color: var(--color-text-muted);
}

.notes-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-sm);
    padding: 4px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.notes-tb-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
    transition: background 0.15s;
}

.notes-tb-btn:hover {
    background: var(--color-border-light);
    border-color: var(--color-border);
}

.notes-textarea {
    min-height: 200px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    line-height: 1.6;
}

.notes-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-md);
}

.notes-autosave-indicator {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════ */
/* Checklist Creator Display                  */
/* ═══════════════════════════════════════════ */
.checklist-creator {
    margin-top: 2px;
    font-style: italic;
}

/* ═══════════════════════════════════════════ */
/* Tag Suggestion Highlights (VIP, Priority)  */
/* ═══════════════════════════════════════════ */
.tag-suggestion-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #f59e0b;
    color: #92400e;
    font-weight: 600;
}

.tag-suggestion-highlight:hover {
    background: linear-gradient(135deg, #fde68a, #fbbf24);
}

/* ═══════════════════════════════════════════ */
/* Create Page - Member Picker                */
/* ═══════════════════════════════════════════ */
.create-member-search {
    position: relative;
    margin-bottom: var(--space-md);
}

.create-member-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}

.create-member-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.create-member-option:hover {
    background: var(--color-bg);
}

.create-member-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.create-member-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.create-member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.create-member-name {
    flex: 1;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.create-member-role {
    max-width: 120px;
    font-size: 12px;
}

.create-member-remove {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.create-member-remove:hover {
    color: var(--color-danger);
}

/* ═══════════════════════════════════════════ */
/* Leaderboard Date Range                     */
/* ═══════════════════════════════════════════ */
.leaderboard-date-range {
    font-weight: 500;
}

/* ═══════════════════════════════════════════ */
/* Team Cards - Enhanced                      */
/* ═══════════════════════════════════════════ */
.team-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.team-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    transition: all 0.2s ease;
}


.db-cat-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.db-status-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
}

.db-remaining-countdown {
    font-size: var(--font-size-xs);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.db-assigned-stack {
    display: flex;
    align-items: center;
}

.db-assigned-avatar {
    display: inline-flex;
    position: relative;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    overflow: hidden;
    flex-shrink: 0;
}

.db-assigned-avatar:not(:first-child) {
    margin-left: -8px;
}

.db-assigned-avatar .user-avatar,
.db-assigned-avatar .user-avatar-photo {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
}

.db-assigned-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-white);
    color: var(--color-text-muted);
    font-size: 10px;
    font-weight: 700;
    margin-left: -8px;
    position: relative;
}

.db-analytics {
    margin-top: var(--space-xl);
}

.db-analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.db-analytics-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.db-analytics-viewing {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-left: auto;
    margin-right: var(--space-md);
}

.db-analytics-viewing-label {
    font-weight: 500;
}

.db-analytics-viewing-name {
    font-weight: 700;
    color: var(--color-primary);
    transition: opacity 0.2s ease;
}

.db-analytics-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--color-border-light);
}

.db-analytics-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1;
}

.db-analytics-tab svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.db-analytics-tab:hover {
    color: var(--color-text);
    background: var(--color-white);
}

.db-analytics-tab:hover svg {
    opacity: 0.8;
}

.db-analytics-tab.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    border-color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.db-analytics-tab.active svg {
    opacity: 1;
    color: #fff;
}

.db-analytics-carousel {
    position: relative;
}

.db-analytics-slide {
    display: none;
}

.db-analytics-slide.active {
    display: block;
    animation: dbSlideIn 0.3s ease;
}

@keyframes dbSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.db-chart-panel {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    position: relative;
}

.db-chart-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.db-chart-panel-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.db-chart-panel-head h4 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.db-chart-panel-sub {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.db-chart-panel-stats {
    display: flex;
    gap: var(--space-lg);
    flex-shrink: 0;
}

.db-chart-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.db-chart-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.db-chart-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.db-chart-canvas {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.db-chart-canvas svg {
    display: block;
    max-width: 100%;
}

.db-chart-tooltip {
    position: fixed;
    z-index: 1000;
    padding: 8px 14px;
    background: #0F172A;
    color: #F8FAFC;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.06);
    transform: translate(-50%, -100%);
    margin-top: -12px;
    letter-spacing: -0.01em;
    backdrop-filter: blur(8px);
}

.db-chart-bar {
    transition: opacity 0.2s ease, filter 0.2s ease;
    cursor: pointer;
}

.db-chart-bar:hover {
    opacity: 0.9;
    filter: brightness(1.05);
}

.db-chart-donut-segment {
    transition: opacity 0.2s ease, filter 0.2s ease;
    cursor: pointer;
    transform-origin: center;
}

.db-chart-donut-segment:hover {
    opacity: 0.85;
    filter: brightness(1.08);
}

.db-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: var(--space-md);
    justify-content: center;
}

.db-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.db-chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.db-chart-area-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.db-chart-area-fill {
    opacity: 1;
}

.db-chart-grid-line {
    stroke: var(--color-border-light);
    stroke-width: 1;
    stroke-dasharray: 5 5;
}

.db-chart-axis-label {
    font-size: 10px;
    fill: var(--color-text-muted);
    font-weight: 500;
    font-family: inherit;
}

.db-chart-axis-val {
    font-size: 10px;
    fill: var(--color-text-muted);
    font-weight: 500;
    font-family: inherit;
    text-anchor: end;
}

.db-chart-dot {
    fill: var(--color-white);
    stroke-width: 2.5;
    transition: r 0.15s ease;
    cursor: pointer;
}

.db-chart-dot:hover {
    r: 6;
}

.db-chart-value-label {
    font-size: 9px;
    fill: var(--color-text-muted);
    font-weight: 600;
    font-family: inherit;
    text-anchor: middle;
    pointer-events: none;
}

.db-chart-highlight-val {
    font-size: 11px;
    fill: #1E293B;
    font-weight: 700;
    font-family: inherit;
    text-anchor: middle;
    pointer-events: none;
}

.db-analytics-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

.db-chart-zero-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.db-chart-zero-state svg {
    display: inline-block;
    width: 40px;
    height: 40px;
    color: var(--color-border);
    margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
    .db-hero-actions {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    .db-analytics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    .db-analytics-viewing {
        display: none;
    }
    .db-analytics-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .db-analytics-tab span {
        display: none;
    }
    .db-analytics-footer {
        justify-content: center;
    }
    .db-chart-panel-head {
        flex-direction: column;
        gap: var(--space-md);
    }
    .db-chart-panel-stats {
        width: 100%;
        justify-content: flex-start;
    }
    .db-chart-stat {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .db-chart-panel-stats {
        gap: var(--space-md);
    }
    .db-chart-stat-value {
        font-size: var(--font-size-base);
    }
}

.slip-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--color-border);
    transition: transform 0.15s ease;
}
.slip-thumb:hover {
    transform: scale(1.15);
}

.db-deadlines-list {
    display: flex;
    flex-direction: column;
}
.db-deadline-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s;
}
.db-deadline-item:last-child { border-bottom: none; }
.db-deadline-item:hover { background: var(--color-bg-hover, #f8fafc); }
.db-deadline-id {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    min-width: 90px;
}
.db-deadline-desc {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.db-deadline-due {
    font-weight: 600;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.db-action-warn {
    border-left-color: var(--color-warning);
}
.db-action-warn .db-action-icon { color: var(--color-warning); }

.db-checkin-analytics {
    margin-bottom: var(--space-lg);
}
.db-checkin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}
.db-checkin-stat {
    text-align: center;
    padding: var(--space-sm);
}
.db-checkin-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}
.db-checkin-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 2px;
}
.db-checkin-bar-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.db-checkin-bar {
    flex: 1;
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
}
.db-checkin-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.6s ease;
}
.db-checkin-bar-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.rpt-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}
.rpt-month-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}
.rpt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}
.rpt-kpi {
    background: var(--color-bg-card, #fff);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
}
.rpt-kpi-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.rpt-kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
}
.rpt-kpi-delta {
    font-size: var(--font-size-xs);
    margin-top: 4px;
}
.rpt-delta-up { color: var(--color-success); }
.rpt-delta-down { color: var(--color-danger); }
.rpt-delta-neutral { color: var(--color-text-muted); }
.rpt-kpi-blue { border-left: 3px solid #3b82f6; }
.rpt-kpi-green { border-left: 3px solid #22c55e; }
.rpt-kpi-amber { border-left: 3px solid #f59e0b; }
.rpt-kpi-purple { border-left: 3px solid #8b5cf6; }
.rpt-kpi-slate { border-left: 3px solid #64748b; }

@media print {
    .sidebar, .topbar, .sidebar-user, .page-header button, .rpt-month-nav .btn { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .rpt-kpi { break-inside: avoid; }
}

/* ═══════════════════════════════════════════ */
/* Client Picker                              */
/* ═══════════════════════════════════════════ */
.client-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}

.client-search-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.client-search-option:hover { background: var(--color-bg); }

.client-search-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-bg-subtle);
}

.client-linked-input {
    border-color: var(--color-primary) !important;
    background: var(--color-primary-light, #eff6ff) !important;
}
.client-linked-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.client-linked-hint strong { color: var(--color-text); font-weight: 600; }
.client-unlink-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    margin-left: auto;
}
.client-unlink-btn:hover { color: var(--color-danger); }

/* ═══════════════════════════════════════════ */
/* Client Analytics                           */
/* ═══════════════════════════════════════════ */
.ca-top-list { list-style: none; padding: 0; margin: 0; }
.ca-top-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
}
.ca-top-item:last-child { border-bottom: none; }
.ca-top-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}
.ca-top-rank.rank-1 { background: #fef3c7; color: #b45309; }
.ca-top-rank.rank-2 { background: #e5e7eb; color: #374151; }
.ca-top-rank.rank-3 { background: #fed7aa; color: #9a3412; }
.ca-top-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-bg-subtle);
}
.ca-top-info { flex: 1; min-width: 0; }
.ca-top-name { font-weight: 600; font-size: var(--font-size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-top-meta { font-size: 12px; color: var(--color-text-muted); }
.ca-top-revenue { text-align: right; flex-shrink: 0; }
.ca-top-amount { font-weight: 700; font-size: var(--font-size-sm); }
.ca-top-bar-wrap { width: 80px; height: 6px; background: var(--color-bg-subtle); border-radius: 3px; margin-top: 4px; }
.ca-top-bar { height: 100%; background: var(--color-primary); border-radius: 3px; }

.ca-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    margin-bottom: var(--space-md);
}
.ca-filter-bar .form-control { max-width: 200px; font-size: 13px; }
.ca-filter-bar .form-control:first-child { max-width: 280px; }

@media (max-width: 768px) {
    .ca-filter-bar { flex-direction: column; }
    .ca-filter-bar .form-control { max-width: 100%; }
}

@media (max-width: 640px) {
    .db-checkin-grid { grid-template-columns: repeat(2, 1fr); }
    .rpt-kpi-grid { grid-template-columns: 1fr 1fr; }
}

