/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f1f5f9; color: #0f172a; min-height: 100vh; font-size: 15px; line-height: 1.5; }
input, select, button, textarea { font-family: inherit; font-size: 14px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── AUTH ─── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; background: #f1f5f9; }
.auth-card { background: #fff; border-radius: 20px; box-shadow: 0 4px 32px rgba(0,0,0,.1); width: 100%; max-width: 380px; padding: 40px; }
.auth-logo-icon { width: 52px; height: 52px; background: #BA7517; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.auth-logo-img { height: 44px; object-fit: contain; margin: 0 auto 14px; border-radius: 6px; }
.auth-title { font-size: 24px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: #64748b; text-align: center; margin-bottom: 24px; }

/* ─── HEADER ─── */
.app-header { background: #fff; border-bottom: 0.5px solid #e2e8f0; position: sticky; top: 0; z-index: 40; }
.header-top { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 50px; }
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo { height: 28px; width: 28px; object-fit: cover; border-radius: 4px; }
.header-logo-icon { width: 28px; height: 28px; background: #BA7517; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.header-company { font-size: 14px; font-weight: 600; color: #0f172a; }
.header-sub { font-size: 10px; color: #94a3b8; letter-spacing: .06em; }
.header-user { display: flex; align-items: center; gap: 8px; }
.header-username { font-size: 13px; color: #64748b; }
.header-nav { display: flex; gap: 2px; padding: 4px 10px; overflow-x: auto; border-top: 0.5px solid #f1f5f9; }
.nav-link { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 400; color: #64748b; white-space: nowrap; transition: all .15s; }
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.nav-link.active { background: #FAEEDA; color: #854F0B; font-weight: 600; }

/* ─── MAIN ─── */
.app-main { }
.page { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.page-sm { max-width: 620px; margin: 0 auto; padding: 20px 16px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-title { font-size: 22px; font-weight: 600; }
.page-sub { font-size: 13px; color: #64748b; margin-top: 2px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title { font-size: 16px; font-weight: 600; }

/* ─── CARD ─── */
.card { background: #fff; border: 0.5px solid #e2e8f0; border-radius: 14px; padding: 20px 22px; margin-bottom: 12px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* ─── FORM ─── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #475569; margin-bottom: 6px; }
.form-input { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #0f172a; background: #fff; outline: none; transition: border-color .2s; }
.form-input:focus { border-color: #BA7517; }
.form-hint { font-size: 13px; color: #64748b; margin-bottom: 10px; }

/* ─── BUTTONS ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; font-size: 14px; font-weight: 500; border-radius: 10px; border: 0.5px solid #e2e8f0; background: #fff; color: #0f172a; cursor: pointer; transition: all .15s; white-space: nowrap; }
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-primary { background: #BA7517; color: #FAEEDA; border-color: #BA7517; }
.btn-primary:hover { background: #854F0B; }
.btn-danger { color: #A32D2D; border-color: #F09595; }
.btn-block { width: 100%; display: flex; }
.btn-lg { padding: 13px 16px; font-size: 15px; }
.btn-sm { font-size: 12px; padding: 5px 10px; }
.btn-group { display: flex; gap: 8px; }

/* ─── ALERTS ─── */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert-info { background: #EFF6FF; border: 1px solid #93C5FD; color: #1D4ED8; }
.alert-success { background: #EAF3DE; border: 1px solid #97C459; color: #3B6D11; }
.alert-danger { background: #FCEBEB; border: 1px solid #F09595; color: #A32D2D; }
.alert-warning { background: #FAEEDA; border: 1px solid #FAC775; color: #633806; }
.hidden { display: none !important; }

/* ─── STATS ─── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card { background: #f8fafc; border: 0.5px solid #e2e8f0; border-radius: 12px; padding: 14px 10px; text-align: center; }
.stat-card.stat-warning { background: #FAEEDA; border-color: #FAC775; }
.stat-card.stat-success { background: #EAF3DE; border-color: #97C459; }
.stat-value { font-size: 30px; font-weight: 600; color: #0f172a; }
.stat-warning .stat-value { color: #854F0B; }
.stat-success .stat-value { color: #3B6D11; }
.stat-label { font-size: 12px; color: #64748b; font-weight: 500; margin-top: 2px; }
.stat-warning .stat-label { color: #854F0B; }
.stat-success .stat-label { color: #3B6D11; }

/* ─── ANALYSIS ROW ─── */
.analysis-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border: 0.5px solid #e2e8f0; border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s; }
.analysis-row:hover, .analysis-row.active { border-color: #BA7517; background: #FAEEDA0a; }
.an-num { font-size: 14px; font-weight: 600; color: #0f172a; }
.an-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.grade-badge { font-size: 24px; font-weight: 700; min-width: 36px; text-align: right; }

/* ─── BADGES ─── */
.badge { font-size: 11px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.badge-warning { background: #FAEEDA; color: #633806; }
.badge-success { background: #EAF3DE; color: #3B6D11; }

/* ─── TABS ─── */
.tabs { display: flex; gap: 2px; background: #f1f5f9; border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.tab { flex: 1; padding: 7px 8px; border-radius: 8px; font-size: 13px; font-weight: 400; color: #64748b; text-align: center; transition: all .15s; }
.tab.active { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 0 0 0.5px #e2e8f0; }

/* ─── WIZARD ─── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-progress { margin-bottom: 20px; }
.progress-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-info span:first-child { font-weight: 500; }
.progress-info span:last-child { color: #64748b; }
.progress-bar { height: 4px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: #BA7517; border-radius: 99px; transition: width .35s ease; width: 0; }
.wizard-nav { display: flex; gap: 8px; margin-top: 16px; }
.dossier-num-box { background: #f8fafc; border: 0.5px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.dossier-num-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; margin-bottom: 4px; }
.dossier-num { font-size: 24px; font-weight: 700; color: #BA7517; font-variant-numeric: tabular-nums; }

/* ─── PHOTO CAPTURE ─── */
.photo-drop { border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 36px 20px; text-align: center; color: #64748b; }
.photo-drop p { font-size: 13px; margin: 10px 0 14px; }
.photo-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.camera-video { width: 100%; max-height: 280px; display: block; border-radius: 10px; background: #000; margin-bottom: 8px; object-fit: cover; }
.photo-preview { width: 100%; max-height: 220px; object-fit: contain; display: block; border-radius: 10px; border: 0.5px solid #e2e8f0; background: #f8fafc; }

/* ─── CANVAS ─── */
.zone-canvas { display: block; width: 100%; max-height: 320px; cursor: crosshair; border: 0.5px solid #e2e8f0; border-radius: 10px; touch-action: none; }
.zone-info { font-size: 12px; color: #64748b; margin-top: 8px; }

/* ─── RESULT ─── */
.result-grade { font-size: 88px; font-weight: 700; line-height: 1; margin: 8px 0; }
.result-label { font-size: 14px; font-weight: 600; color: #0f172a; }
.result-detail { font-size: 12px; color: #64748b; margin-top: 6px; }
.result-dot { width: 42px; height: 42px; border-radius: 50%; border: 0.5px solid #e2e8f0; margin: 14px auto 0; }

/* ─── PHOTOS GRID ─── */
.photos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.photo-grid-label { font-size: 11px; text-align: center; color: #94a3b8; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* ─── DETAIL TABLE ─── */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.detail-table th { text-align: left; font-weight: 500; padding: 7px 10px; background: #f8fafc; border: 0.5px solid #e2e8f0; width: 130px; color: #475569; }
.detail-table td { padding: 7px 10px; border: 0.5px solid #e2e8f0; }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 56px 0; color: #94a3b8; }
.empty-state svg { margin: 0 auto 14px; opacity: .5; }
.empty-state p { font-size: 15px; margin-bottom: 4px; color: #64748b; }
.empty-state span { font-size: 13px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
    .page, .page-sm { padding: 16px 12px; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .stat-value { font-size: 22px; }
    .photos-grid { grid-template-columns: 1fr; }
    .btn-group { flex-direction: column; }
    .result-grade { font-size: 72px; }
}
