* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0b1320;
    color: #eef4ff;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #101b2d;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand {
    font-size: 22px;
    font-weight: 700;
}

.nav a {
    color: #d4e2ff;
    margin-left: 16px;
    text-decoration: none;
}

.page {
    padding: 24px;
}

.layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sidebar-card,
.content-card {
    background: #122033;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.form-block input,
.form-block textarea,
.form-block select,
.form-block button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #0d1828;
    color: #fff;
}

.form-block textarea {
    min-height: 80px;
    resize: vertical;
}

.form-block button {
    cursor: pointer;
    background: #1b8f68;
    border: none;
}

.maps-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0d1828;
    color: #dce8ff;
    text-decoration: none;
}

.map-link.active {
    outline: 2px solid #22c38a;
}

.map-stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.map-image {
    display: block;
    max-width: 100%;
    border-radius: 16px;
}

.pot-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    text-decoration: none;
}

.pot-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16, 40, 65, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1ed29b;
    box-shadow: 0 0 18px rgba(30,210,155,.35);
    font-size: 18px;
}

.pot-icon.light-on {
    border-color: #ffd34d;
    box-shadow: 0 0 18px rgba(255,211,77,.45);
}

.pot-icon.offline {
    opacity: 0.5;
}

.pot-label {
    margin-top: 6px;
    min-width: 110px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(9, 17, 29, 0.92);
    color: #fff;
    text-align: center;
    font-size: 12px;
}

.pot-name {
    font-weight: 700;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.muted {
    opacity: 0.75;
    font-size: 13px;
}

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    width: 360px;
    padding: 24px;
    border-radius: 18px;
    background: #122033;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.login-box input,
.login-box button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #0d1828;
    color: #fff;
}

.login-box button {
    border: none;
    background: #1b8f68;
    cursor: pointer;
}

.error {
    color: #ff8f8f;
    margin-bottom: 8px;
}

.hint {
    margin-top: 12px;
    opacity: .75;
    font-size: 13px;
}

.table-like {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.row-item {
    display: grid;
    grid-template-columns: 1fr 1fr 120px;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #0d1828;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-box {
    margin-top: 20px;
    padding: 18px;
    border-radius: 14px;
    background: #0d1828;
}

.back-link {
    color: #dce8ff;
    text-decoration: none;
}

.empty-state {
    padding: 60px;
    text-align: center;
    opacity: 0.8;
}
.coord-box {
    margin-top: 10px;
}

.coord-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    opacity: 0.8;
}

.click-map-stage {
    cursor: crosshair;
}

.placement-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20;
}

.placement-marker.hidden {
    display: none;
}

.placement-cross {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px dashed #58d5ff;
    box-shadow: 0 0 18px rgba(88, 213, 255, 0.35);
    background: rgba(88, 213, 255, 0.12);
}

.placement-cross::before,
.placement-cross::after {
    content: "";
    position: absolute;
    background: #58d5ff;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.placement-cross::before {
    width: 2px;
    height: 18px;
}

.placement-cross::after {
    width: 18px;
    height: 2px;
}

.placement-label {
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(9, 17, 29, 0.92);
    color: #fff;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}
.draggable-pot {
    cursor: grab;
    user-select: none;
}

.draggable-pot.dragging {
    cursor: grabbing;
    z-index: 50;
}

.draggable-pot.dragging .pot-icon {
    transform: scale(1.08);
    box-shadow: 0 0 24px rgba(88, 213, 255, 0.55);
}

.saved-flash .pot-icon {
    animation: potSavedFlash 0.45s ease;
}

@keyframes potSavedFlash {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.14);
        box-shadow: 0 0 28px rgba(34, 195, 138, 0.75);
    }
    100% {
        transform: scale(1);
    }
}
.pot-meta {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.pot-icon.online {
    opacity: 1;
}

.pot-icon.offline {
    opacity: 0.45;
    border-color: #7f8ea3;
    box-shadow: none;
}
.layout-3 {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    gap: 20px;
}

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

.events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    max-height: 75vh;
    overflow: auto;
    padding-right: 4px;
}

.event-card {
    padding: 12px;
    border-radius: 12px;
    background: #0d1828;
    border-left: 4px solid rgba(255,255,255,0.15);
}

.event-card.severity-info {
    border-left-color: #4da3ff;
}

.event-card.severity-warning {
    border-left-color: #ffbf47;
}

.event-card.severity-critical {
    border-left-color: #ff6363;
}

.event-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.event-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .9;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
}

.event-time {
    font-size: 11px;
    opacity: .7;
}

.event-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.event-message {
    font-size: 13px;
    opacity: .88;
    line-height: 1.35;
}

.pot-icon.low-water {
    border-color: #ffbf47;
    box-shadow: 0 0 18px rgba(255,191,71,0.55);
}

@media (max-width: 1400px) {
    .layout-3 {
        grid-template-columns: 320px 1fr;
    }
}

@media (max-width: 980px) {
    .layout-3 {
        grid-template-columns: 1fr;
    }
}
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 14px 0 18px;
}

.filters-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #0d1828;
    color: #dce8ff;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.08);
}

.filter-pill.active {
    background: #1b8f68;
    color: #fff;
    border-color: transparent;
}

.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.search-form input {
    min-width: 260px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #0d1828;
    color: white;
}

.search-form button,
.btn-danger {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: #a73939;
    color: #fff;
}

.search-form button {
    background: #1b8f68;
}

.table-card {
    margin-top: 20px;
    padding: 18px;
    border-radius: 16px;
    background: #0d1828;
}

.pots-table-wrap {
    margin-top: 14px;
    overflow: auto;
}

.pots-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.pots-table th,
.pots-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    vertical-align: top;
}

.pots-table th {
    font-size: 13px;
    opacity: 0.8;
}

.row-alert {
    background: rgba(255, 191, 71, 0.08);
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-btn {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 8px;
    background: #1b8f68;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
}

.mini-btn.danger {
    background: #a73939;
}