/* ============================================================
   BASE RESET & TYPOGRAPHY
   ============================================================ */

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

html {
    font-size: 16px;
    /* Fallback colour for login page overscroll / rubber-band on iOS —
       must match the SVG's dominant tone so any exposed area blends in. */
    background-color: #cbebfb;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #236192;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

/* Background lives on a position:fixed pseudo-element so it is permanently
   glued to the viewport. This guarantees full coverage on all mobile browsers
   regardless of rubber-band overscroll, address-bar resizing, or SVG
   intrinsic-size quirks (the SVG has viewBox but no explicit width/height). */
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;           /* top:0 right:0 bottom:0 left:0 — always full viewport */
    background-color: #cbebfb;
    background-image: url('../map-editor-background.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;       /* fallback */
    height: 100dvh;      /* adjusts for mobile browser chrome */
    overflow: hidden;
    overscroll-behavior: none;
    background-color: transparent; /* background handled by ::before */
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
}

.login-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 40px 40px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.09);
    text-align: center;
}

.login-logo {
    height: auto;
    width: 220px;
    margin-bottom: 28px;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.login-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Google's notification iframe — pinned outside the card so it never affects layout */
#g_id_onload {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* The footer itself stays fully flexible so text can wrap freely on small screens */
.login-card-footer {
    width: 100%;
}

/* Only the button wrapper is height-locked — this is what Google bloats during
   its native-button → iframe swap. height (not min-height) + overflow:hidden
   clips any over-tall intermediate render without affecting surrounding text. */
.signin-button-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    overflow: hidden;
    margin-bottom: 20px;
}

/* Greyscale placeholder — sits above the real button (z-index 2), hiding
   Google's native-button → iframe rendering stages underneath.
   Fades out once the real button has fully settled. */
.gsi-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;  /* exact Google button width */
    height: 40px;  /* exact Google button height */
    display: flex;
    align-items: center;
    padding: 0 12px; /* matches Google button padding */
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-family: 'Google Sans', arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    color: #9aa0a6;
    -webkit-font-smoothing: antialiased; /* matches Google iframe's font rendering */
    pointer-events: none;
    user-select: none;
    z-index: 9999;
    transition: opacity 0.25s ease;
}

/* G logo sits in normal flex flow at the left, matching Google's exact spacing */
.gsi-placeholder-logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 8px; /* matches .nsm7Bb-HzV7m-LgbsSe-Bz112c { margin-right: 8px } */
}

/* Text grows to fill remaining space and centres within it, matching Google's flex-grow:1 */
.gsi-placeholder-text {
    flex-grow: 1;
    text-align: center;
    vertical-align: top; /* matches Google's .nsm7Bb-HzV7m-LgbsSe-BPrWId */
}

/* Real button hidden underneath the placeholder while Google renders */
.signin-button-wrapper .g_id_signin {
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* On ready: placeholder fades out, real button fades in simultaneously */
.signin-button-wrapper.gsi-ready .gsi-placeholder {
    opacity: 0;
}

.signin-button-wrapper.gsi-ready .g_id_signin {
    opacity: 1;
}

.login-notice {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
}

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.09);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 200;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 3px;
}

.navbar-logo {
    height: auto;
    width: 128px;
    object-fit: contain;
    flex-shrink: 0;
}

