html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

a{
    text-decoration:none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

/*body {
  margin-bottom: 60px;
}*/
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a202c;
    --sidebar-active-bg: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --primary-purple: #4f46e5;
    --body-bg: #f8fafc;
    --card-border: #e2e8f0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    color: #334155;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-text-main {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.brand-text-sub {
    color: #94a3b8;
    font-size: 0.72rem;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 0 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    color: #94a3b8;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

    .nav-link-custom:hover {
        color: #ffffff;
        background-color: rgba(255, 255, 255, 0.06);
    }

    .nav-link-custom.active {
        color: #ffffff;
        background: var(--sidebar-active-bg);
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
    }

    .nav-link-custom i {
        font-size: 1.1rem;
    }

.sidebar-footer {
    padding: 1.25rem 1rem;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.layout-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.main-content {
    flex: 1 0 auto;
    padding: 1.5rem 2rem;
}

.layout-footer {
    padding: 1rem 2rem;
    background: #ffffff;
    border-top: 1px solid var(--card-border);
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem 0.5rem 2rem;
    border-bottom: 1px solid #ccc;
}

.page-title {
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.mobile-header-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    margin-right: 0.75rem;
    cursor: pointer;
    padding: 0;
}

.user-dropdown-container {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    border: none;
    outline: none;
}

    .user-dropdown-trigger:hover,
    .user-dropdown-trigger:focus,
    .user-dropdown-container:hover .user-dropdown-trigger {
        background-color: #f8fafc;
/*        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);*/
        border: none;
        outline: none;
        box-shadow: none;
    }

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 0;
    line-height: 1.2;
}

.user-role {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 0;
    line-height: 1.2;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

/* Hover support for dropdown on desktop */
@media (min-width: 992px) {
    .user-dropdown-container:hover .profile-dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.profile-dropdown-menu {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    min-width: 220px;
    margin-top: 0.35rem !important;
    transition: all 0.2s ease;
}

    .profile-dropdown-menu .dropdown-header-info {
        padding: 0.6rem 0.75rem;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 0.35rem;
    }

    .profile-dropdown-menu .dropdown-item {
        border-radius: 8px;
        padding: 0.55rem 0.75rem;
        font-size: 0.84rem;
        font-weight: 500;
        color: #334155;
        display: flex;
        align-items: center;
        gap: 0.65rem;
        transition: all 0.15s ease;
        cursor: pointer;
    }

        .profile-dropdown-menu .dropdown-item:hover {
            background-color: #f1f5f9;
            color: var(--primary-purple);
        }

        .profile-dropdown-menu .dropdown-item.item-logout {
            color: #ef4444;
        }

            .profile-dropdown-menu .dropdown-item.item-logout:hover {
                background-color: #fef2f2;
                color: #dc2626;
            }

.stat-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.2rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 0.85rem;
}

.stat-badge {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.badge-surveys {
    background-color: #e0e7ff;
    color: #4338ca;
}

.badge-districts {
    background-color: #f3e8ff;
    color: #7e22ce;
}

.badge-blocks {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-inspectors {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-swos {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-gpus {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-hq-officials {
    background-color: #f3e8ff;
    color: #7e22ce;
}

.badge-records {
    background-color: #ffe4e6;
    color: #be123c;
}

.badge-inactive {
    background-color: #ffe4e6;
    color: #be123c;
}

.badge-active {
    background-color: #dcfce7;
    color: #15803d;
}

.content-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.custom-tabs-header {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.25rem;
}

.custom-nav-tabs {
    border-bottom: none;
    gap: 1.5rem;
}

    .custom-nav-tabs .nav-link {
        border: none;
        color: #64748b;
        font-weight: 500;
        font-size: 0.92rem;
        padding: 0.5rem 0 0.85rem 0;
        background: transparent;
        position: relative;
        transition: color 0.2s ease;
    }

        .custom-nav-tabs .nav-link:hover {
            color: #334155;
        }

        .custom-nav-tabs .nav-link.active {
            color: var(--primary-purple);
            font-weight: 600;
            background: transparent;
        }

            .custom-nav-tabs .nav-link.active::after {
                content: '';
                position: absolute;
                bottom: -1px;
                left: 0;
                right: 0;
                height: 2px;
                background-color: var(--primary-purple);
                border-radius: 2px;
            }

.toolbar-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-desc {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.btn-new-survey {
    background-color: var(--primary-purple);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}

    .btn-new-survey:hover {
        background-color: #4338ca;
        color: #ffffff;
        box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
    }

.custom-table-container {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .custom-table th {
        font-size: 0.72rem;
        font-weight: 700;
        color: #64748b;
        letter-spacing: 0.5px;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid #e2e8f0;
        background-color: #ffffff;
    }

    .custom-table td {
        padding: 1rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.88rem;
        color: #334155;
    }

    .custom-table tr:last-child td {
        border-bottom: none;
    }

.status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    display: inline-block;
}

.status-active {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-closed {
    background-color: #f1f5f9;
    color: #64748b;
}

.action-link {
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.82rem;
    margin-left: 0.85rem;
    transition: opacity 0.15s ease;
}

    .action-link:hover {
        opacity: 0.8;
    }

.link-close {
    color: #d97706;
}

.link-reopen {
    color: #16a34a;
}

.link-edit {
    color: #3b82f6;
}

.link-delete {
    color: #ef4444;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .layout-wrapper {
        margin-left: 0;
    }

    .main-content {
        padding: 1.25rem 1rem;
    }

    .top-header {
        padding: 1rem 1rem 0.5rem 1rem;
    }

    .layout-footer {
        padding: 0.85rem 1rem;
        flex-direction: column;
        text-align: center;
    }

    .mobile-header-toggle {
        display: block;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

        .sidebar-overlay.show {
            display: block;
        }
}

@media (max-width: 575.98px) {
    .top-header {
/*        flex-direction: column;*/
        align-items: flex-start;
        gap: 1rem;
    }

    .user-dropdown-container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .toolbar-area {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-new-survey {
        width: 100%;
        text-align: center;
    }
}



/* styles for validation helpers */
.field-validation-error {
    width: 100%;
    padding-top: .25rem;
    font-size: 80%;
    color: #c82623;
}

.field-validation-valid {
    display: none;
}

input.input-validation-error {
    border: 1px solid #b94a48;
}

input[type="checkbox"].input-validation-error {
    border: 0 none;
}

.validation-summary-errors {
    color: #b94a48;
}

.validation-summary-valid {
    display: none;
}

.validation-summary-errors {
    width: 100%;
    margin-top: .25rem;
    font-size: 90%;
    color: #b76ba3;
}

/*

.ns-grid-pager {
    background-color: transparent;
    padding: 16px 4px;
    font-size: 13.5px;
    color: #64748b;
    font-weight: 500;
}

    .ns-grid-pager .row {
        display: flex;
        align-items: center;
        width: 100%;
        margin: 0;
    }

/* Pagination container */
.ns-pagination {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

    /* Labels: "Page Size:", "Page", "of" */
    .ns-pagination label,
    .ns-pagination .pager-label,
    .ns-pagination .page-size-label {
        display: inline-flex;
        align-items: center;
        margin: 0 4px;
        font-size: 13px;
        font-weight: 500;
        color: #64748b;
    }

    /* Custom styled dropdown selects */
    .ns-pagination select.page-size,
    .ns-pagination select.page-number {
        appearance: none;
        -webkit-appearance: none;
        background-color: #ffffff;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 6px 26px 6px 10px;
        font-size: 13px;
        font-weight: 500;
        color: #1e293b;
        height: 34px;
        min-width: 52px;
        cursor: pointer;
        outline: none;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

        .ns-pagination select.page-size:hover,
        .ns-pagination select.page-number:hover {
            border-color: #cbd5e1;
        }

        .ns-pagination select.page-size:focus,
        .ns-pagination select.page-number:focus {
            border-color: #4f46e5;
            box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
        }

    /* Navigation Icons (FontAwesome <a> tags) */
    .ns-pagination a.ns-page-link,
    .ns-pagination a.ns-page-link-disabled {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 6px;
        font-size: 12px;
        text-decoration: none;
        transition: all 0.15s ease;
    }

    /* Enabled action buttons */
    .ns-pagination a.ns-page-link {
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        color: #475569;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        cursor: pointer;
    }

        .ns-pagination a.ns-page-link:hover {
            background-color: #f8fafc;
            border-color: #cbd5e1;
            color: #4f46e5;
            text-decoration: none;
        }

    /* Disabled action buttons */
    .ns-pagination a.ns-page-link-disabled {
        background-color: #ffffff;
        border: 1px solid #f1f5f9;
        color: #cbd5e1;
        cursor: not-allowed;
        opacity: 0.8;
    }

.list-photo{
    width:80px;
}

.custom-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
}

.table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 0.75rem;
}

.table td {
    font-size: 0.85rem;
    vertical-align: middle;
    padding: 10px 15px;
    font-size: 14px;
    /*border-bottom: 1px solid #898989 !important;
    border-left: 1px solid #898989 !important;
    border-right: 1px solid #898989 !important;*/
}

.action-edit {
    color: #4f46e5;
    text-decoration: none;
    font-size: 0.82rem;
}

.action-delete {
    color: #f43f5e;
    text-decoration: none;
    font-size: 0.82rem;
}

.role-user {
    background-color: #ede9fe;
    color: #7c3aed;
}

/* Actions & Buttons */
.btn-primary-purple {
    background-color: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

    .btn-primary-purple:hover {
        background-color: #4338ca;
        border-color: #4338ca;
        color: #fff;
    }

.action-edit {
    color: #4f46e5;
    text-decoration: none;
    font-size: 0.85rem;
}

.action-delete {
    color: #ef4444;
    text-decoration: none;
    font-size: 0.85rem;
}

.action-edit:hover {
    color: #3730a3;
}
.list-photo{
    width:80px;
}

.file-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.file-modal.is-open {
    display: flex !important;
}

.file-modal__dialog {
    background: #fff;
    width: 90vw;
    max-width: 1200px;
    height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
}

.file-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #dee2e6;
    flex: 0 0 auto;
}

.file-modal__title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-modal__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}
.file-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto; /* DOCX scrolls here */
    background: #f1f3f5;
    position: relative; /* anchor for the PDF iframe */
}

    /* PDF */
    .file-modal__body iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

    /* Image */
    .file-modal__body img {
        display: block;
        max-width: 100%;
        max-height: 100%;
        margin: 0 auto;
        object-fit: contain;
    }


    /* DOCX (docx-preview renders a wrapper) */
    .file-modal__body .docx-wrapper {
        background: transparent;
        padding: 16px;
    }
        .file-modal__body .docx-wrapper > section.docx {
            flex-shrink: 0;
        }

@media (max-width: 768px) {
    .file-modal__dialog {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
}