.excel-logo-btn {
    width: 3000px;
    height: 3000px;
    max-width: 3000px;
    max-height: 3000px;
    display: block;
    margin: 0 auto;
    padding: 0;
    object-fit: contain;
}

.pdf-logo-btn {
    max-width: 20px;
    max-height: 20px;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 auto;
    padding: 0;
    object-fit: contain;
}

/* ========================================
   CSS Variables & Base Styles
   Corporate Navy / Gold / Silver Theme
======================================== */
* {
    box-sizing: border-box;
}

:root {
    /* Core Corporate Palette */
    --bg-dark: #1B2A3D;
    --bg-surface: #243447;
    --bg-elevated: #2C3E50;
    --accent-gold: #F1C40F;
    --accent-gold-hover: #D4AC0D;
    --accent-silver: #AAB7B8;
    --accent-silver-light: #D5D8DC;
    --text-main: #BFC9CA;
    --text-heading: #F8F9FA;

    /* Semantic Mappings */
    --bg-primary: var(--bg-dark);
    --bg-secondary: var(--bg-surface);
    --bg-card: rgba(241, 196, 15, 0.04);

    --text-primary: var(--text-heading);
    --text-secondary: var(--text-main);
    --text-muted: var(--accent-silver);

    --golden: var(--accent-gold);
    --sapphire: var(--bg-elevated);
    --diamond: var(--text-heading);

    --accent-primary: var(--accent-gold);
    --accent-secondary: var(--bg-elevated);

    /* Category Colors */
    --success: #27AE60;
    --success-bg: rgba(39, 174, 96, 0.12);
    --warning: #F1C40F;
    --warning-bg: rgba(241, 196, 15, 0.12);
    --danger: #C0392B;
    --danger-bg: rgba(192, 57, 43, 0.12);

    --border-color: rgba(170, 183, 184, 0.18);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0F1C2E 0%, var(--bg-dark) 40%, #1E3044 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    /* iPhone safe area support */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

html {
    background: #0F1C2E;
}

/* ========================================
   App Container
======================================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========================================
   Header
======================================== */
.header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
    background: linear-gradient(180deg, rgba(241, 196, 15, 0.03) 0%, transparent 100%);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

/* Center header when upload screen is active */
body.upload-mode .header-content {
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    width: 100%;
    /* Ensure it spans if needed */
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.875rem;
    color: var(--accent-gold);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* We no longer restore original layout for upload screen.
   We want the title ALWAYS perfectly centered! */
body.upload-mode .logo-text {
    /* Keep it absolute and centered! */
    pointer-events: auto;
    /* allow clicking if needed */
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
    margin-right: 16px;
    background: rgba(36, 52, 71, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 6px;
}

.header-countdown {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: auto;
    /* Pushes it to the right */
    background: rgba(36, 52, 71, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    gap: 4px;
}

/* Hide header stats on upload mode so countdown takes its place on the right */
body.upload-mode .header-stats {
    display: none !important;
}

body:not(.upload-mode) .header-countdown {
    display: none !important;
    /* Hide countdown when not on upload page if needed, or adjust */
}

/* When upload mode, no need to push everything between. The absolute text handles the center. */
body.upload-mode .header-content {
    justify-content: space-between;
}

.header-countdown-title {
    font-size: 0.65rem;
    color: var(--accent-silver);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.header-countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-time-box {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.header-time-box span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
    line-height: 1;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.header-time-box small {
    font-size: 0.60rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.header-time-sep {
    font-size: 1rem;
    color: rgba(170, 183, 184, 0.4);
    font-weight: 700;
    margin: 0 2px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    cursor: default;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stat-value {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    flex-shrink: 0;
}

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

.stat-total .stat-dot {
    background: #7f8c8d;
    box-shadow: 0 0 6px rgba(127, 140, 141, 0.4);
}

.stat-invite .stat-dot {
    background: var(--success);
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.4);
}

.stat-reserve .stat-dot {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(241, 196, 15, 0.4);
}

.stat-eliminated .stat-dot {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(192, 57, 43, 0.4);
}

.stat-count {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.stat-total .stat-count {
    color: #95a5a6;
}

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

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

.stat-eliminated .stat-count {
    color: var(--danger);
}

.stat-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 1px;
}

/* ========================================
   Upload Section
======================================== */
.upload-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* ========================================
   Countdown Timer (Moved to Header)
======================================== */

.upload-card {
    width: 100%;
    max-width: 600px;
}

.resume-banner {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(36, 52, 71, 0.9), rgba(28, 40, 56, 0.95));
    border: 1px solid rgba(241, 196, 15, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    gap: 16px;
    animation: slideDownFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.resume-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(241, 196, 15, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
}

.resume-banner-content {
    flex-grow: 1;
}

.resume-banner-content h4 {
    color: var(--accent-gold);
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 600;
}

.resume-banner-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.resume-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.resume-banner-actions .btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.resume-banner.hiding {
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.upload-zone {
    background: rgba(36, 52, 71, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px dashed rgba(241, 196, 15, 0.3);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(241, 196, 15, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-gold);
    background: rgba(36, 52, 71, 0.85);
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.08);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(241, 196, 15, 0.2);
    position: relative;
    z-index: 1;
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: var(--accent-gold);
}

.upload-zone h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-heading);
    position: relative;
    z-index: 1;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.upload-btn {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
    color: var(--bg-dark);
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.3);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    border: 1px solid var(--border-color);
}

.file-icon {
    font-size: 2rem;
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: var(--text-heading);
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remove-file {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
}

.remove-file:hover {
    background: var(--danger);
    color: white;
}

/* ========================================
   Controls Bar
======================================== */
.controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.controls-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px 12px;
    min-width: 215px;
    max-width: 265px;
    transition: border-color var(--transition);
    box-sizing: border-box;
    height: 38px;
}

.search-box:focus-within {
    border-color: var(--accent-gold);
}

.search-box svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

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

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

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    align-items: center;
    height: 33px;
}

.filter-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: rgba(241, 196, 15, 0.06);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
    color: var(--bg-dark);
    font-weight: 600;
}

/* ... existing styles ... */

.avg-score-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    box-shadow: 0 0 12px rgba(241, 196, 15, 0.08);
    transition: all var(--transition);
    white-space: nowrap;
    font-size: 0.82rem;
    box-sizing: border-box;
    height: 33px;
}

.avg-score-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding-right: 10px;
    border-right: 1px solid var(--border-color);
}


.avg-score-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avg-score-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.avg-score-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 2px;
    flex-shrink: 0;
}

.avg-score-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.avg-score-value {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 18px;
    text-align: right;
}

.avg-score-badge {
    max-height: 44px;
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
}

/* ... existing styles ... */

.btn-primary,
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border-color: var(--accent-gold);
}

.btn-primary.btn-pdf {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
}

.btn-primary.btn-pdf:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border-color: var(--accent-gold);
}

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