.navbar-sep {
    width: 2px;
    height: 28px;
    background: #d0d0d0;
    border-radius: 1px;
    flex-shrink: 0;
    margin: 0 18px;
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
    color: #009DDC;
    letter-spacing: -0.2px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    color: #1a1a1a;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

/* Same fixed-viewport background technique as the login page */
.app-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-color: #cbebfb;
    background-image: url('../map-editor-background.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.app-page {
    background: transparent;
    opacity: 0;
}

.main-content {
    margin-top: 60px;
    padding: 28px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.09);
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

/* ============================================================
   SECTION 1 — ADD / EDIT SCHOOL — TWO COLUMN LAYOUT
   ============================================================ */

.section-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

/* ---- MAP PANEL ---- */

.map-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-search-wrapper {
    width: 100%;
}

.map-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.map-search-input:focus {
    border-color: #236192;
    box-shadow: 0 0 0 3px rgba(35, 97, 146, 0.1);
}

.map-search-input:disabled {
    background: #f9f9f9;
    color: #aaa;
    cursor: not-allowed;
}

.map-container {
    width: 100%;
    min-height: 450px;
    border-radius: 7px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
    background: #f0f0f0;
}

/* ---- FORM PANEL ---- */

.form-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-panel .section-title {
    margin-bottom: 16px;
}

.selected-school-info {
    background: #f7f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

.info-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 5px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #555;
    min-width: 58px;
    flex-shrink: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.info-value {
    color: #1a1a1a;
    font-size: 13px;
    word-break: break-word;
}

.info-link {
    color: #236192;
}

/* ---- INFO PANEL: two-column layout with photo thumbnail ---- */

.info-with-photo {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.info-photo-col {
    position: relative;
    flex-shrink: 0;
}

.info-photo-thumb {
    width: 140px;
    height: 80px; /* 7:4 ratio — matches 280×160 map popup */
    border-radius: 6px;
    overflow: hidden;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.info-photo-thumb picture {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.info-photo-thumb picture img,
.info-photo-thumb > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.info-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e8e8e8;
    padding: 10px;
    box-sizing: border-box;
}

.info-photo-placeholder-link {
    font-size: 11px;
    color: #236192;
    text-align: center;
    cursor: pointer;
    line-height: 1.3;
    text-decoration: none;
}

.info-photo-placeholder-link:hover {
    text-decoration: underline;
}

.info-photo-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.52);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 0;
    line-height: 1;
}

.info-photo-delete:hover {
    background: rgba(220, 38, 38, 0.85);
}

.info-photo-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-photo-upload-btn {
    display: block;
    width: 140px;
    margin-top: 5px;
    padding: 4px 0;
    font-size: 10px;
    font-family: inherit;
    color: #236192;
    background: none;
    border: 1px solid #c5d5e4;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    line-height: 1.3;
    white-space: normal;
}

.info-photo-upload-btn:hover {
    background: #edf3f8;
    border-color: #236192;
}

.info-photo-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.info-text-col {
    flex: 1;
    min-width: 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 7px;
    letter-spacing: 0.1px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    font-size: 14px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.form-input:focus {
    border-color: #236192;
    box-shadow: 0 0 0 3px rgba(35, 97, 146, 0.1);
}

.form-input:disabled {
    background: #f9f9f9;
    color: #aaa;
    cursor: not-allowed;
}

/* ---- TYPE CHECKBOXES ---- */

.type-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.type-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #1a1a1a;
    user-select: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.1s;
}

.type-checkbox-item:hover {
    background: #f4f6f8;
}

.type-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #236192;
    flex-shrink: 0;
}

.type-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    display: inline-block;
}

/* ---- FORM ACTIONS ---- */

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
}

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

.btn-primary {
    background: #236192;
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: #1c4e76;
}

