/* BizPass Dashboard - Component Styles (FeedBacker-inspired) */

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    min-width: 200px;
    max-width: calc(100vw - 2rem);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

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

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-error);
}

.toast.warning {
    background: var(--color-warning);
}

.toast.info {
    background: var(--color-info);
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--color-gray-900);
    margin-bottom: var(--space-2);
}

.empty-state-description {
    color: var(--color-gray-600);
    margin-bottom: var(--space-6);
}

/* Card Grid - TESTING MODE: Fewer columns for larger preview */
.card-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: 1fr;
}

/* Responsive card grid - scales from 1 to 3 columns with smooth transitions */
@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

@media (min-width: 900px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
}

@media (min-width: 1280px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-7);
    }
}

@media (min-width: 1600px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-8);
        max-width: 1600px;
        margin: 0 auto;
    }
}

/* Card Preview - Neumorphic Responsive Design */
/* Card Preview - iOS-style floating design */
.card-preview {
    background: transparent; /* No background, let card float */
    border-radius: 0;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: visible; /* Allow card to float */
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.card-preview:hover .card-thumbnail {
    transform: translateY(-8px) scale(1.02);
}

/* Card thumbnail - floating card design */
/* iOS renders 350×200pt with cornerRadius 20 → baked-in radius is 5.714% of width / 10% of height.
   Using percentage radius so the CSS clip scales with the container, matching the image at every size.
   Slightly larger (6%/10.5%) ensures the clip sits just inside the baked-in corners. */
.card-thumbnail {
    width: 100%;
    aspect-ratio: 1.75; /* Matches iOS 350:200 */
    background: transparent;
    border-radius: 6% / 10.5%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 0;
    line-height: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Portrait card thumbnail — 200×350 (landscape rotated 90°).
   Border-radius axes are swapped vs landscape so corners match the baked-in iOS radius. */
.card-thumbnail.portrait {
    aspect-ratio: 4 / 7;
    border-radius: 10.5% / 6%;
    max-width: 160px; /* ~200pt equivalent — keeps it from filling the full card-preview column */
    margin-left: auto;
    margin-right: auto;
}

.rendered-card-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6% / 10.5%;
    overflow: hidden;
}

/* Thumbnail image - full card display */
.card-thumbnail > img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the container */
    object-position: center center;
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 0; /* Container handles clipping — no double-radius */
}

.card-thumbnail .business-card {
    pointer-events: none;
}

.card-thumbnail .business-card img {
    pointer-events: none;
    user-select: none;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    flex: 1;
    background: var(--color-bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-neu-sm);
    border: 1px solid rgba(153, 153, 161, 0.08);
    position: relative;
    overflow: hidden;
}

.card-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 60%;
    bottom: 60%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 60%);
    pointer-events: none;
    border-radius: 20px 0 0 0;
}

.card-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    font-weight: 500;
}

.card-share-stats {
    padding-top: var(--space-2);
    margin-top: var(--space-2);
    border-top: none; /* Remove border for cleaner look */
    display: flex;
    gap: var(--space-3);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: var(--space-2);
    padding: 0 var(--space-2) var(--space-2);
    margin-top: var(--space-2);
}

.btn-icon {
    flex: 1;
    padding: var(--space-3) var(--space-6);
    background: var(--color-bg-card);
    border: none;
    border-radius: 24px;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 44px;
    box-shadow: 6px 6px 12px var(--neu-shadow-dark),
                -6px -6px 12px var(--neu-shadow-light);
    position: relative;
    overflow: hidden;
}

/* Top highlight for 3D effect */
.btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 8px 8px 16px var(--neu-shadow-dark),
                -8px -8px 16px var(--neu-shadow-light);
}

.btn-icon:active {
    transform: translateY(1px);
    box-shadow: inset 4px 4px 8px rgba(163, 157, 147, 0.25),
                inset -4px -4px 8px rgba(255, 255, 255, 0.7);
}

.btn-icon:active::before {
    background: linear-gradient(180deg, rgba(74, 74, 74, 0.08) 0%, rgba(74, 74, 74, 0) 100%);
}

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

/* Share List */
.share-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.share-item {
    background: white;
    border-radius: 12px;
    padding: var(--space-5);
    box-shadow: var(--shadow);
}

.share-header {
    display: flex;
    align-items: start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.share-thumbnail {
    width: 80px;
    height: 50px;
    background: var(--color-gray-100);
    border-radius: 6px;
    flex-shrink: 0;
}

.share-details {
    flex: 1;
    min-width: 0;
}

.share-card-name {
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: var(--space-1);
}

.share-url {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    margin-bottom: var(--space-2);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.share-stats {
    display: flex;
    gap: var(--space-6);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-gray-200);
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: var(--space-4);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-gray-600);
}

.share-link-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: var(--space-4);
}

.share-url-preview {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
    color: var(--color-primary);
    font-family: monospace;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-neu-sm);
    transition: background 0.15s;
}

.share-url-preview:hover {
    background: var(--color-gray-100);
    text-decoration: underline;
}

.share-url-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-regen-btn {
    align-self: flex-start;
    font-size: 0.8rem;
    color: var(--color-gray-600);
}

.share-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-neu-sm);
    position: relative;
}

.btn-sm::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    pointer-events: none;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-neu);
}

.btn-sm:active {
    transform: translateY(0);
    box-shadow: var(--shadow-neu-inset);
}

.btn-sm svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-outline {
    background: var(--color-bg-card);
    border: none;
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-neu-sm);
}

.btn-outline:hover {
    color: var(--color-primary);
    box-shadow: var(--shadow-neu);
}

.btn-danger {
    background: var(--color-error);
    color: white;
    border-radius: 24px;
    padding: var(--space-3) var(--space-5);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 12px rgba(201, 87, 74, 0.4), -4px -4px 12px rgba(255, 255, 255, 0.3);
}

.btn-danger:hover {
    background: #b84a3f;
    transform: translateY(-2px);
    box-shadow: 6px 6px 16px rgba(201, 87, 74, 0.5), -6px -6px 16px rgba(255, 255, 255, 0.4);
}

.btn-danger:active {
    transform: translateY(1px);
    box-shadow: inset 4px 4px 8px rgba(150, 50, 40, 0.4), inset -4px -4px 8px rgba(220, 100, 90, 0.3);
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-left: 40px;
    border: none;
    border-radius: 24px;
    font-size: 0.95rem;
    background: var(--color-bg-card);
    box-shadow: var(--shadow-neu-inset);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-gray-400);
}

.toolbar-actions {
    display: flex;
    gap: var(--space-2);
}

.select {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: 20px;
    background: var(--color-bg-card);
    box-shadow: var(--shadow-neu-inset);
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--color-text-primary);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stats Widgets */
.stats-grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: 1fr;
    margin-bottom: var(--space-6);
}

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Neumorphic Stats Widget - iOS-matched 3D effect */
.stats-widget {
    background: var(--color-bg-card);
    border-radius: 24px;
    padding: var(--space-6);
    box-shadow: 8px 8px 16px var(--neu-shadow-dark),
                -8px -8px 16px var(--neu-shadow-light);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Top highlight for 3D effect */
.stats-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.stats-widget:hover {
    transform: translateY(-3px);
    box-shadow: 10px 10px 20px var(--neu-shadow-dark),
                -10px -10px 20px var(--neu-shadow-light);
}

/* Clickable stat widget */
.stats-widget-clickable {
    cursor: pointer;
    user-select: none;
}

.stats-widget-clickable:active {
    transform: translateY(1px);
    box-shadow: inset 4px 4px 8px var(--neu-shadow-dark),
                inset -4px -4px 8px var(--neu-shadow-light);
}

.stats-widget-clickable.active {
    box-shadow: inset 4px 4px 10px var(--neu-shadow-dark),
                inset -4px -4px 10px var(--neu-shadow-light);
    transform: translateY(0);
}

.stats-widget-clickable.active .stats-widget-hint svg {
    transform: rotate(180deg);
}

/* Chevron hint in bottom-right of clickable widget */
.stats-widget-hint {
    position: absolute;
    bottom: 10px;
    right: 14px;
    color: var(--color-text-muted);
    opacity: 0.6;
    line-height: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.stats-widget-hint svg {
    transition: transform 0.25s ease;
}

.stats-widget-clickable:hover .stats-widget-hint {
    opacity: 1;
}

/* Stat detail panel */
.stat-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    margin-bottom: 0;
}

.stat-detail-panel.open {
    max-height: 600px;
    opacity: 1;
    margin-bottom: var(--space-6);
}

.stat-detail-panel > * {
    background: var(--color-bg-card);
    border-radius: 20px;
    padding: var(--space-6);
    box-shadow: var(--shadow-neu);
}

.stat-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.stat-detail-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stat-detail-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.stat-detail-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--color-bg-main);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-neu-sm);
    transition: all 0.2s ease;
}

