/* ═══════════════════════════════════════════
   CRM 客戶管理系統 — 商用級設計系統
   Version: 4.0
   Theme: Premium Dark + Glassmorphism
   ═══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    /* Background */
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f23;
    --bg-card: rgba(22, 22, 48, 0.65);
    --bg-card-hover: rgba(30, 30, 60, 0.8);
    --bg-input: rgba(15, 15, 35, 0.8);
    --bg-sidebar: rgba(8, 8, 20, 0.95);

    /* Accent */
    --accent-blue: hsl(230, 80%, 65%);
    --accent-blue-dim: hsl(230, 60%, 40%);
    --accent-blue-glow: hsla(230, 80%, 65%, 0.3);
    --accent-green: hsl(160, 70%, 45%);
    --accent-green-dim: hsl(160, 50%, 30%);
    --accent-green-glow: hsla(160, 70%, 45%, 0.3);
    --accent-amber: hsl(40, 90%, 55%);
    --accent-amber-glow: hsla(40, 90%, 55%, 0.25);
    --accent-red: hsl(0, 75%, 60%);
    --accent-red-glow: hsla(0, 75%, 60%, 0.25);
    --accent-purple: hsl(270, 70%, 65%);

    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555570;
    --text-inverse: #0a0a1a;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(100, 120, 255, 0.3);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px hsla(230, 80%, 65%, 0.15);
    --shadow-glow-green: 0 0 30px hsla(160, 70%, 45%, 0.15);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, hsla(230, 60%, 30%, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, hsla(270, 50%, 25%, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, hsla(160, 40%, 20%, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    transition: transform var(--transition-slow);
}

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

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(100, 120, 255, 0.4));
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-blue);
    border-radius: var(--radius-full);
    transition: height var(--transition-base);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(100, 120, 255, 0.08);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-item.active::before {
    height: 60%;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    margin-bottom: var(--space-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background var(--transition-base);
}

.status-dot.connected {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green-glow);
    animation: pulse 2s ease infinite;
}

.status-dot.disconnected {
    background: var(--accent-amber);
    box-shadow: 0 0 8px var(--accent-amber-glow);
}

.status-text {
    color: var(--text-muted);
}

.powered-by {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    /* 確保在 iOS PWA 模式下不會被瀏海或狀態列遮擋 */
    top: calc(var(--space-md) + env(safe-area-inset-top, 0px));
    left: var(--space-md);
    z-index: 110;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    backdrop-filter: blur(20px);
    transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

/* ═══════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════ */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--space-2xl);
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ── Pages ── */
.page {
    display: none;
    animation: fadeIn 0.35s ease;
}

.page.active {
    display: block;
}

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

.page-header {
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-xs);
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.93rem;
}

/* Google Sheet link */
.sheet-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: rgba(66, 133, 244, 0.08);
    border: 1px solid rgba(66, 133, 244, 0.2);
    color: hsl(217, 89%, 61%);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-base);
}

.sheet-link:hover {
    background: rgba(66, 133, 244, 0.15);
    border-color: rgba(66, 133, 244, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 120, 255, 0.15);
}

.suggestion-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.suggestion-btn::before {
    font-size: 1rem;
}

.sheet-link-icon {
    font-size: 1rem;
}

