:root {
    /* Color Palette - Premium Monochromatic Dark */
    --bg-black: #000000;
    --bg-dark: #0a0a0a;
    --bg-card: #121212;
    --bg-input: #181818;
    
    --border-dim: #222222;
    --border-bright: #333333;
    --border-white: #ffffff;
    
    --text-pure: #ffffff;
    --text-dim: #888888;
    --text-muted: #555555;
    
    --accent-gold: #facc15;
    
    /* Layout Constants */
    --sidebar-width: 440px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-black);
    color: var(--text-pure);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-black);
}
::-webkit-scrollbar-thumb {
    background: var(--border-dim);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-bright);
}

/* Full App Container */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    background-color: var(--bg-black);
}

/* --- SIDEBAR LAYOUT --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-black);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    position: relative;
}

/* Sidebar views generic */
.sidebar-view {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.sidebar-view.active {
    display: flex;
}

/* --- 1. EXPLORE VIEW --- */
.sidebar-header {
    padding: 28px 24px 16px 24px;
    background-color: var(--bg-black);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.logo-icon {
    color: var(--text-pure);
    width: 24px;
    height: 24px;
}

.logo h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-pure);
    text-transform: uppercase;
}

.tagline {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Search & Filters Section */
.controls-section {
    padding: 12px 24px 20px 24px;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 12px 14px 12px 38px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--border-white);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    width: 16px;
    height: 16px;
}

.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.filter-group label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

.filter-group select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 10px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-group select:focus {
    border-color: var(--border-white);
}

/* Tree Feed Section */
.tree-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px 8px 24px;
}

.feed-header h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.count-badge {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-dim);
}

.feed-list {
    padding: 8px 16px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Feed item cards */
.feed-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.feed-item:hover {
    border-color: var(--border-bright);
}

.feed-item.active {
    border-color: var(--border-white);
}

.feed-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    filter: grayscale(100%);
    background-color: var(--bg-black);
    flex-shrink: 0;
    border: 1px solid var(--border-dim);
}

.feed-item:hover .feed-img,
.feed-item.active .feed-img {
    filter: none;
}

.feed-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.feed-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-pure);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-city {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

.feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.feed-status-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-pure);
}

.feed-status-badge.marked_for_felling { color: var(--accent-gold); }
.feed-status-badge.felled { color: #f43f5e; }
.feed-status-badge.new_tree_planted { color: #10b981; }
.feed-status-badge.existing { color: #888888; }
.feed-status-badge.pending { color: #888888; }

.feed-date {
    font-size: 10px;
    color: var(--text-muted);
}

/* Explore Footer stats & buttons */
.explore-footer {
    padding: 16px 24px 24px 24px;
    background-color: var(--bg-black);
    border-top: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-counter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-pure);
    letter-spacing: 0.5px;
}

.stats-counter .divider {
    color: var(--text-muted);
}

.btn-witness-trigger {
    width: 100%;
    background-color: var(--text-pure);
    color: var(--bg-black);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-witness-trigger:hover {
    background-color: #dddddd;
}

/* --- 2. REGISTER VIEW (Wizard Stepper) --- */
.register-header {
    padding: 24px 24px 12px 24px;
    border-bottom: 1px solid var(--border-dim);
}

.register-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.register-brand .logo h2 {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.btn-cancel-register {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-cancel-register:hover {
    color: var(--text-pure);
}

/* Stepper Progress Steps connecting bar */
.stepper-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 4px;
}

.step-indicator {
    position: relative;
    z-index: 2;
}

.step-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    transition: var(--transition-fast);
    padding-bottom: 4px;
}

.step-indicator.active .step-label {
    color: var(--text-pure);
    font-weight: 700;
    border-bottom: 2px solid var(--text-pure);
}

.step-line {
    flex: 1;
    height: 1px;
    background-color: var(--border-dim);
    margin: 0 8px;
    margin-top: -6px; /* align with text baseline */
}

/* Form Container inside sidebar */
.register-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.register-step {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: none;
}

.register-step.active {
    display: block;
}

.step-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 14px;
    text-transform: uppercase;
}

/* CAPTURE Method boxes */
.photo-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.photo-box-method {
    border: 1px dashed var(--border-bright);
    background-color: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.photo-box-method:hover {
    border-color: var(--border-white);
}

.photo-box-icon {
    width: 24px;
    height: 24px;
    color: var(--text-pure);
}

.photo-box-method span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-pure);
}

.hidden-file-input {
    display: none;
}

/* Form Controls & Labels */
.minimal-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 6px;
    display: block;
}

.url-input-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.url-input-section input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    width: 100%;
}