.stat-detail-close:hover {
    box-shadow: var(--shadow-neu);
    color: var(--color-text-primary);
}

.stat-detail-body {
    /* empty — charts render inside here */
}

.stat-detail-chart-wrap {
    position: relative;
    width: 100%;
}

.stat-detail-two-col {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--space-6);
    align-items: center;
}

@media (max-width: 767px) {
    .stat-detail-two-col {
        grid-template-columns: 1fr;
    }

    .stat-detail-two-col > .stat-detail-chart-wrap:first-child {
        max-width: 240px !important;
        margin: 0 auto;
    }

    .stat-detail-panel.open {
        max-height: 900px;
    }
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 4px 4px 8px rgba(74, 74, 74, 0.2),
                inset -4px -4px 8px rgba(255, 255, 255, 0.7);
    background: linear-gradient(145deg, rgba(74, 74, 74, 0.05) 0%, rgba(255, 255, 255, 0.05) 100%);
}

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

.stats-content {
    flex: 1;
}

.stats-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
    font-weight: 500;
}

.stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.stats-trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: var(--space-1);
}

/* Data Table with Score Cells (FeedBacker-style) */
.data-table-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

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

.data-table thead {
    background: var(--color-gray-50);
}

.data-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-gray-200);
}

.data-table th:first-child {
    border-top-left-radius: var(--radius-md);
}

.data-table th:last-child {
    border-top-right-radius: var(--radius-md);
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-gray-100);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

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

.data-table tbody tr:hover {
    background: var(--color-gray-50);
}

/* Score Cells */
.score-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

.score-cell.high {
    background: var(--color-primary);
    color: white;
}

.score-cell.medium {
    background: var(--color-accent-light);
    color: var(--color-text-primary);
}

.score-cell.low {
    background: var(--color-gray-300);
    color: var(--color-text-secondary);
}

/* Team/Category Row Header */
.table-row-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    color: var(--color-text-primary);
}

.table-row-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table-row-icon svg {
    width: 100%;
    height: 100%;
}

/* Score Metric Circle (like FeedBacker's 8.2 / 10 circle) */
.score-metric-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(133, 138, 107, 0.08) 0%,
        rgba(133, 138, 107, 0.02) 70%,
        transparent 100%
    );
}

.score-circle::after {
    content: '';
    position: absolute;
    width: 85%;
    height: 85%;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(133, 138, 107, 0.05) 0%,
        transparent 70%
    );
}

.score-value-large {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    z-index: 1;
    line-height: 1;
}

.score-denominator {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    z-index: 1;
}

.score-label-text {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Metric Grid (for score breakdowns) */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.metric-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.metric-score-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.metric-score-badge.olive {
    background: var(--color-primary);
    color: white;
}

.metric-score-badge.gray {
    background: var(--color-gray-400);
    color: white;
}

.metric-score-badge.light {
    background: var(--color-accent-light);
    color: var(--color-text-primary);
}

.metric-info {
    flex: 1;
}

.metric-name {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.metric-value-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Chart Widgets - Neomorphic Style */
.chart-widget {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-neu);
    border: 1px solid rgba(163, 157, 147, 0.1);
    position: relative;
    overflow: hidden;
}

/* Subtle highlight gradient for 3D depth */
.chart-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 50%;
    bottom: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    pointer-events: none;
    border-radius: var(--radius-lg) 0 0 0;
}

.chart-header {
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

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

.chart-canvas-container {
    position: relative;
    z-index: 1;
}

/* Activity List - Neomorphic Style */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.activity-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-neu-sm);
    border: 1px solid rgba(163, 157, 147, 0.1);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    position: relative;
    overflow: hidden;
}

.activity-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 60%;
    bottom: 60%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, transparent 60%);
    pointer-events: none;
    border-radius: var(--radius-md) 0 0 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

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

.activity-action {
    font-weight: 500;
    color: var(--color-gray-900);
    margin-bottom: 2px;
}

.activity-card-name {
    font-size: 0.85rem;
    color: var(--color-gray-600);
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 2px;
}

.activity-timestamp {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    white-space: nowrap;
}

/* Clickable Activity Item */
.activity-item-clickable {
    transition: all 0.2s ease;
}

.activity-item-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neu), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
}

.activity-item-clickable:active {
    transform: translateY(0);
}

.activity-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-400);
    margin-left: auto;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.activity-item-clickable:hover .activity-chevron {
    opacity: 1;
    color: var(--color-primary);
    transform: translateX(2px);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: var(--space-5);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    text-decoration: none;
    transition: all 0.2s;
}

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

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.action-content {
    flex: 1;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: var(--space-1);
}

.action-description {
    font-size: 0.85rem;
    color: var(--color-gray-600);
}

/* Section Header */
.section-header {
    margin-bottom: var(--space-4);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

/* Refresh Button Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

.btn-icon.refreshing svg {
    animation: spin 1s linear infinite;
}

.btn-icon:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Responsive - Tablet & below */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .search-box {
        min-width: 0;
        width: 100%;
    }

    .toolbar-actions {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .toolbar-actions .select {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: var(--space-2) var(--space-3);
    }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    .share-header {
        flex-direction: column;
    }

    .share-stats {
        gap: var(--space-4);
    }

    .search-box {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }

    .stats-widget {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .stats-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .stats-icon {
        margin: 0 auto var(--space-2);
    }

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

    .activity-timestamp {
        width: 100%;
        text-align: left;
    }

    /* Card preview adjustments for mobile */
    .card-actions {
        flex-direction: column;
        gap: var(--space-2);
    }

    .btn-icon {
        width: auto;
    }

    /* Page header adjustments for mobile */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: var(--space-3);
    }

    .page-header-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .page-header-actions .btn-icon {
        width: auto;
        flex: none;
    }

    /* Toolbar actions full-width on mobile */
    .toolbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .toolbar-actions .select {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }

    /* Bulk actions responsive */
    #bulk-actions,
    #rc-bulk-actions {
        flex-wrap: wrap !important;
        width: 100%;
    }

    #bulk-actions button,
    #rc-bulk-actions button {
        flex: 1;
        min-width: 0;
    }

    /* Hide sync indicator on mobile to save space */
    #sync-indicator {
        display: none !important;
    }

    /* Toast adjustments */
    .toast {
        min-width: 0;
        max-width: calc(100vw - 2rem);
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    /* Keep button text visible for clarity - icons alone are confusing */
    .page-header-actions .btn-icon span {
        display: inline;
        font-size: 0.9rem;
    }

    .page-header-actions .btn-icon {
        padding: var(--space-3) var(--space-4);
        min-height: 48px;
    }

    /* Stack select dropdowns vertically */
    .toolbar-actions .select {
        flex: 1 1 100%;
    }

    /* Compact toolbar */
    .toolbar {
        gap: var(--space-2);
    }

    .search-box {
        min-width: 0;
        max-width: 100%;
    }

    .search-box input {
        font-size: 0.85rem;
        padding: var(--space-2) var(--space-3);
        padding-left: 36px;
    }
}

/* Survey Components */
.survey-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-neu);
    margin-bottom: var(--space-4);
    transition: all 0.2s ease;
}

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

