/* ================================================================
   DocTranslate — AI Translation Platform
   Figma Design System Implementation
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

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

:root {
    --primary: #2563EB;
    --primary-hover: #1d4ed8;
    --primary-light: #EEF4FF;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.04);
    --text-primary: #111827;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ── App Shell Layout ─────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, rgba(238, 242, 255, 0.3) 50%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

/* ── Sidebar (Matching Figma DashboardLayout.tsx) ─────────────── */
.sidebar {
    width: 232px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 30;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
}

/* Brand Header */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 20px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.brand-text h2 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Navigation Menu */
.sidebar-menu {
    padding: 12px 12px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: #52525b;
    font-weight: 500;
    font-family: inherit;
}

.nav-link:hover {
    background-color: #f9fafb;
    color: #18181b;
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-active-indicator {
    display: none;
}

.nav-link.active .nav-active-indicator {
    display: block;
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-link svg {
    flex-shrink: 0;
    color: #a1a1aa;
    transition: color 0.15s ease;
}

.nav-link.active svg {
    color: var(--primary);
}

/* Sidebar Footer / User Profile */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
}

.user-avatar-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout-btn {
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: none;
    color: #d4d4d8;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-logout-btn:hover {
    color: #71717a;
    background-color: #f4f4f5;
}

/* ── Main Workspace ───────────────────────────────────────────── */
.main-workspace {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    height: 100vh;
}

.dash-page-container {
    padding: 32px;
    max-width: 1320px;
    margin: 0 auto;
}

/* Header Row */
.dash-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
}

.dash-date-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.dash-greeting-heading,
.dash-main-title,
.projects-main-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.03em;
}

.projects-main-subtitle {
    font-size: 13px;
    color: #71717a;
    margin-top: 6px;
}

.dash-section-eyebrow {
    font-size: 11.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

/* Primary Action Buttons */
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(37,99,235,0.25), 0 4px 12px rgba(37,99,235,0.15);
    text-decoration: none;
    font-family: inherit;
}

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

.btn-plus-symbol {
    font-size: 16px;
    line-height: 1;
    font-weight: 300;
}

.btn-white-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-white-outline:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.btn-ghost-cancel {
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: #71717a;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-ghost-cancel:hover {
    background-color: #f4f4f5;
    color: #18181b;
}

.btn-danger-outline {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background-color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-danger-outline:hover {
    background-color: #fef2f2;
    border-color: #f87171;
}

/* ── 3-Metric Summary Cards ───────────────────────────────────── */
.stats-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px 24px 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
}

.stat-card-title {
    font-size: 11px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.stat-card-val-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.stat-card-number {
    font-size: 38px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-pill-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    line-height: 1.4;
}

.stat-pill-emerald {
    color: #059669;
    background-color: #ecfdf5;
}

.stat-pill-violet {
    color: #7c3aed;
    background-color: #f5f3ff;
}

.stat-ratio-text {
    font-size: 11px;
    font-weight: 500;
    color: #a1a1aa;
}

.stat-unit-text {
    font-size: 17px;
    font-weight: 600;
    color: #a1a1aa;
    line-height: 1;
    margin-bottom: 2px;
}

.stat-progress-track {
    margin-top: 12px;
    height: 3px;
    background-color: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
}

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

/* ── CTA Banner Bar ───────────────────────────────────────────── */
.cta-banner-bar {
    background: linear-gradient(to right, #2563EB, #3674EE, #7C3AED);
    border-radius: 16px;
    padding: 18px 28px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
    cursor: pointer;
}

.cta-watermark {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    font-family: Georgia, serif;
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.05);
    user-select: none;
    pointer-events: none;
    letter-spacing: -0.04em;
}

.cta-left-content {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
}

.cta-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cta-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 5px;
}

.cta-subtitle {
    font-size: 12px;
    color: #dbeafe;
    line-height: 1.2;
}

.cta-action-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #ffffff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: background-color 0.15s ease;
    font-family: inherit;
}

.cta-action-btn:hover {
    background-color: #eff6ff;
}

