:root {
    --bg-main: #F4F7FB;
    --bg-sidebar: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --accent-blue: #3B82F6;
    
    /* 卡片邊框色彩池 */
    --card-border-1: #00D2D3;
    --card-border-2: #8E44AD;
    --card-border-3: #F39C12;
    --card-border-4: #2ECC71;
    --card-border-5: #E74C3C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[v-cloak] {
    display: none;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 0 24px 32px 24px;
}

.brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4A90E2;
    letter-spacing: 0.5px;
}

.menu-label {
    padding: 0 24px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.nav-list {
    list-style: none;
    overflow-y: auto;
}

.nav-item {
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: #F8FAFC;
    color: var(--text-primary);
}

.nav-item.active {
    background-color: #EFF6FF;
    border-left-color: var(--accent-blue);
    color: var(--accent-blue);
}

.nav-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background-color: currentColor;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-main);
}

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

.top-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.device-badge {
    font-size: 0.8rem;
    background: #E2E8F0;
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.last-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: #FFFFFF;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    font-weight: 500;
}

.time-display {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 12px;
}

/* Custom Lang Selector */
.custom-lang-selector {
    position: relative;
    display: inline-block;
}

.lang-trigger {
    display: flex;
    align-items: center;
    background-color: #E2E8F0;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lang-trigger:hover, .lang-trigger.is-open {
    border-color: var(--accent-blue);
    background-color: #F1F5F9;
}

.lang-flag {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chevron-icon {
    margin-left: 6px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.lang-trigger.is-open .chevron-icon {
    transform: rotate(180deg);
}

.lang-dropdown-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99;
}

.lang-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 100;
    min-width: 120px;
}