.survey-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.survey-card-info {
    flex: 1;
}

.survey-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.survey-card-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.survey-card-actions {
    display: flex;
    gap: var(--space-2);
}

.survey-questions-preview {
    padding-top: var(--space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.survey-questions-preview h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
}

.survey-questions-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.survey-questions-preview li {
    padding: var(--space-2) 0;
    color: var(--color-gray-700);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.survey-questions-preview li.more-questions {
    color: var(--color-gray-500);
    font-style: italic;
}

.question-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--color-gray-100);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--color-gray-600);
}

/* Question Analysis */
.question-analysis-card {
    background: white;
    border-radius: 12px;
    padding: var(--space-6);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-4);
}

.question-analysis-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: var(--space-1);
}

.question-analysis-meta {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-bottom: var(--space-4);
}

/* Question Breakdown */
.question-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.breakdown-item {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: var(--space-3);
    align-items: center;
}

.breakdown-label {
    font-size: 0.9rem;
    color: var(--color-gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breakdown-bar {
    height: 24px;
    background: var(--color-gray-100);
    border-radius: 12px;
    overflow: hidden;
}

.breakdown-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    transition: width 0.3s ease;
}

.breakdown-stats {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-700);
    white-space: nowrap;
}

/* Rating Analysis */
.rating-analysis {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: var(--space-6);
    align-items: center;
}

.rating-average {
    text-align: center;
}

.rating-average .rating-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.rating-average .rating-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-top: var(--space-2);
}

.rating-distribution {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.rating-dist-item {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: var(--space-2);
    align-items: center;
    font-size: 0.85rem;
}

.rating-dist-bar {
    height: 20px;
    background: var(--color-gray-100);
    border-radius: 10px;
    overflow: hidden;
}

.rating-dist-fill {
    height: 100%;
    background: var(--color-warning);
}

/* Text Responses */
.text-responses {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.text-response {
    padding: var(--space-3);
    background: var(--color-gray-50);
    border-radius: 8px;
    border-left: 3px solid var(--color-primary);
}

.text-response p {
    font-size: 0.95rem;
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
    font-style: italic;
}

.text-response-meta {
    font-size: 0.8rem;
    color: var(--color-gray-500);
}

.text-responses-more {
    font-size: 0.85rem;
    color: var(--color-gray-500);
    text-align: center;
    margin-top: var(--space-2);
}

/* Responses Table */
.responses-table {
    background: white;
    border-radius: 12px;
    padding: var(--space-4);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

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

.responses-table th {
    text-align: left;
    padding: var(--space-3);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-700);
    border-bottom: 2px solid var(--color-gray-200);
}

.responses-table td {
    padding: var(--space-3);
    font-size: 0.9rem;
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-gray-200);
}

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

.source-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--color-gray-100);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: white;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    color: var(--color-gray-700);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: var(--space-3);
}

.btn-back:hover {
    background: var(--color-gray-50);
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

/* Responsive Survey Styles */
@media (max-width: 768px) {
    .survey-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .breakdown-item {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .breakdown-label {
        white-space: normal;
    }

    .rating-analysis {
        grid-template-columns: 1fr;
    }

    .responses-table {
        font-size: 0.85rem;
    }

    .responses-table th,
    .responses-table td {
        padding: var(--space-2);
    }
}

/* Received Cards & Lead Management */
.received-cards-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 1024px) {
    .received-cards-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
}

@media (min-width: 1600px) {
    .received-cards-list {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
}

.received-card-item {
    background: var(--color-bg-card);
    border-radius: 20px;
    padding: var(--space-5);
    box-shadow: var(--shadow-neu);
    border: 1px solid rgba(163, 157, 147, 0.1);
    position: relative;
    transition: all 0.2s ease;
}

.received-card-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-4);
    align-items: start;
    margin-bottom: var(--space-4);
}

.card-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

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

.received-card-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: var(--space-1);
}

.received-card-meta {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    margin-bottom: var(--space-2);
}

.received-card-contact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: 0.85rem;
    color: var(--color-gray-700);
}

.received-card-status {
    text-align: right;
}

.status-badge-large {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-bottom: var(--space-2);
}

.received-date {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    margin-top: var(--space-1);
}

.lead-info-section {
    padding: var(--space-4);
    background: var(--color-gray-50);
    border-radius: 8px;
    margin-bottom: var(--space-4);
}

.lead-status-selector {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.lead-status-selector label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray-700);
}

.lead-last-contacted {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-bottom: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--color-primary);
}

.lead-notes {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.lead-notes label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray-700);
}

.lead-notes textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
}

.lead-notes textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.received-card-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-gray-200);
}

/* Responsive Received Cards */
@media (max-width: 768px) {
    .received-card-header {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .card-avatar-large {
        margin: 0 auto;
    }

    .received-card-info {
        text-align: center;
    }

    .received-card-contact {
        flex-direction: column;
        gap: var(--space-1);
    }

    .received-card-status {
        text-align: center;
    }

    .lead-status-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .received-card-actions {
        flex-direction: column;
    }
}

/* Info Box (for Settings diagnostics) */
.info-box {
    background: var(--color-bg-main);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.info-box strong {
    color: var(--color-text);
}

/* Survey Analytics Enhancements - Neomorphic Style */
.chart-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-neu);
    border: 1px solid rgba(163, 157, 147, 0.1);
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 50%;
    bottom: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    pointer-events: none;
    border-radius: var(--radius-lg) 0 0 0;
}

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

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.stats-subtitle {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
}

/* Time Range Selector - Neomorphic Style */
.time-range-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: var(--shadow-neu-inset);
}

.time-range-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--color-text-primary);
}

.time-range-btn.active {
    background: var(--color-bg-card);
    color: var(--color-accent);
    box-shadow: var(--shadow-neu-sm);
}

/* Enhanced Stats Widget */
.stats-widget .stats-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin-top: 0.25rem;
}

/* ==========================================
   ENHANCED RESPONSIVE DESIGN FOR COMPONENTS
   ========================================== */

/* Charts - Responsive canvas sizing */
@media (max-width: 768px) {
    .chart-widget {
        padding: var(--space-4);
    }

    .chart-canvas-container {
        height: 250px;
        min-height: 200px;
    }

    .chart-title {
        font-size: 1rem;
    }

    .performance-summary {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .chart-canvas-container {
        height: 200px;
    }
}

/* Tables - Horizontal scroll on mobile */
@media (max-width: 768px) {
    .data-table-container {
        border-radius: var(--radius-md);
    }

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

    .data-table th,
    .data-table td {
        padding: var(--space-3);
        font-size: 0.85rem;
    }

    .responses-table {
        border-radius: var(--radius-md);
    }

    .responses-table table {
        min-width: 700px;
    }
}

/* Stats Widgets - Stack on mobile */
@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-widget {
        padding: var(--space-4);
    }

    .stats-icon {
        width: 40px;
        height: 40px;
    }

    .stats-value {
        font-size: 1.75rem;
    }
}