/* ── Generic White Card & Table ───────────────────────────────── */
.recent-table-card,
.figma-white-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
}

.recent-table-header,
.figma-card-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.recent-heading,
.figma-card-heading {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
}

.recent-count-tag {
    font-size: 11px;
    font-weight: 500;
    color: #a1a1aa;
    background-color: #f9fafb;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.recent-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.15s ease;
    font-family: inherit;
}

.recent-view-all-link:hover {
    color: var(--primary-hover);
}

.table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
}

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

.figma-data-table thead tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.figma-data-table th {
    font-size: 10.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    padding: 10px 16px;
}

.figma-data-table th.col-doc {
    padding-left: 24px;
}

.figma-data-table th.col-actions {
    padding-right: 24px;
    text-align: right;
}

.figma-data-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.15s ease;
}

.figma-data-table tbody tr:hover {
    background-color: #fafafa;
}

.figma-data-table td {
    padding: 14px 16px;
    font-size: 13px;
    color: #1f2937;
    vertical-align: middle;
}

.figma-data-table td:first-child {
    padding-left: 24px;
}

.figma-data-table td:last-child {
    padding-right: 24px;
    text-align: right;
}

/* Document Cell Layout */
.table-doc-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-badge {
    width: 34px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8.5px;
    font-weight: 900;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    white-space: nowrap;
}

.file-badge-pdf  { background-color: #fef2f2; color: #ef4444; }
.file-badge-docx { background-color: #eff6ff; color: #3b82f6; }
.file-badge-pptx { background-color: #fff7ed; color: #f97316; }
.file-badge-xlsx { background-color: #ecfdf5; color: #059669; }
.file-badge-img  { background-color: #faf5ff; color: #9333ea; }

.table-doc-title {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.25;
}

/* Language Pair Pill */
.lang-pair-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f9fafb;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 700;
    color: #4b5563;
}

.lang-pair-badge .arrow {
    color: #d1d5db;
}

/* Status Badges */
.status-badge-completed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #047857;
    background-color: #ecfdf5;
    padding: 4px 10px;
    border-radius: 9999px;
}

.status-dot-emerald {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
}

.status-badge-processing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #b45309;
    background-color: #fffbeb;
    padding: 4px 10px;
    border-radius: 9999px;
}

.ping-dot-container {
    position: relative;
    display: flex;
    width: 6px;
    height: 6px;
    flex-shrink: 0;
}

.ping-dot-pulse {
    position: absolute;
    display: inline-flex;
    height: 100%;
    width: 100%;
    border-radius: 50%;
    background-color: #fbbf24;
    opacity: 0.75;
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.ping-dot-core {
    position: relative;
    display: inline-flex;
    border-radius: 50%;
    width: 6px;
    height: 6px;
    background-color: #f59e0b;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Table Actions (Visible by default without hovering) */
.table-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 1 !important;
    transition: all 0.15s ease;
}

.figma-data-table tbody tr .table-row-actions,
.project-grid-card .table-row-actions {
    opacity: 1 !important;
}

.icon-action-btn {
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-action-btn:hover {
    color: var(--primary);
    background-color: #eff6ff;
    border-color: #bfdbfe;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.icon-action-btn.btn-delete:hover {
    color: #ef4444;
    background-color: #fef2f2;
    border-color: #fecaca;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.12);
}

/* ── All Projects View (Matching Figma Projects.tsx) ──────────── */
.projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.projects-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 8px 14px;
    flex: 1;
    max-width: 400px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.projects-search-control {
    border: none;
    outline: none;
    background: none;
    font-size: 13px;
    color: #1f2937;
    width: 100%;
    font-family: inherit;
}

.projects-search-control::placeholder {
    color: #a1a1aa;
}

.projects-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-dropdown-wrap {
    position: relative;
}

.btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    font-family: inherit;
}

.btn-filter-toggle:hover {
    background-color: #f9fafb;
}

.filter-active-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
}

.filter-popup-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    padding: 6px;
    min-width: 180px;
    z-index: 50;
}

.filter-popup-title {
    font-size: 10.5px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 10px;
}

.filter-popup-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 10px;
    font-size: 13px;
    color: #374151;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.filter-popup-opt:hover {
    background-color: #f3f4f6;
}

