* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f5;
    color: #1f2d28;
}
.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e6e4;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar h1 { font-size: 18px; margin: 0; color: #0f5132; }
.topbar nav a { color: #0f5132; text-decoration: none; font-weight: 600; margin-left: 12px; }
.topbar nav a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 32px; }

h2 { color: #0f5132; }
.dataset-title { font-size: 28px; font-weight: 800; color: #0f5132; margin-bottom: 4px; }
.muted { color: #6b7a72; font-size: 14px; }

.card {
    background: #fff;
    border: 1px solid #e2e6e4;
    border-radius: 10px;
    padding: 20px 24px;
    margin-top: 16px;
}
.card label { display: block; font-weight: 600; margin-bottom: 6px; margin-top: 12px; }
.card input[type=text], .card input[type=file], .card select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d3dad7;
    border-radius: 6px;
    font-size: 14px;
}
.btn-primary {
    margin-top: 20px;
    background: #16a34a;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 15px;
}
.btn-primary:hover { background: #0f5132; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-error { background: #fde8e8; color: #9b1c1c; border: 1px solid #f5b5b5; }

/* Mapping table */
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; background: #fff; }
.mapping-table th, .mapping-table td,
.pivot-table th, .pivot-table td {
    border: 1px solid #e2e6e4;
    padding: 10px 14px;
    font-size: 14px;
    text-align: left;
}
.mapping-table th, .pivot-table th { background: #0f5132; color: #fff; }
.pivot-table td.num, .pivot-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pivot-table tfoot td { background: #eaf3ee; }
.sample-cell div { color: #6b7a72; font-size: 12px; }

/* Dashboard filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-group { min-width: 180px; }
.filter-group label { display: block; font-size: 12px; font-weight: 700; color: #445048; margin-bottom: 4px; text-transform: uppercase; }
.btn-reset { display: inline-block; padding: 10px 16px; border: 1px solid #d3dad7; border-radius: 6px; color: #0f5132; text-decoration: none; font-weight: 600; }

/* KPI cards */
.kpi-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; }
.kpi-card { background: #fff; border: 1px solid #e2e6e4; border-radius: 10px; padding: 18px 24px; min-width: 200px; }
.kpi-label { font-size: 13px; color: #6b7a72; font-weight: 600; }
.kpi-value { font-size: 26px; font-weight: 800; color: #0f5132; margin-top: 4px; }

/* Dataset grid on index */
.dataset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.dataset-card { display: block; background: #fff; border: 1px solid #e2e6e4; border-radius: 10px; padding: 18px 20px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.dataset-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.dataset-card-title { font-weight: 700; color: #0f5132; margin-bottom: 6px; }
.dataset-card-meta { font-size: 13px; color: #6b7a72; margin-bottom: 8px; }
.dataset-card-file { font-size: 13px; color: #445048; }
