@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f6f7f4;
    color: #1f2824;
}

:root {
    --crm-ink: #1f2824;
    --crm-muted: #68746e;
    --crm-surface: #ffffff;
    --crm-line: #d9ded7;
    --crm-primary: #1f6f5b;
    --crm-primary-dark: #175444;
    --crm-accent: #c7a34b;
    --crm-danger: #b33a3a;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--crm-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

.btn-primary:hover {
    background-color: var(--crm-primary-dark);
    border-color: var(--crm-primary-dark);
}

.btn-outline-primary {
    color: var(--crm-primary);
    border-color: var(--crm-primary);
}

.btn-outline-primary:hover {
    background-color: var(--crm-primary);
    border-color: var(--crm-primary);
}

.btn-outline-secondary {
    color: var(--crm-ink);
    border-color: #aab4ae;
}

.form-control,
.form-select {
    border-color: #cfd7d1;
    border-radius: .35rem;
}

.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.22rem rgba(31, 111, 91, .25);
  border-color: var(--crm-primary);
}

.content {
    padding-top: 1.1rem;
}

.page {
    background: #f6f7f4;
}

.sidebar {
    background: linear-gradient(180deg, #18231f 0%, #26332d 100%);
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.top-row.navbar {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0;
}

.nav-scrollable .nav-link {
    color: rgba(255, 255, 255, .78);
    border-radius: .35rem;
    margin: .1rem .4rem;
}

.nav-scrollable .nav-link.active,
.nav-scrollable .nav-link:hover {
    color: #ffffff;
    background: rgba(199, 163, 75, .18);
}

.top-row.auth {
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid var(--crm-line);
    backdrop-filter: blur(10px);
}

.auth-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: radial-gradient(circle at 10% 10%, rgba(199, 163, 75, .12), transparent 28%),
        linear-gradient(135deg, #f7f7f2 0%, #e8eee9 100%);
}

.auth-content {
    width: min(100%, 28rem);
    background: var(--crm-surface);
    border: 1px solid var(--crm-line);
    border-radius: .5rem;
    padding: 1.5rem;
    box-shadow: 0 1.25rem 3rem rgba(31, 40, 36, .12);
}

.auth-content h1 {
    font-size: 1.45rem;
    margin-bottom: 1rem;
}

.table {
    --bs-table-striped-bg: #f9faf7;
    border-color: var(--crm-line);
}

.table thead th {
    color: var(--crm-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom-color: var(--crm-line);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIH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kyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

body:has(.modal.show) {
    overflow: hidden;
}

.modal.show.d-block {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: .5rem;
}

.modal.show .modal-dialog {
    display: flex;
    align-items: center;
    min-height: calc(100dvh - 1rem);
    margin-top: 0;
    margin-bottom: 0;
}

.modal.show .modal-dialog,
.modal.show .modal-dialog-scrollable {
    max-height: none;
}

.modal.show .modal-content {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 1rem);
}

.modal.show .modal-body {
    flex: 1 1 auto;
    max-height: calc(100dvh - 9rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: rgba(27, 110, 194, .06);
}

.people-table {
    font-size: .95rem;
}

.table-row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: .5rem;
}

.form-section {
    border: 1px solid var(--crm-line);
    border-radius: .375rem;
    margin-top: .5rem;
    padding: 1rem;
    background: #fff;
}

.section-title {
    color: var(--crm-ink);
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.organisation-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: .35rem 1rem;
}

.organisation-people-section {
    order: 2;
}

.organisation-links-section {
    order: 3;
}

.organisation-addresses-section {
    order: 4;
}

.organisation-extra-info-section {
    order: 5;
}

.address-fields {
    display: grid;
    gap: .5rem;
}

.address-field {
    display: grid;
    grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
    align-items: center;
    gap: .75rem;
}

.address-field .form-label {
    margin-bottom: 0;
}

.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

.list-toolbar .list-filter-search {
    flex: 0 1 20rem;
    max-width: 20rem;
}

.list-toolbar .form-control {
    max-width: 24rem;
}

.list-toolbar .form-select {
    max-width: 14rem;
}

@media (max-width: 575.98px) {
    .list-toolbar .list-filter-search {
        flex-basis: 100%;
        max-width: 100%;
    }
}

.dashboard-card-button,
.dashboard-card-link {
    border: 1px solid rgba(0, 0, 0, 0.125);
    background: #fff;
}

.dashboard-card-button:hover,
.dashboard-card-button:focus,
.dashboard-card-link:hover,
.dashboard-card-link:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

@media (max-width: 767.98px) {
    .modal.show.d-block {
        padding: 0;
    }

.boot-problem {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: #f6f7f4;
}

.boot-problem section {
    width: min(100%, 30rem);
    background: var(--crm-surface);
    border: 1px solid var(--crm-line);
    border-radius: .5rem;
    padding: 1.5rem;
    box-shadow: 0 1rem 2.5rem rgba(31, 40, 36, .12);
}

.boot-problem h1 {
    font-size: 1.4rem;
}

.boot-problem button {
    color: #fff;
    background: var(--crm-primary);
    border: 1px solid var(--crm-primary);
    border-radius: .35rem;
    padding: .45rem .85rem;
}

    .modal.show .modal-dialog {
        align-items: stretch;
        min-height: 100dvh;
        margin: 0;
    }

    .modal.show .modal-content {
        min-height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .modal.show .modal-body {
        max-height: calc(100dvh - 8rem);
    }

    .address-field {
        display: block;
    }

    .address-field .form-label {
        margin-bottom: .5rem;
    }

    .table-responsive-priority table,
    .table-responsive-priority thead,
    .table-responsive-priority tbody,
    .table-responsive-priority tr,
    .table-responsive-priority th,
    .table-responsive-priority td {
        display: block;
        width: 100%;
    }

    .table-responsive-priority thead {
        display: none;
    }

    .table-responsive-priority tr {
        border: 1px solid #dee2e6;
        border-radius: .5rem;
        margin-bottom: .75rem;
        padding: .75rem;
    }

    .table-responsive-priority td {
        border: 0;
        padding: .15rem 0;
    }

    .mobile-hide-actions {
        display: none !important;
    }
}
