:root {
    --light-blue: #009fdf;
    --pink: #d40f7d;
}

header {
    background-color: var(--pink);
    padding: 1rem 0;
    margin-bottom: 0;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header .container {
    display: flex;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

header a {
    color: white;
    text-decoration: none;
}

/* ── Breadcrumb strip ───────────────────────────────────── */
.breadcrumb-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.6rem 0;
}

.breadcrumb {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item a {
    color: var(--light-blue);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

.site-title {
    font-size: 2rem;
    margin: 0.625rem 0;
}

nav {
    display: flex;
    align-items: center;
    padding-left: 1rem;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-weight: bold;
}

.plain-button {
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;
}

.site-info-bubble-content img {
    max-width: 100%;
    max-height: 150px;
    width: auto;
    height: auto;
    margin-bottom: 0.5rem;
}

table td, table th {
    padding: 0.25rem 0.5rem;
}

/* ── Modern data table ─────────────────────────────────── */
table.standard {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

table.standard thead th {
    background-color: var(--light-blue);
    color: white;
    padding: 0.65rem 0.85rem;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

table.standard thead th.asc a::before {
    content: '▲';
    opacity: 1;
    font-size: 1.1em;
    color: white;
}

table.standard thead th.desc a::before {
    content: '▼';
    opacity: 1;
    font-size: 1.1em;
    color: white;
}

table.standard thead th:first-child {
    border-radius: 0.5rem 0 0 0;
}

table.standard thead th:last-child {
    border-radius: 0 0.5rem 0 0;
}

table.standard th a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

table.standard th a:visited,
table.standard th a:hover,
table.standard th a:focus,
table.standard th a:active {
    color: white;
}

table.standard th a:hover {
    text-decoration: underline;
    opacity: 0.9;
}

table.standard tbody tr {
    transition: background 0.12s;
}

table.standard tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

table.standard tbody tr:hover {
    background-color: #eef6fd;
}

table.standard tbody td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #333;
}

table.standard tbody tr:last-child td {
    border-bottom: none;
}

table.standard a {
    color: var(--light-blue);
    font-weight: 500;
    text-decoration: none;
}

table.standard a:hover {
    color: var(--pink);
    text-decoration: underline;
}

.tag {
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.tag.min-width {
    width: min-content;
}

.tag.unconfirmed, .tag.removed, .tag.not_applicable {
    background-color: #CCC;
}

.tag.declined, .tag.do_not_contact {
    background-color: #e53935;
    color: white;
}

.tag.not_set_up, .tag.conflicting, .tag.pending, .tag.follow_up {
    background-color: #fbbc04;
}

.tag.set_up, .tag.approved {
    background-color: #21cb00;
}

.cumulative {
    font-size: 0.9rem;
    color: #666;
}

.helptext {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.plain-list {
    list-style: none;
}

.campaigns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    grid-auto-rows: 1fr;
    gap: 1rem;
}

.campaign {
    border: 1px solid #999;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

.campaign .title a {
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration-thickness: 1px;
}

.tag.active {
    background-color: red;
    color: white;
}

.installation-photo {
    max-width: 100%;
    max-height: 300px;
}

/* ── Edit form card ─────────────────────────────────────── */
.edit-form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.edit-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    align-items: center;
}

.required-asterisk {
    color: #dc3545;
    font-weight: 700;
    font-size: 0.9em;
}

.fields-table th {
    text-align: right;
    vertical-align: top;
    padding-top: calc(0.25rem + 7px);
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

/* Read-only values should align with the label's baseline */
.fields-table td.readonly-value {
    padding-top: calc(0.25rem + 7px);
}

.fields-table input[type="checkbox"] + label {
    vertical-align: middle;
}

.fields-table td > input[type="checkbox"]:first-child {
    margin-top: 7px;
}

/* ── List page chrome ───────────────────────────────────── */
.list-page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.list-page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.list-search-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.list-search-card-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    user-select: none;
    list-style: none;
}

summary.list-search-card-label {
    cursor: pointer;
}

.list-search-card-label::-webkit-details-marker {
    display: none;
}

.list-search-card details:not([open]) .list-search-card-label {
    margin-bottom: 0;
}

.list-search-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.list-table-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: clip;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.list-table-card table.standard {
    margin: 0;
}

/* ── Search form ────────────────────────────────────────── */
.search-form th {
    width: 1%;
    text-align: right;
    vertical-align: top;
    padding-top: calc(0.25rem + 7px);
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.search-form td {
    width: auto;
    min-width: 250px;
    max-width: 400px;
}

input:not([type="radio"]), select, textarea {
    background-color: #FDFDFD;
    width: 100%;
    max-width: 400px;
    color: #495057;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-family: "Arial", Helvetica, sans-serif;
    line-height: 1.5;
    box-sizing: border-box;
}

select {
    height: 38px;
}

input[type="file"] {
    height: 38px;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0.25rem;
    align-content: center;
}

input:disabled, select:disabled, textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

textarea {
    height: 110px;
}

input[type="checkbox"], input[type="radio"] {
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
    margin-top: 0;
}

.input-group {
    width: 100%;
    max-width: 400px;
    flex-wrap: nowrap;
}

.input-group input {
    background-color: #FDFDFD !important;
    font-size: 1rem;
    font-family: "Arial", Helvetica, sans-serif;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .input-group-addon {
    cursor: pointer;
}

.select2-container {
    max-width: 400px;
    width: 100% !important;
    min-width: unset !important;
}

.select2-container--default .select2-selection--single {
    min-height: 38px !important;
    height: auto !important;
    box-sizing: border-box !important;
    display: flex !important;
}

.select2-container--default .select2-selection--multiple {
    min-height: 38px !important;
    box-sizing: border-box !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    white-space: normal !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-grow: 1 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered > :last-child {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    line-height: 22px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: block !important;
    padding-bottom: 5px !important;
}

.select2-container--default .select2-selection__clear {
    order: 1 !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 9px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    flex-shrink: 0 !important;
}

.select2-selection__choice {
    border-radius: 999px !important;
    font-weight: bold !important;
    padding: 0.1rem 0.75rem !important;
    color: #000 !important;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 400px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
    margin-top: 8px !important;
}

.select2-container--default .select2-selection {
    border-color: #ced4da !important;
}

.select2-selection__choice {
    border-color: #999 !important;
}

.horizontal-radio-select {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.horizontal-radio-select label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
}

.horizontal-radio-select input[type="radio"] {
    margin: 0;
}

ul.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

ul.pagination li a {
    display: block;
    padding: 0.3rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 0.4rem;
    color: #333;
    text-decoration: none;
    line-height: 1.5;
    font-size: 0.85rem;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

ul.pagination li a:hover {
    background-color: var(--light-blue);
    border-color: var(--light-blue);
    color: #fff;
}

ul.pagination li.active a {
    background-color: var(--light-blue);
    border-color: var(--light-blue);
    color: #fff;
    font-weight: 600;
}

ul.pagination li.previous a,
ul.pagination li.next a {
    display: none;
}

/* ── Banner messages ────────────────────────────────────── */
.banner-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.45;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.banner-message::before {
    flex-shrink: 0;
    font-size: 1.1rem;
    line-height: 1.45;
}

.banner-message.success {
    background-color: #f0fdf4;
    border-left-color: #22c55e;
    color: #166534;
}

.banner-message.success::before {
    content: '✓';
    color: #22c55e;
}

.banner-message.error {
    background-color: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.banner-message.error::before {
    content: '✕';
    color: #ef4444;
}

.banner-message.warning {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.banner-message.warning::before {
    content: '⚠';
    color: #f59e0b;
}

.banner-message.info {
    background-color: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e3a8a;
}

.banner-message.info::before {
    content: 'ℹ';
    color: #3b82f6;
}

.map_canvas_wrapper {
    margin-left: unset !important;
    margin-top: 0.5rem;
}

#map_canvas {
    height: 280px !important;
    width: 400px !important;
}

#id_address {
    width: 100% !important;
}