.filter-popup-opt.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.view-mode-toggle {
    display: flex;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.view-mode-btn {
    padding: 6px 10px;
    border-radius: 9px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.view-mode-btn:hover {
    color: #4b5563;
}

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

/* Projects Cards Grid (Figma Projects.tsx) */
.projects-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.project-grid-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.project-grid-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}

.project-grid-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.project-grid-card-body {
    margin-bottom: 18px;
}

.project-grid-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-grid-card-meta {
    font-size: 12px;
    color: #a1a1aa;
}

.project-grid-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid rgba(0,0,0,0.04);
}

/* Empty State Card */
.empty-state-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 64px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background-color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.empty-state-subtitle {
    font-size: 13px;
    color: #6b7280;
    max-width: 400px;
}

/* ── New Project Form (Matching Figma NewProject.tsx) ─────────── */
.figma-card-body {
    padding: 24px 28px;
}

.figma-form-label {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.figma-input-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
    color: #1f2937;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fafafa;
    outline: none;
    transition: all 0.15s ease;
    font-family: inherit;
}

.figma-input-control:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.figma-select-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.input-with-leading-icon {
    position: relative;
}

.input-with-leading-icon .leading-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.pl-9 {
    padding-left: 36px !important;
}

.grid-2col-gap5 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Dropzone */
.figma-dropzone-box {
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.figma-dropzone-box:hover,
.figma-dropzone-box.drag-over {
    border-color: var(--primary);
    background-color: #eff6ff;
}

.np-hidden-file-input {
    display: none;
}

.dropzone-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background-color: #EEF4FF;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
}

.dropzone-primary-text {
    font-size: 13.5px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 4px;
}

.dropzone-browse-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.dropzone-hint-text {
    font-size: 12px;
    color: #a1a1aa;
}

/* Picked file preview inside dropzone */
.dropzone-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
}

.dropzone-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropzone-file-meta {
    flex: 1;
    min-width: 0;
}

.dropzone-file-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropzone-file-size {
    font-size: 11px;
    color: #a1a1aa;
}

.dropzone-file-remove {
    padding: 6px;
    border-radius: 6px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s;
}

.dropzone-file-remove:hover {
    color: #ef4444;
}

/* Scanned Document Pill Toggle */
.pill-toggle-group {
    display: flex;
    gap: 8px;
}

.pill-toggle-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.pill-toggle-btn:hover {
    background-color: #f9fafb;
}

.pill-toggle-btn.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* ── Project Progress Card (Matching Figma ProjectProgress.tsx) ─ */
.progress-dialog-container {
    max-width: 760px;
    margin: 40px auto;
    width: 100%;
}

.progress-main-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    padding: 28px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

