/* Admin — modern black / orange shell + page utilities */

:root {
    --admin-sidebar-w: 260px;
    --admin-dark: #111111;
    --admin-dark-soft: #1a1a1a;
    --admin-dark-elevated: #222222;
    --admin-accent: #00aef0;
    --admin-accent-hover: #00aef0;
    --admin-accent-soft: rgba(248, 151, 29, 0.14);
    --admin-text: #ffffff;
    --admin-text-muted: rgba(255, 255, 255, 0.72);
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-content-bg: #f4f6f9;
    --admin-surface: #ffffff;
    --admin-radius: 12px;
    --admin-radius-sm: 8px;
    --admin-shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
    --admin-shadow-sm: 0 2px 8px rgba(17, 17, 17, 0.06);
    --admin-navbar-h: 64px;
    --admin-space: 8px;
    --admin-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { min-height: 100%; }

body.admin-body {
    font-family: var(--admin-font);
    font-size: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
    color: #1f2937;
    background: var(--admin-content-bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.admin-sidebar,
.admin-sidebar-offcanvas {
    width: var(--admin-sidebar-w);
    background:
        linear-gradient(180deg, rgba(248, 151, 29, 0.06) 0%, transparent 28%),
        linear-gradient(180deg, var(--admin-dark) 0%, #0d0d0d 100%);
    color: var(--admin-text);
    border-right: 1px solid var(--admin-border);
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    flex-direction: column;
}

.admin-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

.admin-sidebar .brand,
.admin-sidebar-offcanvas .brand {
    padding: 1.125rem 1rem 1rem;
    border-bottom: 1px solid var(--admin-border);
}

.admin-sidebar .brand a,
.admin-sidebar-offcanvas .brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.brand-img {
    width: auto;
    max-width: 100%;
    max-height: 44px;
    object-fit: contain;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: var(--admin-accent-soft);
    color: var(--admin-accent);
    border: 1px solid rgba(248, 151, 29, 0.25);
}

.brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.admin-nav {
    flex: 1;
    padding: 0.75rem 0.625rem;
    gap: 0.125rem;
}

.admin-nav .nav-section {
    padding: 1rem 0.75rem 0.35rem;
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.admin-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.625rem 0.75rem;
    margin: 0;
    border-radius: var(--admin-radius-sm);
    color: var(--admin-text-muted);
    font-weight: 500;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    position: relative;
}

.admin-nav .nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1.05rem;
}

.admin-nav .nav-link:hover {
    color: var(--admin-text);
    background: rgba(255, 255, 255, 0.06);
}

.admin-nav .nav-link.active {
    color: var(--admin-accent);
    background: var(--admin-accent-soft);
    font-weight: 600;
}

.admin-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--admin-accent);
}

.sidebar-foot {
    padding: 0.875rem 1rem 1rem;
    border-top: 1px solid var(--admin-border);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ── Main + navbar ── */
.admin-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .admin-main { margin-left: var(--admin-sidebar-w); }
}

.admin-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--admin-navbar-h);
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    box-shadow: var(--admin-shadow-sm);
    z-index: 1020;
}

@media (min-width: 768px) {
    .admin-navbar { padding: 0.625rem 1.25rem; }
}

.navbar-start,
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.navbar-actions { flex-shrink: 0; }

.page-head { min-width: 0; }

.page-title {
    margin: 0;
    font-size: clamp(1rem, 0.92rem + 0.35vw, 1.15rem);
    font-weight: 700;
    color: var(--admin-dark);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.btn-icon,
.btn-ghost,
.btn-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    min-width: 44px;
    padding: 0.45rem 0.75rem;
    border-radius: var(--admin-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: #374151;
    font-weight: 500;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover,
.btn-icon:hover {
    background: #f3f4f6;
    color: var(--admin-dark);
}

.btn-ghost.is-active {
    background: var(--admin-accent-soft);
    color: #b45309;
    border-color: rgba(248, 151, 29, 0.25);
}

.btn-user {
    padding-right: 0.875rem;
    border-color: #e5e7eb;
    background: #fff;
}

.btn-user:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--admin-accent), #ffb347);
    color: #111;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-content {
    flex: 1;
    padding: 1rem;
}

@media (min-width: 768px) {
    .admin-content { padding: 1.25rem 1.5rem 2rem; }
}

