:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --muted: #6b7280;
    --text: #0f172a;
    --accent: #3b82f6;
    --accent-strong: #2563eb;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --border: #e5e7eb;
    --shadow: 0 10px 28px rgba(15,23,42,0.08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 6px 0 20px rgba(0,0,0,0.02);
}
.brand { font-weight: 700; letter-spacing: 0.5px; margin-bottom: 12px; color: var(--accent-strong); }
.nav { display: flex; flex-direction: column; gap: 10px; }
.nav a { padding: 8px 10px; border-radius: 8px; color: var(--text); border: 1px solid transparent; }
.nav a:hover { background: #eef2ff; color: var(--accent-strong); border-color: #e0e7ff; text-decoration: none; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #ffffff;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0; z-index: 5;
}
.user-area { display: flex; align-items: center; gap: 10px; }

.container { padding: 20px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.muted { color: var(--muted); }
.btn {
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform .1s ease, box-shadow .1s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(37,99,235,0.25); }
.btn.secondary { background: #e5e7eb; color: #111827; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.warning { background: var(--warning); color: #111827; }

.btn-landing-page {
    display: inline-block;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(90deg, #e12e8b 0%, #b3117e 100%);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 600;
}


label { display: block; margin: 8px 0 4px; color: var(--muted); }
input, select, textarea {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
.table th, .table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}
.table th { text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px; }
.table tr:hover { background: #f8fafc; }

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
}
.alert.success { background: #ecfdf3; color: #16a34a; border: 1px solid #bbf7d0; }
.alert.error { background: #fef2f2; color: #dc2626; border: 1px solid #fecdd3; }

.status {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}
.status.livre { background: #ecfdf3; color: #16a34a; }
.status.reservada { background: #fff7ed; color: #f59e0b; }
.status.paga { background: #fef2f2; color: #dc2626; }
.status.cortesia { background: #eff6ff; color: #2563eb; }
.status.bloqueada { background: #f1f5f9; color: #475569; }
.status.emtroca { background: #f3e8ff; color: #9333ea; }

.footer {
    padding: 16px;
    text-align: center;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 24px;
    background: #ffffff;
}

.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.justify-between { justify-content: space-between; }

.map-panel { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; }
.map-panel > div { min-width: 0; }
@media (max-width: 900px) { .map-panel { grid-template-columns: 1fr; } }

.map-frame {
    background: #1d1a25;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: auto;
    min-height: 420px;
    height: 70vh;
    max-height: 75vh;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}
.zoom-controls .btn {
    padding: 6px 10px;
}
.zoom-level {
    font-size: 12px;
    color: var(--muted);
}
.map-actions { background: var(--card); padding: 12px; border-radius: 12px; border:1px solid var(--border); }

.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.booth-clickable:hover { outline: 2px dashed var(--accent); }
.actions-col { display: flex; gap: 8px; flex-direction: column; align-items: flex-start; }
.checkbox-inline { display:flex; align-items:center; gap:8px; }
.table-scroll { max-height: 320px; overflow:auto; }
.color-preview { display:inline-flex; align-items:center; gap:6px; font-size:12px; }
.color-swatch { width:18px; height:18px; border-radius:4px; border:1px solid var(--border); display:inline-block; }

.map-canvas {
    position: relative;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: top left;
    display: inline-block;
}
.hotspot {
    position: absolute;
    background: rgba(37,99,235,0.28);
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.05;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
}
.hotspot.selected { outline: 2px solid var(--accent-strong); }
.hotspot .resize-handle { display: none; }
.map-canvas[data-mode="editor"] .hotspot .resize-handle { display: block; }
.hotspot.status-paga { background: rgba(239,68,68,0.26); }
.hotspot.status-reservada { background: rgba(245,158,11,0.26); }
.hotspot.status-cortesia { background: rgba(59,130,246,0.26); }
.hotspot.status-bloqueada { background: rgba(148,163,184,0.26); }
.hotspot.status-livre { background: rgba(34,197,94,0.22); }
.hotspot.status-emtroca { background: rgba(192,132,252,0.26); }
.shape-square { border-radius: 6px; }
.shape-circle { border-radius: 999px; }
.shape-triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.shape-star { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

.log-level-info { background: #e0f2fe; }
.log-level-warn { background: #fffbeb; }
.log-level-error { background: #fee2e2; }
.log-level-security { background: #fff7ed; }
.log-level-system { background: #eef2ff; }

.pill { padding: 4px 8px; background: #e5e7eb; border-radius: 8px; font-size: 12px; }
.pill-highlight { background: #dbeafe; border: 1px solid #60a5fa; color: #0f172a; box-shadow: 0 1px 4px rgba(37,99,235,0.18); }
.client-row.selected { background: #e0f2fe; box-shadow: inset 4px 0 0 #2563eb; }
.select-client-btn.active { background: #2563eb; color: #fff; }
