:root {
    --primary: #4f46e5;
    --sidebar: #111827;
    --background: #eef2f7;
    --text-dark: #111827;
    --border: #e5e7eb;
    --muted: #64748b;
    --bs-body-font-family: "Roboto", sans-serif;
}

body {
    background:
        radial-gradient(circle at 88% 8%, rgba(79, 70, 229, 0.12), transparent 24rem),
        radial-gradient(circle at 18% 22%, rgba(14, 165, 233, 0.09), transparent 28rem),
        var(--background);
    color: var(--text-dark);
    font-family: "Roboto", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

button,
input,
select,
textarea,
.btn,
.form-control,
.form-select,
.table {
    font-family: "Roboto", sans-serif;
}

.public-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    position: sticky;
    top: 0;
    z-index: 1040;
    backdrop-filter: blur(14px);
}

.public-header .navbar {
    padding: 1rem 0;
}

.public-header .nav-link {
    color: #374151;
    font-weight: 600;
}

.public-header .nav-link:hover {
    color: var(--primary);
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
}

.home-hero {
    min-height: calc(100vh - 72px);
    background:
        radial-gradient(circle at 12% 18%, rgba(79, 70, 229, 0.12), transparent 24rem),
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.15), transparent 32rem),
        linear-gradient(135deg, #ffffff 0%, #f3f4f6 60%, #eef2ff 100%);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.trust-row span {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.55rem 0.9rem;
}

.eyebrow {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-card,
.feature-card,
.stat-card,
.form-card,
.table-card,
.report-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 1rem;
}

.hero-card {
    padding: 2rem;
}

.feature-card {
    min-height: 120px;
    padding: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.seo-card {
    align-items: flex-start;
    display: block;
    height: 100%;
}

.seo-card h3,
.module-card h3,
.report-highlight h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.7rem;
}

.seo-card p,
.module-card p,
.report-highlight p {
    color: #6b7280;
    font-weight: 400;
    margin-bottom: 0;
}

.dashboard-preview {
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.preview-header {
    display: flex;
    gap: 0.4rem;
}

.preview-header span {
    background: #c7d2fe;
    border-radius: 50%;
    height: 0.75rem;
    width: 0.75rem;
}

.preview-stat,
.metric-card {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    display: flex;
    justify-content: space-between;
    margin-top: 0.8rem;
    padding: 1rem;
}

.preview-stat strong,
.metric-card strong {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 900;
}

.preview-stat span,
.metric-card span {
    color: #4b5563;
    font-weight: 700;
}

.metric-card {
    background: #ffffff;
}

.whatsapp-status-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    max-width: 680px;
}

.metric-card-link {
    color: inherit;
    margin-top: 0;
    text-decoration: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.metric-card-link:hover,
.metric-card-link.active {
    border-color: rgba(79, 70, 229, 0.5);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    color: inherit;
    transform: translateY(-1px);
}

.metric-card-compact {
    border-radius: 0.75rem;
    min-height: 74px;
    padding: 0.75rem 0.85rem;
}

.metric-card-compact span {
    align-items: center;
    display: inline-flex;
    font-size: 0.9rem;
    gap: 0.4rem;
}

.metric-card-compact strong {
    font-size: 1.3rem;
}

@media (max-width: 767.98px) {
    .whatsapp-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }

    .metric-card-compact {
        min-height: 64px;
        padding: 0.65rem 0.75rem;
    }
}

.section-pad {
    padding: 5rem 0;
}

.section-soft {
    background: #ffffff;
}

.section-heading {
    margin: 0 auto 2.5rem;
    max-width: 760px;
    text-align: center;
}

.section-heading h2 {
    font-weight: 900;
    margin-top: 0.6rem;
}

.section-heading p {
    color: #6b7280;
    font-size: 1.05rem;
    margin-bottom: 0;
}

.module-card,
.report-highlight {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    height: 100%;
    padding: 1.5rem;
}

