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

:root {
    --primary: #1a56db;
    --primary-light: #e1effe;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --success: #16a34a;
    --success-light: #dcfce7;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* === Header === */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    text-decoration: none;
}

.nav { display: flex; gap: 8px; }

.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.nav-link:hover { background: var(--gray-100); }

/* === Main === */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* === Cards === */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: #1e40af; }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; }

.btn-outline {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); }

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

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

.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* === Upload === */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone-icon { font-size: 48px; color: var(--gray-300); margin-bottom: 12px; }
.upload-zone-text { font-size: 16px; color: var(--gray-500); }
.upload-zone-sub { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* === File List === */
.file-list { list-style: none; }

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
}

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

.file-name { font-size: 14px; flex: 1; }

.file-size {
    font-size: 13px;
    color: var(--gray-500);
    margin-left: 12px;
}

.file-remove {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
}

/* === Progress === */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 8px;
}

/* === Status Badges === */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending { background: var(--gray-100); color: var(--gray-500); }
.badge-processing { background: var(--primary-light); color: var(--primary); }
.badge-completed { background: var(--success-light); color: var(--success); }
.badge-failed { background: var(--danger-light); color: var(--danger); }
.badge-reviewed { background: #dbeafe; color: #1d4ed8; }
.badge-exported { background: #f3e8ff; color: #7c3aed; }

/* === Table === */
.table-wrap { overflow-x: auto; }

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

th, td {
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}

th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 13px;
    background: var(--gray-50);
}

tr:hover td { background: var(--gray-50); }

/* === Confidence indicators === */
.confidence-high { color: var(--success); }
.confidence-medium { color: var(--warning); }
.confidence-low { color: var(--danger); font-weight: 600; }

.confidence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.confidence-dot.high { background: var(--success); }
.confidence-dot.medium { background: var(--warning); }
.confidence-dot.low { background: var(--danger); }

/* === Confidence Summary === */
.confidence-summary {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 14px;
}

.confidence-summary span { display: flex; align-items: center; gap: 4px; }

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--gray-500);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; }

/* === Processing === */
.processing-list { list-style: none; }

.processing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.processing-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.processing-check {
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 12px;
}

.processing-error {
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    font-size: 12px;
}

/* === Responsive grid === */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

/* === Utilities === */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--gray-500); }

/* === Stat cards === */
.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* === Property Cards === */
.property-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    transition: box-shadow 0.15s;
}

.property-card:hover { box-shadow: var(--shadow-lg); }

.property-card-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.property-card-file {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.property-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
