:root {
    --kids: #E11D48;
    --kids-soft: #FFF1F2;
    --people: #D97706;
    --vehicle: #2563EB;
    --doc: #0D9488;
    --ink: #0F172A;
    --muted: #475569;
    --bg: #F4F7FB;
    --card: #FFFFFF;
    --border: #E2E8F0;
    --radius: 16px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.topbar-inner {
    max-width: 980px; margin: 0 auto; padding: 11px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
    width: 38px; height: 38px; border-radius: 12px;
    background: linear-gradient(135deg, #E11D48 0%, #F97316 100%);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 800; box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}
.brand-name { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
.brand-pill {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px;
    font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    background: var(--kids-soft); color: var(--kids); border: 1px solid #FECDD3;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.container { max-width: 980px; margin: 0 auto; padding: 18px 16px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 18px 16px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 0.88rem;
    border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-danger { background: linear-gradient(135deg, #E11D48, #F97316); color: #fff; box-shadow: 0 6px 16px rgba(225, 29, 72, 0.28); }
.btn-call { background: var(--kids-soft); color: #BE123C; border-color: #FECDD3; font-weight: 800; }
.btn-amber { background: var(--people); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; border-radius: 10px; }
.btn-block { width: 100%; }

.hero-banner {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 55%, #BE123C 100%);
    color: #fff; border-radius: 20px; padding: 22px; margin-bottom: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hero-pill {
    padding: 4px 11px; border-radius: 99px; font-size: 0.72rem; font-weight: 700;
    background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-banner h1 { margin: 0 0 8px; font-size: 1.45rem; line-height: 1.3; font-weight: 800; }
.hero-banner p { margin: 0 0 16px; font-size: 0.9rem; color: #E2E8F0; max-width: 660px; }

.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.cat-tab {
    white-space: nowrap; padding: 8px 14px; border-radius: 99px; font-size: 0.82rem; font-weight: 800;
    background: #fff; border: 1.5px solid var(--border); color: var(--muted);
}
.cat-tab.priority-kids { border-color: #FECDD3; background: var(--kids-soft); color: #BE123C; }
.cat-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cat-tab.priority-kids.active { background: var(--kids); color: #fff; border-color: var(--kids); }

.filter-bar {
    background: #fff; padding: 12px; border-radius: 16px; border: 1px solid var(--border);
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.filter-bar input, .filter-bar select {
    flex: 1; min-width: 150px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: #F8FAFC; font-family: inherit; font-size: 0.88rem;
}

.compact-list { display: flex; flex-direction: column; gap: 10px; }
.compact-row {
    width: 100%; text-align: left; background: #fff; border: 1px solid var(--border);
    border-radius: 16px; padding: 12px; display: flex; align-items: center; gap: 14px;
    cursor: pointer; transition: 0.15s ease; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    font-family: inherit;
}
.compact-row:hover { background: #F8FAFC; border-color: #CBD5E1; }
.compact-row.is-kids {
    background: #FFF8F9; border-color: #FECDD3; border-left: 4px solid var(--kids);
}
.compact-thumb-wrap { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.compact-thumb {
    width: 72px; height: 72px; border-radius: 12px; object-fit: cover;
    border: 1px solid var(--border); background: #F1F5F9; display: block;
}
.compact-thumb-fallback {
    width: 72px; height: 72px; border-radius: 12px; display: flex; align-items: center;
    justify-content: center; font-size: 1.7rem; border: 1px solid var(--border);
}
.thumb-count {
    position: absolute; bottom: 4px; right: 4px; background: rgba(15, 23, 42, 0.82);
    color: #fff; font-size: 0.65rem; font-weight: 800; padding: 2px 5px; border-radius: 6px;
}
.compact-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.compact-meta-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.72rem; }
.cat-pill { color: #fff; padding: 2px 8px; border-radius: 99px; font-weight: 800; font-size: 0.7rem; }
.compact-title {
    font-size: 0.96rem; font-weight: 800; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.compact-sub {
    font-size: 0.8rem; color: var(--muted); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.compact-chevron { font-size: 1.6rem; color: #CBD5E1; font-weight: 300; padding-left: 4px; }

.card {
    background: var(--card); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 18px; margin-bottom: 16px;
}
.cat-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cat-pick-btn {
    padding: 16px 14px; border-radius: 14px; border: 2px solid var(--border);
    background: #fff; text-align: left; cursor: pointer; font-family: inherit;
}
.cat-pick-btn.kids-highlight { border-color: var(--kids); background: var(--kids-soft); }
.cat-pick-btn strong { display: block; font-size: 0.96rem; margin-bottom: 4px; }
.cat-pick-btn small { display: block; font-size: 0.76rem; color: var(--muted); line-height: 1.35; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 700; font-size: 0.82rem; text-transform: uppercase; color: #334155; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 11px 13px; border: 1.5px solid #CBD5E1;
    border-radius: 12px; font-size: 0.95rem; font-family: inherit; background: #fff;
}
.form-control:focus { outline: none; border-color: var(--ink); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn {
    padding: 6px 12px; border-radius: 99px; background: #F1F5F9; border: 1px solid var(--border);
    font-size: 0.76rem; font-weight: 700; color: #334155; cursor: pointer; font-family: inherit;
}
.chip-btn:hover { background: #E2E8F0; }

.vault-box {
    background: #ECFDF5; border: 2px solid #34D399; border-radius: 14px;
    padding: 14px; margin-bottom: 14px;
}
.vault-box-title { font-weight: 800; color: #065F46; font-size: 0.88rem; margin-bottom: 4px; }
.vault-box p { margin: 0; font-size: 0.8rem; color: #047857; }

.photo-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-preview-item {
    position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border); background: #F1F5F9;
}
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-size-tag {
    position: absolute; bottom: 0; inset-x: 0; background: rgba(15, 23, 42, 0.78);
    color: #6EE7B7; font-size: 0.68rem; font-weight: 700; padding: 3px 6px; text-align: center;
}

.notice { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 0.88rem; font-weight: 600; }
.notice-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.notice-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }

.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.72);
    display: none; align-items: center; justify-content: center; padding: 14px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: #fff; border-radius: 20px; max-width: 500px; width: 100%;
    max-height: 92vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal-head {
    padding: 14px 18px; color: #fff; display: flex; align-items: center; justify-content: space-between;
}
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--border); background: #F8FAFC; }

.footer {
    text-align: center; padding: 24px 16px 36px; color: var(--muted); font-size: 0.82rem;
    border-top: 1px solid var(--border); margin-top: 28px; background: #fff;
}

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data-table th, table.data-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
table.data-table th { background: #F1F5F9; font-weight: 700; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 99px; font-size: 0.72rem; font-weight: 800; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-active { background: #DBEAFE; color: #1E40AF; }
.badge-resolved { background: #DCFCE7; color: #166534; }
.badge-rejected { background: #E2E8F0; color: #475569; }
