/* Giao diện thu thập dữ liệu thiên tai cấp xã — bổ sung cho design-system.css.
   Nguyên tắc: nền sáng, chữ đậm, nút to đủ để bấm trên điện thoại ngoài thực địa. */

.dsp-app {
    max-width: 1380px;
    margin: 0 auto;
    padding: 18px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------------------------------------------------------- hero */

.dsp-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 22px 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.dsp-hero-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    max-width: 860px;
}

.dsp-hero-badge {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    font-size: 1.15rem;
}

.dsp-hero h1 {
    margin: 0 0 6px;
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
}

.dsp-hero p {
    margin: 0 0 8px;
    color: #334155;
    line-height: 1.6;
    font-size: 0.95rem;
}

.dsp-hero-note {
    background: rgba(255, 255, 255, 0.75);
    border-left: 3px solid #2563eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.88rem !important;
    color: #475569 !important;
}

.dsp-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------- buttons */

.dsp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dsp-btn:hover { transform: translateY(-1px); }

.dsp-btn-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.dsp-btn-ghost {
    background: #fff;
    color: #1e293b;
    border-color: rgba(148, 163, 184, 0.35);
}

.dsp-btn-sm { padding: 9px 14px; font-size: 0.86rem; }
.dsp-btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------- cards */

.dsp-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.dsp-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
}

.dsp-step-num {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 800;
}

.dsp-hint {
    margin: 0 0 14px;
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.55;
}

/* ---------------------------------------------------------- form */

.dsp-grid-2,
.dsp-grid-3 {
    display: grid;
    gap: 14px;
}

.dsp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dsp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.dsp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.dsp-field > span {
    font-size: 0.87rem;
    font-weight: 600;
    color: #334155;
}

.dsp-field > span b { color: #dc2626; }
.dsp-soft-req { color: #94a3b8; font-style: normal; font-weight: 500; }

.dsp-field input,
.dsp-field select,
.dsp-field textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
    font-size: 0.94rem;
    color: #0f172a;
    font-family: inherit;
}

.dsp-field input:focus,
.dsp-field select:focus,
.dsp-field textarea:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 1px;
    background: #fff;
}

.dsp-field small {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
}

.dsp-field input[type="checkbox"] {
    width: 22px;
    height: 22px;
    align-self: flex-start;
    accent-color: #2563eb;
}

/* ---------------------------------------------------------- type picker */