.url-input-section input:focus {
    border-color: var(--border-white);
}

.photo-preset-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 8px;
}

.preset-buttons-row {
    display: flex;
    gap: 8px;
}

.btn-preset {
    flex: 1;
    background-color: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-preset:hover {
    border-color: var(--border-bright);
    color: var(--text-pure);
}

/* Location input styling */
.btn-current-location {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    color: var(--text-pure);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: var(--transition-fast);
}

.btn-current-location:hover {
    border-color: var(--border-white);
}

.btn-current-location i {
    width: 14px;
    height: 14px;
}

.coord-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.input-group input,
.input-group select,
.input-group textarea {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
    width: 100%;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--border-white);
}

.location-help-text {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-dim);
}

.location-help-text .help-icon {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
    flex-shrink: 0;
}

/* DETAILS step widgets */

/* Status cards list - large boxes stack */
.status-cards-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.status-card-option {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.status-card-option:hover {
    border-color: var(--border-bright);
}

.status-card-option.selected {
    border-color: var(--border-white);
    box-shadow: 0 0 0 1px var(--border-white);
}

.option-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.option-desc {
    font-size: 11px;
    color: var(--text-dim);
}

/* Quantity selector buttons grid */
.qty-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
}

.btn-qty {
    background-color: transparent;
    border: 1px solid var(--border-bright);
    color: var(--text-pure);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-qty:hover {
    border-color: var(--border-white);
}

.btn-qty.active {
    background-color: var(--text-pure);
    color: var(--bg-black);
    border-color: var(--text-pure);
    font-weight: 700;
}

/* Toggle Switches */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-pure);
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-bright);
    transition: .3s;
    border-radius: 24px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-pure);
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .slider-toggle {
    background-color: var(--border-white);
}

.switch-toggle input:checked + .slider-toggle:before {
    transform: translateX(20px);
    background-color: var(--bg-black);
}

/* Trunk measurement tabs & inputs */
.trunk-measurement-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.tabs-measurement {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tab-meas {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: var(--transition-fast);
}

.tab-meas.active {
    color: var(--text-pure);
    border-bottom-color: var(--border-white);
}

.measurement-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.measurement-input-wrapper input {
    width: 100%;
    background-color: var(--bg-black);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 10px 42px 10px 12px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.measurement-input-wrapper input:focus {
    border-color: var(--border-white);
}

.unit-label {
    position: absolute;
    right: 12px;
    font-size: 12px;
    color: var(--text-dim);
}

.status-conditional-form {
    border-top: 1px solid var(--border-dim);
    margin-top: 20px;
    padding-top: 20px;
}

/* Stepper Actions Bar */
.stepper-actions {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    background-color: var(--bg-black);
}

.btn-step-action {
    background: none;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-pure);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-step-action i {
    width: 16px;
    height: 16px;
}

.btn-back {
    color: var(--text-dim);
}
.btn-back:hover {
    color: var(--text-pure);
}

.btn-next {
    background-color: var(--border-white);
    color: var(--bg-black);
    padding: 10px 16px;
}
.btn-next:hover {
    background-color: #dddddd;
}

/* --- 3. DETAILS VIEW IN SIDEBAR --- */
.detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-back-to-explore {
    background: none;
    border: none;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.btn-close-detail {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-detail:hover {
    color: var(--text-pure);
}

.detail-scroller {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

.detail-media {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-dark);
    border-bottom: 1px solid var(--border-dim);
}

.main-image-wrapper {
    width: 100%;
    height: 240px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-dim);
}

#detail-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(40%);
}

.status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--bg-black);
    background-color: var(--text-pure);
}