.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.btn-primary svg,
.btn-secondary svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Icon-only button variant (same height as text buttons) */
.btn-icon {
    padding: 0 !important;
    gap: 0 !important;
    height: 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-icon svg {
    width: 18px !important;
    height: 18px !important;
    display: block;
    margin: 0 auto;
    padding: 0;
    object-fit: contain;
}

.btn-icon img {
    width: 100% !important;
    height: 100% !important;
    max-width: 20px;
    max-height: 20px;
    display: block;
    margin: 0 auto;
    padding: 0;
    object-fit: contain;
}

/* ========================================
   Results Table
======================================== */
.table-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

.results-table th {
    text-align: left;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--bg-elevated), #344E63);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-gold);
    border-bottom: 2px solid rgba(241, 196, 15, 0.2);
    user-select: none;
}

.results-table th.sortable {
    cursor: pointer;
    transition: color var(--transition);
}

.results-table th.sortable:hover {
    color: var(--text-heading);
}

.results-table th.sortable.active-sort {
    color: var(--text-heading);
}

.sort-arrow {
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: 0.5;
}

.active-sort .sort-arrow {
    opacity: 1;
}

.th-rank {
    width: 60px;
    text-align: center;
}

.results-table .th-score {
    width: 100px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.results-table .th-ai-score {
    width: 100px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.results-table .th-category {
    width: 140px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.results-table .th-details {
    width: 100px;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

.results-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.results-table tbody tr:hover td {
    background: rgba(241, 196, 15, 0.04);
}

.results-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.08);
}

.results-table tbody tr:nth-child(even):hover td {
    background: rgba(241, 196, 15, 0.04);
}

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

.rank-cell {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.company-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.company-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-heading);
}

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

.score-cell {
    text-align: center;
}

.score-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
}

.score-invite {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success);
}

.score-reserve {
    background: var(--warning-bg);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.score-eliminated {
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.score-success {
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success);
}

.score-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.score-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.score-neutral {
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

.score-info {
    background: rgba(44, 62, 80, 0.4);
    color: var(--accent-silver);
    border: 2px solid var(--accent-silver);
}

.category-cell {
    text-align: center;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.category-invite {
    background: var(--success-bg);
    color: var(--success);
}

.category-reserve {
    background: var(--warning-bg);
    color: var(--warning);
}

.category-eliminated {
    background: var(--danger-bg);
    color: var(--danger);
}

.details-cell {
    text-align: center;
}

.details-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.details-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border-color: var(--accent-gold);
}

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

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-elevated), #344E63);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-heading);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-gold);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.detail-item {
    background: rgba(241, 196, 15, 0.03);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 500;
    color: var(--text-heading);
}

