/* ===============================
   THEME VARIABLES
=============================== */

:root {
    --bg: #111;
    --fg: #eee;
    --panel: #1e1e1e;
    --panel-alt: #181818;
    --accent: #f5c542;
    --muted: #aaa;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
}

[data-theme="light"] {
    --bg: #e2e9f1;
    --fg: #111;
    --panel: #f2f4f7;
    --panel-alt: #e4e7eb;
    --accent: #d9a400;
    --muted: #333;
}

/* ===============================
   BASE
=============================== */

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

a {
    color: #4ea3ff;
    text-decoration: none;
}

/* ===============================
   LOGO
=============================== */

.brand-link {
    display: inline-flex;
    align-items: center;
}

.logo {
    height: 75px;
}

/* ===============================
   PAGE CONTAINER
=============================== */

.page-container {
    max-width: 90vw;
    margin: 0 auto;
    padding: 20px 8px 20px;
}

#scrollSpacer {
    height: 12vh;
    min-height: 96px;
    max-height: 200px;
}

/* ===============================
   NOTES BADGE
=============================== */

.notes-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(245,197,66,0.9);
    color: #111;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

/* ===============================
   ICON BUTTONS (GLOBAL)
=============================== */

.icon-btn {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
}

.icon-btn:hover {
    background-color: rgba(255,255,255,0.08);
}


#addNoteBtn {
    width: 50% !important;
}
#addNoteBtn {
    flex: 0 0 50%;
}

.btn-primary {
    background: #2c7be5;
    color: white;
    border: none;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1f6ad6;
}

.badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 75px;      /* controls uniform width */
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.6;
}

.badge-green {
    background: #22c55e;
    color: #000;
}

.badge-red {
    background: #ff3030;
    color: #000;
}

.badge-yellow {
    background: #fff44f;
    color: #000;
}

.badge-blue {
    background: #00ffff;
    color: #000;
}

.badge-orange {
    background: #ffa500;
    color: #000;
}

.badge-gray {
    background: #444;
    color: #ccc;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
    transition: 0.2s ease;
}

.sub-header {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 90;

    background: var(--panel);
    border-bottom: 1px solid var(--panel-alt);

    padding: var(--space-md) 0;
}

.sub-header h1 {
    color: var(--fg);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    padding: var(--space-md) 0;
}

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

.sub-header-left h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--fg);
}

.sub-header-right {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.sub-header-inner {
    max-width: 90vw;
    margin: 0 auto;
    padding: 0 var(--space-sm);

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.sub-header input,
.sub-header select {
    background: var(--panel-alt);
    color: var(--fg);
    border: 1px solid var(--panel-alt);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.filter-group.actions {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    /* 8px between buttons */
}

filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 4px;
    display: block;
}

.page-container {
    max-width: 90vw;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-sm) var(--space-lg);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: #1e293b;
    padding: 20px;
    border-radius: 10px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content .form-group {
    margin-bottom: 12px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
}

.filter-red {
    background: #FF3030;
    color: #000;
}

.filter-green {
    background: #22c55e;
    color: #000;
}

.filter-yellow {
    background: #ffff00;
    color: #000;
}

.filter-grey {
    background: #444;
    color: #000;
}

.map-toggle-group {
    display: flex;
    gap: 14px;
    align-items: center;
}

.map-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #444;
    border-radius: 22px;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked+.slider {
    background-color: #22c55e;
}

.switch input:checked+.slider:before {
    transform: translateX(18px);
}