.progress-header-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.progress-status-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.spinner-progress {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.progress-header-text {
    flex: 1;
}

.progress-header-heading {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
}

.progress-header-sub {
    font-size: 13px;
    color: #6b7280;
}

.progress-percent-val {
    font-size: 30px;
    font-weight: 700;
    color: var(--primary);
}

.progress-track-outer {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-track-inner {
    height: 100%;
    background-color: var(--primary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.prog-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.prog-step-item.active {
    background-color: #eff6ff;
}

.prog-step-item.completed {
    background-color: #ecfdf5;
}

.prog-step-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-tiny {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(37,99,235,0.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.prog-step-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1px;
}

.prog-step-desc {
    font-size: 11px;
    color: #6b7280;
}

.prog-project-summary {
    background-color: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.prog-actions-row {
    display: flex;
    gap: 12px;
}

/* Comparison Preview Card */
.preview-container {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-top: 16px;
}

.preview-panel {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-label {
    padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
}

.preview-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.preview-badge--translated {
    background-color: #eff6ff;
    color: var(--primary);
}

.preview-content {
    min-height: 340px;
    max-height: 480px;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: #fafafa;
}

.preview-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.preview-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

/* ── Developer MCP & Figma ConnectMcp System ─────────────────── */
.mcp-page-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px;
}

.mcp-top-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.mcp-eyebrow {
    font-size: 11.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 5px 0;
}

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

.mcp-title {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0;
}

.mcp-badge-new {
    display: inline-block;
    border-radius: 9999px;
    background-color: #eff6ff;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2563EB;
}

.mcp-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9999px;
    border: 1px solid #fde68a;
    background-color: #fffbeb;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #b45309;
    transition: all 0.2s ease;
}

.mcp-dot-amber {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #fbbf24;
    flex-shrink: 0;
}

.mcp-dot-emerald {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
    flex-shrink: 0;
}

/* 2-Column Grid Layout */
.mcp-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 992px) {
    .mcp-main-grid {
        grid-template-columns: 1fr;
    }
}

.mcp-content-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mcp-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #f1f1f4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.mcp-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f1f4;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mcp-card-header-between {
    justify-content: space-between;
}

.mcp-header-icon-blue {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background-color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.mcp-header-icon-dark {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background-color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.mcp-header-icon-violet {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background-color: #f5f3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7C3AED;
    flex-shrink: 0;
}

.mcp-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mcp-card-subtitle {
    font-size: 11.5px;
    color: #a1a1aa;
    margin: 2px 0 0 0;
}

/* Steps Row */
.mcp-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
    position: relative;
}

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

.mcp-step-box {
    position: relative;
    border-radius: 12px;
    border: 1px solid #f1f1f4;
    background-color: #fafafa;
    padding: 20px 16px;
    text-align: center;
}

.mcp-step-arrow {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #cbd5e1;
    pointer-events: none;
}

@media (max-width: 640px) {
    .mcp-step-arrow {
        display: none;
    }
}

.mcp-step-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
}

.mcp-step-num {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #a1a1aa;
    margin-bottom: 4px;
}

.mcp-step-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.mcp-step-desc {
    font-size: 11.5px;
    line-height: 1.5;
    color: #71717a;
    margin: 0;
}

/* Card Body */
.mcp-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mcp-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.mcp-field-label {
    font-size: 10.5px;
    font-weight: 600;
    color: #a1a1aa;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btn-copy-code {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-copy-code:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: var(--primary);
}

.mcp-endpoint-dark-box {
    border-radius: 12px;
    background-color: #030712;
    padding: 12px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #93c5fd;
    word-break: break-all;
}

.mcp-config-window {
    overflow: hidden;
    border-radius: 12px;
    background-color: #030712;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mcp-config-window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    font-family: ui-monospace, monospace;
    font-size: 10.5px;
    color: #9ca3af;
}

.mcp-config-window-pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e5e7eb;
}

.mcp-auth-note-box {
    display: flex;
    gap: 12px;
    border-radius: 12px;
    border: 1px solid #dbeafe;
    background-color: #eff6ff;
    padding: 12px 16px;
    align-items: flex-start;
}

.mcp-auth-note-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.mcp-auth-note-text {
    font-size: 11.5px;
    line-height: 1.5;
    color: #1d4ed8;
    margin: 0;
}

.mcp-prompt-code-box {
    border-radius: 12px;
    border: 1px solid #f1f1f4;
    background-color: #fafafa;
    padding: 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #4b5563;
    white-space: pre-wrap;
    margin: 0;
}

/* Right Column (Sidebar) */
.mcp-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
}

.mcp-sidebar-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f1f4;
}

.mcp-sidebar-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mcp-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.mcp-sidebar-subtitle {
    font-size: 11px;
    line-height: 1.5;
    color: #a1a1aa;
    margin: 0;
}

.mcp-sidebar-card-body {
    padding: 20px;
}

.mcp-endpoint-input-box {
    border-radius: 12px;
    border: 1px solid #f1f1f4;
    background-color: #fafafa;
    padding: 10px 12px;
    font-family: ui-monospace, monospace;
    font-size: 10.5px;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 6px;
}