/* Card Info Section - Adjust spacing */
@media (max-width: 768px) {
    .card-info {
        padding: var(--space-4);
    }

    .card-name {
        font-size: 1rem;
    }

    .card-meta {
        font-size: 0.8rem;
    }

    .card-stats {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .card-stat {
        font-size: 0.8rem;
    }
}

/* Card Actions - Stack buttons on mobile */
@media (max-width: 640px) {
    .card-actions {
        flex-direction: column;
        gap: var(--space-2);
    }

    .card-actions .btn-secondary {
        width: 100%;
    }
}

/* Quick Actions - Responsive grid */
@media (max-width: 640px) {
    .quick-actions {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .action-card {
        padding: var(--space-4);
    }
}

/* Activity Feed - Compact on mobile */
@media (max-width: 640px) {
    .activity-item {
        padding: var(--space-3);
    }

    .activity-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

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

    .activity-title {
        font-size: 0.9rem;
    }

    .activity-description {
        font-size: 0.8rem;
    }
}

/* Modal - Full screen on small mobile */
@media (max-width: 480px) {
    .modal-overlay {
        padding: var(--space-3);
        align-items: flex-start;
        padding-top: var(--space-8);
    }

    .modal {
        max-width: 100%;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }

    .modal-title {
        font-size: 1.25rem;
    }
}

/* Forms - Stack labels and inputs */
@media (max-width: 640px) {
    .form-group label {
        font-size: 0.85rem;
    }

    input,
    textarea,
    select {
        font-size: 1rem; /* Prevent zoom on iOS */
    }
}

/* Badge Groups - Wrap on mobile */
@media (max-width: 640px) {
    .badge-group {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
}

/* Time Range Selector - Smaller buttons */
@media (max-width: 640px) {
    .time-range-selector {
        gap: var(--space-1);
        flex-wrap: wrap;
    }

    .time-range-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Share Card Grid - Optimize for all screens */
@media (max-width: 1024px) {
    .shared-card-item {
        padding: var(--space-4);
    }
}

@media (max-width: 640px) {
    .shared-card-item {
        flex-direction: column;
        gap: var(--space-3);
    }

    .shared-card-preview {
        width: 100%;
        max-width: 100%;
    }

    .shared-card-info {
        width: 100%;
    }

    .shared-card-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Survey Results - Responsive charts */
@media (max-width: 768px) {
    .survey-question {
        padding: var(--space-4);
    }

    .option-bar {
        height: 24px;
    }

    .rating-distribution {
        gap: var(--space-2);
    }
}

/* Empty State - Adjust sizing */
@media (max-width: 640px) {
    .empty-state {
        padding: var(--space-8) var(--space-4);
    }

    .empty-icon {
        width: 60px;
        height: 60px;
    }

    .empty-title {
        font-size: 1.25rem;
    }

    .empty-description {
        font-size: 0.9rem;
    }
}

/* Ensure proper text wrapping on all sizes */
@media (max-width: 768px) {
    .card-title,
    .page-title,
    .modal-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .nav-link,
    .action-card {
        min-height: 44px; /* iOS recommended touch target */
    }

    input[type="checkbox"],
    input[type="radio"] {
        min-width: 20px;
        min-height: 20px;
    }
}

/* ==========================================
   COMPREHENSIVE NEUMORPHIC STYLING
   ========================================== */

/* Neumorphic Form Elements - iOS-matched inset effect (soft blur) */
.neu-input,
.neu-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    background: var(--color-bg-main);
    border: none;
    border-radius: 20px; /* More rounded */
    padding: var(--space-3) var(--space-5);
    box-shadow: inset 5px 5px 14px rgba(74, 74, 74, 0.2),
                inset -5px -5px 14px rgba(255, 255, 255, 0.4);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

/* Inner top-left shadow gradient for depth */
.neu-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

.neu-input:focus,
.neu-select:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: inset 6px 6px 16px rgba(74, 74, 74, 0.22),
                inset -6px -6px 16px rgba(255, 255, 255, 0.5),
                0 0 0 3px rgba(125, 125, 125, 0.15);
}

.neu-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236c7a89' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-8);
}

/* Neumorphic Charts - Soft blur */
.chart-widget-neu {
    background: var(--color-bg-card);
    border-radius: 28px; /* More rounded */
    padding: var(--space-6);
    box-shadow: var(--shadow-neu);
    border: 1px solid rgba(163, 157, 147, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.chart-widget-neu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 50%;
    bottom: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    pointer-events: none;
    border-radius: 28px 0 0 0;
}

.chart-widget-neu:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neu-lg);
}

.chart-widget-neu .chart-header {
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.chart-widget-neu .chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

/* Neumorphic Empty States */
.empty-state-neu {
    background: var(--color-bg-card);
    border-radius: 24px;
    padding: var(--space-10) var(--space-6);
    box-shadow: var(--shadow-neu-inset);
    text-align: center;
}

.empty-state-neu .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.empty-state-neu .empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-neu .empty-description {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Neumorphic Activity Feed */
.activity-feed-neu {
    background: var(--color-bg-card);
    border-radius: 20px;
    padding: var(--space-5);
    box-shadow: var(--shadow-neu);
}

.activity-item-neu {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: 16px;
    transition: all 0.3s ease;
    margin-bottom: var(--space-2);
}

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

.activity-item-neu:last-child {
    margin-bottom: 0;
}

.activity-icon-neu {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: var(--shadow-neu-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Enhanced Quick Actions - iOS-matched neomorphic styling */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-5);
}

.action-card {
    background: var(--color-bg-card);
    border-radius: 24px;
    padding: var(--space-6);
    box-shadow: 8px 8px 16px var(--neu-shadow-dark),
                -8px -8px 16px var(--neu-shadow-light);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Top highlight for 3D effect */
.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 10px 10px 20px var(--neu-shadow-dark),
                -10px -10px 20px var(--neu-shadow-light);
}

.action-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2);
}

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

.action-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.action-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Neumorphic Badges and Pills */
.badge-neu {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-neu-sm);
}

.badge-neu.badge-primary {
    background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary));
    color: white;
}

.badge-neu.badge-success {
    background: linear-gradient(145deg, #34d399, var(--color-success));
    color: white;
}

.badge-neu.badge-warning {
    background: linear-gradient(145deg, #fbbf24, var(--color-warning));
    color: white;
}

/* Neumorphic Data Tables */
.data-table-neu {
    background: var(--color-bg-card);
    border-radius: 20px;
    padding: var(--space-5);
    box-shadow: var(--shadow-neu);
    overflow: hidden;
}

.data-table-neu table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table-neu th {
    padding: var(--space-3);
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-bg-hover);
}

.data-table-neu td {
    padding: var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--color-bg-hover);
}

.data-table-neu tr:last-child td {
    border-bottom: none;
}

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

/* Neumorphic Toggle Switch */
.toggle-neu {
    position: relative;
    width: 56px;
    height: 30px;
    background: var(--color-bg-main);
    border-radius: 15px;
    box-shadow: var(--shadow-neu-inset);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-neu input {
    display: none;
}

.toggle-neu-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: var(--color-bg-card);
    border-radius: 50%;
    box-shadow: var(--shadow-neu-sm);
    transition: all 0.3s ease;
}

.toggle-neu input:checked + .toggle-neu-slider {
    transform: translateX(26px);
    background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary));
}

/* Neumorphic Search Bar */
.search-bar-neu {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar-neu input {
    width: 100%;
    padding-left: var(--space-10);
}

.search-bar-neu::before {
    content: "🔍";
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
}

/* Neumorphic Icon Buttons */
.icon-btn-neu {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-neu-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn-neu:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neu);
}

.icon-btn-neu:active {
    box-shadow: var(--shadow-neu-inset);
    transform: translateY(0);
}

.icon-btn-neu svg {
    width: 20px;
    height: 20px;
    color: var(--color-text-primary);
}

/* Neumorphic Progress Bar */
.progress-bar-neu {
    height: 12px;
    background: var(--color-bg-main);
    border-radius: 6px;
    box-shadow: var(--shadow-neu-inset);
    overflow: hidden;
}

.progress-fill-neu {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
    border-radius: 6px;
    transition: width 0.3s ease;
}

/* Enhanced Card Info Section - Neomorphic rounded */
.card-info {
    padding: var(--space-4);
    background: var(--color-bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-neu-sm);
    border: 1px solid rgba(153, 153, 161, 0.08);
}

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.card-meta {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.card-stats {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-3);
}

.card-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-main);
    border-radius: 10px;
    box-shadow: var(--shadow-neu-inset);
}

/* Neumorphic Stat Card */
.stat-card-neu {
    background: var(--color-bg-card);
    border-radius: 20px;
    padding: var(--space-6);
    box-shadow: var(--shadow-neu);
    transition: all 0.3s ease;
}

.stat-card-neu:hover {
    transform: translateY(-4px);
}

.stat-card-neu .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    box-shadow: var(--shadow-neu-inset);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
}

.stat-card-neu .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