.status-badge.marked_for_felling { background-color: var(--accent-gold); }
.status-badge.felled { background-color: #f43f5e; color: #fff; }
.status-badge.new_tree_planted { background-color: #10b981; color: #fff; }
.status-badge.existing { background-color: #555555; color: #fff; }
.status-badge.pending { background-color: #555555; color: #fff; }

.thumbnail-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.thumbnail-row img {
    width: 100%;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border-dim);
    filter: grayscale(100%);
}

.thumbnail-row img.active,
.thumbnail-row img:hover {
    filter: none;
    border-color: var(--border-white);
}

.detail-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.detail-location {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-location i {
    width: 12px;
    height: 12px;
    color: var(--text-pure);
}

.detail-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pill i {
    width: 12px;
    height: 12px;
}

#detail-needs-id-pill {
    color: var(--accent-gold);
    border-color: rgba(250, 204, 21, 0.3);
}

.info-block {
    background-color: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.info-block h3 {
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    font-size: 12px;
}

.info-grid strong {
    color: var(--text-dim);
}

.arborist-status {
    background-color: var(--bg-black);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#detail-arborist-text {
    font-weight: 700;
    color: var(--accent-gold);
}

.notes-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-pure);
}

/* Community Suggestions */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.suggestion-item {
    background-color: var(--bg-black);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggested-spec {
    font-weight: 600;
    color: var(--text-pure);
}

.suggested-by {
    color: var(--text-muted);
}

.suggest-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggest-form input {
    background-color: var(--bg-black);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 11px;
    outline: none;
}

.btn-suggest-submit {
    background-color: var(--text-pure);
    color: var(--bg-black);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* Actions in Details Footer panel */
.detail-actions {
    padding: 16px;
    border-top: 1px solid var(--border-dim);
    display: flex;
    gap: 8px;
    background-color: var(--bg-black);
}

.btn-detail-action {
    flex: 1;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.btn-detail-action i {
    width: 14px;
    height: 14px;
}

.btn-edit {
    background-color: transparent;
    border: 1px solid var(--border-bright);
    color: var(--text-pure);
}
.btn-edit:hover {
    border-color: var(--border-white);
}

.btn-mark {
    background-color: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
}
.btn-mark:hover {
    background-color: rgba(250, 204, 21, 0.05);
}

.btn-delete {
    background-color: transparent;
    border: 1px solid #f43f5e;
    color: #f43f5e;
}
.btn-delete:hover {
    background-color: rgba(244, 63, 94, 0.05);
}

/* --- HERO MAP AREA (Right side) --- */
.main-view {
    flex: 1;
    position: relative;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Leaflet Dark theme styles */
.leaflet-container {
    background-color: #000000 !important;
}
.leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}
.leaflet-bar {
    border: 1px solid var(--border-dim) !important;
    box-shadow: none !important;
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
}
.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-pure) !important;
    border-bottom: 1px solid var(--border-dim) !important;
    transition: var(--transition-fast);
}
.leaflet-bar a:hover {
    background-color: var(--border-dim) !important;
}

/* Popup styling */
.leaflet-popup-content-wrapper {
    background-color: var(--bg-card) !important;
    color: var(--text-pure) !important;
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8) !important;
    padding: 2px !important;
}
.leaflet-popup-tip {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-dim);
}
.popup-card {
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 200px;
    padding: 6px;
}
.popup-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
}
.popup-status {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.popup-btn {
    background-color: var(--text-pure);
    color: var(--bg-black);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    width: 100%;
    margin-top: 4px;
    transition: var(--transition-fast);
}
.popup-btn:hover {
    background-color: #dddddd;
}

/* Floating BRANDING on map top-left */
.map-branding {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: var(--bg-black);
    border: 1px solid var(--border-bright);
    border-radius: 40px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.brand-logo-map {
    color: var(--text-pure);
    width: 16px;
    height: 16px;
}

.map-branding span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-pure);
}

/* Map Navigation Menu (Floating top-right) */
.map-nav-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
    background-color: var(--bg-black);
    border: 1px solid var(--border-bright);
    border-radius: 40px;
    padding: 4px;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.menu-tab {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.menu-tab i {
    width: 12px;
    height: 12px;
}

.menu-tab:hover {
    color: var(--text-pure);
}

.menu-tab.active {
    background-color: var(--text-pure);
    color: var(--bg-black);
}

/* Map Layers toggle & dropdown panel */
.map-layers-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.btn-layers-toggle {
    background-color: var(--bg-black);
    border: 1px solid var(--border-bright);
    color: var(--text-pure);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: var(--transition-fast);
}

.btn-layers-toggle:hover {
    border-color: var(--border-white);
}

.btn-layers-toggle i {
    width: 12px;
    height: 12px;
}

.layers-dropdown {
    margin-top: 8px;
    width: 220px;
    background-color: var(--bg-black);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.layers-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 6px;
}

.layers-dropdown-header button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
}