.mcp-status-banner-ready {
    border-radius: 12px;
    border: 1px solid #fde68a;
    background-color: #fffbeb;
    padding: 11px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    color: #b45309;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.mcp-status-banner-ready.connected {
    border-color: #bbf7d0;
    background-color: #f0fdf4;
    color: #15803d;
}

.mcp-btn-test-conn {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    background-color: #ffffff;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.mcp-btn-test-conn:hover {
    background-color: #f9fafb;
    border-color: #d4d4d8;
}

.mcp-refresh-icon.animate-spin {
    animation: spin 1s linear infinite;
}

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

.mcp-gradient-guide-card {
    border-radius: 16px;
    background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
    padding: 20px;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.25);
}

.mcp-guide-icon {
    color: #bfdbfe;
    margin-bottom: 18px;
}

.mcp-guide-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #ffffff;
}

.mcp-guide-desc {
    font-size: 11.5px;
    line-height: 1.5;
    color: #dbeafe;
    margin: 0 0 18px 0;
}

.mcp-btn-guide {
    width: 100%;
    border-radius: 12px;
    background-color: #ffffff;
    color: #2563EB;
    font-size: 11.5px;
    font-weight: 600;
    padding: 10px 14px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.mcp-btn-guide:hover {
    background-color: #eff6ff;
}

.code-box-display {
    background-color: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12.5px;
    padding: 14px 18px;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ── Modals & Dialogs (Alert Dialogs) ─────────────────────────── */
.modal-backdrop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.modal-alert-dialog {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.modal-alert-dialog.sm\:max-w-sm {
    max-width: 380px;
}

.modal-alert-dialog.max-w-lg {
    max-width: 520px;
}

.modal-alert-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.modal-alert-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 20px;
}

.modal-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.btn-dialog-cancel {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-dialog-cancel:hover {
    background-color: #f9fafb;
}

.btn-dialog-destructive {
    padding: 8px 16px;
    border-radius: 12px;
    border: none;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: inherit;
}

.btn-dialog-destructive:hover {
    background-color: #b91c1c;
}

/* Download Format Choice Buttons */
.format-choice-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #f3f4f6;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    font-family: inherit;
}

.format-choice-btn:hover {
    border-color: var(--primary);
    background-color: #EEF4FF;
}

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

.format-choice-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1px;
}

.format-choice-sub {
    font-size: 11px;
    color: #9ca3af;
}

/* ── Toast Popup ──────────────────────────────────────────────── */
.toast-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 420px;
    z-index: 110;
    animation: slideUp 0.25s ease;
}

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

.toast-icon-wrap {
    color: var(--primary);
    flex-shrink: 0;
}

.toast-body strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.toast-body p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.toast-close-btn {
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
}

/* ── Utility Classes ──────────────────────────────────────────── */
.space-y-2 > * + * { margin-top: 8px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.p-5  { padding: 20px; }
.p-6  { padding: 24px; }
.overflow-hidden { overflow: hidden; }
.flex { display: flex; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-red-500 { color: #ef4444; }

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    .stats-grid-3col {
        grid-template-columns: 1fr;
    }
    .grid-2col-gap5 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   OFFICE DOCUMENT PREVIEW STYLES (DOCX & PPTX)
   ========================================================================== */

/* Preview Loading Spinner */
.preview-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    min-height: 320px;
}

.preview-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: preview-spin 0.8s linear infinite;
}

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

.preview-error-box {
    padding: 24px;
    text-align: center;
    color: #ef4444;
    font-size: 13px;
    background: #fef2f2;
    border: 1px dashed #fca5a5;
    border-radius: 8px;
    width: 90%;
    margin: 20px auto;
}

/* --- DOCX Preview Styling --- */
.docx-preview-wrapper {
    width: 100%;
    height: 100%;
    min-height: 420px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.docx-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    flex-shrink: 0;
}

.docx-topbar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
    font-weight: 500;
}