.stat-card-neu .stat-label {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* ==========================================
   CIRCULAR SELECTION CHECKBOXES
   ========================================== */

/* Custom circular checkbox for card selection */
.card-preview input[type="checkbox"],
.selection-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-bg-card);
    border: 2px solid var(--color-gray-400);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-neu-sm);
}

.card-preview input[type="checkbox"]:hover,
.selection-checkbox:hover {
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.card-preview input[type="checkbox"]:checked,
.selection-checkbox:checked {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(102, 102, 110, 0.4);
}

.card-preview input[type="checkbox"]:checked::after,
.selection-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

/* Bulk action buttons - ensure rounded */
#bulk-actions .btn-secondary,
#bulk-actions button {
    border-radius: 24px;
    padding: var(--space-2) var(--space-4);
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Normal action buttons (Select, Refresh) - match bulk actions styling */
#normal-actions .btn-secondary,
#normal-actions button,
#rc-normal-actions .btn-secondary,
#rc-normal-actions button {
    border-radius: 24px;
    padding: var(--space-2) var(--space-4);
    font-weight: 600;
    transition: all 0.2s ease;
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    border: none;
    box-shadow: var(--shadow-neu-sm);
}

#normal-actions .btn-secondary:hover,
#normal-actions button:hover,
#rc-normal-actions .btn-secondary:hover,
#rc-normal-actions button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neu);
}

#normal-actions .btn-secondary:active,
#normal-actions button:active,
#rc-normal-actions .btn-secondary:active,
#rc-normal-actions button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-neu-inset);
}

#select-all-btn {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    border: none;
    box-shadow: var(--shadow-neu-sm);
}

#select-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neu);
}

#cancel-select-btn {
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    border: none;
    box-shadow: var(--shadow-neu-sm);
}

#cancel-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-neu);
}

/* Selection count badge */
#selection-count {
    background: var(--color-bg-card);
    padding: var(--space-2) var(--space-3);
    border-radius: 20px;
    font-weight: 600;
    box-shadow: var(--shadow-neu-inset);
}

/* ==========================================
   ADDITIONAL ROUNDED UI ELEMENTS
   ========================================== */

/* Toolbar rounded styling */
.toolbar {
    background: var(--color-bg-card);
    padding: var(--space-4);
    border-radius: 24px;
    box-shadow: var(--shadow-neu);
    margin-bottom: var(--space-6);
}

/* Toolbar Row - Individual rows within toolbar sections */
.toolbar-row {
    background: var(--color-bg-card);
    padding: var(--space-4);
    border-radius: 24px;
    box-shadow: var(--shadow-neu);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Search box within toolbar row - full width */
.toolbar-row .search-box {
    flex: 1;
    width: 100%;
}

/* Toolbar actions within toolbar row */
.toolbar-row .toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    width: 100%;
}

/* Select dropdown rounded */
.toolbar select,
#sort-select {
    border-radius: 20px;
    padding: var(--space-2) var(--space-4);
    padding-right: var(--space-8);
    background: var(--color-bg-main);
    border: none;
    box-shadow: var(--shadow-neu-inset);
    cursor: pointer;
}

/* Page description rounded badge */
.page-description {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Sync indicator pill */
#sync-indicator {
    background: var(--color-bg-card);
    padding: var(--space-1) var(--space-3);
    border-radius: 20px;
    box-shadow: var(--shadow-neu-sm);
}

/* Card share stats rounded */
.card-share-stats {
    background: var(--color-bg-main);
    padding: var(--space-2) var(--space-3);
    border-radius: 16px;
    box-shadow: var(--shadow-neu-inset);
}

/* ==========================================
   Survey Library & Builder Styles
   ========================================== */

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    background: var(--color-bg-card);
    padding: var(--space-2);
    border-radius: 16px;
    box-shadow: var(--shadow-neu);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: none;
    background: transparent;
    border-radius: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-btn svg {
    flex-shrink: 0;
}

/* Stats Grid 3 columns */
.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

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

/* Survey Library Cards - Improved responsive breakpoints */
#survey-library-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    #survey-library-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

/* Desktop: 2 columns with more spacing */
@media (min-width: 1024px) {
    #survey-library-list {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
}

/* Large desktop: 3 columns */
@media (min-width: 1400px) {
    #survey-library-list {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-6);
    }
}

.library-survey-card {
    background: var(--color-bg-card);
    border-radius: 16px;
    padding: var(--space-5);
    box-shadow: var(--shadow-neu);
    border: 1px solid rgba(163, 157, 147, 0.1);
    transition: all 0.2s ease;
}

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

.library-survey-card.disabled {
    opacity: 0.7;
}

.library-survey-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.library-survey-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.library-survey-status.enabled {
    background: var(--color-success);
}

.library-survey-status.disabled {
    background: var(--color-warning);
}

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

.library-survey-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
}

.library-survey-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.library-survey-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.in-use-badge {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.library-survey-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.library-survey-actions .btn-icon {
    flex: 1;
    min-width: 0;
    width: auto;
    height: auto;
    padding: var(--space-3) var(--space-4);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    gap: var(--space-2);
    min-height: 44px;
    justify-content: center;
}

.library-survey-actions .btn-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.library-survey-actions .btn-icon.btn-danger {
    color: var(--color-error);
}

.library-survey-actions .btn-icon.btn-danger:hover {
    background: var(--color-error);
    color: white;
}

/* Responsive breakpoints for survey actions */
@media (max-width: 640px) {
    .library-survey-actions {
        flex-direction: column;
    }

    .library-survey-actions .btn-icon {
        width: 100%;
        flex: none;
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .library-survey-actions .btn-icon {
        flex: 1 1 calc(50% - var(--space-2));
    }

    .library-survey-actions .btn-icon:last-child:nth-child(odd) {
        flex: 1 1 100%;
    }
}

@media (min-width: 901px) {
    .library-survey-actions {
        justify-content: flex-start;
    }

    .library-survey-actions .btn-icon {
        flex: 0 1 auto;
        min-width: 120px;
    }
}

/* Create Survey Button - Primary accent style */
.btn-create-survey {
    background: var(--color-accent) !important;
    color: white !important;
    padding: var(--space-3) var(--space-6) !important;
    border-radius: 24px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    box-shadow: 8px 8px 16px var(--neu-shadow-dark),
                -8px -8px 16px var(--neu-shadow-light) !important;
}

.btn-create-survey::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%) !important;
}

.btn-create-survey:hover {
    background: var(--color-accent-hover) !important;
    transform: translateY(-2px);
    box-shadow: 10px 10px 20px var(--neu-shadow-dark),
                -10px -10px 20px var(--neu-shadow-light) !important;
}

.btn-create-survey svg {
    width: 18px !important;
    height: 18px !important;
    color: white !important;
}