.sheet-link svg {
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.sheet-link:hover svg {
    opacity: 1;
}

/* ═══════════════════════════════════════════
   CARD COMPONENT
   ═══════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════════
   BUTTON SYSTEM
   ═══════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled::after { display: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), hsl(250, 70%, 60%));
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-blue-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-blue-glow);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), hsl(160, 60%, 40%));
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-green-glow);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), hsl(0, 60%, 50%));
    color: #fff;
}

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

.btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { font-size: 1.1em; }

/* ═══════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════ */

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

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.93rem;
    font-family: inherit;
    transition: all var(--transition-base);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

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

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%238888aa'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

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

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

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

.form-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════ */

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

.upload-zone {
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(100, 120, 255, 0.04);
    box-shadow: inset 0 0 30px rgba(100, 120, 255, 0.05);
}

.upload-zone.has-image {
    border-color: var(--accent-green);
    border-style: solid;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.upload-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.upload-text {
    font-weight: 600;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.upload-preview {
    max-width: 100%;
    max-height: 240px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.upload-actions {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.status-message {
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.status-message.success {
    background: rgba(40, 180, 120, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(40, 180, 120, 0.2);
}

.status-message.error {
    background: rgba(220, 80, 80, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(220, 80, 80, 0.2);
}

/* Scan Tabs */
.scan-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.scan-tab-btn {
    flex: 1;
    padding: 12px var(--space-md);
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.scan-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.scan-tab-btn.active {
    background: rgba(100, 120, 255, 0.1);
    color: var(--accent-blue);
    border-color: rgba(100, 120, 255, 0.2);
    box-shadow: 0 2px 10px rgba(100, 120, 255, 0.05);
}

/* Customer Search */
.search-input-wrapper {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.search-results {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.search-result-item {
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item:hover {
    border-color: var(--accent-blue);
    background: rgba(100, 120, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.search-result-title {
    font-weight: 700;
    color: var(--text-primary);
}

.search-result-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   CHAT INTERFACE
   ═══════════════════════════════════════════ */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    padding: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-full);
}

.chat-welcome {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 0 15px rgba(100, 120, 255, 0.3));
}

.chat-welcome h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.chat-bubble {
    max-width: 80%;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 0.93rem;
    line-height: 1.7;
    animation: messageSlideIn 0.3s ease;
}

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

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-blue), hsl(250, 70%, 60%));
    color: #fff;
    border-bottom-right-radius: var(--space-xs);
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-bottom-left-radius: var(--space-xs);
}

.chat-bubble.assistant h1,
.chat-bubble.assistant h2,
.chat-bubble.assistant h3 {
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
    color: var(--accent-blue);
}

.chat-bubble.assistant table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-md) 0;
    font-size: 0.85rem;
}

.chat-bubble.assistant th,
.chat-bubble.assistant td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    text-align: left;
}

.chat-bubble.assistant th {
    background: rgba(100, 120, 255, 0.1);
    font-weight: 600;
}

.chat-bubble.assistant ul,
.chat-bubble.assistant ol {
    padding-left: var(--space-lg);
    margin: var(--space-sm) 0;
}

.chat-bubble.assistant code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

.chat-bubble.assistant strong {
    color: var(--accent-blue);
}

.chat-suggestions {
    padding: var(--space-sm) var(--space-xl);
    border-top: 1px solid var(--border);
}

.suggestions-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.suggestions-grid {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.suggestion-btn {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    background: rgba(100, 120, 255, 0.08);
    border: 1px solid rgba(100, 120, 255, 0.15);
    color: var(--accent-blue);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.suggestion-btn:hover {
    background: rgba(100, 120, 255, 0.15);
    border-color: rgba(100, 120, 255, 0.3);
    transform: translateY(-1px);
}

.chat-input-area {
    padding: var(--space-md) var(--space-xl) var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
}

.chat-input-wrapper {
    display: flex;
    gap: var(--space-sm);
    width: 100%;
}

.chat-input {
    flex: 1;
    padding: 14px var(--space-lg);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.93rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-base);
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-card);
}

.chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

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

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════ */

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

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    backdrop-filter: blur(20px);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.kpi-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
    opacity: 1;
}

.kpi-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.kpi-value {
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.kpi-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: var(--space-xs);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.chart-card {
    min-height: 380px;
}

.chart-wrapper {
    position: relative;
    height: 280px;
}

.chart-wrapper canvas {
    max-height: 100%;
}

.ai-advisor-card {
    position: relative;
    overflow: hidden;
}

.ai-advisor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green), var(--accent-purple));
}

.ai-advice-content {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-height: 80px;
    line-height: 1.8;
}

.ai-advice-content h1,
.ai-advice-content h2,
.ai-advice-content h3 {
    color: var(--accent-blue);
    margin-top: var(--space-md);
    margin-bottom: var(--space-sm);
}

.ai-advice-content ul, 
.ai-advice-content ol {
    padding-left: var(--space-lg);
    margin: var(--space-sm) 0;
}

.ai-advice-content strong {
    color: var(--accent-green);
}

.advice-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-lg);
}

/* ═══════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════ */

.settings-login {
    max-width: 420px;
    margin: var(--space-2xl) auto;
    text-align: center;
}

.login-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.login-form {
    display: flex;
    gap: var(--space-sm);
}