.score-breakdown {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
}

.score-item {
    flex: 1;
    min-width: 0;
    background: rgba(241, 196, 15, 0.04);
    padding: 12px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-align: center;
}

.score-item-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-gold);
    white-space: nowrap;
}

.score-item-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
}

/* "Soru Toplamı" sub-label shown above the score in detail modal */
.score-item-sub {
    font-size: 0.6rem;
    color: var(--accent-silver);
    margin-bottom: 2px;
    opacity: 0.75;
    white-space: nowrap;
    line-height: 1;
}

.total-score-display {
    background: linear-gradient(135deg, var(--bg-elevated), #344E63);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: 16px;
    border: 1px solid rgba(241, 196, 15, 0.15);
}

.total-score-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.total-score-label {
    font-size: 0.9rem;
    color: var(--text-heading);
    margin-top: 4px;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1200px) {
    .controls-bar {
        gap: 8px;
    }

    .filter-tab {
        padding: 5px 9px;
        font-size: 0.75rem;
    }

    .avg-score-badge {
        padding: 6px 10px;
        font-size: 0.78rem;
        gap: 100px;
    }

    .avg-score-metrics {
        gap: 8px;
    }

    .avg-score-label {
        font-size: 0.68rem;
    }

    .avg-score-value {
        font-size: 0.8rem;
    }

    .controls-right .btn-primary,
    .controls-right .btn-secondary {
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    .split-buttons button {
        padding: 7px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 960px) {
    .controls-bar {
        gap: 6px;
    }

    .search-box {
        min-width: 160px;
        max-width: 220px;
        padding: 8px 12px;
    }

    .search-box input {
        font-size: 0.82rem;
    }

    .filter-tab {
        padding: 4px 7px;
        font-size: 0.72rem;
    }

    .avg-score-badge {
        padding: 4px 8px;
        font-size: 0.74rem;
        gap: 8px;
    }

    .avg-score-metrics {
        gap: 6px;
    }

    .avg-score-label {
        font-size: 0.66rem;
    }

    .avg-score-value {
        font-size: 0.76rem;
    }

    .controls-right .btn-primary,
    .controls-right .btn-secondary {
        padding: 6px 8px;
        font-size: 0.74rem;
        gap: 4px;
    }

    .controls-right .btn-primary svg,
    .controls-right .btn-secondary svg {
        width: 13px;
        height: 13px;
    }

    .split-buttons button {
        padding: 6px 8px;
        font-size: 0.72rem;
        gap: 4px;
    }

    .split-buttons button svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0 12px;
    }

    .header {
        padding: 12px 0;
        margin-bottom: 16px;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .logo {
        order: 1;
        flex-shrink: 0;
    }

    /* Mobile logo swap */
    .mobile-logo-img {
        display: block !important;
    }

    .desktop-logo-img {
        display: none !important;
    }

    .logo-text {
        position: static;
        transform: none;
        width: auto;
        order: 2;
        flex: 1;
        min-width: 0;
        text-align: center;
        align-items: center;
    }

    /* Profile button next to title */
    #authHeaderUI {
        order: 3;
        margin-left: 0 !important;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .logo-text span {
        font-size: 0.68rem;
    }

    .project-logo {
        height: 48px;
    }

    .header-stats {
        order: 4;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        padding: 6px 4px;
        gap: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .stat-item {
        padding: 4px 10px;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-count {
        font-size: 0.85rem;
    }

    .header-countdown {
        order: 4;
        width: 100%;
        margin-left: 0;
        align-items: center;
        padding: 6px 12px;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .controls-left {
        flex-direction: column;
    }

    .controls-center {
        justify-content: center;
    }

    .controls-right {
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .filter-tabs {
        overflow-x: auto;
        justify-content: flex-start;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .avg-score-badge {
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .avg-score-metrics {
        flex-wrap: wrap;
        justify-content: center;
    }

    .avg-score-title {
        border-right: none;
        padding-right: 0;
    }

    .controls-right .split-buttons,
    .controls-right .btn-primary {
        flex: 1;
        min-width: 0;
    }

    .split-buttons button {
        flex: 1;
    }

    /* Horizontally scrollable table */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .results-table th {
        padding: 10px 12px;
        font-size: 0.7rem;
    }

    .results-table td {
        padding: 10px 12px;
    }

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

    .score-breakdown {
        flex-wrap: wrap;
    }

    .score-item {
        flex: 1 1 calc(33% - 6px);
        min-width: 70px;
    }

    /* Modal adjustments */
    .modal {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 0.85rem;
        word-break: break-word;
        overflow-wrap: break-word;
        min-width: 0;
        flex: 1;
        line-height: 1.3;
    }

    .modal-body {
        padding: 16px;
    }

    /* Detail section: stack buttons below heading on mobile */
    .detail-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px;
    }

    .modal-body .detail-section .detail-value {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .settings-modal {
        max-width: 100%;
        width: 95%;
    }

    .settings-grid.ai-flat-grid {
        grid-template-columns: 1fr;
    }

    .setting-item {
        flex: 1 1 100%;
        min-width: unset;
    }

    /* History modal */
    .history-modal {
        width: 95%;
    }

    /* Admin panel & modal tables - horizontal scroll on mobile */
    .modal-body {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin modal: user cards wrap vertically on mobile */
    .user-card {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }

    .user-card-info {
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    .user-card-info>div:last-child>div {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-card-actions {
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    /* Form grids stack on mobile */
    .user-form-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-header h2 {
        font-size: 1.1rem !important;
    }

    .modal-header p {
        font-size: 0.78rem !important;
    }

    /* Activity logs table scroll */
    #activityLogsModalOverlay .modal-body {
        overflow-x: auto;
    }

    #activityLogsModalOverlay .modal-body table {
        min-width: 500px;
    }

    /* Auth dropdown mobile */
    .auth-dropdown {
        right: 0 !important;
        left: auto !important;
        min-width: 180px !important;
    }
}

/* ========================================
   Small mobile (phones)
======================================== */
@media (max-width: 480px) {
    .app-container {
        padding: 0 8px;
    }

    .header {
        padding: 8px 0;
        margin-bottom: 12px;
    }

    .project-logo {
        height: 44px;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .logo-text span {
        font-size: 0.7rem;
    }

    .header-stats {
        border-radius: var(--radius-md);
    }

    .stat-item {
        padding: 3px 8px;
    }

    .stat-divider {
        height: 18px;
    }

    .header-countdown-title {
        font-size: 0.58rem;
    }

    .header-time-box span {
        font-size: 0.9rem;
    }

    .controls-right {
        gap: 4px;
    }

    .btn-icon {
        height: 34px !important;
        width: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    .btn-icon svg {
        width: 15px !important;
        height: 15px !important;
    }

    .avg-score-badge {
        padding: 4px 8px;
        font-size: 0.72rem;
        height: auto;
        max-height: none;
    }

    .avg-score-title {
        font-size: 0.62rem;
    }

    .avg-score-value {
        font-size: 0.78rem;
    }

    .filter-tab {
        padding: 4px 8px;
        font-size: 0.72rem;
    }

    .score-value {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .upload-zone {
        padding: 24px 16px;
    }

    .upload-zone h2 {
        font-size: 1.15rem;
    }

    .upload-zone p {
        font-size: 0.82rem;
    }

    .upload-btn,
    .history-btn {
        padding: 12px 16px;
        font-size: 0.82rem;
        flex: 1;
        justify-content: center;
        white-space: nowrap;
    }

    .upload-buttons-row {
        width: 100%;
        align-items: stretch;
    }

    .total-score-value {
        font-size: 2rem;
    }

    .score-item-value {
        font-size: 1rem;
    }

    .score-item-label {
        font-size: 0.62rem;
    }

    .modal-header h3 {
        font-size: 0.8rem;
    }

    .pagination-btn {
        padding: 5px 8px;
        font-size: 0.78rem;
        min-width: 30px;
    }

    .pagination-info {
        font-size: 0.78rem;
        margin-right: 6px;
    }

    /* Settings modal compact */
    .settings-main-header {
        font-size: 0.75rem;
        padding: 6px 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-header-badges {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .settings-body {
        padding: 14px 12px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn-primary,
    .modal-footer .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   Animations
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-table tbody tr {
    animation: fadeIn 0.3s ease forwards;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-right: 12px;
}

.pagination-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 36px;
    text-align: center;
}

.pagination-btn:hover:not([disabled]) {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border-color: var(--accent-gold);
}

.pagination-btn.active {
    background: var(--accent-gold);
    color: var(--bg-dark);
    border-color: var(--accent-gold);
    font-weight: 600;
}

.pagination-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-dots {
    color: var(--text-secondary);
    padding: 0 4px;
    font-size: 0.85rem;
}

/* ========================================
   Refined Split Buttons (50/50 Attached - Compact)
======================================== */
.split-buttons {
    display: flex;
}

.split-buttons button {
    flex: 1;
    justify-content: center;
    border-radius: 0;
    margin: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
    gap: 5px;
}

.split-buttons button svg {
    width: 14px;
    height: 14px;
}

.split-buttons button:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.split-buttons button:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    border-left: none;
}

/* ========================================
   Refined Settings Modal UI
======================================== */
.settings-modal {
    background: linear-gradient(180deg, #1a2636 0%, var(--bg-dark) 100%);
    border: 1px solid rgba(241, 196, 15, 0.1);
    max-width: 860px;
    width: 92%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.settings-modal .modal-header {
    background: linear-gradient(135deg, #1B2A3D 0%, #243447 100%);
    border-bottom: 2px solid rgba(241, 196, 15, 0.15);
    padding: 16px 24px;
}

.settings-modal .modal-header h3 {
    color: var(--accent-gold);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.settings-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 8px;
}

.settings-main-header {
    color: var(--accent-gold);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(241, 196, 15, 0.08) 0%, transparent 100%);
    border-left: 3px solid var(--accent-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 36px;
}

/* Section title text */
.settings-header-title {
    flex: 1 1 auto;
    min-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right-side badges container */
.settings-header-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.section-max-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-max-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.section-max-input {
    width: 46px;
    background: rgba(170, 183, 184, 0.12);
    border: 1px solid rgba(241, 196, 15, 0.25);
    color: var(--accent-gold);
    font-weight: 700;
    text-align: center;
    padding: 3px 4px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.section-max-input:focus {
    background: rgba(170, 183, 184, 0.2);
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.15);
}

/* "Soru Toplamı" badge in settings panel section headers */
.section-sum-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.section-sum-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    opacity: 0.85;
}

.section-sum-value {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.78rem;
    border: 1px solid rgba(39, 174, 96, 0.25);
    background: rgba(39, 174, 96, 0.1);
    color: #27AE60;
    min-width: 26px;
    text-align: center;
}

.settings-sub-section {
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    border: 1px solid rgba(170, 183, 184, 0.08);
}

.settings-sub-section:last-child {
    margin-bottom: 0;
}

.settings-sub-header {
    color: var(--text-heading);
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    letter-spacing: 0.2px;
    opacity: 0.9;
}

.settings-sub-header::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: var(--accent-gold);
    margin-right: 8px;
    border-radius: 2px;
    opacity: 0.6;
}

.settings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Single-item sub-sections (AI scoring, multi-select caps) */
.settings-sub-special .settings-grid {
    max-width: 280px;
}

.settings-sub-special .settings-sub-header {
    font-size: 0.68rem;
    opacity: 0.85;
}

.setting-item {
    background: rgba(27, 42, 61, 0.6);
    border: 1px solid rgba(170, 183, 184, 0.1);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    flex: 1 1 140px;
    min-width: 140px;
}

.setting-item:hover {
    border-color: rgba(241, 196, 15, 0.3);
    background: rgba(241, 196, 15, 0.04);
}

.setting-item label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
    padding-right: 6px;
    line-height: 1.3;
    min-height: unset;
    white-space: normal;
    word-break: break-word;
}

.setting-item input[type="number"] {
    width: 46px;
    background: rgba(170, 183, 184, 0.12);
    border: 1px solid rgba(170, 183, 184, 0.18);
    color: var(--accent-gold);
    font-weight: 700;
    text-align: center;
    padding: 4px 3px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: inherit;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.setting-item input[type="number"]:focus {
    background: rgba(170, 183, 184, 0.2);
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.1);
}

/* AI settings: flat 2x5 grid */
.settings-grid.ai-flat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* AI total badge in header */
.ai-total-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ai-total-badge .ai-total-label {
    color: var(--text-secondary);
}

.ai-total-badge .ai-total-value {
    background: rgba(241, 196, 15, 0.15);
    color: var(--accent-gold);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(241, 196, 15, 0.25);
}

/* Diğer Bilgi gray style */
.setting-item.ai-other-info {
    background: rgba(100, 110, 120, 0.25);
    border: 1px solid rgba(100, 110, 120, 0.3);
}

.setting-item.ai-other-info input[type="number"] {
    color: #8a9ba8;
    border-color: rgba(100, 110, 120, 0.35);
}

.setting-item.ai-other-info label {
    color: #8a9ba8;
}

/* Footer grand total */
.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid rgba(241, 196, 15, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: linear-gradient(0deg, rgba(27, 42, 61, 0.85), transparent);
    border-radius: 0 0 12px 12px;
}

.footer-total-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    font-size: 0.78rem;
    flex-wrap: wrap;
}

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

.footer-total-value {
    font-weight: 700;
    font-size: 0.88rem;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    transition: all 0.2s ease;
}

.footer-total-value.total-ok {
    color: #27ae60;
    border-color: rgba(39, 174, 96, 0.3);
    background: rgba(39, 174, 96, 0.1);
}

.footer-total-value.total-error {
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
    background: rgba(231, 76, 60, 0.1);
}

.footer-total-warning {
    font-size: 0.72rem;
    color: #e74c3c;
    font-weight: 500;
}

#saveSettingsBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.modal-footer .btn-secondary {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.modal-footer .btn-primary {
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Multi-select sub-section styles */
.settings-sub-multiselect .settings-sub-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.multi-max-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    background: rgba(241, 196, 15, 0.08);
    border: 1px solid rgba(241, 196, 15, 0.2);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
}

.multi-max-label {
    font-size: 0.68rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.multi-max-input {
    width: 44px;
    background: rgba(170, 183, 184, 0.12);
    border: 1px solid rgba(170, 183, 184, 0.18);
    color: var(--accent-gold);
    font-weight: 700;
    text-align: center;
    padding: 2px 3px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
}

.multi-max-input:focus {
    background: rgba(170, 183, 184, 0.2);
    border-color: var(--accent-gold);
    outline: none;
    box-shadow: 0 0 0 2px rgba(241, 196, 15, 0.1);
}

.multi-toggle-btn {
    background: rgba(170, 183, 184, 0.08);
    border: 1px solid rgba(170, 183, 184, 0.15);
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.multi-toggle-btn:hover {
    background: rgba(241, 196, 15, 0.1);
    border-color: rgba(241, 196, 15, 0.3);
    color: var(--accent-gold);
}

/* ========================================
   Analytics / Charts Section
======================================== */
.analytics-section {
    margin-bottom: 20px;
}

.analytics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border: 1px solid rgba(241, 196, 15, 0.15);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 12px;
    cursor: pointer;
}

.analytics-header:hover {
    border-color: rgba(241, 196, 15, 0.3);
}

.analytics-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.3px;
}

.analytics-toggle {
    background: none;
    border: none;
    color: var(--accent-gold);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.analytics-toggle.collapsed {
    transform: rotate(-90deg);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(241, 196, 15, 0.08);
    border-radius: var(--radius-md, 10px);
    padding: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.chart-card:hover {
    border-color: rgba(241, 196, 15, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.chart-card h4 {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: 0.2px;
    line-height: 1.35;
    min-height: 1.2em;
}

.chart-card canvas {
    max-height: 260px;
    flex: 1;
    min-height: 0;
}

/* Custom HTML Legend for Pie/Doughnut Charts */
.chart-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px 12px;
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-legend .legend-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    cursor: default;
}

.chart-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.chart-legend .legend-text {
    font-size: 0.85rem;
    color: #D5DBDB;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

.chart-legend .legend-pct {
    font-size: 0.78rem;
    color: rgba(213, 219, 219, 0.7);
    margin-left: 3px;
}

@media (max-width: 1400px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ========================================
   History Button (Upload Section)
======================================== */
.upload-buttons-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.history-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--accent-silver);
    border: 1px solid var(--border-color);
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

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

.history-btn:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(241, 196, 15, 0.06);
    transform: translateY(-1px);
}

/* ========================================
   History Modal
======================================== */
.history-modal {
    max-width: 600px;
    width: 90%;
}

.history-body {
    padding: 16px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.history-body::-webkit-scrollbar {
    width: 6px;
}

.history-body::-webkit-scrollbar-track {
    background: transparent;
}

.history-body::-webkit-scrollbar-thumb {
    background: rgba(170, 183, 184, 0.3);
    border-radius: 3px;
}

/* Empty state */
.history-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.history-empty svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.history-empty p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Loading */
.history-loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* History list */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual history item */
.history-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
}

.history-item:hover {
    border-color: var(--accent-gold);
    background: rgba(241, 196, 15, 0.06);
    transform: translateX(3px);
}

/* Date icon */
.history-item-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.2);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    color: var(--accent-gold);
    font-size: 1.1rem;
}

/* Info area */
.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-heading);
    word-break: break-word;
    margin-bottom: 4px;
}

.history-item-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Stats badges row */
.history-item-stats {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.history-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.history-stat.total {
    background: rgba(170, 183, 184, 0.12);
    color: var(--accent-silver-light);
    border: 1px solid rgba(170, 183, 184, 0.2);
}

.history-stat.invite {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.history-stat.reserve {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(241, 196, 15, 0.2);
}

.history-stat.eliminated {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

/* Delete button */
.history-item-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
    font-size: 0.85rem;
}

.history-item-delete:hover {
    background: var(--danger-bg);
    border-color: rgba(192, 57, 43, 0.3);
    color: var(--danger);
}

.history-clear-all-btn {
    background: transparent;
    border: 1px solid rgba(192, 57, 43, 0.3);
    color: var(--danger);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.history-clear-all-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
}

/* Responsive */
@media (max-width: 600px) {
    .history-item {
        flex-wrap: wrap;
    }

    .history-item-stats {
        width: 100%;
        margin-top: 6px;
    }
}

/* ========================================
   Firma Kartı Çıktısı (Off-screen render)
   ======================================== */
.company-card-wrapper {
    width: 800px;
    background: var(--bg-dark, #1B2A3D);
    color: var(--text-heading, #F8F9FA);
    font-family: 'Inter', sans-serif;
    padding: 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.company-card-wrapper .card-header {
    background: linear-gradient(135deg, rgba(27, 42, 61, 0.4), rgba(44, 62, 80, 0.6));
    border: 1px solid rgba(241, 196, 15, 0.2);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.company-card-wrapper .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold, #F1C40F);
}

.company-card-wrapper .header-logo {
    width: 100px;
    height: 100px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.15);
}

.company-card-wrapper .card-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.company-card-wrapper .company-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Max 2 lines for title */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.company-card-wrapper .company-subtitle {
    font-size: 0.85rem;
    color: var(--accent-silver, #AAB7B8);
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-card-wrapper .tags {
    display: flex;
    gap: 8px;
}

.company-card-wrapper .tag {
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: var(--accent-gold, #F1C40F);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.company-card-wrapper .header-score-box {
    background: rgba(44, 62, 80, 0.4);
    border: 1px solid rgba(241, 196, 15, 0.15);
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    margin-left: auto;
    /* Pushtes to the far right */
}

.company-card-wrapper .score-label {
    font-size: 0.65rem;
    color: var(--accent-silver, #AAB7B8);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.company-card-wrapper .score-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--success, #27AE60);
    line-height: 1;
}

.company-card-wrapper .score-max {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
}

.company-card-wrapper .card-middle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.company-card-wrapper .card-box {
    background: var(--bg-surface, #243447);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
}

.company-card-wrapper .box-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading, #F8F9FA);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.company-card-wrapper .contact-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.company-card-wrapper .contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.company-card-wrapper .contact-icon {
    color: var(--accent-gold, #F1C40F);
    font-size: 1.2rem;
    background: rgba(241, 196, 15, 0.08);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.company-card-wrapper .contact-text {
    font-size: 0.85rem;
    color: var(--text-main, #BFC9CA);
    line-height: 1.4;
}

.company-card-wrapper .contact-text strong {
    color: var(--text-heading, #F8F9FA);
}

.company-card-wrapper .card-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.company-card-wrapper .stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
}

.company-card-wrapper .stat-icon {
    font-size: 1.5rem;
    color: var(--accent-gold, #F1C40F);
    margin-bottom: 12px;
}

.company-card-wrapper .stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-heading, #F8F9FA);
    line-height: 1.2;
    word-break: break-word;
    /* Handle long numbers/text */
    max-width: 100%;
}

.company-card-wrapper .stat-label {
    font-size: 0.65rem;
    color: var(--accent-silver, #AAB7B8);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.company-card-wrapper .profile-text {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    /* Max 4 lines for description */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Iframe Overlay (for Advanced & Analytics pages)
======================================== */
.iframe-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark, #1B2A3D);
    animation: iframeSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes iframeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.iframe-overlay.closing {
    animation: iframeSlideOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes iframeSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

.iframe-overlay .iframe-content {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-dark, #1B2A3D);
}

/* ========================================
   Premium Company Profile Modal Styles
======================================== */
.premium-company-profile {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.premium-company-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold);
}

.profile-main {
    flex: 2;
    min-width: 300px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.profile-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--accent-gold);
    flex-shrink: 0;
}

.profile-title-area {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.profile-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.profile-value-large {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
    word-break: break-word;
    /* Allow very long words to break */
}

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

.profile-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-item-icon {
    color: var(--accent-silver-light);
    font-size: 1rem;
    margin-top: 2px;
}

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

.profile-contact {
    flex: 1;
    min-width: 250px;
    background: transparent;
    /* Changed from explicit background to blend with card gradient */
    padding: 24px;
    padding-top: 32px;
    /* Pull it down to align with left title content */
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.contact-heading {
    font-size: 0.9rem;
    color: var(--text-heading);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-row {
    display: flex;
    align-items: center;
    /* keep it visually aligned if single row */
    gap: 12px;
}

.contact-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(241, 196, 15, 0.08);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.contact-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-all;
    /* handle very long emails */
}

@media (max-width: 768px) {
    .profile-contact {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* ========================================
   QR Code Generator Modal
======================================== */
.qr-gen-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    min-height: 400px;
}

.qr-gen-form {
    padding: 24px;
    border-right: 1px solid rgba(170, 183, 184, 0.1);
    overflow-y: auto;
    max-height: calc(92vh - 60px);
}

.qr-gen-preview {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: rgba(15, 28, 46, 0.4);
}

/* Tabs */
.qr-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
}

.qr-tab {
    padding: 6px 8px;
    border: 1px solid rgba(170, 183, 184, 0.15);
    border-radius: var(--radius-md);
    background: rgba(27, 42, 61, 0.5);
    color: var(--text-muted);
    font-size: 0.70rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 calc(20% - 8px);
    /* Forces up to 5 items per row cleanly */
    justify-content: center;
    white-space: nowrap;
}

.qr-tab:hover {
    border-color: rgba(241, 196, 15, 0.3);
    color: var(--text-heading);
    background: rgba(241, 196, 15, 0.05);
}

.qr-tab.active {
    background: rgba(241, 196, 15, 0.12);
    border-color: rgba(241, 196, 15, 0.4);
    color: var(--accent-gold);
}

.qr-tab i {
    font-size: 0.72rem;
}

/* Form areas */
.qr-form-container {
    margin-bottom: 16px;
}

.qr-label {
    font-size: 0.72rem;
    color: var(--accent-silver);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.qr-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(27, 42, 61, 0.8);
    border: 1.5px solid rgba(170, 183, 184, 0.2);
    border-radius: 8px;
    color: var(--text-heading);
    font-size: 0.88rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.qr-input:focus {
    border-color: rgba(241, 196, 15, 0.5);
}

.qr-textarea {
    resize: vertical;
    min-height: 60px;
}

.qr-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.qr-checkbox-row input[type="checkbox"] {
    accent-color: var(--accent-gold);
    width: 16px;
    height: 16px;
}

.qr-vcard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Advanced settings */
.qr-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-silver);
    cursor: pointer;
    transition: color 0.2s;
    border-top: 1px solid rgba(170, 183, 184, 0.1);
    margin-top: 8px;
    user-select: none;
}

.qr-advanced-toggle:hover {
    color: var(--accent-gold);
}

.qr-toggle-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.qr-advanced-panel {
    padding: 16px;
    background: rgba(27, 42, 61, 0.4);
    border: 1px solid rgba(170, 183, 184, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.qr-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.qr-setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qr-color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qr-color-input {
    width: 40px;
    height: 36px;
    border: 2px solid rgba(170, 183, 184, 0.2);
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: rgba(27, 42, 61, 0.8);
}

.qr-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.qr-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.qr-color-hex {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Slider */
.qr-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, rgba(241, 196, 15, 0.35), rgba(170, 183, 184, 0.35));
    outline: none;
    transition: background 0.2s;
    cursor: pointer;
}

.qr-slider:hover {
    background: linear-gradient(to right, rgba(241, 196, 15, 0.55), rgba(170, 183, 184, 0.45));
}

.qr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(241, 196, 15, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.qr-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(241, 196, 15, 0.4);
}

.qr-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, rgba(241, 196, 15, 0.35), rgba(170, 183, 184, 0.35));
}

.qr-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(241, 196, 15, 0.3);
}

/* Logo upload */
.qr-logo-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qr-logo-btn {
    padding: 8px 16px;
    background: rgba(36, 52, 71, 0.8);
    border: 1px solid rgba(170, 183, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--accent-silver);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-logo-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(241, 196, 15, 0.05);
}

.qr-logo-filename {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-logo-clear {
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(192, 57, 43, 0.12);
    color: var(--danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.qr-logo-clear:hover {
    background: rgba(192, 57, 43, 0.25);
}

/* Preview panel */
.qr-preview-card {
    width: 100%;
    text-align: center;
}

.qr-preview-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 16px;
}

.qr-preview-box {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.qr-preview-box canvas {
    max-width: 100%;
    height: auto !important;
    border-radius: 4px;
}

.qr-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    text-align: center;
    padding: 20px;
}

/* Download buttons */
.qr-download-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.qr-download-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(170, 183, 184, 0.2);
    border-radius: var(--radius-md);
    background: rgba(27, 42, 61, 0.8);
    color: var(--accent-silver);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.qr-download-btn:not(:disabled):hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(241, 196, 15, 0.08);
}

.qr-download-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qr-email-btn:not(:disabled) {
    border-color: rgba(39, 174, 96, 0.3);
    color: var(--success);
}

.qr-email-btn:not(:disabled):hover {
    border-color: var(--success);
    background: rgba(39, 174, 96, 0.08);
    color: var(--success);
}

/* Responsive: stack on mobile */
@media (max-width: 700px) {
    .qr-gen-layout {
        grid-template-columns: 1fr;
    }

    .qr-gen-form {
        border-right: none;
        border-bottom: 1px solid rgba(170, 183, 184, 0.1);
        max-height: none;
    }

    .qr-gen-preview {
        padding: 20px;
    }

    .qr-settings-grid {
        grid-template-columns: 1fr;
    }

    .qr-vcard-grid {
        grid-template-columns: 1fr;
    }

    .qr-tabs {
        gap: 4px;
    }

    .qr-tab {
        padding: 6px 10px;
        font-size: 0.72rem;
    }
}