.library-survey-description {
    margin-top: var(--space-3);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.library-survey-questions {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.question-preview {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    font-size: 0.9rem;
}

.question-type-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.question-text {
    color: var(--color-text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.required-badge {
    color: var(--color-error);
    font-weight: 600;
}

.more-questions {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-style: italic;
    padding-top: var(--space-2);
}

/* Survey Builder Form - Two Column Layout */
.survey-builder-form {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.survey-builder-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-6);
    align-items: start;
}

/* Left Column - Survey Details */
.survey-details-column {
    position: sticky;
    top: var(--space-4);
}

/* Right Column - Questions */
.survey-questions-column {
    min-width: 0;
}

/* Responsive Grid - Stack on Mobile/Tablet */
@media (max-width: 1024px) {
    .survey-builder-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .survey-details-column {
        position: static;
    }

    /* Hide sidebar actions on mobile */
    .form-actions-sidebar {
        display: none;
    }
}

/* Show mobile actions only on mobile */
.form-actions-mobile {
    display: none;
}

@media (max-width: 1024px) {
    .form-actions-mobile {
        display: flex;
        margin-top: var(--space-4);
    }
}

@media (min-width: 1025px) {
    .form-actions-sidebar {
        display: flex;
        margin-top: var(--space-6);
    }
}

.form-section {
    background: var(--color-bg-card);
    border-radius: 16px;
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-neu);
}

/* Responsive form section padding */
@media (max-width: 768px) {
    .form-section {
        padding: var(--space-4);
        margin-bottom: var(--space-4);
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: var(--space-3);
    }
}

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

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.question-count {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    background: var(--color-bg-main);
    padding: var(--space-1) var(--space-3);
    border-radius: 12px;
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.form-group .required {
    color: var(--color-error);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--color-bg-main);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

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

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

/* Responsive form inputs */
@media (max-width: 640px) {
    .form-input {
        padding: var(--space-2) var(--space-3);
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .form-textarea {
        min-height: 60px;
    }

    .form-help {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .form-input {
        padding: var(--space-2);
        font-size: 0.9rem;
    }
}

/* Toggle Switch - Fixed Spacing */
.toggle-label-wrapper {
    margin-bottom: var(--space-2);
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-2) 0;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 48px;
    height: 26px;
    background: #e5e7eb;
    border-radius: 13px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--color-success);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 24px;
}

.toggle-text {
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.toggle-small .toggle-switch {
    width: 40px;
    height: 22px;
}

.toggle-small .toggle-switch::after {
    width: 18px;
    height: 18px;
}

.toggle-small input:checked + .toggle-switch::after {
    left: 20px;
}

/* Empty Questions State */
.empty-questions {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-secondary);
    background: var(--color-bg-main);
    border-radius: 12px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
}

/* Add Question Section */
.add-question-section {
    position: relative;
    margin-top: var(--space-4);
}

.btn-add-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-4);
    background: rgba(16, 185, 129, 0.1);
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    color: #10b981;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-question:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
}

.btn-add-question svg {
    width: 20px;
    height: 20px;
}

/* Question Type Menu */
.question-type-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--space-2);
    background: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.question-type-menu button {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.question-type-menu button:hover {
    background: var(--color-bg-main);
}

.question-type-menu .type-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 8px;
    font-weight: 600;
    flex-shrink: 0;
}

.question-type-menu .type-label {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.95rem;
}

.question-type-menu .type-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* Responsive question type menu */
@media (max-width: 640px) {
    .question-type-menu {
        max-height: 60vh;
    }

    .question-type-menu button {
        padding: var(--space-3);
        gap: var(--space-2);
    }

    .question-type-menu .type-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .question-type-menu .type-label {
        font-size: 0.9rem;
    }

    .question-type-menu .type-desc {
        font-size: 0.8rem;
    }
}

/* Question Card */
.question-card {
    background: var(--color-bg-main);
    border-radius: 12px;
    margin-bottom: var(--space-3);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.question-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

/* Responsive question header */
@media (max-width: 640px) {
    .question-header {
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
    }

    .question-number {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .question-type-badge {
        font-size: 0.75rem;
        padding: 2px 8px;
    }
}

.question-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.question-type-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-bg-card);
    padding: 4px 10px;
    border-radius: 10px;
}

.question-actions {
    margin-left: auto;
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
    align-items: center;
}

/* Question Action Buttons - Properly Sized */
.btn-question-action {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

.btn-question-action:hover {
    background: var(--color-bg-main);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-question-action:active {
    transform: translateY(0);
}

.btn-question-delete {
    color: var(--color-error);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-question-delete:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

/* Responsive question actions */
@media (max-width: 768px) {
    .question-actions {
        gap: var(--space-1);
    }

    .btn-question-action {
        width: 32px;
        height: 32px;
    }

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

@media (max-width: 480px) {
    .question-header {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .btn-question-action {
        width: 28px;
        height: 28px;
    }

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

.question-body {
    padding: var(--space-4);
}

/* Responsive question body */
@media (max-width: 768px) {
    .question-body {
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    .question-body {
        padding: var(--space-2);
    }
}

.question-text-input {
    font-size: 1rem;
    font-weight: 500;
}

/* Options Section */
.options-section {
    margin-top: var(--space-3);
    padding: var(--space-4);
    background: var(--color-bg-card);
    border-radius: 10px;
}

.options-section > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.option-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.option-indicator {
    width: 20px;
    text-align: center;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.option-input {
    flex: 1;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    font-size: 0.9rem;
}

/* Responsive options section */
@media (max-width: 640px) {
    .options-section {
        padding: var(--space-3);
    }

    .option-row {
        gap: var(--space-1);
    }

    .option-indicator {
        width: 16px;
        font-size: 0.85rem;
    }

    .option-input {
        padding: var(--space-2);
        font-size: 0.875rem;
    }

    .option-row .btn-danger-small {
        width: 32px;
        height: 32px;
    }
}

.btn-add-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-card);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-success);
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-neu-sm);
    transition: all 0.2s ease;
}

.btn-add-option svg {
    width: 16px;
    height: 16px;
}

.btn-add-option:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-neu);
}

.btn-add-option:active {
    transform: translateY(0);
    box-shadow: var(--shadow-neu-inset);
}

/* Button Styles - Neomorphic Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-card);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-neu-sm);
    position: relative;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

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

.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-neu);
}

.btn-icon:hover svg {
    color: var(--color-primary);
}

.btn-icon:active {
    transform: translateY(0);
    box-shadow: var(--shadow-neu-inset);
}

.btn-icon.btn-danger:hover {
    background: var(--color-error);
}

.btn-icon.btn-danger:hover svg {
    color: white;
}

.btn-danger-small {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding-top: var(--space-4);
    flex-wrap: wrap;
}

/* Responsive form actions */
@media (max-width: 640px) {
    .form-actions {
        flex-direction: column-reverse;
        gap: var(--space-2);
    }

    .form-actions button {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .form-actions button {
        flex: 1;
        min-width: 120px;
    }
}

/* Button Spinner */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

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

.btn-back svg {
    width: 18px;
    height: 18px;
}

/* Danger button style */
.btn-danger {
    background: var(--color-error) !important;
    color: white !important;
}

.btn-danger:hover {
    background: #dc2626 !important;
}

/* ================================================
   Card Detail Page Styles
   ================================================ */

.card-detail-page {
    max-width: 1200px;
    margin: 0 auto;
}

.card-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    margin-top: var(--space-6);
}

@media (max-width: 900px) {
    .card-detail-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* Centered Single Column Layout */
.card-detail-centered {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

@media (max-width: 480px) {
    .card-detail-centered {
        padding: var(--space-4) var(--space-3);
        gap: var(--space-4);
    }
}

.card-detail-title-section {
    text-align: center;
    margin-top: var(--space-2);
}

.card-detail-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2) 0;
}

@media (max-width: 480px) {
    .card-detail-name {
        font-size: 1.5rem;
    }
}

.card-detail-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
}

.card-detail-pills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Card Preview Section */
.card-detail-preview {
    position: sticky;
    top: var(--space-6);
    align-self: start;
}

@media (max-width: 900px) {
    .card-detail-preview {
        position: static;
    }
}

.card-thumbnail-large {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1.75;
    border-radius: 6% / 10.5%;
    overflow: hidden;
    box-shadow: var(--shadow-neu-lg);
    background: transparent;
}

.card-thumbnail-large.portrait {
    aspect-ratio: 4 / 7;
    border-radius: 10.5% / 6%;
    max-width: 286px; /* 500 × (4/7) */
}

.card-thumbnail-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.card-thumbnail-placeholder {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1.75;
    border-radius: 6% / 10.5%;
    background: var(--color-bg-card);
    box-shadow: var(--shadow-neu-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
}

/* Card Metadata */
.card-meta-info {
    padding: 0;
}

.meta-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-gray-300);
}

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

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

.meta-value {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 0.85rem;
}

/* Info Subsections (for merged Card Information section) */
.info-subsection {
    margin-bottom: var(--space-5);
}

.info-subsection:last-child {
    margin-bottom: 0;
}

.info-subsection-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

/* Share link in meta section */
.meta-item-share {
    flex-wrap: wrap;
    gap: var(--space-2);
}

