:root {
    color-scheme: dark;
    --bg: #0f1115;
    --surface: #181b22;
    --surface-2: #222630;
    --surface-3: #2d3340;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #2e3545;
    --border-focus: #e10600;
    --accent: #e10600;
    --accent-2: #ff3b50;
    --accent-soft: rgba(225, 6, 0, 0.15);
    --shade-yes: #fbbf24;
    --shade-no: #64748b;
    --shade-na: #f40ce8;
}

@font-face {
    font-family: "inter";
    src: url("/assets/inter.ttf");
}

/* Globals */
* {
    font-family: inter, Roboto, Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0f1115;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
}

body.dashboard-page,
body.manage-page,
body.insert-page {
    display: flex;
    flex-direction: column;
}

nav {
    background: #14171e;
    padding: 18px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

nav ul {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    list-style: none;
    display: flex;
    gap: 24px;
    align-items: center;
}

nav li a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

nav li a:hover {
    color: var(--text);
}

nav li:first-child {
    margin-right: auto;
}

nav li:first-child a {
    font-size: 18px;
    color: var(--text);
    letter-spacing: -0.5px;
}

a {
    color: var(--muted);
    transition: color 0.2s;
}

a:hover {
    color: var(--text);
}

body.dashboard-page .container,
body.manage-page .container,
body.insert-page .container {
    margin: 40px auto;
    width: 95%;
    max-width: 1600px;
    padding: 32px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body.chooser-page .container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 32px;
}

body.dashboard-page h1,
body.manage-page h1,
body.insert-page h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.dashboard-toolbar {
    margin: 24px 0;
    padding: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.dashboard-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group-wide {
    grid-column: span 2;
}

.dashboard-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dashboard-actions .btn-reset,
.dashboard-actions .btn-submit {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-actions .btn-reset {
    padding: 12px 24px;
}

body.dashboard-page .stats {
    background-color: var(--surface-2);
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-2);
}

thead {
    background: var(--surface-3);
    color: var(--text);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
}

th a {
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

th a:hover {
    color: var(--text);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

tbody td a {
    color: var(--accent-2);
    text-decoration: underline;
}

tbody td a:hover {
    color: var(--text);
}

.empty,
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--muted);
}

.area-selector {
    margin-bottom: 32px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.area-selector select,
.spot-row input,
.spot-row select,
.add-adjacency select,
select,
input[type="date"],
input[type="text"] {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--surface-3);
    color: var(--text);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

textarea {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--surface-3);
    color: var(--text);
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
    font-family: inherit;
}

.area-selector select {
    font-size: 16px;
    cursor: pointer;
    background: var(--surface-2);
}

.spots-table th,
.spots-table td {
    padding: 14px;
}

.spot-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.spot-row input {
    flex: 1;
}

.btn-save,
.btn-add,
.btn-submit,
.btn-enter {
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 600;
    transition:
        background-color 0.2s,
        border-color 0.2s,
        transform 0.1s;
}

.btn-save:hover,
.btn-add:hover,
.btn-submit:hover:not(:disabled),
.area-card:hover .btn-enter {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.btn-save:active,
.btn-add:active,
.btn-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-save,
.btn-add {
    padding: 10px 18px;
    border-radius: 6px;
}

.btn-submit,
.btn-reset,
.btn-cancel {
    padding: 12px 32px;
    font-size: 15px;
    border-radius: 6px;
    font-weight: 600;
}

.btn-reset,
.btn-cancel {
    background: var(--surface-3);
    color: var(--text);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-reset:hover,
.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-submit:disabled,
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.area-card,
.modal-content,
.batch-settings,
.summary-list,
.adjacency-section,
.stats,
.container {
    border: 1px solid var(--border);
}

.chooser-page .header {
    text-align: center;
    color: var(--text);
    margin-bottom: 48px;
}

.chooser-page .header h1 {
    font-size: 36px;
    margin-bottom: 12px;
    font-weight: 800;
}

.chooser-page .header p,
.subtitle,
.info-text,
.spot-group-title,
.area-name,
.footer {
    color: var(--muted);
    font-size: 14px;
}

.subtitle {
    margin-top: 4px;
    font-size: 15px;
}

.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.area-card {
    display: block;
    background: var(--surface);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition:
        border-color 0.2s,
        transform 0.2s,
        box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}

.area-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--text);
}

.area-code {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.area-name {
    font-size: 16px;
    margin-bottom: 20px;
    font-weight: 500;
}

.area-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.btn-enter {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    margin-top: 8px;
}

.chooser-page .nav-links {
    text-align: center;
    margin-top: 32px;
}

.chooser-page .nav-links a {
    color: var(--muted);
    margin: 0 16px;
    text-decoration: none;
    font-weight: 600;
}

.chooser-page .nav-links a:hover {
    text-decoration: underline;
    color: var(--text);
}

.chooser-page .footer {
    text-align: center;
    margin-top: 48px;
    opacity: 0.7;
}

.batch-settings {
    background: var(--surface-2);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 32px;
    border-left: 4px solid var(--accent);
}

.batch-settings h2,
.spots-section h2,
.modal-header,
.summary-heading,
h3 {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.batch-settings h2,
.spots-section h2 {
    margin-bottom: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
}

select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.spots-section {
    margin-bottom: 32px;
}

.spot-group {
    margin-bottom: 24px;
}

.spot-group-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.spot-btn {
    padding: 14px;
    border: 2px solid var(--border);
    background: var(--surface-2);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition:
        background-color 0.2s,
        border-color 0.2s,
        color 0.2s;
    font-size: 13px;
    color: var(--text);
    position: relative;
    min-width: 60px;
}

.spot-btn:hover {
    border-color: var(--text);
    background: var(--surface-3);
}

.spot-btn.selected {
    font-style: italic;
    font-weight: 800;
    border-width: 3px;
}

.spot-btn.shade-yes {
    border: 2px solid var(--shade-yes);
}

.spot-btn.shade-no {
    border: 2px solid var(--shade-no);
}

.spot-btn.shade-na {
    border: 2px dashed var(--shade-na);
}

.message {
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 6px;
    text-align: center;
    display: none;
    font-weight: 600;
}

.message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: block;
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    max-width: 650px;
    width: 90%;
    border: 1px solid var(--border);
}

.modal-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.modal-body {
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.modal-body .form-group {
    margin-bottom: 0;
}

#spzFields,
#paFields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: center;
}

.modal-footer {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.adjacent-info {
    background: var(--surface-2);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--border-focus);
    border: 1px solid var(--border);
}

.summary-list {
    background: var(--surface-2);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.summary-item {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: var(--surface-3);
    border-radius: 6px;
    border-left: 4px solid var(--border-focus);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item-details {
    flex-grow: 1;
}

.spot-id {
    font-weight: 700;
    color: var(--text);
}

.spot-meta {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.edit-link {
    color: var(--accent-2);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    margin-left: 12px;
    transition: color 0.2s;
}

.edit-link:hover {
    color: var(--accent);
}

.summary-section {
    margin-top: 32px;
}

.summary-heading {
    margin-bottom: 16px;
}

.checkbox-inline {
    margin-right: 6px;
    accent-color: var(--border-focus);
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.checkbox-inline-wide {
    margin-right: 8px;
}

.info-text-tight {
    margin-top: 6px;
    font-size: 12px;
}

.form-group-spaced {
    margin-top: 0;
}

.is-hidden {
    display: none !important;
}

/* Import Page Styles */
body.import-page .container {
    margin: 40px auto;
    width: 95%;
    max-width: 1600px;
    padding: 32px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body.import-page h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

.import-card {
    background: var(--surface-2);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
}

.import-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.csv-template-guide {
    background: var(--surface-2);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
}

.csv-template-guide h3 {
    margin-bottom: 12px;
}

.csv-template-guide p {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.csv-template-guide code {
    display: block;
    background: var(--surface-3);
    padding: 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--accent-2);
    font-family:
        Fira Code,
        Monaco,
        Consolas,
        monospace;
    font-size: 13px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Alert Notification Banners */
.alert {
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

nav li a.active {
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
}

.spot-btn {
    padding: 14px;
    border: 2px solid var(--border);
    background: var(--surface-2);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition:
        background-color 0.2s,
        border-color 0.2s,
        color 0.2s;
    font-size: 13px;
    color: var(--text);
    position: relative;
    min-width: 60px;
}

.spot-btn:hover {
    border-color: var(--text);
    background: var(--surface-3);
}

.spot-btn.selected {
    font-style: italic;
    font-weight: 800;
    border-width: 3px;
}

/* Yellow if Not Shaded */
.spot-btn.shade-no {
    border: 2px solid var(--shade-yes);
    background-color: rgba(251, 191, 36, 0.08);
}

/* Gray if Shaded */
.spot-btn.shade-yes {
    border: 2px solid var(--shade-no);
    background-color: rgba(100, 116, 139, 0.15);
}

/* Dashed Gray if N/A / Unknown Shading */
.spot-btn.shade-na {
    border: 2px dashed var(--shade-na);
    background-color: rgba(71, 85, 105, 0.1);
}

div.row {
    display: flex;
    flex-wrap: wrap;
}

.row > form {
    /* makes grandchild col divs ignore parent when doing row-col layout */
    display: contents;
}

[onclick],
button {
    cursor: pointer;
}

[class^="col"] {
    padding: 0.25rem;
}

div.colA {
    width: auto;
}

div.col1 {
    width: 100%;
}

div.col2 {
    width: 50%;
}

div.col3 {
    width: 33.3333%;
}

div.col4 {
    width: 25%;
}

div.col5 {
    width: 20%;
}

div.col6 {
    width: 16.6667%;
}

div.col8 {
    width: 12.5%;
}

div.col10 {
    width: 10%;
}

.expand {
    position: relative;
    transition: transform 0.5s;
}

.expand:hover {
    transform: scale(1.03);
    z-index: 1;
}

.space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.space-evenly {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.space-around {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.centerX {
    display: flex;
    justify-content: center;
}

.center-column {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.flex-bottom {
    margin-top: auto;
}

.text-center {
    text-align: center;
    vertical-align: center;
}

.inline {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
}

a.btn {
    text-decoration: none;
}

a.no-dec {
    text-decoration: none;
    color: var(--black);
}