/* ── Buttons & surfaces ── */
.btn-accent,
.btn-sa {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #111;
    font-weight: 600;
}

.btn-accent:hover,
.btn-sa:hover {
    background: var(--admin-accent-hover);
    border-color: var(--admin-accent-hover);
    color: #111;
}

.btn-outline-sa {
    border-color: var(--admin-accent);
    color: #b45309;
}

.btn-outline-sa:hover {
    background: var(--admin-accent-soft);
    border-color: var(--admin-accent);
    color: #92400e;
}

.card {
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow-sm);
}

.card-admin {
    border: 0;
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    background: var(--admin-surface);
}

.alert-modern {
    border: 0;
    border-radius: var(--admin-radius-sm);
    box-shadow: var(--admin-shadow-sm);
    display: flex;
    align-items: center;
}

/* ── Page blocks ── */
.block-title {
    margin-top: 32px;
    margin-bottom: 12px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #4b5563;
}

.block-title:first-child,
.admin-page-head + .block-title {
    margin-top: 8px;
}

.admin-page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.admin-page-head h1 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin: 0;
    font-weight: 700;
}

.stat-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--admin-accent), #ffb347);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(17, 17, 17, 0.1);
}

.stat-card .stat-value {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 1.85rem);
    font-weight: 800;
    color: var(--admin-dark);
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    margin-top: 6px;
    font-weight: 600;
}

/* ── Tables ── */
.table-admin {
    table-layout: auto;
    width: 100%;
    margin-bottom: 0;
}

.table-admin th.col-fit,
.table-admin td.col-fit {
    width: 1%;
    white-space: nowrap;
}

.table-admin .text-end { text-align: right; }

.table-admin td.col-truncate,
.table-admin th.col-grow {
    width: 100%;
    max-width: 0;
}

.table-admin .cell-ellipsis {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Merchant Address & Location geotag map */
.merchant-location-canvas {
    width: 100%;
    min-height: 320px;
    height: clamp(320px, 50vh, 480px);
    border-radius: var(--admin-radius);
    border: 1px solid rgba(17, 17, 17, 0.1);
}

.pac-container {
    z-index: 1100;
}

.table thead th {
    font-weight: 600;
    color: var(--admin-dark);
    font-size: 0.8125rem;
}

/* Floating stack for AJAX feedback, so it never pushes the page down */
.js-alerts {
    position: fixed;
    top: calc(var(--admin-navbar-h) + 12px);
    right: 16px;
    z-index: 1080;
    width: min(360px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.js-alerts .alert {
    box-shadow: 0 10px 30px rgba(17, 17, 17, 0.18);
    margin-bottom: 0;
}

/* Icon-only row actions: forms stay inline so buttons align in a single row */
.table-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
}

.btn-action i {
    font-size: 1rem;
}

/* Touch-friendly targets on small screens */
@media (max-width: 767.98px) {
    .btn-action {
        width: 44px;
        height: 44px;
    }
}

.search-form .form-label { display: none; }

.status-badge { font-weight: 600; }

/* ── Tabs ── */
.admin-content .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-content .nav-tabs .nav-link {
    font-weight: 500;
    font-size: 0.875rem;
    color: #64748b;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.45rem 0.95rem;
    white-space: nowrap;
    background: transparent;
}

.admin-content .nav-tabs .nav-link.active {
    color: var(--admin-dark);
    font-weight: 600;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), inset 0 -2px 0 0 var(--admin-accent);
}

.map-subnav .nav-link { min-height: 44px; }

.map-subnav-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 1rem;
}

.admin-content .map-subnav-bar .map-subnav,
.admin-content .map-subnav-bar > .nav-tabs {
    margin-bottom: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.map-subnav-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.map-subnav-actions .btn {
    min-height: 44px;
}

.accordion-header.is-open .accordion-button {
    background: var(--admin-accent-soft);
    color: #111;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--admin-accent);
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at top right, rgba(248, 151, 29, 0.18), transparent 40%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.04), transparent 35%),
        linear-gradient(160deg, #0d0d0d 0%, #171717 45%, #111 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.login-header {
    padding: 1.75rem 1.5rem 1.25rem;
    text-align: center;
    background: linear-gradient(180deg, #151515 0%, #111 100%);
    border-bottom: 3px solid var(--admin-accent);
}

.login-header img {
    max-height: 52px;
    width: auto;
    max-width: 100%;
}

.login-header .sub {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.85rem;
    margin-top: 0.625rem;
    font-weight: 500;
}

.login-body { padding: 1.5rem 1.5rem 1.75rem; }

.login-body .form-control {
    min-height: 44px;
    font-size: 16px;
    border-radius: var(--admin-radius-sm);
}

.login-body .form-control:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 0.2rem rgba(248, 151, 29, 0.2);
}