.login-form .form-input {
    flex: 1;
}

.login-error {
    color: var(--accent-red);
    font-size: 0.85rem;
    font-weight: 500;
}

.settings-panel {
    animation: fadeIn 0.35s ease;
}

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

.settings-tabs {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.tab-btn {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

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

.tab-btn.active {
    background: rgba(100, 120, 255, 0.1);
    border-color: rgba(100, 120, 255, 0.3);
    color: var(--accent-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.info-banner {
    background: rgba(100, 120, 255, 0.06);
    border: 1px solid rgba(100, 120, 255, 0.15);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    font-size: 0.88rem;
    line-height: 1.8;
}

.info-banner ol {
    padding-left: var(--space-lg);
    margin-top: var(--space-sm);
}

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

/* Fields settings */
.field-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
}

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

.field-name {
    min-width: 120px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.field-alias-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-base);
}

.field-alias-input:focus {
    border-color: var(--accent-blue);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-secondary);
    left: 3px;
    top: 3px;
    transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #fff;
}

.toggle-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    min-width: 320px;
    max-width: 450px;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    transition: opacity var(--transition-base);
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

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

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

.toast.success {
    background: rgba(40, 180, 120, 0.15);
    border-color: rgba(40, 180, 120, 0.25);
    color: var(--accent-green);
}

.toast.error {
    background: rgba(220, 80, 80, 0.15);
    border-color: rgba(220, 80, 80, 0.25);
    color: var(--accent-red);
}

.toast.warning {
    background: rgba(220, 170, 50, 0.15);
    border-color: rgba(220, 170, 50, 0.25);
    color: var(--accent-amber);
}

.toast.info {
    background: rgba(100, 120, 255, 0.15);
    border-color: rgba(100, 120, 255, 0.25);
    color: var(--accent-blue);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-body {
    margin-bottom: var(--space-xl);
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════ */

.global-loading {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.93rem;
    font-weight: 500;
}

/* Inline loading dots */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

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

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,
        var(--border) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        var(--border) 75%
    );
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════ */

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

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-lg);
        padding-top: calc(var(--space-lg) + 60px + env(safe-area-inset-top, 0px));
    }

    /* 修復：top-user-bar 被漢堡選單按鈕遮擋 */
    .top-user-bar {
        padding: 6px 12px;
        font-size: 0.78rem;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* 修復：上傳區域在手機上偏高 */
    .upload-grid {
        grid-template-columns: 1fr;
    }

    .upload-zone {
        min-height: 140px;
        padding: var(--space-lg);
    }

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

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

    /* 修復：表單下方按鈕全寬 */
    .form-actions {
        flex-direction: column;
    }

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

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

    /* 修復：Chat 鍵盤彈出後不破版 — 改用 dvh 動態視窗高度 */
    .chat-container {
        height: calc(100dvh - 160px);
        min-height: 400px;
    }

    .chat-bubble {
        max-width: 95%;
    }

    .suggestions-grid {
        flex-direction: column;
    }

    .scan-tabs {
        flex-direction: column;
    }

    .scan-tab-btn {
        text-align: left;
        padding: var(--space-md);
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 1.4rem;
    }

    /* 修復：設定頁 Tab 在手機排列 */
    .settings-tabs {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .tab-btn {
        flex-shrink: 0;
        text-align: center;
        font-size: 0.78rem;
        padding: var(--space-sm);
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 32px);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }
}

/* Backdrop for mobile sidebar */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-backdrop.visible {
    display: block;
}

/* ═══════════════════════════════════════════
   SCROLLBAR STYLING
   ═══════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent-blue);
    color: #fff;
}

/* ====== 身分識別 UI ====== */
.top-user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 10px;
    font-size: 0.9rem;
}

.top-user-bar .current-user-text {
    color: var(--text-secondary);
}

.top-user-bar strong {
    color: var(--primary);
    font-weight: 600;
}

.identity-modal-overlay {
    backdrop-filter: blur(8px);
    background-color: rgba(15, 23, 42, 0.85); /* 較深的遮罩 */
    z-index: 9999; /* 確保在最上層 */
}

.identity-modal {
    max-width: 400px;
}

/* ═══════════════════════════════════════════
   USAGE GUIDE STYLES
   ═══════════════════════════════════════════ */