.meta-share-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.meta-share-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.meta-share-link:hover {
    text-decoration: underline;
}

.btn-copy-small,
.btn-open-small {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-bg-main);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-neu-sm);
    transition: all 0.2s ease;
}

.btn-copy-small:hover,
.btn-open-small:hover {
    color: var(--color-primary);
    box-shadow: var(--shadow-neu-inset);
}

/* Detail Info Section */
.card-detail-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Section Styles */
.detail-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-neu-sm);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-4) 0;
}

.section-icon {
    font-size: 1.1rem;
}

.section-footer {
    margin-top: var(--space-4);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: right;
}

.subsection-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: var(--space-4) 0 var(--space-3) 0;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-gray-300);
}

.empty-section {
    text-align: center;
    padding: var(--space-6);
    color: var(--color-text-muted);
}

.empty-section p {
    margin: 0;
    font-size: 0.9rem;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-success {
    background: var(--color-success);
    color: white;
}

.status-warning {
    background: var(--color-gray-400);
    color: var(--color-text-primary);
}

.status-info {
    background: var(--color-info);
    color: white;
}

.status-error {
    background: var(--color-error);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    gap: var(--space-4);
}

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

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

.stat-card {
    text-align: center;
    padding: var(--space-4);
    background: var(--color-bg-main);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-neu-inset);
}

@media (max-width: 480px) {
    .stat-card {
        padding: var(--space-3);
    }
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 1.25rem;
    }
}

.stat-label {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .stat-label {
        font-size: 0.6rem;
        letter-spacing: 0;
    }
}

.stat-primary .stat-value {
    color: var(--color-primary);
}

.stat-success .stat-value {
    color: var(--color-success);
}

.stat-warning .stat-value {
    color: var(--color-warning);
}

/* Breakdown Grid */
.breakdown-grid {
    background: var(--color-bg-main);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-neu-inset);
    margin-top: var(--space-4);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

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

.breakdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-gray-300);
}

.breakdown-item:nth-last-child(-n+2) {
    border-bottom: none;
}

@media (max-width: 480px) {
    .breakdown-item:last-child {
        border-bottom: none;
    }
    .breakdown-item:nth-last-child(2) {
        border-bottom: 1px solid var(--color-gray-300);
    }
}

.breakdown-icon {
    font-size: 1rem;
}

.breakdown-label {
    flex: 1;
    color: var(--color-text-secondary);
}

.breakdown-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Attachments Grid */
.attachments-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-main);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-neu-inset);
    font-size: 0.85rem;
    color: var(--color-text-primary);
}

.attachment-icon {
    font-size: 1rem;
}

/* Contact List */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.contact-icon {
    font-size: 1rem;
    color: var(--color-text-secondary);
}

.contact-item a {
    color: var(--color-primary);
    text-decoration: none;
    word-break: break-all;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Custom Fields */
.custom-fields {
    margin-top: var(--space-4);
}

.custom-field-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-2) 0;
    gap: var(--space-4);
}

.field-label {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.field-value {
    color: var(--color-text-primary);
    font-size: 0.9rem;
    text-align: right;
    word-break: break-word;
}

/* Web Share Link Section */
.web-share-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-neu-sm);
}

.web-share-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.web-share-icon {
    font-size: 1rem;
}

.web-share-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.web-share-link-container {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-bg-main);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    box-shadow: var(--shadow-neu-inset);
}

.web-share-link {
    flex: 1;
    min-width: 0;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .web-share-link {
        font-size: 0.8rem;
    }
}

.web-share-link:hover {
    text-decoration: underline;
}

.btn-copy-link,
.btn-open-link {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-neu-sm);
    transition: all 0.2s ease;
}

.btn-copy-link:hover,
.btn-open-link:hover {
    color: var(--color-primary);
    box-shadow: var(--shadow-neu-inset);
}

.web-share-meta {
    margin-top: var(--space-3);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Web Shares List Section */
.section-count {
    margin-left: auto;
    background: var(--color-bg-main);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-neu-inset);
}

.shares-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.share-item-card {
    background: var(--color-bg-main);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    box-shadow: var(--shadow-neu-inset);
}

.share-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.share-item-url {
    flex: 1;
    min-width: 0;
}

.share-item-url a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-item-url a:hover {
    text-decoration: underline;
}

.share-status-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-item-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

@media (max-width: 480px) {
    .share-item-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.share-stat {
    text-align: center;
    padding: var(--space-2);
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-neu-sm);
}

.share-stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.share-stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.share-item-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.share-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.btn-share-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-bg-card);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-neu-sm);
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-share-action:hover {
    color: var(--color-primary);
    box-shadow: var(--shadow-neu-inset);
}

.btn-share-action svg {
    flex-shrink: 0;
}

.btn-share-danger {
    color: var(--color-error);
}

.btn-share-danger:hover {
    color: white;
    background: var(--color-error);
}

/* ==========================================
   RECEIVED CARDS PAGE - Grid & Selection Styles
   ========================================== */

/* Grid lead status pill badge */
.grid-lead-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-top: var(--space-2);
    letter-spacing: 0.01em;
}

/* Custom date range picker row */
.custom-date-range {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow-neu-inset);
    flex-wrap: wrap;
}

.custom-date-range input[type="date"] {
    flex: 1;
    min-width: 130px;
    padding: var(--space-2) var(--space-3);
    border-radius: 16px;
    font-size: 0.9rem;
}

.custom-date-range span {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Selected card highlight — grid view */
.card-preview.selected {
    outline: 3px solid var(--color-accent, #66666e);
    outline-offset: 4px;
}

.card-preview.selected .card-thumbnail {
    opacity: 0.85;
}

/* Selected card highlight — list view */
.received-card-item.selected {
    outline: 3px solid var(--color-accent, #66666e);
    outline-offset: -3px;
    background: rgba(133, 138, 107, 0.06);
}

/* List view selection checkbox */
.rc-list-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-bg-card);
    border: 2px solid var(--color-gray-400);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-neu-sm);
    flex-shrink: 0;
    position: relative;
}

.rc-list-checkbox:hover {
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.rc-list-checkbox:checked {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(102, 102, 110, 0.4);
}

.rc-list-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Bulk actions bar styling for received cards */
#rc-bulk-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

#rc-bulk-actions button {
    border-radius: 20px;
    padding: var(--space-2) var(--space-4);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

#rc-selection-count {
    background: var(--color-bg-card);
    padding: var(--space-2) var(--space-3);
    border-radius: 20px;
    font-weight: 600;
    box-shadow: var(--shadow-neu-inset);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* View toggle active state */
#rc-view-toggle-btn.active,
.btn-icon.view-active {
    box-shadow: var(--shadow-neu-inset);
    color: var(--color-accent);
}

/* Received cards toolbar — ensure dropdowns fit nicely */
#rc-status-filter,
#rc-date-filter,
#rc-sort-select {
    border-radius: 20px;
    padding: var(--space-2) var(--space-4);
    padding-right: var(--space-8);
    background: var(--color-bg-main);
    border: none;
    box-shadow: var(--shadow-neu-inset);
    cursor: pointer;
    font-size: 0.9rem;
}

/* Responsive adjustments for received cards grid */
@media (max-width: 640px) {
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-date-range input[type="date"] {
        width: 100%;
    }

    #rc-bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #rc-bulk-actions button {
        width: 100%;
    }
}

/* ==============================
   Custom Fields - Received Card Detail
   ============================== */

.cf-section {
    margin-bottom: 1.5rem;
}

.cf-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.cf-section-header svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.cf-fields-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cf-field-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg-card);
    box-shadow: var(--shadow-neu-inset);
    border-radius: 16px;
    transition: transform 0.15s ease;
}

.cf-field-card:hover {
    transform: translateY(-1px);
}

.cf-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.cf-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.cf-qr-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 16px;
    height: 16px;
    background: #00796b;
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
}

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

.cf-field-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.cf-field-value {
    font-size: 0.9rem;
    color: var(--color-text-primary);
    word-break: break-word;
}