.login-body .form-check-input:checked {
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
}

/* ── Map builder / zones ── */
.builder-layout {
    display: grid;
    gap: 12px;
}

.builder-col-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.builder-sidebar-section + .builder-sidebar-section .builder-col-head {
    margin-top: 28px;
    margin-bottom: 12px;
}

.builder-col-head .block-title {
    margin: 0;
    flex-shrink: 0;
}

.builder-col-head .js-pin-search {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0.25rem 0.5rem;
}

.pin-show-in-map {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pin-label-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.pin-label-head .form-label {
    margin-bottom: 0;
}

.pin-label-code {
    width: 7.5rem;
}

.pin-label-code .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0;
}

@media (max-width: 767.98px) {
    .pin-label-code {
        width: 8.5rem;
    }

    .pin-label-code .btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* New Label stacked above New/Edit pin. */
#categoryModal {
    z-index: 1065;
}

.modal-backdrop ~ .modal-backdrop {
    z-index: 1060;
}

@media (max-width: 767.98px) {
    .builder-col-head .js-pin-search {
        min-height: 44px;
        height: 44px;
    }
}

.builder-col {
    min-width: 0;
}

@media (min-width: 992px) {
    .builder-layout {
        grid-template-columns: minmax(0, 260px) minmax(0, 1fr) minmax(0, 260px);
        min-height: calc(100vh - var(--admin-navbar-h) - 48px);
        align-items: start;
    }
}

#mapCanvas,
.map-builder-canvas,
.print-map-canvas {
    width: 100%;
    min-height: 420px;
    height: calc(100vh - 220px);
    border-radius: var(--admin-radius);
}

.pin-list,
.category-list {
    max-height: calc(100vh - 280px);
    overflow: auto;
}