.layers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-section-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 2px;
}

.layer-item-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-pure);
    cursor: pointer;
}

.layer-item-checkbox input[type="checkbox"] {
    accent-color: var(--text-pure);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Map Hint Box (floating bottom-left) */
.map-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.85);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.hint-icon {
    color: var(--text-pure);
    width: 12px;
    height: 12px;
}

.map-hint span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
}

/* --- CUSTOM MAP MARKERS --- */
.tree-custom-marker {
    background: none;
    border: none;
}

.marker-pin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--bg-black);
    border: 2px solid var(--border-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-pure);
    font-family: inherit;
    font-weight: 800;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    transition: var(--transition-fast);
}

.marker-pin:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(255,255,255,0.2);
}

.marker-pin.marked {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.marker-pin.felled {
    color: #f43f5e;
    border-color: #f43f5e;
}

.marker-pin.planted {
    color: #10b981;
    border-color: #10b981;
}

.marker-pin i {
    width: 12px;
    height: 12px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-dim);
    }
    .main-view {
        height: 50vh;
    }
    .sidebar-view {
        position: relative;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        display: none;
    }
    .sidebar-view.active {
        display: flex;
    }
    .map-branding {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
    }
    .map-nav-menu {
        top: 10px;
        right: 10px;
        padding: 2px;
    }
    .menu-tab {
        padding: 6px 12px;
        font-size: 10px;
    }
    .map-layers-panel {
        top: 60px;
        right: 10px;
    }
}

/* Map Popup Status Badge Color Overrides */
.popup-status.marked_for_felling {
    color: var(--accent-gold);
}
.popup-status.felled {
    color: #f43f5e;
}
.popup-status.new_tree_planted {
    color: #10b981;
}

/* --- 4. FULL-SCREEN REGISTER OVERLAY --- */
.register-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 2000; /* Over everything */
    display: none;
    flex-direction: column;
}

.register-overlay-header {
    padding: 20px 40px;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #000000;
}

.register-overlay-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.register-overlay-header .logo h1 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.register-overlay-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    background-color: #000000;
}

.register-overlay-form {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.register-overlay .register-step {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.register-overlay .register-step.active {
    display: flex;
}

/* Floating Witness Button on Map */
.btn-witness-floating {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    background-color: var(--text-pure);
    color: var(--bg-black);
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-family: inherit;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: var(--transition-fast);
}

.btn-witness-floating:hover {
    background-color: #dddddd;
    transform: translateY(-2px);
}

.btn-witness-floating i {
    width: 16px;
    height: 16px;
}

/* Leaflet Custom Marker Pins (+, X, dot) */
.tree-custom-marker {
    background: none;
    border: none;
}

.marker-pin {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.5);
    transition: var(--transition-fast);
}

.marker-pin:hover {
    transform: scale(1.15);
    background-color: #e0e0e0;
}
.marker-pin.marked {
    background-color: var(--accent-gold);
    border-color: #000000;
    color: #000000;
}

.marker-pin.felled {
    background-color: #f43f5e;
    border-color: #000000;
    color: #000000;
}

.marker-pin.planted {
    background-color: #10b981;
    border-color: #000000;
}

.marker-pin.planted .dot {
    width: 6px;
    height: 6px;
    background-color: #000000;
    border-radius: 50%;
}

.marker-pin.pending-approval {
    background-color: #888888;
    border-color: #000000;
    color: #000000;
}

.marker-pin.existing {
    width: 10px !important;
    height: 10px !important;
    background-color: #555555 !important;
    border: 1px solid #111111 !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.6) !important;
    padding: 0 !important;
    margin: 0 !important;
}

.marker-pin.existing:hover {
    transform: scale(1.3) !important;
    background-color: #999999 !important;
}

.stepper-mini-map {
    width: 100%;
    height: 280px;
    border-radius: 6px;
    border: 1px solid var(--border-dim);
    margin-top: 20px;
    background-color: #111;
    z-index: 10;
}

.login-modal-card input:focus {
    border-color: var(--text-pure) !important;
}

.login-modal-card button#btn-submit-login:hover {
    background-color: var(--text-dim) !important;
}