.lang-option {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-option:hover {
    background-color: #F8FAFC;
}

.lang-option.active {
    background-color: #EFF6FF;
    color: var(--accent-blue);
}

.content-wrapper {
    flex: 1;
    padding: 0 40px 40px 40px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

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

/* View Toggle (Capsule) */
.view-toggle {
    display: inline-flex;
    background-color: #FFFFFF;
    border-radius: 30px;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

/* View Profile Selector (Capsule matching view-toggle) */
.view-profile-selector {
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    border-radius: 30px;
    padding: 8px 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    gap: 8px;
    height: 100%;
}

.view-profile-selector .label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.view-profile-selector select {
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-btn.active {
    background-color: #0F172A;
    color: #FFFFFF;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.2);
}

.icon {
    display: inline-block;
}

/* View Panels */
.view-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Metric Cards */
.reports-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.report-card {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-left: 6px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: #FFFFFF;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-left: 6px solid #ccc; /* Will be overridden by inline style */
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.card-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.card-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.card-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    word-break: break-all; /* 防止長文字超出卡片範圍 */
}

.card-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: pre-line; /* 支援 \n 換行 */
    line-height: 1.4;
}

.card-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.safe-value-text {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75rem;
    color: #94A3B8;
    font-weight: 500;
}

.card-warning {
    background-color: #FFFBEB !important;
}

.card-warning .card-value {
    color: #D97706 !important;
}

.warning-badge {
    margin-left: auto;
    color: #D97706;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    background: #FEF3C7;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-offline {
    background-color: #F8FAFC !important;
}

.card-offline .card-value {
    color: #64748B !important;
}

.offline-badge {
    margin-left: auto;
    color: #64748B;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 8px;
    background: #E2E8F0;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-danger {
    background-color: #FEF2F2 !important;
}

.card-danger .card-value {
    color: #DC2626 !important;
}

.danger-badge {
    margin-left: auto;
    color: #EF4444;
    font-size: 0.8rem;
    font-weight: 700;
    animation: blink 1s infinite;
    padding: 4px 8px;
    background: #FEE2E2;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.normal-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Chart Container */
.chart-container {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

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

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.export-wrapper {
    display: flex;
    flex-direction: column;
}

.health-advice-container {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-left: 6px solid #22C55E;
}

.advice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.advice-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.advice-title-group h3 {
    margin: 0;
    color: #166534;
    font-size: 1.2rem;
}

.advice-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advice-list li {
    font-size: 1rem;
    color: #14532D;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #16A34A;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.download-btn:hover {
    background-color: #15803D;
    transform: translateY(-2px);
}

/* Data Table */
.table-container {
    background-color: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    overflow: hidden;
}

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

.data-table th {
    background-color: #F8FAFC;
    padding: 16px 24px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

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

.time-col {
    color: var(--text-secondary) !important;
    font-variant-numeric: tabular-nums;
}

/* Welcome Box */
.welcome-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Profile Form */
.profile-container {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    max-width: 600px;
    margin: 0 auto;
    margin-top: 24px;
}

.specs-container {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    max-width: 1000px;
    margin: 0 auto;
    margin-top: 24px;
}

.profile-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input, .form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: #F8FAFC;
    transition: all 0.2s;
    width: 100%;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-unit input {
    padding-right: 48px;
}

.input-with-unit .unit {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.save-btn {
    background-color: var(--accent-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover:not(:disabled) {
    background-color: #2563EB;
}

.save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.save-msg {
    color: #10B981;
    font-weight: 500;
    animation: fadeIn 0.3s;
}

/* Health Analysis View */
.analysis-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.age-comparison-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.age-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.age-card.actual-age {
    border-left: 4px solid var(--text-secondary);
}

.age-card.bio-age {
    border-left: 4px solid var(--accent-blue);
}

.age-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.info-icon {
    font-size: 0.9rem;
    cursor: help;
    opacity: 0.7;
}

.age-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.age-unit {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.age-diff {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.text-success { color: #10B981 !important; }
.text-danger { color: #EF4444 !important; }
.text-normal { color: var(--text-primary) !important; }

.analysis-main-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.radar-container, .advice-section {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.radar-container h3, .advice-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.radar-canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.advice-category {
    margin-bottom: 24px;
}

.advice-category:last-child {
    margin-bottom: 0;
}

.advice-category h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.advice-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advice-category li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 16px;
    position: relative;
}

.advice-category li::before {
    content: "•";
    color: var(--accent-blue);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 匯出 PDF 載入中遮罩 */
.export-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-modal {
    background: white;
    padding: 32px 48px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.export-modal h3 {
    margin-top: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.export-modal p {
    color: var(--text-secondary);
    margin-top: 8px;
    font-size: 0.95rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PDF Export Fixes */
.pdf-export-mode {
    background-color: #F8FAFC;
    padding: 24px;
}

.pdf-export-mode .fade-in,
.pdf-export-mode .view-panel {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.report-card, .metric-card, .chart-container, 
.health-advice-container, .age-comparison-section, 
.radar-container, .advice-section, .analysis-main-row {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* --- Fix CSS Grid Page Break Issues for PDF Export --- */
/* html2canvas struggles with CSS Grid page breaks, so we fallback to floats */
.pdf-export-mode .reports-row,
.pdf-export-mode .cards-row,
.pdf-export-mode .age-comparison-section,
.pdf-export-mode .analysis-main-row {
    display: block !important;
}

/* Clear floats */
.pdf-export-mode .reports-row::after,
.pdf-export-mode .cards-row::after,
.pdf-export-mode .age-comparison-section::after,
.pdf-export-mode .analysis-main-row::after {
    content: "";
    display: table;
    clear: both;
}

.pdf-export-mode .report-card {
    float: left !important;
    width: calc(50% - 12px) !important;
    margin-right: 24px !important;
    margin-bottom: 24px !important;
}
.pdf-export-mode .report-card:nth-child(2n) {
    margin-right: 0 !important;
}

.pdf-export-mode .metric-card {
    float: left !important;
    width: calc(25% - 15px) !important;
    margin-right: 20px !important;
    margin-bottom: 20px !important;
}
.pdf-export-mode .metric-card:nth-child(4n) {
    margin-right: 0 !important;
}

.pdf-export-mode .age-card {
    float: left !important;
    width: calc(50% - 12px) !important;
    margin-right: 24px !important;
    margin-bottom: 24px !important;
}
.pdf-export-mode .age-card:nth-child(2n) {
    margin-right: 0 !important;
}

.pdf-export-mode .radar-container {
    float: left !important;
    width: calc(50% - 12px) !important;
    margin-right: 24px !important;
    margin-bottom: 24px !important;
}
.pdf-export-mode .advice-section {
    float: left !important;
    width: calc(50% - 12px) !important;
    margin-right: 0 !important;
    margin-bottom: 24px !important;
}

/* 設備硬體規格 (Hardware Specs) */
.hardware-specs-body {
    padding: 32px;
    background: #FAFAFA;
    border-radius: 12px;
    margin-top: 24px;
}

.specs-intro {
    background: #FFFFFF;
    border-left: 4px solid var(--accent-blue);
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.specs-intro p {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 1.05rem;
    margin: 0;
}

.specs-diagram {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    text-align: center;
}

.specs-diagram svg {
    max-width: 100%;
    height: auto;
}

.hardware-specs-list {
    list-style: disc inside;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.hardware-specs-list li {
    margin-bottom: 12px;
}

.hardware-specs-list li strong {
    font-weight: 600;
}

/* Multi-profile & Device assignment */
.nav-item-device {
    align-items: flex-start;
}

.device-item-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.device-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-profile-select select {
    width: 100%;
    padding: 6px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: var(--text-primary);
}

/* User Cards View Layout */
.user-cards-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.user-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.user-cards-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.user-cards-header p {
    margin: 4px 0 0 0;
    color: var(--text-secondary);
}

.btn-create {
    background-color: #0E7490;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.btn-create:hover {
    background-color: #164E63;
}

.user-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.user-card {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    border-color: #CBD5E1;
}

.user-card-top-bar {
    display: flex;
    justify-content: space-between;
    font-family: monospace;
    font-size: 0.75rem;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 8px;
    border-bottom: 1px dashed #E2E8F0;
}

.user-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-card-subtitle {
    font-size: 0.85rem;
    color: #64748B;
}

.user-card-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 4px;
}

.icon-btn:hover {
    opacity: 1;
}

.user-card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-icon {
    opacity: 0.7;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-cancel {
    background-color: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

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

/* =========================================
   PDF Preview Modal & A4 Layout Styles
   ========================================= */
.pdf-preview-modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    overflow-y: auto;
    padding: 24px;
    box-sizing: border-box;
}

.pdf-preview-header {
    width: 100%;
    max-width: 1122px;
    margin: 0 auto 24px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.pdf-preview-header h2 {
    font-size: 1.25rem;
    color: #0F172A;
    margin: 0;
}

.pdf-preview-actions {
    display: flex;
    gap: 12px;
}

.pdf-preview-body {
    display: flex;
    justify-content: center;
    padding-bottom: 60px;
}

/* A4 Landscape Page */
.a4-landscape-page {
    width: 1122px;
    min-height: 794px;
    height: auto;
    background: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 40px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: visible;
}

.a4-header {
    border-bottom: 2px solid #E2E8F0;
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.a4-title {
    font-size: 24px;
    font-weight: 800;
    color: #0F172A;
}

.a4-meta {
    font-size: 12px;
    color: #64748B;
    display: flex;
    gap: 16px;
}

.a4-main-grid {
    display: flex;
    gap: 24px;
    height: calc(100% - 70px);
}

.a4-left-col, .a4-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.a4-section {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 20px;
    flex: 1;
}

.a4-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 16px;
    margin-top: 0;
    display: flex;
    align-items: center;
}

.a4-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.a4-card {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px;
}

.a4-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748B;
    margin-bottom: 8px;
}

.a4-card-icon {
    font-size: 16px;
}

.a4-card-val {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    white-space: pre-line;
}

.a4-factors {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.a4-factor-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border-left: 4px solid #CBD5E1;
}

.a4-type-danger { border-left-color: #EF4444; background: #FEF2F2; color: #991B1B; }
.a4-type-warning { border-left-color: #F59E0B; background: #FFFBEB; color: #92400E; }
.a4-type-success { border-left-color: #10B981; background: #ECFDF5; color: #065F46; }

.a4-ages {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.a4-age-box {
    background: white;
    padding: 16px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
    border: 1px solid #E2E8F0;
}

.a4-age-label {
    font-size: 12px;
    color: #64748B;
    margin-bottom: 4px;
}

.a4-age-val {
    font-size: 24px;
    font-weight: 800;
    color: #0F172A;
}

.a4-advice-block {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #E2E8F0;
}

.a4-advice-sub {
    font-weight: 700;
    font-size: 14px;
    color: #0F172A;
    margin-bottom: 8px;
}

.a4-advice-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}