.builder-col-categories.has-labels .category-list {
    max-height: calc((100vh - 320px) / 2);
}
.list-group-item {
    padding: .25rem .5rem;
}
form.search-form
 {
    border: 1px solid #d1cdcd;
    border-radius: 7px;
    padding-bottom: 5px;
    background: #e7e7e7;
}
.builder-item-name {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.builder-item-name:hover {
    color: var(--admin-accent);
}

.builder-item-name:hover .label-code-badge {
    color: #fff;
}

.builder-item-name .bi {
    flex-shrink: 0;
}

.pin-code-badge {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.pin-code-badge.is-off-map {
    display: none !important;
}

.label-code-badge {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.builder-sort-handle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9ca3af;
    cursor: grab;
}

.builder-sort-handle:active {
    cursor: grabbing;
}

.pin-list .list-group-item.is-dragging,
.category-list .list-group-item.is-dragging {
    opacity: 0.45;
}

@media (max-width: 767.98px) {
    .builder-sort-handle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

.zone-board {
    min-width: 0;
}

.merchant-pool {
    max-height: calc(100vh - 220px);
    overflow: auto;
}

.merchant-card[draggable="true"] { cursor: grab; }
.merchant-card.is-dragging { opacity: 0.45; }

.ad-pool-thumb {
    width: 80px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    display: block;
}

/* Lets flex children truncate instead of stretching their card */
.min-w-0 { min-width: 0; }

/* A3 print preview — intrinsic size is 420mm × 297mm, then scaled to the column. */
.zone-sheet-scroll {
    overflow: hidden;
    margin-bottom: 4px;
}

.zone-sheet {
    position: relative;
    background: #003366;
    color: #fff;
    overflow: hidden;
    transform-origin: top left;
}

.zone-sheet-grid {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 0.2mm, transparent 0.2mm),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0.2mm, transparent 0.2mm);
    background-size: 10mm 10mm;
    pointer-events: none;
}

.zone-sheet-map,
.zone-sheet-poi,
.zone-sheet-slot,
.zone-sheet-banner {
    position: absolute;
    box-sizing: border-box;
}

.zone-sheet-banner {
    overflow: hidden;
    background: #003366;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.zone-sheet-banner:hover,
.zone-sheet-banner:focus-visible {
    outline: 2px solid var(--admin-accent, #f58220);
    outline-offset: -2px;
}

.zone-sheet-banner-img {
    display: block;
    width: 100%;
    height: 100%;
    /*object-fit: cover;*/
    object-position: center;
    pointer-events: none;
}

/* No-banner fallback: same brand + title as the PDF, vertically centred. */
.zone-sheet-masthead {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0 4mm;
    white-space: nowrap;
    color: #fff;
}

.zone-sheet-brand {
    font-size: 20pt;
    font-weight: 800;
    letter-spacing: -0.01em;
    padding-right: 5mm;
    line-height: 1;
}

.zone-sheet-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    line-height: 1.02;
}

.zone-sheet-title-head {
    font-size: 17pt;
    font-weight: 800;
}

.zone-sheet-title-tail {
    font-size: 15pt;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.93);
}

.zone-sheet-map {
    overflow: hidden;
    background: #3ec4ee;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.zone-sheet-map.js-zone-map {
    cursor: pointer;
}

.zone-sheet-map.js-zone-map:hover,
.zone-sheet-map.js-zone-map:focus-visible {
    outline: 2px solid var(--admin-accent, #f58220);
    outline-offset: -2px;
}

.zone-sheet-map-img {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.zone-sheet-pin {
    position: absolute;
    width: 5.5mm;
    height: 5.5mm;
    object-fit: contain;
    pointer-events: none;
    z-index: 3;
}

.zone-sheet-pin-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 50%;
    border: 0.2mm solid #ffffff;
    object-fit: unset;
}

.zone-sheet-pin-label {
    line-height: 1;
    font-weight: 700;
}

.zone-sheet-map-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    text-align: center;
    color: #1b3d14;
}

.zone-sheet-poi {
    overflow: hidden;
    padding: 1.8mm 2.5mm;
    background: #ffffff;
    color: #000000;
    border-top: 0.5px dashed #000000;
    pointer-events: none;
}

.zone-sheet-poi-title {
    margin-top: 0;
    margin-bottom: 1.8mm;
    font-size: 11pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: #000000;
}

.zone-sheet-poi-columns {
    display: flex;
    align-items: flex-start;
    gap: 2mm;
    min-width: 0;
}

.zone-sheet-poi-col {
    min-width: 0;
    flex: 1 1 0;
}

.zone-sheet-poi-heading {
    margin-top: 0;
    margin-bottom: 1.2mm;
    padding-bottom: 0.8mm;
    font-size: 8.5pt;
    font-weight: 700;
    text-transform: uppercase;
    color: #000000;
    border-bottom: 0.2mm solid #000000;
}

.zone-sheet-poi-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.zone-sheet-poi-list li {
    margin-bottom: 0.6mm;
    font-size: 8pt;
    line-height: 1.34;
    word-wrap: break-word;
}

.zone-sheet-poi-list li:before {
    content: none;
}

.poi-label-row {
    width: 100%;
    border: 0;
    border-collapse: collapse;
}

.poi-label-code-cell {
    width: 4.8mm;
    height: 4.8mm;
    padding: 0;
    vertical-align: middle;
}

.poi-label-code {
    width: 4.8mm;
    height: 4.8mm;
    background: #000000;
    color: #ffffff;
    border-radius: 50%;
}

.poi-label-code-table {
    border-collapse: collapse;
    border-spacing: 0;
}

.poi-label-name {
    padding-left: 1.2mm;
    color: #000000;
    vertical-align: middle;
}

.zone-sheet-poi-empty {
    font-size: 6.8pt;
    color: #555555;
}

.zone-sheet-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.8;
}

.zone-sheet-map-label {
    font-size: 12px;
    line-height: 1.3;
    max-width: 100%;
}

.zone-sheet-slot {
    min-width: 0;
    min-height: 0;
}

.zone-drop {
    border: 1px dashed rgba(255, 255, 255, 0.65);
    border-radius: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.04em;
    position: relative;
    background: rgba(255, 255, 255, 0.03);
}

.zone-drop.is-empty {
    cursor: pointer;
}

.zone-drop.is-filled {
    cursor: grab;
}

.zone-sheet .zone-drop {
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    font-size: 1.2rem;
}