.btn-secondary {
    background: #eeeeee;
    color: #1a1a1a;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e2e2;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

/* ============================================================
   SECTION 2 — SCHOOL LIST
   ============================================================ */

.list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.list-controls-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.sort-controls,
.filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-controls {
    display: flex;
    align-items: center;
}

.control-search {
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    font-size: 13px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    font-family: inherit;
    width: 200px;
    transition: border-color 0.15s, width 0.2s ease;
}

.control-search:focus {
    border-color: #236192;
    width: 260px;
}

.control-search::-webkit-search-cancel-button {
    cursor: pointer;
}

.control-label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.control-select {
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    font-size: 13px;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.control-select:focus {
    border-color: #236192;
}

.sort-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.sort-btn:hover {
    background: #f0f0f0;
}

.sort-btn.active {
    background: #236192;
    color: #ffffff;
    border-color: #236192;
}

/* ---- SCHOOL LIST ---- */

.schools-list {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.school-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
    transition: background 0.1s;
}

.school-row:last-child {
    border-bottom: none;
}

.school-row:hover:not(.editing-dimmed) {
    background: #fafafa;
}

.school-row.editing-dimmed {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.school-info {
    flex: 1;
    min-width: 0;
}

.school-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.school-address {
    font-size: 12px;
    color: #777;
    margin-bottom: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.school-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.type-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.6;
}

.school-date {
    font-size: 11px;
    color: #aaa;
}

.school-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ---- EMPTY / LOADING STATES ---- */

.loading-message,
.empty-message,
.error-message-list {
    padding: 40px 24px;
    text-align: center;
    color: #aaa;
    font-size: 14px;
}

.error-message-list {
    color: #dc2626;
    background: #fef2f2;
}

/* ============================================================
   DELETE CONFIRMATION MODAL
   ============================================================ */

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

.modal {
    background: #ffffff;
    border-radius: 10px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.modal-text {
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================================
   USERS MANAGEMENT MODAL
   ============================================================ */

.users-modal {
    width: 100%;
    max-width: 480px;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

.users-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.users-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.users-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.12s, color 0.12s;
}

.users-modal-close:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

.users-modal-hint {
    font-size: 12px;
    color: #888;
    padding: 10px 24px 0;
    flex-shrink: 0;
}

.users-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 0;
    flex-shrink: 0;
}

.users-email-group {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
}

.users-email-prefix {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 7px 0 0 7px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s;
}

.users-email-prefix:focus {
    border-color: #236192;
    box-shadow: inset 0 0 0 1px #236192;
}

.users-email-suffix {
    padding: 8px 10px;
    background: #f4f4f4;
    border: 1px solid #e0e0e0;
    border-left: none;
    border-radius: 0 7px 7px 0;
    font-size: 13px;
    color: #777;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.users-add-error {
    font-size: 12px;
    color: #dc2626;
    padding: 6px 24px 0;
    min-height: 20px;
    flex-shrink: 0;
}

/* ---- Scrollable list ---- */

.users-list {
    overflow-y: auto;
    margin: 12px 0 0;
    border-top: 1px solid #f0f0f0;
    flex: 1;
    max-height: 272px;
    padding-bottom: 8px;
}

.users-loading,
.users-empty,
.users-error {
    padding: 28px 24px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
}

.users-error {
    color: #dc2626;
}

/* ---- User list item with slide-to-reveal actions ---- */

.uitem {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #f4f4f4;
}

.uitem:last-child {
    border-bottom: none;
}

.uitem-face {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 11px 16px 11px 24px;
    background: #fff;
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
}

.uitem.slide-promote .uitem-face,
.uitem.slide-demote .uitem-face,
.uitem.slide-delete .uitem-face {
    transform: translateX(-90px);
}

.uitem-email {
    font-size: 14px;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* Fixed-width columns so badges and buttons align across all rows */

.uitem-badge-col {
    width: 74px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.uitem-actions-col {
    width: 60px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Badges */

.uitem-badge {
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.uitem-badge-vlastnik {
    color: #009DDC;
    background: #e8f6fd;
}

.uitem-badge-spravce {
    color: #236192;
    background: #e8edf2;
}

/* Gear icon — filled SVG via CSS mask, 30×30px */

.uitem-gear {
    width: 30px;
    height: 30px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.12s;
    font-size: 0;
}

.uitem-gear::before {
    content: '';
    width: 15px;
    height: 15px;
    background-color: #aaa;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54C14.35 2.57 14.16 2.4 13.92 2.4h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.56-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.13.2-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94 0 .31.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.03-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54C14.35 2.57 14.16 2.4 13.92 2.4h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.56-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.13.2-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94 0 .31.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.03-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

.uitem-gear:hover {
    background-color: #eef3f8;
}

.uitem-gear:hover::before {
    background-color: #236192;
}

/* Dismiss (×) button — 28×28px */

.uitem-dismiss {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #bbb;
    line-height: 1;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.uitem-dismiss:hover {
    background: #f0f0f0;
    color: #666;
}

/* Revealed action buttons */

.uitem-action-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 90px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 0;
}

.uitem-promote-btn {
    background: #236192;
    color: #fff;
}

.uitem-promote-btn:hover { background: #1c4e76; }

.uitem-demote-btn {
    background: #d97706;
    color: #fff;
}

.uitem-demote-btn:hover { background: #b45309; }

.uitem-delete-btn {
    background: #dc2626;
    color: #fff;
}

.uitem-delete-btn:hover { background: #b91c1c; }

.uitem.slide-promote .uitem-promote-btn { display: flex; }
.uitem.slide-demote  .uitem-demote-btn  { display: flex; }
.uitem.slide-delete  .uitem-delete-btn  { display: flex; }

/* ============================================================
   GOOGLE PLACES AUTOCOMPLETE DROPDOWN — Z-INDEX FIX
   ============================================================ */

.pac-container {
    z-index: 9999 !important;
    border-radius: 0 0 7px 7px;
    border: 1px solid #e0e0e0;
    border-top: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.pac-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.pac-item:hover {
    background: #f4f6f8;
}

/* ============================================================
   RESPONSIVE — TABLET PORTRAIT & MOBILE (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {

    /* ---- Navbar ---- */

    .navbar {
        padding: 0 16px;
    }

    .navbar-logo {
        width: 90px;
    }

    .navbar-sep {
        margin: 0 10px;
        height: 22px;
    }

    .navbar-title {
        font-size: 13px;
    }

    .user-name {
        display: none;
    }

    /* ---- Main content ---- */

    .main-content {
        padding: 16px;
    }

    .section {
        padding: 18px 16px;
    }

    /* ---- Section 1: stack map above form ---- */

    .section-columns {
        grid-template-columns: 1fr;
    }

    .map-container {
        min-height: 300px;
    }

    /* ---- List controls: wrap onto two lines ---- */

    .list-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-controls-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .control-select,
    .control-search {
        width: 100%;
    }

    .control-search:focus {
        width: 100%;
    }

    /* ---- School rows: stack info and buttons ---- */

    .school-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .school-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* ---- Modal ---- */

    .modal {
        padding: 24px 20px 20px;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
