* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.container {
    width: min(1100px, 92%);
    margin: 40px auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

/* =========================================================
   Locator Info Tooltip
   ========================================================= */

.locator-info {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.locator-info-btn {
    width: 30px;
    height: 30px;
    border: 2px solid #7f1d1d;
    border-radius: 50%;
    background: #dc2626;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.24);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.locator-info-btn:hover,
.locator-info-btn:focus {
    background: #b91c1c;
    border-color: #7f1d1d;
    transform: scale(1.05);
    outline: none;
}

.locator-info-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: min(320px, 80vw);
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.locator-info-tooltip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #111827;
    transform: translateX(-50%) rotate(45deg);
}

.locator-info:hover .locator-info-tooltip,
.locator-info:focus-within .locator-info-tooltip {
    opacity: 1;
    visibility: visible;
}

.top-bar {
    margin-bottom: 14px;
}

.search-box input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    outline: none;
}

.area-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: thin;
}

.area-pill {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.area-pill:hover {
    background: #eef2ff;
    border-color: #2563eb;
}

.area-pill.active {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.saved-section {
    margin-bottom: 18px;
    position: relative;
}

.saved-toggle {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.saved-toggle span {
    display: inline-block;
    margin-left: 8px;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
}

.saved-dropdown {
    margin-top: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.saved-list {
    display: flex;
    flex-direction: column;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}

.saved-item:last-child {
    border-bottom: none;
}

.saved-item-info {
    min-width: 0;
    flex: 1;
}

.saved-item-number {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.saved-item-area {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.saved-item-comment {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #374151;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 10px;
    max-width: 520px;
    word-break: break-word;
    white-space: pre-line;
}

.saved-item-comment-empty {
    color: #9ca3af;
    font-style: italic;
    background: #f9fafb;
}

.saved-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: flex-start;
}

.saved-map-btn,
.saved-remove-btn,
.saved-note-btn,
.map-btn {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    padding: 9px 12px;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.saved-map-btn,
.map-btn {
    background: #2563eb;
    color: #fff;
}

.saved-remove-btn {
    background: #dc2626;
    color: #fff;
}

.saved-note-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
}

.saved-note-btn:hover {
    background: #eef2ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

.table-wrap {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: fixed;
}

thead {
    background: #111827;
    color: #fff;
}

th,
td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

th:nth-child(1),
td:nth-child(1) {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
}

th:nth-child(2),
td:nth-child(2) {
    width: auto;
}

th:nth-child(3),
td:nth-child(3) {
    width: 120px;
    min-width: 120px;
    white-space: nowrap;
}

th:nth-child(4),
td:nth-child(4) {
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
}

th:nth-child(2),
td:nth-child(2) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

tbody tr:hover {
    background: #f9fafb;
}

.save-col {
    text-align: center;
}

.save-btn {
    border: none;
    background: transparent;
    box-shadow: none;
    color: #cbd5e1;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    min-width: 0;
    width: auto;
    height: auto;
    transition: transform 0.15s ease, color 0.2s ease;
}

.save-btn:hover {
    transform: scale(1.08);
    color: #f59e0b;
}

.save-btn.saved {
    color: #f59e0b;
}

.map-btn {
    display: inline-block;
    padding: 10px 14px;
    font-size: 14px;
}

.no-results,
.saved-empty {
    padding: 18px 16px;
    text-align: center;
    color: #6b7280;
}

.hidden {
    display: none;
}