.cf-field-value a {
    color: var(--color-accent, #858A6B);
    text-decoration: none;
}

.cf-field-value a:hover {
    text-decoration: underline;
}

.cf-copy-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    color: var(--color-text-muted);
}

.cf-field-card:hover .cf-copy-btn {
    opacity: 1;
}

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

.cf-copy-btn svg {
    width: 16px;
    height: 16px;
}

.cf-copy-btn.copied {
    opacity: 1;
    color: #10b981;
}

/* Icon color variants */
.cf-icon-text { background: #e8f0fe; color: #1a73e8; }
.cf-icon-email { background: #fce8e6; color: #d93025; }
.cf-icon-phone { background: #e6f4ea; color: #137333; }
.cf-icon-website { background: #e8f0fe; color: #1a73e8; }
.cf-icon-social { background: #f3e8fd; color: #8430ce; }
.cf-icon-address { background: #fef7e0; color: #e37400; }
.cf-icon-notes { background: #e8eaed; color: #5f6368; }
.cf-icon-qrcode { background: #e0f2f1; color: #00796b; }

/* ==============================
   Surveys - Received Card Detail
   ============================== */

.survey-section {
    margin-bottom: 1.5rem;
}

.survey-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

.survey-section-header svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

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

.survey-card {
    background: var(--color-bg-card);
    box-shadow: var(--shadow-neu);
    border-radius: 16px;
    padding: 16px;
    transition: transform 0.15s ease;
}

.survey-card:hover {
    transform: translateY(-1px);
}

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

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

.survey-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}

.survey-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.survey-respond-btn {
    flex-shrink: 0;
    padding: 6px 16px;
    border: none;
    background: var(--color-accent, #858A6B);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.survey-respond-btn:hover {
    opacity: 0.85;
}

.survey-respond-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Survey inline form */
.survey-form-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(163, 157, 147, 0.2);
}

.survey-form-question {
    margin-bottom: 1rem;
}

.survey-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    display: block;
}

.survey-form-label .required-mark {
    color: #d93025;
    margin-left: 2px;
}

.survey-form-textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    background: var(--color-bg-main);
    box-shadow: var(--shadow-neu-inset);
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--color-text-primary);
    resize: vertical;
    box-sizing: border-box;
}

.survey-form-textarea:focus {
    outline: none;
    box-shadow: var(--shadow-neu-inset), 0 0 0 2px var(--color-accent, #858A6B);
}

.survey-radio-group,
.survey-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.survey-radio-option,
.survey-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-main);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.survey-radio-option:hover,
.survey-checkbox-option:hover {
    background: var(--color-bg-card);
}

.survey-radio-option input,
.survey-checkbox-option input {
    accent-color: var(--color-accent, #858A6B);
}

.survey-radio-option label,
.survey-checkbox-option label {
    font-size: 0.85rem;
    color: var(--color-text-primary);
    cursor: pointer;
}

.survey-rating-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.survey-rating-option {
    position: relative;
}

.survey-rating-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.survey-rating-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--color-bg-main);
    box-shadow: var(--shadow-neu-sm, 2px 2px 4px rgba(163,157,147,0.3), -2px -2px 4px rgba(255,255,255,0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}

.survey-rating-option input:checked + label {
    background: var(--color-accent, #858A6B);
    color: white;
    box-shadow: var(--shadow-neu-inset);
}

.survey-rating-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 2px;
}

.survey-yesno-group {
    display: flex;
    gap: 10px;
}

.survey-yesno-option {
    position: relative;
    flex: 1;
}

.survey-yesno-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.survey-yesno-option label {
    display: block;
    text-align: center;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--color-bg-main);
    box-shadow: var(--shadow-neu-sm, 2px 2px 4px rgba(163,157,147,0.3), -2px -2px 4px rgba(255,255,255,0.8));
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}

.survey-yesno-option input:checked + label {
    background: var(--color-accent, #858A6B);
    color: white;
    box-shadow: var(--shadow-neu-inset);
}

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

.survey-form-cancel {
    padding: 8px 20px;
    border: none;
    background: var(--color-bg-main);
    box-shadow: var(--shadow-neu-sm, 2px 2px 4px rgba(163,157,147,0.3), -2px -2px 4px rgba(255,255,255,0.8));
    color: var(--color-text-secondary);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.survey-form-cancel:hover {
    box-shadow: var(--shadow-neu-inset);
}

.survey-form-submit {
    padding: 8px 20px;
    border: none;
    background: var(--color-accent, #858A6B);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.survey-form-submit:hover {
    opacity: 0.85;
}

.survey-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.survey-success-msg {
    text-align: center;
    padding: 12px;
    color: #10b981;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Detail modal thumbnail */
.detail-thumbnail {
    width: 100%;
    border-radius: 6% / 10.5%;
    overflow: hidden;
    margin-bottom: 1rem;
    aspect-ratio: 1.75;
    background: transparent;
}

.detail-thumbnail.portrait {
    aspect-ratio: 4 / 7;
    border-radius: 10.5% / 6%;
    max-width: 57%; /* keeps portrait from spanning full modal width */
}

.detail-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* Detail modal contact with SVG icons */
.detail-contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.detail-contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--color-bg-main);
}

.detail-contact-icon svg {
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
}

.detail-contact-item a {
    color: var(--color-accent, #858A6B);
    text-decoration: none;
    font-size: 0.9rem;
}

.detail-contact-item a:hover {
    text-decoration: underline;
}

/* Mobile responsive for custom fields & surveys */
@media (max-width: 640px) {
    .cf-copy-btn {
        opacity: 1;
    }

    .survey-rating-group {
        gap: 6px;
    }

    .survey-rating-option label {
        width: 38px;
        height: 38px;
        font-size: 0.8rem;
    }

    /* SURVEY CARD MOBILE FIX - Stack Actions Vertically */
    .library-survey-header {
        flex-direction: column;
        gap: var(--space-3);
    }

    .library-survey-info {
        width: 100%;
    }

    .library-survey-title {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .library-survey-actions {
        width: 100%;
        flex-direction: column;
        gap: var(--space-2);
    }

    .library-survey-actions .btn-icon {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        font-size: 0.95rem;
    }

    /* Card Actions Full Width */
    .card-actions {
        flex-direction: column;
    }

    .card-actions .btn-icon {
        width: 100%;
        min-height: 48px;
    }
}

/* ===================
   DASHBOARD REFRESH & LAST UPDATED
   =================== */

/* Last updated indicator */
.dashboard-last-updated {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.05),
                inset -2px -2px 4px rgba(255, 255, 255, 0.7);
}

.last-updated-label {
    font-weight: 500;
}

.last-updated-time {
    color: var(--color-primary);
    font-weight: 600;
}

/* Stale data indicator */
.dashboard-last-updated.stale {
    animation: pulse-stale 2s ease-in-out infinite;
}

.dashboard-last-updated.stale .last-updated-time {
    color: var(--color-warning);
}

@keyframes pulse-stale {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Refresh button states */
#dashboard-refresh-btn {
    transition: all 0.2s ease;
}

#dashboard-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#dashboard-refresh-btn.refresh-success {
    background: var(--color-success) !important;
    color: white !important;
}

#dashboard-refresh-btn.refresh-error {
    background: var(--color-error) !important;
    color: white !important;
}

/* Spin animation for refresh icon and loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pro Modal Enhanced Styles */
.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    transition: all 0.2s ease;
}

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

/* Mobile adjustments for dashboard header */
@media (max-width: 768px) {
    .dashboard-last-updated {
        font-size: 0.8rem;
        padding: var(--space-2);
    }

    .last-updated-label {
        display: none; /* Hide "Last updated:" label on mobile */
    }
}

@media (max-width: 640px) {
    .page-header .page-header-actions {
        flex-direction: row !important; /* Keep horizontal on dashboard */
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .dashboard-last-updated {
        order: 2;
        flex: 1 1 100%;
        justify-content: center;
    }

    #dashboard-refresh-btn {
        order: 1;
        flex: 1 1 100%;
    }
}