.section-soft .module-card {
    background: #f9fafb;
}

.report-highlight {
    border-top: 4px solid var(--primary);
}

.faq-box {
    background: #ffffff;
    border-radius: 1rem;
    margin: 0 auto;
    max-width: 900px;
    overflow: hidden;
}

.faq-box .accordion-item {
    border-color: var(--border);
}

.faq-box .accordion-button {
    font-weight: 800;
}

.public-footer {
    background: var(--sidebar);
    color: #d1d5db;
    padding: 3rem 0;
}

.public-footer h2 {
    color: #ffffff;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.12), transparent 30%),
        var(--background);
}

.login-card {
    width: min(100%, 420px);
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 2rem;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar);
    color: #ffffff;
    padding: 1.25rem;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
}

.sidebar-backdrop,
.mobile-bottom-nav {
    display: none;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar-nav a {
    align-items: center;
    color: #d1d5db;
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.8rem 0.9rem;
    border-radius: 0.75rem;
    font-weight: 600;
}

.sidebar-nav a i {
    font-size: 1.08rem;
    line-height: 1;
    width: 1.25rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidebar-user {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    color: #d1d5db;
    font-size: 0.9rem;
}

.content {
    flex: 1;
    margin-left: 260px;
    max-width: calc(100vw - 260px);
    min-width: 0;
    padding: 1.5rem;
    position: relative;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.sidebar-toggle {
    align-items: center;
    display: none;
    gap: 0.45rem;
    border-radius: 999px;
    font-weight: 700;
}

.stat-card {
    border: 0;
    color: #ffffff;
    min-height: 150px;
    overflow: hidden;
    padding: 1.35rem;
    position: relative;
    transition: transform 0.18s ease;
}

.stat-card::after {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    content: "";
    height: 8rem;
    position: absolute;
    right: -3.5rem;
    top: -3.5rem;
    width: 8rem;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-indigo {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.stat-green {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.stat-blue {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}

.stat-orange {
    background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
}

.stat-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.9rem;
    display: inline-flex;
    font-size: 1.25rem;
    height: 2.65rem;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    width: 2.65rem;
    z-index: 1;
}

.stat-card .label {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.stat-card .value {
    color: #ffffff;
    font-size: 2.15rem;
    font-weight: 800;
    margin-top: 0.35rem;
    position: relative;
    z-index: 1;
}

.table-card,
.form-card,
.report-card {
    border: 1px solid rgba(226, 232, 240, 0.92);
    max-width: 100%;
    min-width: 0;
    padding: 1.25rem;
}

.content.compact-form-page {
    padding-top: 1rem;
}

.compact-form-page .topbar {
    margin-bottom: 0.75rem;
}

.compact-form-page .topbar h1 {
    margin-bottom: 0.15rem !important;
}

.compact-form-page .topbar p {
    font-size: 0.9rem;
}

.compact-form-card {
    padding: 1rem;
}

.compact-form-card .form-label {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.22rem;
}

.compact-form-card .form-control,
.compact-form-card .form-select {
    border-radius: 0.55rem;
    font-size: 0.92rem;
    min-height: 36px;
    padding: 0.36rem 0.62rem;
}

.compact-form-card textarea.form-control {
    min-height: 66px;
}

textarea[name="address"] {
    max-height: 96px;
    resize: none;
}

.compact-form-card .btn {
    min-height: 38px;
    padding: 0.42rem 0.9rem;
}

.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-scroll .table {
    margin-bottom: 0;
}

.citizen-list-card {
    overflow: hidden;
}

.compact-filter-form {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(220px, 1.6fr) repeat(7, minmax(128px, 1fr)) auto;
}

.compact-filter-form .filter-field,
.compact-filter-form .filter-actions {
    min-width: 0;
}

.compact-filter-form .form-control,
.compact-filter-form .form-select,
.compact-filter-form .btn {
    min-height: 38px;
}

.compact-filter-form .filter-actions {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(92px, 1fr));
}

.compact-filter-form .btn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    white-space: nowrap;
}

.document-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(110px, auto);
}

.ward-leader-filter-form {
    grid-template-columns: minmax(220px, 1fr);
}

.document-filter-form .filter-actions {
    grid-template-columns: 1fr;
}

.bulk-whatsapp-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(140px, 190px) minmax(170px, 220px) minmax(110px, auto);
}

.bulk-whatsapp-filter-form .filter-actions {
    grid-template-columns: 1fr;
}

.bulk-send-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.bulk-table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.table-pagination {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.9rem 0 0;
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.table-pagination .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.table-pagination .page-link {
    border-radius: 0.45rem;
    font-weight: 700;
    min-width: 2.1rem;
    text-align: center;
}

.compact-data-table {
    font-size: 0.88rem;
}

.compact-data-table th,
.compact-data-table td {
    padding: 0.58rem 0.7rem;
}

.citizen-table {
    min-width: 1550px;
}

.citizen-table td,
.citizen-table th {
    max-width: 180px;
}

.citizen-table td:nth-child(2),
.citizen-table td:nth-child(3),
.citizen-table td.wrap {
    max-width: 220px;
}

.citizen-table td.wrap {
    min-width: 180px;
    white-space: normal;
}

.citizen-table .actions {
    min-width: 116px;
}

.citizen-table .actions .btn {
    min-height: 32px;
    padding: 0.2rem 0.55rem;
}

.dashboard-hero-card {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(14, 165, 233, 0.9)),
        #4f46e5;
    border-radius: 1.35rem;
    color: #ffffff;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    overflow: hidden;
    padding: 1.6rem;
    position: relative;
}

.dashboard-hero-card::before {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    content: "";
    height: 12rem;
    position: absolute;
    right: -4rem;
    top: -5rem;
    width: 12rem;
}

.dashboard-hero-card.ward-hero {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.95), rgba(79, 70, 229, 0.92)),
        #059669;
}