.docx-topbar-filename {
    font-weight: 600;
    color: #0f172a;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docx-topbar-stat {
    font-size: 11px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.docx-pages-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.docx-page-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 24px 28px;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    box-sizing: border-box;
}

.docx-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 11px;
    color: #94a3b8;
}

.docx-page-badge {
    font-weight: 600;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.docx-page-badge-muted {
    color: #94a3b8;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docx-heading-1 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 16px 0 10px 0;
    line-height: 1.3;
}

.docx-heading-2 {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 14px 0 8px 0;
    line-height: 1.35;
}

.docx-heading-3 {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin: 12px 0 6px 0;
}

.docx-paragraph {
    margin: 0 0 10px 0;
    color: #334155;
    word-break: break-word;
}

.docx-bullet-list {
    margin: 0 0 12px 0;
    padding-left: 20px;
    color: #334155;
}

.docx-list-item {
    margin-bottom: 4px;
    word-break: break-word;
}

.docx-table-container {
    width: 100%;
    overflow-x: auto;
    margin: 14px 0;
}

.docx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    border: 1px solid #cbd5e1;
}

.docx-table th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: 600;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    text-align: left;
}

.docx-table td {
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: top;
}

.docx-table tr:nth-child(even) td {
    background: #f8fafc;
}

.docx-inline-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 6px 0;
}

/* --- PPTX Preview Styling --- */
.pptx-preview-wrapper {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.pptx-preview-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    flex-shrink: 0;
}

.pptx-nav-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-weight: 500;
}

.pptx-nav-filename {
    font-weight: 600;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pptx-nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pptx-btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pptx-btn-nav:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.pptx-btn-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pptx-slide-counter {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.pptx-slides-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: #f1f5f9;
    box-sizing: border-box;
    overflow: hidden;
}

.pptx-slide-canvas {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.pptx-slide-canvas.pptx-slide-active {
    display: flex;
}

.pptx-slide-aspect-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 100%;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    container-type: inline-size;
}

.pptx-slide-surface {
    position: absolute;
    inset: 0;
    background: #ffffff;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
}

.pptx-shape {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.5% 1%;
}

.pptx-shape-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.2% 1.8%;
}

.pptx-shape-card-rounded {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5% 2%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.pptx-paragraph {
    line-height: 1.35;
    margin: 0 0 1.5% 0;
    word-break: break-word;
    font-size: clamp(9px, 1.4cqw, 22px);
}

.pptx-bullet-line {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1.35;
    margin-bottom: 1.5%;
    font-size: clamp(9px, 1.35cqw, 20px);
}

.pptx-bullet-dot {
    color: #2563eb;
    font-size: 1.1em;
    line-height: 1;
}

.pptx-bullet-text {
    flex: 1;
    word-break: break-word;
}

.pptx-p-spacer {
    height: 0.8cqw;
}

.pptx-table-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pptx-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    font-size: clamp(8.5px, 1.2cqw, 16px);
}

.pptx-table th, .pptx-table td {
    border: 1px solid #cbd5e1;
    padding: 1.5% 2%;
    text-align: left;
    vertical-align: middle;
}

.pptx-table th {
    background: #f1f5f9;
    font-weight: 600;
}

.pptx-slide-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- XLSX Spreadsheet Preview Styling --- */
.xlsx-preview-wrapper {
    width: 100%;
    height: 100%;
    min-height: 420px;
    max-height: 540px;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Segoe UI Symbol", sans-serif;
}

#officePreviewModalBody .xlsx-preview-wrapper {
    min-height: 520px;
    max-height: 68vh;
    height: 100%;
}

.preview-content .xlsx-preview-wrapper {
    min-height: 440px;
    max-height: 500px;
    height: 100%;
}

.xlsx-preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    flex-shrink: 0;
    gap: 12px;
}

.xlsx-topbar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-weight: 500;
    min-width: 0;
}

.xlsx-topbar-filename {
    font-weight: 600;
    color: #0f172a;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xlsx-topbar-stat {
    font-size: 11px;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 600;
}

.xlsx-zoom-controls {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}