.dsp-type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dsp-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-radius: 14px;
    border: 1.5px solid rgba(148, 163, 184, 0.3);
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.dsp-type-card i { font-size: 1.3rem; color: var(--type-color, #2563eb); }
.dsp-type-card strong { font-size: 0.87rem; font-weight: 600; color: #334155; line-height: 1.35; }

.dsp-type-card.is-active {
    border-color: var(--type-color, #2563eb);
    background: color-mix(in srgb, var(--type-color, #2563eb) 7%, #fff);
}

.dsp-type-card.is-active strong { color: #0f172a; }

/* ---------------------------------------------------------- workbench */

.dsp-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.dsp-map {
    height: 420px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #eef2f7;
}

.dsp-coord-row { margin-top: 14px; }

.dsp-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

/* ---------------------------------------------------------- alert */

.dsp-alert {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.dsp-alert.is-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.dsp-alert.is-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.dsp-alert.is-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ---------------------------------------------------------- point list */

.dsp-count-chip {
    margin-left: auto;
    padding: 3px 11px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 700;
}

.dsp-point-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.dsp-point {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-left: 4px solid var(--point-color, #2563eb);
    border-radius: 12px;
    padding: 13px 15px;
    background: #fff;
}

.dsp-point-head {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 6px;
}

.dsp-point-head strong { font-size: 0.95rem; color: #0f172a; }

.dsp-point-status {
    flex: 0 0 auto;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--status-color, #64748b);
    background: color-mix(in srgb, var(--status-color, #64748b) 12%, #fff);
}

.dsp-point-meta { font-size: 0.82rem; color: #64748b; margin-bottom: 5px; }
.dsp-point-meta a { color: #2563eb; text-decoration: none; }

.dsp-point-detail { font-size: 0.84rem; color: #334155; line-height: 1.55; }
.dsp-point-note {
    margin-top: 7px;
    font-size: 0.82rem;
    color: #92400e;
    background: #fffbeb;
    border-radius: 8px;
    padding: 7px 10px;
}

.dsp-point-del {
    margin-top: 10px;
    padding: 7px 13px;
    border-radius: 9px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.dsp-empty { color: #94a3b8; font-size: 0.9rem; margin: 0; }

/* ---------------------------------------------------------- guide */

.dsp-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.dsp-guide-grid h3 {
    margin: 0 0 6px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1d4ed8;
}

.dsp-guide-grid p {
    margin: 0;
    font-size: 0.87rem;
    color: #475569;
    line-height: 1.6;
}

/* ---------------------------------------------------------- bảng & tiến độ */

.dsp-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.dsp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
    min-width: 720px;
}

.dsp-table thead th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    text-align: left;
    padding: 11px 13px;
    white-space: nowrap;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.dsp-table tbody td {
    padding: 11px 13px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    color: #334155;
    vertical-align: top;
}

.dsp-table tbody tr:last-child td { border-bottom: none; }
.dsp-table tbody tr:hover { background: #f8fafc; }
.dsp-table a { color: #2563eb; text-decoration: none; }

.dsp-num { text-align: right; font-variant-numeric: tabular-nums; }
.dsp-nowrap { white-space: nowrap; }

.dsp-meter {
    display: inline-block;
    width: 74px;
    height: 7px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 7px;
}

.dsp-meter-fill {
    display: block;
    height: 100%;
    width: var(--pct, 0%);
    background: #2563eb;
    border-radius: 999px;
}

.dsp-missing-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dsp-missing-chip {
    padding: 6px 13px;
    border-radius: 999px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.83rem;
    font-weight: 600;
}

/* ---------------------------------------------------------- màn duyệt */

.dsp-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.dsp-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 17px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-left: 4px solid var(--stat-color, #2563eb);
}

.dsp-stat i { font-size: 1.25rem; color: var(--stat-color, #2563eb); }
.dsp-stat strong { display: block; font-size: 1.2rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.dsp-stat span { font-size: 0.83rem; color: #64748b; }

.dsp-inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.dsp-inline-form input[type="file"] {
    flex: 1 1 260px;
    padding: 10px 13px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #f8fafc;
    font-size: 0.9rem;
}

.dsp-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    align-items: end;
}

.dsp-filter-form .dsp-field { margin-bottom: 0; }

.dsp-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dsp-type-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--tag-color, #2563eb);
    background: color-mix(in srgb, var(--tag-color, #2563eb) 12%, #fff);
}

.dsp-detail-cell { max-width: 340px; }

.dsp-detail-item {
    display: block;
    font-size: 0.81rem;
    color: #475569;
    line-height: 1.5;
}

.dsp-detail-note {
    margin-top: 6px;
    font-size: 0.79rem;
    color: #92400e;
}

.dsp-actions-cell {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 118px;
}

.dsp-btn-approve {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.dsp-btn-reject {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.dsp-pager {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.dsp-pager-info { font-size: 0.87rem; color: #64748b; font-weight: 600; }

.dsp-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    color: #0369a1;
    background: #e0f2fe;
    border-radius: 999px;
    padding: 2px 9px;
    margin-top: 3px;
}

.dsp-source-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    color: #0c4a6e;
    opacity: 0.75;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 992px) {
    .dsp-workbench { grid-template-columns: minmax(0, 1fr); }
    .dsp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsp-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsp-map { height: 340px; }
}

@media (max-width: 640px) {
    .dsp-app { padding: 12px 12px 48px; }
    .dsp-card { padding: 16px 15px; border-radius: 14px; }
    .dsp-grid-2,
    .dsp-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .dsp-hero { padding: 16px; }
    .dsp-hero h1 { font-size: 1.2rem; }
    .dsp-hero-actions { width: 100%; }
    .dsp-hero-actions .dsp-btn { flex: 1 1 auto; justify-content: center; }
    .dsp-btn { padding: 13px 18px; }
    .dsp-map { height: 280px; }
    .dsp-point-list { grid-template-columns: minmax(0, 1fr); }
}