.guide-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.guide-card {
    padding: 30px;
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.guide-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.guide-step {
    display: flex;
    gap: 20px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-color);
}

.guide-step-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.guide-step-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.guide-step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 15px 0;
}

/* Mockup UI Elements */
.guide-mockup {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
}

.mockup-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.mockup-btn.primary {
    background: var(--accent-blue);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Chat Mockup */
.chat-mockup {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 25px;
}

.mockup-chat {
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.5;
}

.mockup-chat.user {
    align-self: flex-end;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.mockup-chat.ai {
    align-self: flex-start;
    background: rgba(37, 99, 235, 0.1);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border-left: 4px solid var(--accent-blue);
}

.guide-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-list li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-list li::before {
    content: "✅";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9rem;
}

/* Grid Mockup */
.guide-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.guide-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.05rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .guide-step {
        flex-direction: column;
        gap: 15px;
    }
    .guide-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ═════════════════════════════════════════════
   PWA 安裝說明區塊
   ═════════════════════════════════════════════ */

/* 已安裝徽章 */
.pwa-installed-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(40, 180, 120, 0.08);
    border: 1px solid rgba(40, 180, 120, 0.25);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease;
}

.pwa-installed-badge .installed-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.pwa-installed-badge strong {
    display: block;
    color: var(--accent-green);
    font-size: 1rem;
    margin-bottom: 4px;
}

.pwa-installed-badge p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin: 0;
}

/* 平台區塊 */
.pwa-platform-block {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px dashed var(--border-hover);
}

.pwa-platform-block:first-of-type {
    margin-top: 16px;
    padding-top: 16px;
}

.pwa-platform-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pwa-platform-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.pwa-platform-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.pwa-platform-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.pwa-platform-badge.ios {
    background: rgba(100, 120, 255, 0.12);
    border: 1px solid rgba(100, 120, 255, 0.25);
    color: var(--accent-blue);
}

.pwa-platform-badge.android {
    background: rgba(40, 180, 120, 0.1);
    border: 1px solid rgba(40, 180, 120, 0.25);
    color: var(--accent-green);
}

.pwa-platform-badge.desktop {
    background: rgba(270, 70%, 65%, 0.08);
    border: 1px solid rgba(150, 100, 220, 0.25);
    color: var(--accent-purple);
}

/* 步驟列表 */
.pwa-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.pwa-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.pwa-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), hsl(250, 70%, 60%));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-blue-glow);
}

.pwa-step-content {
    flex: 1;
    padding-top: 4px;
}

.pwa-step-content strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.pwa-step-content p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0;
}

.pwa-inline-icon {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 0.9rem;
    vertical-align: middle;
}

/* 注意與提示框 */
.pwa-notice {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 8px;
}

.pwa-notice.warning {
    background: rgba(220, 170, 50, 0.08);
    border: 1px solid rgba(220, 170, 50, 0.2);
    color: var(--accent-amber);
}

.pwa-notice.info {
    background: rgba(100, 120, 255, 0.06);
    border: 1px solid rgba(100, 120, 255, 0.15);
    color: var(--text-secondary);
}

.pwa-notice strong {
    color: inherit;
}

/* 安全區域 safe-area 支援 (iOS notch 處理) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: calc(var(--space-2xl) + env(safe-area-inset-bottom));
    }

    .chat-input-area {
        padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
    }
}

/* 手機版 PWA 步驟適配 */
@media (max-width: 768px) {
    .pwa-steps {
        gap: 12px;
    }

    .pwa-step {
        gap: 12px;
    }

    .pwa-platform-header {
        gap: 8px;
    }

    .pwa-platform-header h3 {
        font-size: 1rem;
    }
}

/* 圖片管理 Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    transition: all 0.2s ease;
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.image-card.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.image-card-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    background: var(--bg-color);
}

.image-card-info {
    padding: 10px;
    font-size: 0.85rem;
}

.image-card-title {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-card-source {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: #e2e8f0;
    color: #475569;
}

.image-card-source.drive {
    background: #dbeafe;
    color: #1e40af;
}

.image-card-source.gcs {
    background: #dcfce7;
    color: #166534;
}

.image-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    z-index: 10;
    cursor: pointer;
    background: white;
}