.xlsx-btn-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.xlsx-btn-tool:hover:not(:disabled) {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.xlsx-btn-tool:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.xlsx-zoom-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: #ffffff;
    color: #0f172a;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
}

.xlsx-zoom-display:hover {
    background: #e2e8f0;
}

.xlsx-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    flex-shrink: 0;
}

.xlsx-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
}

.xlsx-tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.xlsx-tab-btn.active {
    background: #059669;
    color: #ffffff;
    border-color: #047857;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

.xlsx-sheets-viewport {
    flex: 1;
    overflow: hidden;
    padding: 0;
    background: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.xlsx-sheet-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.xlsx-table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #ffffff;
    position: relative;
}

.xlsx-table-zoom-wrapper {
    display: inline-block;
    min-width: 100%;
    transform-origin: 0 0;
}

.xlsx-grid-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Calibri", "Arial", sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #1e293b;
}

.xlsx-header-row {
    position: sticky;
    top: 0;
    z-index: 5;
}

.xlsx-corner-cell {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10;
    background: #f1f5f9;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-align: center;
    min-width: 38px;
    user-select: none;
}

.xlsx-col-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #cbd5e1;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    user-select: none;
}

.xlsx-row-header {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #f8fafc;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 8px;
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    min-width: 38px;
    user-select: none;
}

.xlsx-cell {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 8px;
    min-width: 65px;
    font-size: 12px;
    vertical-align: middle;
    box-sizing: border-box;
    transition: background-color 0.1s ease;
}

.xlsx-cell:hover {
    outline: 1.5px solid #10b981;
    outline-offset: -1px;
}

/* ==========================================================================
   MULTI-TARGET LANGUAGE PICKER & LANGUAGE TABS (Matching Design System)
   ========================================================================== */

.multi-lang-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.multi-lang-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
    align-items: center;
}

.lang-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3.5px 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid #bfdbfe;
    transition: all 0.15s ease;
    user-select: none;
}

.lang-chip-code {
    font-size: 10px;
    font-weight: 700;
    color: #3b82f6;
    background: #dbeafe;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
}

.lang-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e40af;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: all 0.12s ease;
}

.lang-chip-remove:hover {
    background: #bfdbfe;
    color: #dc2626;
}

.btn-add-target-lang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: #4b5563;
    background: #fafafa;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-add-target-lang:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #111827;
}

.lang-popover-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 290px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    z-index: 100;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: popoverFadeIn 0.15s ease;
}

@keyframes popoverFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-popover-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.lang-popover-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
    width: 100%;
    color: #1e293b;
    font-family: inherit;
}

.lang-popover-presets {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding-bottom: 4px;
    border-bottom: 1px solid #f1f5f9;
}

.preset-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-right: 2px;
}

.preset-pill-btn {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2.5px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
}

.preset-pill-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.preset-pill-btn.preset-clear {
    color: #ef4444;
    border-color: #fee2e2;
    background: #fef2f2;
}

.preset-pill-btn.preset-clear:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.lang-popover-list {
    max-height: 210px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12.5px;
    color: #334155;
    transition: background 0.12s ease;
    user-select: none;
}

.lang-item-row:hover {
    background: #f1f5f9;
}

.lang-item-row input[type="checkbox"] {
    cursor: pointer;
    accent-color: #2563eb;
    width: 14px;
    height: 14px;
}

.lang-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-item-code {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: #e2e8f0;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Comparison Preview Language Switcher Tabs */
.preview-lang-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e2e8f0;
    padding: 2.5px;
    border-radius: 8px;
}

.preview-lang-tab {
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.preview-lang-tab:hover {
    color: #0f172a;
}

.preview-lang-tab.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

.preview-lang-tab .tab-badge {
    font-size: 9.5px;
    padding: 0 4px;
    border-radius: 3px;
    background: #eff6ff;
    color: #2563eb;
}

/* Multi-language badges in projects and recent tables */
.multi-lang-pills {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

.lang-pill {
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid #dbeafe;
    line-height: 1.3;
}

/* ── Multi-Target Download Actions & Language Selector ───────── */
.download-lang-action-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.download-lang-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0 10px;
    height: 38px;
    box-sizing: border-box;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.download-lang-picker:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.download-lang-picker:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.download-picker-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    user-select: none;
}

.download-picker-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.download-picker-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    outline: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    padding-right: 18px;
    cursor: pointer;
    font-family: inherit;
}