.zone-drop.is-cover .zone-code {
    letter-spacing: 0.08em;
    font-size: 10px;
    padding: 0 4px;
    line-height: 1.2;
}

.zone-drop.is-over {
    outline: 2px solid var(--admin-accent);
    outline-offset: -2px;
    background: rgba(245, 166, 35, 0.18);
    z-index: 2;
}

.zone-drop.is-filled {
    border-style: solid;
    background: #fff;
    color: #111;
    padding: 0;
    cursor: grab;
    overflow: hidden;
    border:none;
}

.zone-drop.is-filled.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.zone-drop.is-missing {
    opacity: 0.45;
    pointer-events: none;
}

.zone-drop .zone-code {
    opacity: 0.7;
    font-weight: 700;
}

/* Ad image fills the printed slot with no inset. */
.zone-slot-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

/* Title-only ads sit in the middle of the slot. */
.zone-slot-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4px;
    text-align: center;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
}

.zone-slot-unassign {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

/* Slot letter: left edge, vertically centered. Fill is the page Advertiser
   Marker color. White type must beat .zone-drop.is-filled { color: #111 }. */
.zone-drop.is-filled .zone-slot-badge,
.zone-slot-badge {
    position: absolute;
    left: 3px;
    top: 50%;
    right: auto;
    bottom: auto;
    z-index: 3;
    transform: translateY(-50%);
    color: #ffffff;
    font-weight: 700;
    font-size: 11pt;
    padding: 2pt 4pt;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0;
    pointer-events: none;
}

.zone-drop.is-filled:hover .zone-slot-unassign,
.zone-drop.is-filled:focus-within .zone-slot-unassign {
    opacity: 1;
    pointer-events: auto;
}

.zone-sheet .btn-action {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
}

.placeholder-img {
    background: repeating-linear-gradient(45deg, #eee, #eee 6px, #e4e4e4 6px, #e4e4e4 12px);
    color: #888;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.ad-thumb {
    width: 80px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.ad-form-preview {
    max-width: 240px;
    width: 100%;
    height: auto;
    aspect-ratio: 1600 / 760;
    object-fit: cover;
    border-radius: 6px;
}

.ad-form-preview-slot {
    max-width: 100%;
    aspect-ratio: 830 / 390;
}

.map-banner-preview {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 3305 / 390;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.map-banner-frame {
    position: relative;
    margin-top: 8px;
}

.map-banner-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.export-engine {
    font-size: 12px;
    color: #666;
}

/* Full-page wait while a map PDF is generated for Fancybox preview. */
body.pdf-loading-open {
    overflow: hidden;
}

.pdf-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, 0.72);
}

.pdf-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.pdf-loading-card .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--admin-accent, #f58220);
    border-width: 0.2em;
}

.admin-pdf-fancybox {
    --fancybox-zIndex: 4100;
}

.admin-pdf-fancybox .fancybox__content {
    width: min(96vw, 1200px);
    height: min(92vh, 900px);
    max-width: 96vw;
    max-height: 92vh;
    padding: 0;
}

.admin-pdf-fancybox iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.map-settings-canvas {
    width: 100%;
    min-height: 240px;
    height: clamp(240px, 32vh, 320px);
    border-radius: var(--admin-radius);
    border: 1px solid rgba(17, 17, 17, 0.1);
}

#mapSettingsModal .block-title {
    margin-top: 0;
    margin-bottom: 12px;
}

/* Places autocomplete must sit above the Bootstrap modal. */
.pac-container {
    z-index: 2000;
}

.zone-locations-map {
    width: 100%;
    min-height: 280px;
    height: min(70vh, 640px);
    border-radius: var(--admin-radius-sm);
    overflow: hidden;
    background: #e8eef3;
}

#zoneLocationsModal .modal-header {
    padding: 12px 16px 8px;
}

#zoneLocationsModal .modal-body {
    padding: 8px 16px 16px;
}

#zoneLocationsModal .modal-title {
    margin-top: 0;
    margin-bottom: 4px;
}

.zone-locations-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    font-size: 0.8125rem;
    color: #4b5563;
}

.zone-locations-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.zone-locations-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.18);
    flex-shrink: 0;
}

.zone-locations-swatch-circle {
    border-radius: 50%;
}

.zone-locations-swatch-square {
    border-radius: 3px;
}