.dashboard-hero-card h2 {
    font-size: 1.55rem;
    font-weight: 900;
    margin: 0.35rem 0 0.35rem;
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.dashboard-hero-card p {
    color: rgba(255, 255, 255, 0.84);
    margin: 0;
    max-width: 680px;
    position: relative;
    z-index: 1;
}

.dashboard-kicker {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    padding: 0.42rem 0.75rem;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
}

.dashboard-hero-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 1.25rem;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 2.4rem;
    height: 5rem;
    justify-content: center;
    position: relative;
    width: 5rem;
    z-index: 1;
}

.section-title-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.soft-chip {
    align-items: center;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #4338ca;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    white-space: nowrap;
}

.notification-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dark);
    display: inline-flex;
    height: 2.65rem;
    justify-content: center;
    position: relative;
    width: 2.65rem;
}

.notification-button span {
    align-items: center;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 900;
    height: 1.25rem;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0 0.25rem;
    position: absolute;
    right: -0.2rem;
    top: -0.25rem;
}

.notification-menu {
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    height: min(72vh, 420px);
    min-width: min(92vw, 340px);
    overflow-y: auto;
    padding: 1rem;
    z-index: 1085;
}

.notification-menu-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    padding-bottom: 0.65rem;
}

.notification-group + .notification-group {
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.notification-group-title {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.notification-item {
    align-items: flex-start;
    border-bottom: 1px solid #eef2f7;
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
    padding: 0.65rem 0;
}

.notification-item strong,
.notification-item span {
    overflow-wrap: anywhere;
    white-space: normal;
}

.notification-item a {
    color: var(--text-dark);
    text-decoration: none;
}

.notification-item span {
    color: var(--muted);
    display: block;
    font-size: 0.86rem;
}

.notification-clear {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #64748b;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 900;
    height: 1.45rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 1.45rem;
}

.birthday-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.birthday-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
}

.birthday-card-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.birthday-card-title h3 {
    font-size: 1rem;
    font-weight: 900;
    margin: 0;
}

.birthday-card-title span {
    align-items: center;
    background: #eef2ff;
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 900;
    height: 1.75rem;
    justify-content: center;
    min-width: 1.75rem;
}

.birthday-person {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
}

.birthday-person + .birthday-person {
    margin-top: 0.6rem;
}

.birthday-person strong,
.birthday-person span {
    display: block;
    overflow-wrap: anywhere;
    white-space: normal;
}

.birthday-person span,
.birthday-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.form-control,
.form-select,
.btn {
    min-height: 42px;
}

.table {
    vertical-align: middle;
}

.table thead th {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.85rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody tr:hover td {
    background: #f8fafc;
}

.table td {
    white-space: nowrap;
}

.table td.wrap {
    min-width: 220px;
    white-space: normal;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.document-preview-modal .modal-content {
    border: 0;
    border-radius: 1rem;
}

.document-preview-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.document-preview-scale {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    margin-left: auto;
}

.document-preview-stage {
    align-items: center;
    background: #111827;
    border-radius: 0.9rem;
    display: flex;
    height: min(70vh, 680px);
    justify-content: center;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.document-preview-stage img {
    cursor: grab;
    max-height: none;
    max-width: none;
    position: absolute;
    user-select: none;
}

.document-preview-stage img.dragging {
    cursor: grabbing;
}

.logout-modal .modal-content {
    border: 0;
    border-radius: 1.25rem;
}

.logout-icon {
    align-items: center;
    background: #fee2e2;
    border-radius: 50%;
    color: #991b1b;
    display: inline-flex;
    font-size: 1.3rem;
    font-weight: 900;
    height: 3rem;
    justify-content: center;
    margin-bottom: 1rem;
    width: 3rem;
}

.custom-toast-container {
    bottom: 1.25rem;
    left: 50%;
    position: fixed;
    transform: translateX(-50%);
    z-index: 1080;
}

.custom-toast-container .toast {
    border-radius: 0.9rem;
    min-width: min(92vw, 420px);
}

.profile-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 1rem;
    height: auto;
    padding: 1.4rem;
}

.admin-profile-layout {
    align-items: flex-start;
}

.admin-account-card h2 {
    line-height: 1.25;
}

.profile-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border: 0;
    border-radius: 1.1rem;
    color: #ffffff;
    display: inline-flex;
    font-size: 2rem;
    font-weight: 900;
    height: 4.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    padding: 0;
    position: relative;
    width: 4.5rem;
}

.profile-avatar img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.profile-photo-trigger {
    cursor: pointer;
}

.profile-photo-edit {
    align-items: center;
    background: rgba(17, 24, 39, 0.72);
    border-radius: 999px;
    bottom: 0.35rem;
    display: inline-flex;
    font-size: 0.8rem;
    height: 1.55rem;
    justify-content: center;
    position: absolute;
    right: 0.35rem;
    width: 1.55rem;
}

.photo-crop-frame {
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    height: min(72vw, 320px);
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    touch-action: none;
    width: min(72vw, 320px);
}

.photo-crop-frame::after {
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 999px rgba(17, 24, 39, 0.26);
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.photo-crop-frame img {
    cursor: grab;
    left: 0;
    max-width: none;
    position: absolute;
    top: 0;
    user-select: none;
}

.photo-crop-frame img.dragging {
    cursor: grabbing;
}

.profile-detail-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-detail-grid div {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.85rem;
}

.profile-detail-grid span {
    color: #6b7280;
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.profile-detail-grid strong {
    color: var(--text-dark);
    display: block;
    overflow-wrap: anywhere;
}

@media (max-width: 991px) {
    .modal {
        z-index: 1095;
    }

    .modal-backdrop {
        z-index: 1090;
    }

    .modal-dialog {
        max-width: calc(100vw - 1.5rem);
    }

    .modal-content {
        max-height: calc(100dvh - 1.5rem);
    }

    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.modal-open .mobile-bottom-nav {
        pointer-events: none;
        transform: translateY(100%);
    }

    body.modal-open .sidebar,
    body.modal-open .sidebar-backdrop {
        pointer-events: none;
    }

    body.has-sidebar-open {
        overflow: hidden;
    }

    .app-shell {
        display: block;
        min-height: 100dvh;
    }

    .sidebar {
        max-width: 320px;
        overflow-y: auto;
        padding: 1rem 1rem 7rem;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        width: 84vw;
        z-index: 1061;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-brand {
        margin-bottom: 1rem;
    }

    .sidebar-nav a {
        padding: 0.95rem 1rem;
    }

    .sidebar-user {
        background: rgba(255, 255, 255, 0.08);
        border-radius: 0.9rem;
        bottom: auto;
        left: auto;
        margin-top: 1.5rem;
        padding: 1rem;
        position: static;
        right: auto;
    }

    .sidebar-backdrop {
        background: rgba(17, 24, 39, 0.54);
        display: block;
        inset: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        transition: opacity 0.2s ease;
        z-index: 1060;
    }

    body.has-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .content {
        margin-left: 0;
        max-width: 100vw;
        padding: 1rem 0.85rem 6.75rem;
    }

    .sidebar-toggle {
        display: inline-flex;
        margin-bottom: 0 !important;
        width: max-content;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .topbar > div {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        width: 100%;
    }

    .topbar > .btn,
    .topbar > a.btn {
        justify-content: center;
        width: 100%;
    }

    .topbar-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .topbar-actions > .btn,
    .topbar-actions > a.btn {
        flex: 1;
        justify-content: center;
    }

    .topbar > .desktop-only-action {
        display: none;
    }

    .topbar-actions .desktop-only-action {
        display: none;
    }

    .topbar {
        padding-right: 3.35rem;
        position: relative;
    }

    .topbar .topbar-actions {
        position: absolute;
        right: 0;
        top: 0;
        width: auto;
    }

    .topbar .notification-button {
        height: 2.65rem;
        width: 2.65rem;
    }

    .topbar h1 {
        font-size: 1.35rem;
        margin-left: 0;
        margin-bottom: 0 !important;
        text-align: left;
    }

    .topbar p {
        display: none;
    }

    .stat-card,
    .table-card,
    .form-card,
    .report-card,
    .profile-card {
        border-radius: 0.4rem;
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.75rem;
    }

    .stat-card {
        min-height: 108px;
        padding: 0.85rem 1rem;
    }

    .stat-icon {
        border-radius: 0.7rem;
        font-size: 1rem;
        height: 2rem;
        margin-bottom: 0.55rem;
        width: 2rem;
    }

    .stat-card::after {
        height: 6.5rem;
        right: -3rem;
        top: -3.25rem;
        width: 6.5rem;
    }

    .stat-card .label {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    .stat-card .value {
        font-size: 1.65rem;
        line-height: 1;
        margin-top: 0.25rem;
    }

    .dashboard-hero-card {
        align-items: flex-start;
        border-radius: 1rem;
        flex-direction: column;
        padding: 1.2rem;
    }

    .dashboard-hero-card h2 {
        font-size: 1.25rem;
    }

    .dashboard-hero-icon {
        font-size: 1.65rem;
        height: 3.6rem;
        width: 3.6rem;
    }

    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }

    .birthday-grid {
        grid-template-columns: 1fr;
    }

    .table-responsive,
    .table-scroll {
        border: 1px solid var(--border);
        border-radius: 0.35rem;
        margin: 0 -0.1rem;
    }

    .table {
        font-size: 0.88rem;
        margin-bottom: 0;
        min-width: 760px;
    }

    .citizen-table {
        min-width: 1400px;
    }

    .table thead th {
        font-size: 0.74rem;
    }

    .actions {
        min-width: 150px;
    }

    .actions .btn {
        min-height: 36px;
    }

    .compact-data-table {
        font-size: 0.82rem;
    }

    .compact-data-table th,
    .compact-data-table td {
        padding: 0.48rem 0.55rem;
    }

    .compact-filter-form {
        gap: 0.45rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-filter-form .filter-search,
    .compact-filter-form .filter-actions {
        grid-column: 1 / -1;
    }

    .compact-filter-form .filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-filter-form {
        grid-template-columns: minmax(0, 1fr) minmax(132px, 0.75fr) minmax(92px, 0.45fr);
    }

    .document-filter-form .filter-search,
    .document-filter-form .filter-actions {
        grid-column: auto;
    }

    .document-filter-form .filter-actions {
        grid-template-columns: 1fr;
    }

    .bulk-whatsapp-filter-form {
        grid-template-columns: minmax(0, 1fr) minmax(132px, 0.75fr) minmax(150px, 0.9fr) minmax(92px, 0.45fr);
    }

    .bulk-whatsapp-filter-form .filter-search,
    .bulk-whatsapp-filter-form .filter-actions {
        grid-column: auto;
    }

    .bulk-whatsapp-filter-form .filter-actions {
        grid-template-columns: 1fr;
    }

    .compact-filter-form .form-control,
    .compact-filter-form .form-select,
    .compact-filter-form .btn {
        font-size: 0.92rem;
        min-height: 40px;
    }

    .form-label {
        font-size: 0.92rem;
        font-weight: 700;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        min-height: 46px;
    }

    textarea.form-control {
        min-height: 96px;
    }

    .content.compact-form-page {
        padding-top: 0.65rem;
    }

    .compact-form-page .topbar {
        gap: 0.35rem;
        margin-bottom: 0.55rem;
    }

    .compact-form-page .topbar p {
        font-size: 0.86rem;
        line-height: 1.25;
    }

    .compact-form-card {
        padding: 0.75rem;
    }

    .compact-form-card .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.18rem;
    }

    .compact-form-card .form-control,
    .compact-form-card .form-select {
        font-size: 16px;
        min-height: 38px;
        padding: 0.3rem 0.55rem;
    }

    .compact-form-card textarea.form-control {
        min-height: 64px;
    }

    .mobile-bottom-nav {
        align-items: center;
        background: rgba(255, 255, 255, 0.97);
        border: 1px solid rgba(229, 231, 235, 0.95);
        border-radius: 1.25rem 1.25rem 0 0;
        bottom: 0;
        display: grid;
        gap: 0.25rem;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        left: 0;
        padding: 0.7rem 0.6rem calc(0.7rem + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        transition: transform 0.18s ease;
        z-index: 1045;
    }

    .mobile-bottom-nav a {
        align-items: center;
        border-radius: 0.95rem;
        color: #6b7280;
        display: flex;
        flex-direction: column;
        font-size: 0.72rem;
        font-weight: 800;
        gap: 0.28rem;
        justify-content: center;
        min-height: 62px;
        padding: 0.3rem 0.15rem;
        text-decoration: none;
        text-align: center;
        min-width: 0;
    }

    .mobile-bottom-nav a > span:last-child {
        display: block;
        line-height: 1.05;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-bottom-nav a.active {
        background: #eef2ff;
        color: var(--primary);
    }

    .mobile-nav-mark {
        align-items: center;
        background: #f3f4f6;
        border-radius: 0.65rem;
        display: inline-flex;
        font-size: 1.12rem;
        height: 2rem;
        justify-content: center;
        width: 2rem;
    }

    .mobile-nav-mark i {
        line-height: 1;
    }

    .mobile-bottom-nav a.active .mobile-nav-mark {
        background: var(--primary);
        color: #ffffff;
    }

    .profile-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-profile-card,
    .admin-account-card {
        padding: 1rem;
    }

    .admin-profile-card .profile-detail-grid {
        margin-top: 1rem !important;
    }

    .admin-account-card h2 {
        font-size: 1.05rem;
        margin-bottom: 0.9rem !important;
    }
}

@media (max-width: 767px) {
    .public-header .navbar {
        padding: 0.75rem 0;
    }

    .public-header .navbar-brand {
        font-size: 1rem;
        max-width: 230px;
        white-space: normal;
    }

    .public-header .navbar-collapse {
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 1rem;
        margin-top: 0.75rem;
        padding: 1rem;
    }

    .home-hero {
        min-height: auto;
    }

    .home-hero .container {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .display-4 {
        font-size: 2.1rem;
        line-height: 1.12;
    }

    .lead {
        font-size: 1rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .trust-row span {
        font-size: 0.8rem;
        padding: 0.45rem 0.7rem;
    }

    .hero-card,
    .feature-card,
    .module-card,
    .report-highlight {
        border-radius: 0.95rem;
        padding: 1.15rem;
    }

    .preview-stat,
    .metric-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.15rem;
    }

    .section-pad {
        padding: 3rem 0;
    }

    .section-heading {
        margin-bottom: 1.6rem;
        text-align: left;
    }

    .section-heading h2 {
        font-size: 1.65rem;
    }

    .section-heading p {
        font-size: 0.98rem;
    }

    .login-page {
        align-items: start;
        padding-top: 2rem;
    }

    .login-card {
        border-radius: 1rem;
        padding: 1.25rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .logout-modal .modal-content {
        border-radius: 1rem;
    }
}

@media (max-width: 575px) {
    .content {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .row.g-3 {
        --bs-gutter-y: 0.65rem;
        --bs-gutter-x: 0.65rem;
    }

    .row.g-4 {
        --bs-gutter-y: 0.9rem;
    }

    .app-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.15rem;
        -webkit-overflow-scrolling: touch;
    }

    .app-tabs .nav-link {
        white-space: nowrap;
    }

    .compact-filter-form,
    .document-filter-form,
    .bulk-whatsapp-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-filter-form .filter-search,
    .compact-filter-form .filter-actions,
    .document-filter-form .filter-search,
    .document-filter-form .filter-actions,
    .bulk-whatsapp-filter-form .filter-search,
    .bulk-whatsapp-filter-form .filter-actions {
        grid-column: 1 / -1;
    }

    .compact-filter-form .filter-actions,
    .document-filter-form .filter-actions,
    .bulk-whatsapp-filter-form .filter-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-filter-form .filter-actions,
    .bulk-whatsapp-filter-form .filter-actions {
        grid-template-columns: 1fr;
    }

    .document-filter-form .filter-actions {
        grid-column: auto;
    }

    .bulk-send-actions .btn,
    .document-preview-toolbar .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .modal-dialog {
        margin: 0.5rem auto;
    }

    .stat-card {
        border-radius: 0.35rem;
        min-height: 92px;
        padding: 0.72rem 0.85rem;
    }

    .stat-card::after {
        height: 5.4rem;
        right: -2.65rem;
        top: -2.8rem;
        width: 5.4rem;
    }

    .stat-icon {
        font-size: 0.9rem;
        height: 1.75rem;
        margin-bottom: 0.45rem;
        width: 1.75rem;
    }

    .stat-card .label {
        font-size: 0.76rem;
        line-height: 1.15;
    }

    .stat-card .value {
        font-size: 1.45rem;
        margin-top: 0.2rem;
    }

    .table-card h2 {
        font-size: 1rem;
    }

    .mobile-bottom-nav {
        border-radius: 1rem 1rem 0 0;
        gap: 0.12rem;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .mobile-bottom-nav a {
        font-size: 0.66rem;
        min-height: 58px;
    }

    .mobile-nav-mark {
        height: 1.85rem;
        width: 1.85rem;
    }

    .custom-toast-container {
        bottom: calc(5.8rem + env(safe-area-inset-bottom));
    }
}