.download-picker-chevron {
    position: absolute;
    right: 0;
    pointer-events: none;
    color: #64748b;
}

.download-action-btn {
    flex: 1;
    min-width: 140px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* ── Comparison Preview Language Switcher Dropdown ──────────── */
.preview-lang-select-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px 8px 2px 10px;
    height: 30px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.preview-lang-select-box:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.preview-lang-select-box:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.preview-select-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    user-select: none;
}

.preview-select-control-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.preview-lang-select-control {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    padding-right: 18px;
    cursor: pointer;
    font-family: inherit;
}

.preview-select-chevron {
    position: absolute;
    right: 0;
    pointer-events: none;
    color: #64748b;
}

@media (max-width: 640px) {
    .prog-actions-row,
    .prog-downloads-bar,
    .prog-nav-bar {
        flex-direction: column;
    }
    .download-lang-action-wrap {
        width: 100%;
        flex-direction: column;
    }
    .download-lang-picker {
        width: 100%;
        justify-content: space-between;
    }
    .download-action-btn,
    .download-main-btn,
    .btn-zip-download,
    .prog-nav-bar > button {
        width: 100%;
    }
}

/* ── Multi-Target Completion Action Container (2-Tier Non-Overlapping) ── */
.prog-actions-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.prog-downloads-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.download-main-btn {
    flex: 1;
    min-width: 140px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    white-space: nowrap;
    padding: 0 16px;
}

.btn-zip-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    background-color: #059669;
    border: 1px solid #059669;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    font-family: inherit;
    flex-shrink: 0;
}

.btn-zip-download:hover {
    background-color: #047857;
    border-color: #047857;
}

.prog-nav-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.prog-nav-bar > button {
    flex: 1;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.btn-secondary-action {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-secondary-action:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Specific pill style for active target in table rows */
.lang-pill.active-pill {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1d4ed8;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   FLOATING ASYNCHRONOUS TRANSLATION PROGRESS WIDGET
   ══════════════════════════════════════════════════════════ */
.async-progress-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.async-widget-card {
    width: 360px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: slideUpWidget 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpWidget {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.async-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.async-widget-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.async-widget-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.async-widget-titles {
    min-width: 0;
    flex: 1;
}

.async-widget-filename {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.async-widget-lang-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    color: #2563eb;
    margin-top: 2px;
}

.async-widget-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.async-icon-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.async-icon-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.async-icon-btn.stop-btn {
    color: #ef4444;
}

.async-icon-btn.stop-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.async-widget-body {
    padding: 14px 16px;
}

.async-widget-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.async-step-text {
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding-right: 8px;
}

.async-percent-text {
    font-weight: 700;
    color: #2563eb;
    flex-shrink: 0;
}

.async-progress-track {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.async-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.async-widget-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
}

.async-status-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.async-status-badge.completed {
    background: #ecfdf5;
    color: #059669;
}

.async-status-badge.failed {
    background: #fef2f2;
    color: #dc2626;
}

.async-status-badge.cancelled {
    background: #f1f5f9;
    color: #64748b;
}

.async-widget-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.async-btn-download {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    background: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.async-btn-download:hover {
    background: #1d4ed8;
}

.async-btn-editor {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.async-btn-editor:hover {
    background: #f1f5f9;
}

/* --- Collapsed Floating Pill --- */
.async-widget-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 320px;
}

.async-widget-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.2);
    border-color: #cbd5e1;
}

.async-pill-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    animation: pulseBadge 1.5s infinite;
    flex-shrink: 0;
}

@keyframes pulseBadge {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 0.3; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.async-pill-text {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.async-pill-badge {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.async-pill-expand-btn {
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
}




