:root {
    --bg: #0f172a;
    --surface: #111827;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #23d7ff;
    --primary-2: #0ea5c9;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #15803d;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #08111a;
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: linear-gradient(180deg, #07131d, #0a1722);
    color: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 48px; height: 48px; border-radius: 16px;
    background: linear-gradient(135deg, #39e6ff, #1778ff);
    color: #031018; display: grid; place-items: center;
    font-weight: 900; letter-spacing: -1px;
}
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: rgba(255,255,255,.68); font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 8px; }
nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255,255,255,.78);
    transition: .18s;
}
nav a:hover, nav a.active { background: rgba(61,231,255,.12); color: white; }
.user-card {
    margin-top: auto;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 14px;
}
.user-card span, .user-card strong { display: block; }
.user-card span { color: rgba(255,255,255,.72); }
.user-card strong { margin-top: 4px; }

.main { margin-left: 260px; padding: 34px; min-height: 100vh; }
.login-main { margin-left: 0; padding: 0; }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}
.page-header h1 { margin: 4px 0 10px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }
.page-header p { color: var(--muted); margin: 0; max-width: 850px; }
.eyebrow { color: var(--primary) !important; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
}
.btn.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn.small { padding: 7px 10px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.full { width: 100%; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.kpi {
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.kpi span { color: var(--muted); font-size: 13px; display: block; }
.kpi strong { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -.03em; }
.kpi.alert strong { color: var(--danger); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.panel.wide { min-height: 100%; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.panel-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.panel-head p { color: var(--muted); margin: 5px 0 0; }
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 800; text-transform: uppercase;
}
.badge.success, .message-box.success { background: #dcfce7; color: #166534; }
.badge.warning, .message-box.warning { background: #fef3c7; color: #92400e; }
.badge.danger, .message-box.danger { background: #fee2e2; color: #991b1b; }
.badge.muted { background: #f1f5f9; color: #475569; }
.map { height: 430px; border-radius: 18px; overflow: hidden; background: #dbeafe; border: 1px solid var(--line); }
.small-map { height: 250px; margin-top: 18px; }

.alert-list { display: grid; gap: 10px; }
.alert-row {
    display: block;
    border: 1px solid var(--line);
    border-left-width: 5px;
    padding: 14px;
    border-radius: 16px;
    background: var(--panel-soft);
}
.alert-row strong, .alert-row span { display: block; }
.alert-row span { margin-top: 5px; color: var(--muted); }
.alert-row.danger { border-left-color: var(--danger); }
.alert-row.warning { border-left-color: var(--warning); }
.alert-row.success { border-left-color: var(--success); }

.card-grid { display: grid; gap: 14px; }
.card-grid.two { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
.device-card, .soil-widget, .meteo-widget {
    display: block;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    background: var(--panel-soft);
    transition: .18s;
}
.device-card:hover, .soil-widget:hover, .meteo-widget:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15,23,42,.08); }
.device-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.device-top h3, .soil-widget h3, .meteo-widget h3 { margin: 0; font-size: 17px; }
.device-top p, .soil-widget p, .meteo-widget p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.device-icon {
    width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 900;
    background: #d1fae5; color: var(--primary);
}
.metric-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.metric-row.compact { grid-template-columns: repeat(2, 1fr); }
.metric-row div {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
}
.metric-row span { display: block; color: var(--muted); font-size: 12px; }
.metric-row strong { display: block; margin-top: 4px; }
.device-message { color: var(--muted); margin: 12px 0 0; font-size: 13px; }
.valve-list { display: grid; gap: 12px; }
.valve-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: var(--panel-soft);
}
.valve-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.muted-text { color: var(--muted); }

.sensor-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.sensor-hero div { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.sensor-hero span, .sensor-hero small { color: var(--muted); display: block; }
.sensor-hero strong { display: block; margin: 6px 0; font-size: 20px; }
.message-box { padding: 14px; border-radius: 16px; font-weight: 700; }
.info-list { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 700; word-break: break-word; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px; vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.admin-table input, .admin-table select, .filter-form input, .filter-form select, .form-stack input {
    width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: white;
}
.admin-table input:disabled, .admin-table select:disabled { background: #f1f5f9; color: #64748b; }
.mini-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.center { text-align: center; }
.filter-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto auto; gap: 12px; align-items: end; }
.filter-form label, .form-stack label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
.report-kpis { grid-template-columns: repeat(5, 1fr); }

.flash-wrap { position: sticky; top: 10px; z-index: 1200; display: grid; gap: 8px; margin-bottom: 14px; }
.flash { border-radius: 14px; padding: 12px 14px; font-weight: 700; background: white; border: 1px solid var(--line); }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.success { background: #dcfce7; color: #166534; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at top left, rgba(61,231,255,.35), transparent 28%), linear-gradient(135deg, #051018, #111827); }
.login-card { width: min(460px, 100%); background: white; border-radius: 28px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.login-brand { color: #0f172a; margin-bottom: 20px; }
.login-brand span { color: var(--muted); }
.login-card h1 { margin: 0 0 8px; font-size: 34px; }
.login-card p { color: var(--muted); }
.form-stack { display: grid; gap: 14px; margin-top: 20px; }

.marker-dot {
    width: 18px; height: 18px; border-radius: 999px;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.marker-dot.pump { background: #22d3ee; }
.marker-dot.soil8in1 { background: #2dd4bf; }
.marker-dot.valve { background: #38bdf8; }
.marker-dot.meteo { background: #67e8f9; }
.marker-dot.alert { box-shadow: 0 0 0 6px rgba(220, 38, 38, .25), 0 2px 10px rgba(0,0,0,.28); }

@media (max-width: 1100px) {
    .sidebar { position: static; width: auto; }
    .main { margin-left: 0; padding: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .kpi-grid, .report-kpis { grid-template-columns: repeat(2, 1fr); }
    .card-grid.two, .sensor-hero, .filter-form { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Mobile OpenRemote-style dashboard skin
   -------------------------------------------------------------------------- */
.mobile-bottom-nav { display: none; }
.mobile-dashboard {
    --mobile-bg: #071018;
    --mobile-panel: rgba(16, 27, 37, 0.84);
    --mobile-panel-2: rgba(10, 20, 29, 0.92);
    --mobile-line: rgba(139, 166, 180, 0.22);
    --mobile-text: #f4f8fb;
    --mobile-muted: #95a3af;
    --mobile-cyan: #3de7ff;
    --mobile-cyan-soft: rgba(61, 231, 255, 0.14);
    background:
        radial-gradient(circle at 18% 0%, rgba(61, 231, 255, 0.11), transparent 34%),
        radial-gradient(circle at 95% 18%, rgba(55, 126, 255, 0.10), transparent 34%),
        linear-gradient(160deg, #071018, #0a121a 45%, #05090f);
    color: var(--mobile-text);
    border-radius: 34px;
    padding: 24px;
    box-shadow: 0 35px 80px rgba(0,0,0,.38);
    max-width: 1120px;
    margin: 0 auto;
}
.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.icon-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #fff;
    font-size: 25px;
    cursor: pointer;
}
.mobile-brand strong { font-size: 28px; letter-spacing: -.05em; }
.mobile-brand span { color: var(--mobile-cyan); }
.mobile-page-title { margin-bottom: 16px; }
.mobile-page-title p { margin: 0 0 4px; color: var(--mobile-cyan); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.mobile-page-title h1 { margin: 0; font-size: clamp(34px, 5vw, 46px); letter-spacing: -.06em; }
.mobile-widget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.glass-card {
    border: 1px solid var(--mobile-line);
    background:
        linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
        var(--mobile-panel);
    border-radius: 20px;
    padding: 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 50px rgba(0,0,0,.22);
    min-width: 0;
}
.widget-title { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.widget-title h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.line-icon {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    border-radius: 11px;
    color: var(--mobile-cyan);
    border: 1px solid rgba(61,231,255,.28);
    background: var(--mobile-cyan-soft);
    font-weight: 900;
}
.pump-list { display: grid; gap: 0; }
.pump-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--mobile-line);
}
.pump-row:last-child { border-bottom: 0; }
.pump-name { font-weight: 800; font-size: 18px; color: var(--mobile-text); }
.state-pill {
    border: 0;
    border-radius: 12px;
    color: white;
    font-weight: 900;
    padding: 9px 12px;
    min-width: 98px;
    cursor: pointer;
    letter-spacing: .02em;
    box-shadow: 0 10px 22px rgba(0,0,0,.28);
}
.state-pill.on { background: linear-gradient(180deg, #1fa664, #137744); }
.state-pill.off { background: linear-gradient(180deg, #586272, #2d3542); }
.state-pill:disabled { opacity: .65; cursor: wait; }
.pump-live-values {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.pump-live-values span {
    color: var(--mobile-muted);
    font-size: 12px;
    background: rgba(3, 8, 14, .38);
    border: 1px solid rgba(139,166,180,.13);
    border-radius: 12px;
    padding: 8px;
}
.pump-live-values b { color: var(--mobile-cyan); font-size: 16px; }
.pump-row.is-off .pump-live-values b,
.valve-row.is-off b[data-pressure],
.valve-row.is-off b[data-flow] { color: #7e8b98; }
.weather-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    color: inherit;
}
.weather-metrics div { padding: 0 14px 16px 0; border-right: 1px solid var(--mobile-line); }
.weather-metrics div:nth-child(2n) { border-right: 0; padding-left: 14px; }
.weather-metrics span, .metric-label { display: block; color: var(--mobile-muted); font-size: 15px; }
.weather-metrics strong { display: block; color: var(--mobile-cyan); font-size: 27px; line-height: 1.1; margin-top: 6px; }
.forecast-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--mobile-line);
    padding-top: 12px;
    gap: 8px;
    text-align: center;
}
.forecast-strip b { color: var(--mobile-muted); font-size: 12px; }
.forecast-strip span { display: block; font-size: 22px; margin: 4px 0; }
.forecast-strip small { color: #d9e3ea; }
.soil-card { margin-bottom: 16px; }
.sensor-grid-8 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    color: inherit;
    border: 1px solid var(--mobile-line);
    border-radius: 16px;
    overflow: hidden;
}
.sensor-grid-8 div {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 2px 12px;
    padding: 16px;
    min-height: 86px;
    border-right: 1px solid var(--mobile-line);
    border-bottom: 1px solid var(--mobile-line);
}
.sensor-grid-8 div:nth-child(4n) { border-right: 0; }
.sensor-grid-8 div:nth-last-child(-n+4) { border-bottom: 0; }
.sensor-grid-8 span { grid-row: 1 / 3; align-self: center; color: var(--mobile-cyan); font-weight: 900; font-size: 24px; }
.sensor-grid-8 small { color: var(--mobile-muted); font-size: 14px; }
.sensor-grid-8 strong { color: var(--mobile-cyan); font-size: 25px; line-height: 1.05; }
.big-number { display: block; color: var(--mobile-cyan); font-size: 33px; margin: 6px 0 12px; letter-spacing: -.04em; }
.medium-number { display: block; color: var(--mobile-cyan); font-size: 29px; margin: 6px 0 8px; }
.divider { border-top: 1px solid var(--mobile-line); padding-top: 14px; }
.water-ripple { position: relative; height: 68px; margin-top: -8px; }
.water-ripple span {
    position: absolute;
    left: 50%; top: 54%;
    width: 115px; height: 34px;
    border: 2px solid rgba(61,231,255,.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 22px rgba(61,231,255,.2);
}
.water-ripple span:nth-child(2) { width: 86px; height: 25px; opacity: .75; }
.water-ripple span:nth-child(3) { width: 46px; height: 14px; opacity: .9; }
.pressure-number { display: block; color: var(--mobile-cyan); font-size: 42px; margin: 8px 0 0; letter-spacing: -.05em; }
.pressure-chart { width: 100%; height: 150px; margin-top: 8px; }
.grid-line { stroke: rgba(139,166,180,.17); stroke-width: 1; fill: none; }
.chart-fill { fill: url(#pressureFill); }
.chart-line { stroke: var(--mobile-cyan); stroke-width: 3; fill: none; filter: drop-shadow(0 0 8px rgba(61,231,255,.5)); }
.chart-dot { fill: rgba(61,231,255,.18); stroke: var(--mobile-cyan); stroke-width: 4; }
.wide-card { grid-column: span 1; }
.compact-head { color: var(--mobile-text); }
.compact-head h2 { color: var(--mobile-text); }
.compact-head p { color: var(--mobile-muted); }
.dark-map { height: 380px; border-color: var(--mobile-line); background: #0d1720; }
.alert-list.neon-alerts .alert-row {
    background: rgba(3, 8, 14, .34);
    color: var(--mobile-text);
    border-color: var(--mobile-line);
}
.alert-list.neon-alerts .alert-row span { color: var(--mobile-muted); }
.neon-valves .valve-row {
    background: rgba(3, 8, 14, .34);
    border-color: var(--mobile-line);
    color: var(--mobile-text);
}
.neon-valves .valve-row span, .neon-valves .valve-row small { display: block; color: var(--mobile-muted); margin-top: 4px; }
.neon-valves .valve-row strong { color: var(--mobile-text); }
.visually-hidden { position: absolute; left: -9999px; }

@media (min-width: 1101px) {
    .mobile-dashboard { border-radius: 28px; }
}

@media (max-width: 780px) {
    body { background: #05090f; }
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 0; min-height: 100vh; background: #05090f; }
    .mobile-dashboard {
        min-height: 100vh;
        border-radius: 0;
        padding: 22px 16px 94px;
        box-shadow: none;
    }
    .mobile-widget-grid,
    .top-widgets,
    .bottom-widgets,
    .map-alert-widgets { grid-template-columns: 1fr; }
    .top-widgets { grid-template-columns: 1fr; }
    .pump-live-values { grid-template-columns: 1fr 1fr 1fr; }
    .sensor-grid-8 { grid-template-columns: repeat(2, 1fr); }
    .sensor-grid-8 div:nth-child(4n) { border-right: 1px solid var(--mobile-line); }
    .sensor-grid-8 div:nth-child(2n) { border-right: 0; }
    .sensor-grid-8 div:nth-last-child(-n+4) { border-bottom: 1px solid var(--mobile-line); }
    .sensor-grid-8 div:nth-last-child(-n+2) { border-bottom: 0; }
    .weather-metrics strong { font-size: 26px; }
    .glass-card { padding: 16px; border-radius: 18px; }
    .map { height: 320px; }
    .page-header { padding: 22px 16px 0; color: white; }
    .panel { margin: 0 16px 18px; background: #101b25; color: white; border-color: rgba(139,166,180,.22); }
    .mobile-bottom-nav {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
        padding: 8px 10px 13px;
        background: rgba(7, 16, 24, .92);
        border-top: 1px solid rgba(139,166,180,.18);
        backdrop-filter: blur(18px);
        z-index: 1500;
    }
    .mobile-bottom-nav a {
        color: #8e99a6;
        font-size: 12px;
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 4px;
    }
    .mobile-bottom-nav a span { font-size: 21px; }
    .mobile-bottom-nav a.active { color: var(--mobile-cyan); }
    .table-wrap { background: white; border-radius: 14px; }
}

@media (max-width: 430px) {
    .mobile-brand strong { font-size: 25px; }
    .pump-name { font-size: 16px; }
    .state-pill { min-width: 88px; padding: 8px 9px; font-size: 12px; }
    .forecast-strip { gap: 4px; }
    .sensor-grid-8 div { grid-template-columns: 38px 1fr; padding: 13px; }
    .sensor-grid-8 strong { font-size: 22px; }
}


.first-map-row .wide-card { min-height: 100%; }
.sensor-grid-uniform span { font-size: 18px; letter-spacing: -.03em; min-width: 40px; }
.sensor-grid-uniform span:nth-child(1) { font-size: 18px; }
.sensor-grid-uniform small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-card-first .badge.muted { background: rgba(61,231,255,.12); color: var(--mobile-cyan); border: 1px solid rgba(61,231,255,.18); }
.valves-card { margin-top: 16px; }

/* --------------------------------------------------------------------------
   V3 responsive mobile-first polish, full map page, clusters and live widgets
   -------------------------------------------------------------------------- */
.mobile-dashboard,
.map-page-shell {
    max-width: 460px;
    margin: 0 auto;
    border-radius: 36px;
}
.mobile-dashboard {
    padding: 22px 15px 92px;
}
.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: 4px;
    backdrop-filter: blur(16px);
}
.mobile-page-title h1 {
    font-size: 39px;
    line-height: 1;
}
.live-status {
    margin: 8px 0 0 !important;
    color: var(--mobile-muted) !important;
    font-size: 12px !important;
    letter-spacing: .02em !important;
    text-transform: none !important;
}
.glass-card {
    border-radius: 18px;
    background:
        radial-gradient(circle at 0 0, rgba(61, 231, 255, .07), transparent 36%),
        linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
        rgba(11, 22, 32, .9);
}
.mobile-widget-grid,
.top-widgets,
.bottom-widgets,
.map-alert-widgets {
    grid-template-columns: 1fr;
}
.first-map-row { margin-bottom: 16px; }
.dark-map { height: 270px; }
.map-card-first .compact-head {
    margin-bottom: 12px;
}
.map-card-first .compact-head p {
    font-size: 12px;
}
.pumps-card { order: 1; }
.valves-card { order: 2; }
.weather-metrics strong,
.sensor-grid-8 strong,
.big-number,
.medium-number,
.pressure-number,
.pump-live-values b {
    text-shadow: 0 0 15px rgba(61,231,255,.25);
}
.state-pill.on {
    background: linear-gradient(180deg, rgba(61,231,255,.95), rgba(12,144,171,.85));
    color: #031018;
}
.state-pill.off {
    background: linear-gradient(180deg, #4d5a66, #202a34);
    color: #d8e5ec;
}
.sensor-grid-uniform span {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(61,231,255,.32);
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(61,231,255,.08);
    font-size: 14px !important;
    color: var(--mobile-cyan);
}
.sensor-grid-8 div {
    min-height: 78px;
}
.valve-row {
    transition: transform .18s ease, border-color .18s ease;
}
.valve-row:not(.is-off), .pump-row:not(.is-off) {
    border-color: rgba(61,231,255,.24);
}
.valve-row:not(.is-off) {
    box-shadow: inset 0 0 0 1px rgba(61,231,255,.05), 0 0 24px rgba(61,231,255,.05);
}
.marker-dot {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.82);
    display: grid;
    place-items: center;
    color: #031018;
    font-weight: 900;
    box-shadow: 0 0 0 5px rgba(61,231,255,.13), 0 12px 24px rgba(0,0,0,.32);
}
.marker-dot span { font-size: 14px; line-height: 1; }
.marker-dot.pump { background: #39e6ff; }
.marker-dot.valve { background: #67e8f9; }
.marker-dot.soil8in1 { background: #2dd4bf; }
.marker-dot.meteo { background: #a5f3fc; }
.marker-dot.alert {
    box-shadow: 0 0 0 7px rgba(239, 68, 68, .24), 0 12px 24px rgba(0,0,0,.32);
}
.cluster-bubble {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 25%, #e7fbff, #39e6ff 58%, #0f7087);
    color: #031018;
    border: 2px solid rgba(255,255,255,.8);
    font-weight: 900;
    box-shadow: 0 0 0 7px rgba(61,231,255,.18), 0 16px 30px rgba(0,0,0,.34);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #0b1620;
    color: #f4f8fb;
    border: 1px solid rgba(61,231,255,.18);
}
.map-popup a { color: #39e6ff; font-weight: 800; }
.map-popup hr { border: 0; border-top: 1px solid rgba(139,166,180,.25); }

.map-page-shell {
    min-height: 100vh;
    color: var(--mobile-text, #f4f8fb);
    background:
        radial-gradient(circle at 18% 0%, rgba(61, 231, 255, 0.12), transparent 34%),
        radial-gradient(circle at 95% 18%, rgba(55, 126, 255, 0.10), transparent 34%),
        linear-gradient(160deg, #071018, #0a121a 45%, #05090f);
    padding: 20px 14px 92px;
}
.map-topbar { margin-bottom: 10px; }
.map-topbar .icon-button { text-align: center; line-height: 44px; }
.map-title { margin-bottom: 12px; }
.map-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 13px;
    scrollbar-width: none;
}
.map-filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
    flex: 0 0 auto;
    border: 1px solid rgba(139,166,180,.22);
    background: rgba(11,22,32,.74);
    color: #c8d5de;
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 800;
    cursor: pointer;
}
.filter-chip.active {
    background: rgba(61,231,255,.16);
    color: var(--mobile-cyan);
    border-color: rgba(61,231,255,.38);
}
.filter-chip.danger.active {
    color: #fecaca;
    border-color: rgba(248,113,113,.45);
    background: rgba(239,68,68,.14);
}
.map-live-layout {
    display: grid;
    gap: 14px;
}
.full-screen-map {
    height: min(62vh, 620px);
    min-height: 420px;
    border: 1px solid rgba(139,166,180,.22);
    border-radius: 22px;
    overflow: hidden;
    background: #0d1720;
    box-shadow: 0 25px 60px rgba(0,0,0,.32);
}
.map-side-panel {
    max-height: 34vh;
    overflow: auto;
}
.map-device-list {
    display: grid;
    gap: 10px;
}
.map-device-list a {
    display: grid;
    gap: 3px;
    padding: 12px;
    border: 1px solid rgba(139,166,180,.16);
    border-radius: 14px;
    background: rgba(3,8,14,.32);
}
.map-device-list strong { color: #f4f8fb; }
.map-device-list span,
.map-device-list small { color: #95a3af; }

@media (min-width: 781px) {
    .mobile-dashboard {
        max-width: 1120px;
        padding: 24px;
    }
    .mobile-widget-grid,
    .top-widgets,
    .bottom-widgets,
    .map-alert-widgets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .soil-card { grid-column: 1 / -1; }
    .dark-map { height: 360px; }
    .map-page-shell {
        max-width: 1180px;
        padding: 24px;
        border-radius: 30px;
    }
    .map-live-layout {
        grid-template-columns: minmax(0, 1fr) 330px;
        align-items: stretch;
    }
    .map-side-panel { max-height: min(62vh, 620px); }
}

@media (max-width: 780px) {
    .mobile-bottom-nav {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    .mobile-bottom-nav a {
        font-size: 11px;
    }
    .mobile-bottom-nav a span {
        font-size: 19px;
    }
    .sensor-grid-8 {
        grid-template-columns: repeat(2, 1fr);
    }
    .full-screen-map {
        height: 58vh;
        min-height: 390px;
    }
}

@media (max-width: 430px) {
    .mobile-dashboard,
    .map-page-shell {
        max-width: none;
        border-radius: 0;
    }
    .mobile-page-title h1 { font-size: 36px; }
    .glass-card { padding: 14px; }
    .dark-map { height: 245px; }
    .weather-metrics strong { font-size: 24px; }
    .pressure-number { font-size: 37px; }
    .full-screen-map { min-height: 360px; }
}


/* --------------------------------------------------------------------------
   V4 requested fixes: menu dropdown, ordering, active cyan nav, centered 8-in-1
   -------------------------------------------------------------------------- */
.mobile-menu-wrap {
    position: relative;
    z-index: 120;
}
.mobile-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 210px;
    padding: 8px;
    border: 1px solid rgba(61,231,255,.22);
    border-radius: 18px;
    background: rgba(8, 18, 28, .96);
    box-shadow: 0 22px 54px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter: blur(20px);
    display: none;
}
.mobile-menu-panel.open {
    display: grid;
    gap: 5px;
}
.mobile-menu-panel a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 13px;
    color: #d9e7ee;
    font-weight: 800;
}
.mobile-menu-panel a:hover,
.mobile-menu-panel a:focus {
    background: rgba(61,231,255,.12);
    color: var(--mobile-cyan, #3de7ff);
}
.header-alert-link.has-alerts {
    color: var(--mobile-cyan, #3de7ff);
    text-shadow: 0 0 16px rgba(61,231,255,.55);
}
.pumps-zone-row {
    margin-bottom: 16px;
}
.valves-card {
    margin: 0 0 16px;
}
.meteo-row {
    margin-bottom: 16px;
}
.mobile-bottom-nav a.active,
.mobile-bottom-nav a.has-alerts {
    color: var(--mobile-cyan, #3de7ff) !important;
}
.mobile-bottom-nav a.active span,
.mobile-bottom-nav a.has-alerts span {
    filter: drop-shadow(0 0 8px rgba(61,231,255,.55));
}
.sensor-grid-8.sensor-grid-uniform {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 18px;
}
.sensor-grid-8.sensor-grid-uniform div {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 11px;
    row-gap: 2px;
    min-height: 82px;
    padding: 14px 12px;
}
.sensor-grid-8.sensor-grid-uniform span {
    grid-row: 1 / 3;
    justify-self: center;
    align-self: center;
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 14px;
    font-size: 13px !important;
    line-height: 1;
}
.sensor-grid-8.sensor-grid-uniform small {
    align-self: end;
    font-size: 12px;
    line-height: 1.1;
    max-width: 100%;
    white-space: normal;
}
.sensor-grid-8.sensor-grid-uniform strong {
    align-self: start;
    font-size: 21px;
    line-height: 1.05;
    min-width: 0;
}
@media (min-width: 781px) {
    .mobile-dashboard .pumps-zone-row,
    .mobile-dashboard .meteo-row {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 430px) {
    .sensor-grid-8.sensor-grid-uniform div {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 13px 10px;
    }
    .sensor-grid-8.sensor-grid-uniform span {
        width: 34px;
        height: 34px;
        font-size: 12px !important;
    }
    .sensor-grid-8.sensor-grid-uniform strong {
        font-size: 19px;
    }
}


/* --------------------------------------------------------------------------
   V5: orderable home widgets + improved 8-in-1 + admin widget order screen
   -------------------------------------------------------------------------- */
.home-widget-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.home-widget {
    min-width: 0;
}
.home-widget.valves-card,
.home-widget.pumps-card,
.home-widget.meteo-card {
    margin: 0;
}
.admin-order-shortcut {
    margin: -4px 0 16px;
}
.admin-order-shortcut a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--mobile-cyan, #3de7ff);
    border: 1px solid rgba(61,231,255,.22);
    background: rgba(61,231,255,.09);
    font-size: 13px;
    font-weight: 900;
}
.soil-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    color: inherit;
}
.soil-metric {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    min-height: 86px;
    padding: 14px 12px;
    border: 1px solid rgba(139,166,180,.18);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(61,231,255,.075), rgba(255,255,255,.018));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.soil-icon {
    grid-row: 1 / 3;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--mobile-cyan, #3de7ff);
    background: rgba(61,231,255,.13);
    border: 1px solid rgba(61,231,255,.24);
    font-size: 13px;
    font-weight: 1000;
    letter-spacing: -.02em;
    line-height: 1;
    box-shadow: 0 0 18px rgba(61,231,255,.09);
}
.soil-metric small {
    align-self: end;
    color: var(--mobile-muted, #95a3af);
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.soil-metric strong {
    display: flex;
    align-items: baseline;
    gap: 4px;
    align-self: start;
    color: var(--mobile-cyan, #3de7ff);
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -.04em;
    text-shadow: 0 0 13px rgba(61,231,255,.20);
    min-width: 0;
}
.soil-metric strong em {
    font-size: .78em;
    font-style: normal;
    letter-spacing: -.03em;
}
.admin-mobile-shell {
    --mobile-bg: #071018;
    --mobile-panel: rgba(16, 27, 37, 0.84);
    --mobile-line: rgba(139, 166, 180, 0.22);
    --mobile-text: #f4f8fb;
    --mobile-muted: #95a3af;
    --mobile-cyan: #3de7ff;
    background:
        radial-gradient(circle at 18% 0%, rgba(61, 231, 255, 0.11), transparent 34%),
        linear-gradient(160deg, #071018, #0a121a 45%, #05090f);
    color: var(--mobile-text);
    border-radius: 30px;
    max-width: 920px;
    margin: 0 auto;
    padding: 24px;
    box-shadow: 0 35px 80px rgba(0,0,0,.38);
}
.widget-order-card {
    display: grid;
    gap: 18px;
}
.widget-order-list {
    display: grid;
    gap: 10px;
}
.widget-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(139,166,180,.18);
    border-radius: 16px;
    background: rgba(3,8,14,.30);
}
.widget-order-row b,
.widget-order-row small {
    display: block;
}
.widget-order-row b {
    color: #f4f8fb;
}
.widget-order-row small {
    margin-top: 3px;
    color: var(--mobile-muted, #95a3af);
}
.widget-order-row select {
    width: 100%;
    min-height: 42px;
    border-radius: 13px;
    border: 1px solid rgba(61,231,255,.22);
    background: rgba(5,12,19,.85);
    color: var(--mobile-cyan, #3de7ff);
    font-weight: 900;
    padding: 8px 10px;
}
@media (min-width: 781px) {
    .home-widget-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-widget.widget-span-2 {
        grid-column: 1 / -1;
    }
    .soil-metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .soil-metric {
        min-height: 96px;
        grid-template-columns: 1fr;
        grid-template-rows: 42px auto auto;
        justify-items: center;
        text-align: center;
        padding: 15px 10px;
    }
    .soil-icon {
        grid-row: auto;
    }
    .soil-metric small {
        margin-top: 8px;
        max-width: 100%;
    }
    .soil-metric strong {
        justify-content: center;
        font-size: 24px;
        margin-top: 5px;
    }
}
@media (max-width: 780px) {
    .home-widget-layout {
        grid-template-columns: 1fr;
    }
    .admin-mobile-shell {
        min-height: 100vh;
        border-radius: 0;
        padding: 22px 16px 94px;
    }
}
@media (max-width: 430px) {
    .soil-metric-grid {
        gap: 8px;
    }
    .soil-metric {
        grid-template-columns: 40px minmax(0, 1fr);
        min-height: 78px;
        padding: 12px 10px;
        border-radius: 16px;
    }
    .soil-icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        font-size: 12px;
    }
    .soil-metric small {
        font-size: 11px;
    }
    .soil-metric strong {
        font-size: 19px;
    }
}


/* --------------------------------------------------------------------------
   V6: global header, full app dark/cyan styling, compact pump telemetry
   -------------------------------------------------------------------------- */
.auth-body {
    --mobile-bg: #071018;
    --mobile-panel: rgba(16, 27, 37, 0.84);
    --mobile-panel-2: rgba(10, 20, 29, 0.92);
    --mobile-line: rgba(139, 166, 180, 0.22);
    --mobile-text: #f4f8fb;
    --mobile-muted: #95a3af;
    --mobile-cyan: #3de7ff;
    --mobile-cyan-soft: rgba(61, 231, 255, 0.14);
    background: #05090f;
}
.app-header {
    position: sticky;
    top: 0;
    z-index: 1600;
    margin-left: 260px;
    min-height: 72px;
    padding: 12px 34px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    align-items: center;
    gap: 14px;
    color: #f4f8fb;
    background: rgba(7, 16, 24, .86);
    border-bottom: 1px solid rgba(139,166,180,.17);
    backdrop-filter: blur(20px);
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.app-header-brand {
    justify-self: center;
    font-size: 28px;
    font-weight: 1000;
    letter-spacing: -.06em;
}
.app-header-brand span { color: var(--mobile-cyan); }
.app-menu-button {
    background: rgba(61,231,255,.08);
    border: 1px solid rgba(61,231,255,.16);
}
.app-menu-panel { left: 0; }
.app-menu-panel a.active {
    background: rgba(61,231,255,.12);
    color: var(--mobile-cyan);
}
.auth-body .main:not(.login-main) {
    background:
        radial-gradient(circle at 18% 0%, rgba(61, 231, 255, 0.08), transparent 34%),
        radial-gradient(circle at 95% 18%, rgba(55, 126, 255, 0.08), transparent 34%),
        linear-gradient(160deg, #071018, #0a121a 45%, #05090f);
    color: var(--mobile-text);
    padding-top: 24px;
}
.auth-body .page-header,
.auth-body .panel,
.auth-body .kpi,
.auth-body .device-card,
.auth-body .soil-widget,
.auth-body .meteo-widget {
    border: 1px solid var(--mobile-line);
    background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018)), var(--mobile-panel);
    color: var(--mobile-text);
    border-radius: 22px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 20px 50px rgba(0,0,0,.22);
}
.auth-body .page-header {
    padding: 20px;
}
.auth-body .page-header h1,
.auth-body .panel-head h2,
.auth-body .kpi strong,
.auth-body .device-top h3,
.auth-body .soil-widget h3,
.auth-body .meteo-widget h3 {
    color: var(--mobile-text);
}
.auth-body .page-header p,
.auth-body .panel-head p,
.auth-body .device-top p,
.auth-body .soil-widget p,
.auth-body .meteo-widget p,
.auth-body .info-list dt,
.auth-body .kpi span,
.auth-body .metric-row span,
.auth-body td small,
.auth-body .muted-text {
    color: var(--mobile-muted);
}
.auth-body .btn {
    border-color: rgba(61,231,255,.22);
    background: rgba(3,8,14,.35);
    color: var(--mobile-text);
}
.auth-body .btn.primary {
    background: linear-gradient(180deg, #22d3ee, #0e7490);
    color: #021018;
    border-color: rgba(61,231,255,.35);
}
.auth-body .table-wrap {
    border: 1px solid rgba(139,166,180,.16);
    border-radius: 18px;
    background: rgba(3,8,14,.28);
}
.auth-body table { color: var(--mobile-text); }
.auth-body th {
    color: var(--mobile-cyan);
    background: rgba(61,231,255,.07);
    border-bottom-color: rgba(139,166,180,.18);
}
.auth-body td { border-bottom-color: rgba(139,166,180,.13); }
.auth-body .admin-table input,
.auth-body .admin-table select,
.auth-body .filter-form input,
.auth-body .filter-form select,
.auth-body .form-stack input {
    border-color: rgba(139,166,180,.22);
    background: rgba(5,12,19,.84);
    color: var(--mobile-text);
}
.auth-body .admin-table input:disabled,
.auth-body .admin-table select:disabled {
    background: rgba(139,166,180,.08);
    color: #7f8d99;
}
.auth-body .sensor-hero div,
.auth-body .metric-row div {
    border-color: rgba(139,166,180,.18);
    background: rgba(3,8,14,.30);
}
.auth-body .info-list dd,
.auth-body .sensor-hero strong,
.auth-body .metric-row strong {
    color: var(--mobile-cyan);
}
.auth-body .message-box.success { background: rgba(21,128,61,.16); color: #bbf7d0; border: 1px solid rgba(21,128,61,.24); }
.auth-body .message-box.warning { background: rgba(217,119,6,.16); color: #fde68a; border: 1px solid rgba(217,119,6,.24); }
.auth-body .message-box.danger { background: rgba(220,38,38,.16); color: #fecaca; border: 1px solid rgba(220,38,38,.24); }
.auth-body .map:not(.dark-map):not(.full-screen-map) {
    border-color: var(--mobile-line);
    background: #0d1720;
}
.pump-live-values {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px;
}
.pump-live-values span {
    min-width: 0;
    text-align: center;
    padding: 7px 5px;
    font-size: 11px;
    white-space: nowrap;
}
.pump-live-values b {
    display: inline-block;
    font-size: 14px;
}
.soil-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}
.soil-metric {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 82px;
}
.soil-icon {
    justify-self: center;
    align-self: center;
}
.soil-metric small,
.soil-metric strong {
    text-align: left;
}
@media (min-width: 781px) {
    .soil-metric-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 1100px) {
    .app-header { margin-left: 0; padding: 10px 22px; }
    .auth-body .sidebar { display: none; }
}
@media (max-width: 780px) {
    .app-header {
        min-height: 66px;
        padding: 9px 16px;
        grid-template-columns: 48px 1fr 48px;
    }
    .app-header-brand { font-size: 25px; }
    .auth-body .main:not(.login-main) { padding: 14px 0 96px; }
    .auth-body .page-header,
    .auth-body .panel,
    .auth-body .kpi-grid,
    .auth-body .dashboard-grid {
        margin-left: 16px;
        margin-right: 16px;
    }
    .auth-body .page-header { display: block; }
    .header-actions { margin-top: 14px; }
}
@media (max-width: 430px) {
    .pump-live-values { gap: 5px; }
    .pump-live-values span { font-size: 10px; padding: 7px 4px; }
    .pump-live-values b { font-size: 13px; }
    .soil-metric { grid-template-columns: 38px minmax(0,1fr); }
}


/* V7 fix spacing: prevent 8-in-1 labels from being cut off */
.soil-metric {
    align-items: start;
    min-height: 90px;
}
.soil-metric small {
    align-self: start;
    display: block;
    margin-top: 2px;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.12;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}
.soil-metric strong {
    align-self: start;
    margin-top: 0;
}
@media (max-width: 430px) {
    .soil-metric {
        min-height: 92px;
        padding: 12px 10px;
        grid-template-columns: 38px minmax(0,1fr);
    }
    .soil-metric small {
        font-size: 10.5px;
        line-height: 1.08;
        margin-top: 0;
        margin-bottom: 5px;
    }
    .soil-metric strong {
        font-size: 18px;
        line-height: 1.02;
    }
}


/* Running water animation for the water widget */
.water-card { position: relative; overflow: hidden; }
.water-state {
    display: inline-flex;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--mobile-cyan, #3de7ff);
    background: rgba(61,231,255,.09);
    border: 1px solid rgba(61,231,255,.18);
    font-size: 12px;
    font-weight: 900;
}
.water-card.water-idle .water-ripple { opacity: .45; filter: grayscale(.35); }
.water-card.water-flowing .water-ripple::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -6px;
    width: 30px;
    height: 78px;
    transform: translateX(-50%);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(61,231,255,0), rgba(61,231,255,.78), rgba(61,231,255,.10)),
        repeating-linear-gradient(180deg, rgba(255,255,255,.65) 0 7px, rgba(61,231,255,.18) 7px 15px);
    box-shadow: 0 0 22px rgba(61,231,255,.55);
    animation: water-stream 0.85s linear infinite;
}
.water-card.water-flowing .water-ripple span {
    animation: water-ripple-pulse 1.45s ease-out infinite;
}
.water-card.water-flowing .water-ripple span:nth-child(2) { animation-delay: .18s; }
.water-card.water-flowing .water-ripple span:nth-child(3) { animation-delay: .36s; }
@keyframes water-stream {
    from { background-position: 0 0, 0 0; opacity: .78; }
    50% { opacity: 1; }
    to { background-position: 0 34px, 0 34px; opacity: .78; }
}
@keyframes water-ripple-pulse {
    0% { transform: translate(-50%, -50%) scale(.78); opacity: .35; }
    55% { opacity: .85; }
    100% { transform: translate(-50%, -50%) scale(1.18); opacity: .12; }
}

/* Tank widget: borehole pump fills the tank until 100% */
.tank-card {
    position: relative;
    overflow: hidden;
}
.tank-widget-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
}
.tank-visual {
    display: grid;
    justify-items: center;
    gap: 10px;
}
.tank-shell {
    position: relative;
    width: min(150px, 100%);
    height: 185px;
    border: 2px solid rgba(61,231,255,.36);
    border-radius: 24px 24px 32px 32px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
        rgba(3,8,14,.35);
    overflow: hidden;
    box-shadow:
        inset 0 0 24px rgba(61,231,255,.10),
        0 0 26px rgba(61,231,255,.08);
}
.tank-shell::before {
    content: "";
    position: absolute;
    inset: 10px 12px auto;
    height: 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    z-index: 3;
}
.tank-water {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 2%;
    background:
        radial-gradient(circle at 30% 10%, rgba(255,255,255,.40), transparent 18%),
        linear-gradient(180deg, rgba(61,231,255,.95), rgba(15,129,168,.82));
    box-shadow: 0 -12px 28px rgba(61,231,255,.32);
    transition: height .75s ease;
}
.tank-water::before {
    content: "";
    position: absolute;
    left: -35%;
    right: -35%;
    top: -11px;
    height: 24px;
    border-radius: 50%;
    background: rgba(182,248,255,.70);
    box-shadow: 0 0 22px rgba(61,231,255,.45);
    animation: tank-wave 2.6s ease-in-out infinite;
}
.tank-stream {
    position: absolute;
    left: 50%;
    top: 0;
    width: 22px;
    height: 70px;
    transform: translateX(-50%);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(61,231,255,0), rgba(61,231,255,.85), rgba(61,231,255,.10)),
        repeating-linear-gradient(180deg, rgba(255,255,255,.70) 0 6px, rgba(61,231,255,.18) 6px 13px);
    opacity: 0;
    z-index: 2;
    filter: drop-shadow(0 0 14px rgba(61,231,255,.65));
}
.tank-card.tank-filling .tank-stream {
    opacity: 1;
    animation: tank-stream 0.78s linear infinite;
}
.tank-percent {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 4;
    color: #f4fbff;
    font-size: 31px;
    font-weight: 1000;
    text-shadow: 0 2px 13px rgba(0,0,0,.55), 0 0 16px rgba(61,231,255,.38);
}
.tank-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--mobile-cyan, #3de7ff);
    background: rgba(61,231,255,.09);
    border: 1px solid rgba(61,231,255,.20);
    font-size: 12px;
    font-weight: 1000;
}
.tank-control {
    display: grid;
    justify-items: end;
    gap: 10px;
    min-width: 148px;
}
.tank-control small {
    display: block;
    color: var(--mobile-muted, #95a3af);
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
    max-width: 190px;
}
.tank-card.tank-full .tank-status {
    color: #a7f3d0;
    border-color: rgba(34,197,94,.25);
    background: rgba(34,197,94,.11);
}
@keyframes tank-wave {
    0%, 100% { transform: translateX(-3%) scaleX(1.02); }
    50% { transform: translateX(3%) scaleX(.96); }
}
@keyframes tank-stream {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 32px, 0 32px; }
}
@media (max-width: 430px) {
    .tank-widget-body {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .tank-control {
        justify-items: center;
        width: 100%;
    }
    .tank-control small {
        text-align: center;
        max-width: 100%;
    }
    .tank-shell {
        height: 165px;
        width: 132px;
    }
    .tank-percent {
        font-size: 28px;
    }
}

/* --------------------------------------------------------------------------
   V9 map stability: smoother pan/zoom and fewer blank tile gaps
   -------------------------------------------------------------------------- */
.map,
.dark-map,
.full-screen-map,
.small-map {
    position: relative;
    isolation: isolate;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    touch-action: none;
}
.leaflet-container {
    width: 100%;
    height: 100%;
    background: #0d1720;
    font: inherit;
    outline: none;
    touch-action: none;
}
.leaflet-pane,
.leaflet-tile-container,
.leaflet-marker-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane {
    will-change: transform;
}
.leaflet-tile {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.leaflet-control-zoom a {
    background: rgba(8, 18, 28, .92) !important;
    color: #dff8ff !important;
    border-color: rgba(61,231,255,.22) !important;
}
.leaflet-control-attribution {
    background: rgba(8, 18, 28, .72) !important;
    color: rgba(244,248,251,.72) !important;
    border-radius: 9px 0 0 0;
}
.leaflet-control-attribution a { color: #39e6ff !important; }

/* --------------------------------------------------------------------------
   V10 OpenStreetMap standard mode: stable tiles and natural Leaflet movement
   -------------------------------------------------------------------------- */
.map,
.dark-map,
.full-screen-map,
.small-map {
    overflow: hidden;
    transform: none;
    -webkit-transform: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}
.leaflet-container {
    background: #101820;
    touch-action: none;
}
.leaflet-pane,
.leaflet-tile-container,
.leaflet-marker-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane {
    will-change: auto;
}
.leaflet-tile {
    will-change: auto;
    image-rendering: auto;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}
.leaflet-fade-anim .leaflet-tile {
    transition: none;
}


/* --------------------------------------------------------------------------
   V12 local map scope + compact dashboard widget
   -------------------------------------------------------------------------- */
.map-card-first {
    min-height: auto;
}
.map-card-first .dark-map {
    height: 250px !important;
}
.full-screen-map {
    height: min(48vh, 460px) !important;
    min-height: 340px !important;
}
.map-live-layout {
    align-items: start;
}
.leaflet-container {
    background: #101820;
}
@media (min-width: 781px) {
    .map-card-first .dark-map {
        height: 260px !important;
    }
    .full-screen-map {
        height: min(50vh, 500px) !important;
        min-height: 360px !important;
    }
}
@media (max-width: 780px) {
    .map-card-first .dark-map {
        height: 220px !important;
    }
    .full-screen-map {
        height: 46vh !important;
        min-height: 300px !important;
    }
}
@media (max-width: 430px) {
    .map-card-first .dark-map {
        height: 200px !important;
    }
    .full-screen-map {
        min-height: 280px !important;
    }
}


/* --------------------------------------------------------------------------
   V13 focused OSM map: compact dashboard card + hard Leaflet tile reset
   -------------------------------------------------------------------------- */
.home-widget-layout {
    align-items: start;
}
.map-card-first {
    align-self: start;
}
.map-card-first .dark-map {
    height: 205px !important;
    min-height: 205px !important;
}
.full-screen-map {
    height: min(44vh, 420px) !important;
    min-height: 330px !important;
}
.leaflet-container .leaflet-tile {
    width: 256px !important;
    height: 256px !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 256px !important;
    min-height: 256px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
.leaflet-container .leaflet-tile-pane,
.leaflet-container .leaflet-tile-container,
.leaflet-container .leaflet-layer {
    line-height: 0 !important;
}
.leaflet-container img.leaflet-tile {
    border: 0 !important;
}
@media (min-width: 781px) {
    .map-card-first .dark-map {
        height: 210px !important;
        min-height: 210px !important;
    }
    .full-screen-map {
        height: min(45vh, 430px) !important;
        min-height: 340px !important;
    }
}
@media (max-width: 780px) {
    .map-card-first .dark-map {
        height: 195px !important;
        min-height: 195px !important;
    }
    .full-screen-map {
        height: 42vh !important;
        min-height: 300px !important;
    }
}
@media (max-width: 430px) {
    .map-card-first .dark-map {
        height: 180px !important;
        min-height: 180px !important;
    }
    .full-screen-map {
        min-height: 275px !important;
    }
}

/* --------------------------------------------------------------------------
   V14 fully offline local map - no OpenStreetMap/Leaflet/CDN requests
   -------------------------------------------------------------------------- */
.offline-map {
    position: relative;
    background: #07131a !important;
    overflow: hidden;
    touch-action: none;
    user-select: none;
}
.offline-map-shell {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    background: radial-gradient(circle at 28% 18%, rgba(61,231,255,.10), transparent 34%), #08141b;
    cursor: grab;
    touch-action: none;
}
.offline-map-shell.is-dragging { cursor: grabbing; }
.offline-map-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    will-change: transform;
}
.offline-basemap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.offline-town circle { fill: #0f7891; stroke: #fff; stroke-width: 4; }
.offline-town text {
    fill: #102027;
    font-size: 25px;
    font-weight: 900;
    paint-order: stroke;
    stroke: rgba(255,255,255,.75);
    stroke-width: 5px;
}
.offline-area-labels text:first-child {
    fill: #0d2d38;
    font-size: 28px;
    font-weight: 900;
}
.offline-area-labels text:last-child {
    fill: #375461;
    font-size: 18px;
    font-weight: 700;
}
.offline-grid path {
    stroke: #0b3d4a;
    stroke-width: 1;
}
.offline-map-marker-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
}
.offline-map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 5;
}
.offline-map-marker .marker-dot {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
}
.offline-map-marker em {
    position: absolute;
    left: 50%;
    top: 37px;
    transform: translateX(-50%);
    min-width: max-content;
    max-width: 150px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(5, 14, 20, .82);
    color: #eef7fb;
    border: 1px solid rgba(61,231,255,.20);
    font-size: 11px;
    font-weight: 800;
    font-style: normal;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
    pointer-events: none;
}
.offline-map-popup-card {
    position: absolute;
    z-index: 20;
    min-width: 220px;
    max-width: min(300px, calc(100% - 22px));
    padding: 13px;
    border-radius: 16px;
    background: rgba(8, 19, 27, .96);
    border: 1px solid rgba(61,231,255,.24);
    color: #dbeaf0;
    box-shadow: 0 22px 45px rgba(0,0,0,.38);
    backdrop-filter: blur(10px);
}
.offline-map-popup-card[hidden] { display: none !important; }
.offline-map-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 8;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(5,14,20,.76);
    color: #39e6ff;
    border: 1px solid rgba(61,231,255,.22);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .09em;
}
.offline-map-controls {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 9;
    display: grid;
    gap: 6px;
}
.offline-map-control {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(61,231,255,.24);
    background: rgba(7, 22, 31, .86);
    color: #e8fbff;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0,0,0,.20);
}
.offline-map-control.reset { font-size: 14px; }
.offline-map-control:hover {
    background: rgba(17, 80, 96, .9);
    color: #39e6ff;
}
.offline-map .map-popup strong { color: #fff; font-size: 14px; }
.offline-map .map-popup span,
.offline-map .map-popup small { color: #9fb0ba; }
.offline-map .map-popup hr { margin: 9px 0; }
.offline-map .map-popup a { display: inline-block; margin-top: 8px; }
.map-card-first .offline-map-badge,
.map-card-first .offline-map-controls { transform: scale(.86); transform-origin: top left; }
.map-card-first .offline-map-controls { transform-origin: top right; }
.map-card-first .offline-map-marker em { display: none; }
@media (max-width: 780px) {
    .offline-map-marker em { display: none; }
    .offline-map-popup-card { font-size: 12px; }
    .offline-map-controls { right: 9px; top: 9px; }
    .offline-map-badge { left: 9px; top: 9px; }
}


/* --------------------------------------------------------------------------
   V15 local satellite offline map - user provided image + larger dashboard card
   -------------------------------------------------------------------------- */
.map-card-first {
    min-height: 0 !important;
}
.map-card-first .dark-map {
    height: 255px !important;
    min-height: 255px !important;
}
.full-screen-map {
    height: min(58vh, 560px) !important;
    min-height: 380px !important;
}
.offline-basemap-wrap {
    position: absolute;
    inset: 0;
}
.offline-basemap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.02) contrast(1.02) brightness(.98);
}
.offline-basemap-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(2,10,15,.06), rgba(2,10,15,.14)),
        radial-gradient(circle at 50% 50%, transparent 55%, rgba(4,11,16,.15) 100%);
    pointer-events: none;
}
.offline-map-shell {
    background: #050b10;
}
.offline-map-badge {
    background: rgba(4, 11, 16, .72);
}
.offline-map-marker .marker-dot {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 22px rgba(0,0,0,.30), 0 0 0 2px rgba(5, 12, 16, .75);
}
.offline-map-marker .marker-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: #06212a;
}
.offline-map-marker .marker-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}
.offline-map-marker em {
    background: rgba(4, 11, 16, .88);
    color: #eef7fb;
    border-color: rgba(61,231,255,.25);
}
.map-card-first .offline-map-badge,
.map-card-first .offline-map-controls {
    transform: scale(.92);
}
@media (min-width: 781px) {
    .map-card-first .dark-map {
        height: 270px !important;
        min-height: 270px !important;
    }
    .full-screen-map {
        height: min(60vh, 590px) !important;
        min-height: 410px !important;
    }
}
@media (max-width: 780px) {
    .map-card-first .dark-map {
        height: 230px !important;
        min-height: 230px !important;
    }
    .full-screen-map {
        height: 48vh !important;
        min-height: 320px !important;
    }
}
@media (max-width: 430px) {
    .map-card-first .dark-map {
        height: 215px !important;
        min-height: 215px !important;
    }
    .full-screen-map {
        min-height: 300px !important;
    }
    .offline-map-marker .marker-dot {
        width: 34px;
        height: 34px;
    }
}


/* --------------------------------------------------------------------------
   V16 smaller map icons + de-overlap clusters + no offline badge
   -------------------------------------------------------------------------- */
.offline-map-badge {
    display: none !important;
}
.offline-map-marker .marker-dot {
    width: 28px !important;
    height: 28px !important;
    box-shadow: 0 8px 16px rgba(0,0,0,.28), 0 0 0 2px rgba(5, 12, 16, .72) !important;
}
.offline-map-marker .marker-icon {
    width: 13px !important;
    height: 13px !important;
}
.offline-map-marker .marker-icon svg {
    width: 13px !important;
    height: 13px !important;
}
.map-card-first .offline-map-controls {
    transform: scale(.86) !important;
}
@media (max-width: 430px) {
    .offline-map-marker .marker-dot {
        width: 26px !important;
        height: 26px !important;
    }
    .offline-map-marker .marker-icon,
    .offline-map-marker .marker-icon svg {
        width: 12px !important;
        height: 12px !important;
    }
}


/* --------------------------------------------------------------------------
   V17 dashboard map card without title/subtitle/live badge
   -------------------------------------------------------------------------- */
.map-card-first {
    padding: 14px !important;
}
.map-card-first .clean-dashboard-map {
    margin: 0 !important;
    height: 285px !important;
    min-height: 285px !important;
}
@media (min-width: 781px) {
    .map-card-first .clean-dashboard-map {
        height: 300px !important;
        min-height: 300px !important;
    }
}
@media (max-width: 780px) {
    .map-card-first {
        padding: 12px !important;
    }
    .map-card-first .clean-dashboard-map {
        height: 245px !important;
        min-height: 245px !important;
    }
}
@media (max-width: 430px) {
    .map-card-first .clean-dashboard-map {
        height: 225px !important;
        min-height: 225px !important;
    }
}


/* --------------------------------------------------------------------------
   V18 fixed marker overlap + clearer ON/OFF state colors
   -------------------------------------------------------------------------- */
.offline-map-marker .marker-dot {
    width: 24px !important;
    height: 24px !important;
    border-width: 2px !important;
    box-shadow: 0 5px 12px rgba(0,0,0,.24), 0 0 0 2px rgba(5,12,16,.66) !important;
}
.offline-map-marker .marker-icon,
.offline-map-marker .marker-icon svg {
    width: 10px !important;
    height: 10px !important;
}
.marker-dot.pump.state-on,
.marker-dot.valve.state-on {
    background: linear-gradient(180deg, #5ef2ff, #1ab8dc) !important;
    color: #04161e !important;
    border-color: rgba(255,255,255,.88) !important;
}
.marker-dot.pump.state-off,
.marker-dot.valve.state-off {
    background: linear-gradient(180deg, #73808c, #44505b) !important;
    color: #eef6fb !important;
    border-color: rgba(220,230,236,.85) !important;
}
.pump-row, .valve-row {
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
    border-radius: 16px;
    padding: 14px 12px !important;
}
.pump-row.is-on, .valve-row.is-on {
    background: linear-gradient(180deg, rgba(61,231,255,.10), rgba(10,34,44,.20));
    border: 1px solid rgba(61,231,255,.24);
    box-shadow: inset 0 0 0 1px rgba(61,231,255,.05), 0 0 28px rgba(61,231,255,.08);
}
.pump-row.is-off, .valve-row.is-off {
    background: linear-gradient(180deg, rgba(87,98,110,.10), rgba(10,16,22,.16));
    border: 1px solid rgba(123,138,152,.12);
}
.pump-row.is-on .pump-name,
.valve-row.is-on strong,
.valve-row.is-on a strong {
    color: #78f2ff;
}
.pump-row.is-off .pump-name,
.valve-row.is-off strong,
.valve-row.is-off a strong {
    color: #d7e1e8;
}
.pump-row.is-off .pump-live-values span,
.valve-row.is-off small,
.valve-row.is-off span {
    opacity: .88;
}
@media (max-width: 430px) {
    .offline-map-marker .marker-dot {
        width: 22px !important;
        height: 22px !important;
    }
    .offline-map-marker .marker-icon,
    .offline-map-marker .marker-icon svg {
        width: 9px !important;
        height: 9px !important;
    }
}

/* --------------------------------------------------------------------------
   V19 Market page + header-only alerts
   -------------------------------------------------------------------------- */
.market-page-shell {
    display: grid;
    gap: 18px;
}
.market-title {
    margin-bottom: 4px;
}
.market-admin-card {
    display: grid;
    gap: 16px;
}
.market-form {
    display: grid;
    grid-template-columns: .65fr 1.35fr 1fr auto;
    gap: 12px;
    align-items: end;
}
.market-form label {
    display: grid;
    gap: 7px;
    color: var(--mobile-muted);
    font-size: 12px;
    font-weight: 800;
}
.market-form input,
.market-form textarea {
    width: 100%;
    border: 1px solid rgba(61,231,255,.16);
    background: rgba(3, 8, 14, .45);
    color: var(--mobile-text);
    border-radius: 14px;
    padding: 11px 12px;
    outline: none;
    font: inherit;
}
.market-form textarea {
    resize: vertical;
    min-height: 46px;
}
.market-form input:focus,
.market-form textarea:focus {
    border-color: rgba(61,231,255,.42);
    box-shadow: 0 0 0 3px rgba(61,231,255,.08);
}
.market-form-wide {
    grid-column: 1 / 4;
}
.market-submit {
    min-height: 44px;
    white-space: nowrap;
}
.market-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.market-item-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    min-height: 170px;
    position: relative;
    overflow: hidden;
}
.market-item-card::after {
    content: '';
    position: absolute;
    inset: auto -25% -45% 15%;
    height: 110px;
    background: radial-gradient(circle, rgba(61,231,255,.14), transparent 65%);
    pointer-events: none;
}
.market-item-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(61,231,255,.22), rgba(61,231,255,.07));
    border: 1px solid rgba(61,231,255,.26);
    font-size: 27px;
    box-shadow: 0 14px 28px rgba(0,0,0,.22);
}
.market-item-body h2 {
    margin: 0 0 8px;
    font-size: 19px;
    color: var(--mobile-text);
}
.market-price {
    display: inline-flex;
    margin-bottom: 10px;
    color: #39e6ff;
    font-size: 18px;
    text-shadow: 0 0 18px rgba(61,231,255,.22);
}
.market-item-body p {
    margin: 0;
    color: var(--mobile-muted);
    line-height: 1.55;
    font-size: 14px;
}
.market-item-card form {
    grid-column: 1 / -1;
    position: relative;
    z-index: 2;
}
.btn.ghost.danger {
    background: rgba(239,68,68,.10);
    color: #fecaca;
    border: 1px solid rgba(239,68,68,.24);
}
.market-empty-card {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--mobile-muted);
}
@media (max-width: 1100px) {
    .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .market-form { grid-template-columns: 1fr 1fr; }
    .market-form-wide { grid-column: 1 / -1; }
    .market-submit { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .market-grid { grid-template-columns: 1fr; }
    .market-form { grid-template-columns: 1fr; }
    .market-form-wide { grid-column: auto; }
    .market-item-card { grid-template-columns: auto 1fr; }
}


/* --------------------------------------------------------------------------
   V20 Market image upload cards - 500x500 product images instead of icons
   -------------------------------------------------------------------------- */
.market-form {
    grid-template-columns: 1.15fr 1.25fr .85fr auto;
}
.market-image-upload small {
    color: var(--mobile-muted);
    opacity: .85;
    font-size: 11px;
    line-height: 1.35;
}
.market-form input[type="file"] {
    padding: 9px 10px;
}
.market-item-card {
    grid-template-columns: 118px 1fr !important;
    gap: 16px !important;
    align-items: start;
}
.market-item-media {
    width: 118px;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(61,231,255,.26);
    background: linear-gradient(180deg, rgba(61,231,255,.12), rgba(61,231,255,.04));
    box-shadow: 0 16px 30px rgba(0,0,0,.25);
    position: relative;
    z-index: 2;
}
.market-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.market-item-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #39e6ff;
    font-weight: 950;
    font-size: 28px;
    background: radial-gradient(circle, rgba(61,231,255,.18), rgba(5,14,20,.88));
}
.market-item-icon {
    display: none !important;
}
.market-item-body {
    position: relative;
    z-index: 2;
}
@media (max-width: 720px) {
    .market-item-card {
        grid-template-columns: 92px 1fr !important;
    }
    .market-item-media {
        width: 92px;
        border-radius: 18px;
    }
}
@media (max-width: 420px) {
    .market-item-card {
        grid-template-columns: 1fr !important;
    }
    .market-item-media {
        width: 100%;
        max-width: 220px;
    }
}


/* --------------------------------------------------------------------------
   V21 Market edit support + mobile-friendly admin forms
   -------------------------------------------------------------------------- */
.market-admin-card {
    padding: clamp(18px, 3vw, 28px) !important;
}
.market-create-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, .55fr) auto;
    align-items: end;
}
.market-create-form .market-image-upload {
    grid-column: 1 / -1;
}
.market-form label span,
.market-edit-form label span {
    color: var(--mobile-text);
    font-size: 13px;
}
.market-form input,
.market-form textarea,
.market-edit-form input,
.market-edit-form textarea {
    min-height: 48px;
    font-size: 15px;
}
.market-form textarea,
.market-edit-form textarea {
    min-height: 116px;
}
.market-item-card {
    grid-template-rows: auto auto;
}
.market-admin-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 3;
    margin-top: 4px;
}
.market-edit-panel {
    flex: 1 1 100%;
}
.market-edit-panel summary {
    width: fit-content;
    list-style: none;
    cursor: pointer;
}
.market-edit-panel summary::-webkit-details-marker {
    display: none;
}
.market-edit-form {
    margin-top: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(61,231,255,.18);
    background: rgba(3, 8, 14, .36);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .55fr);
    gap: 12px;
}
.market-edit-form label {
    display: grid;
    gap: 7px;
    color: var(--mobile-muted);
    font-size: 12px;
    font-weight: 800;
}
.market-edit-form .market-form-wide {
    grid-column: 1 / -1;
}
.market-edit-form button {
    justify-self: start;
}
@media (max-width: 920px) {
    .market-create-form {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .market-create-form .market-form-wide {
        grid-column: 1 / -1;
    }
    .market-submit {
        width: 100%;
        justify-content: center;
        min-height: 52px;
    }
}
@media (max-width: 720px) {
    .market-page-shell {
        gap: 14px;
    }
    .market-title {
        padding-inline: 4px;
    }
    .market-admin-card {
        padding: 18px !important;
        border-radius: 24px !important;
    }
    .market-form,
    .market-create-form,
    .market-edit-form {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    .market-form label,
    .market-edit-form label {
        min-width: 0;
        width: 100%;
    }
    .market-form input,
    .market-form textarea,
    .market-edit-form input,
    .market-edit-form textarea {
        width: 100%;
        min-height: 52px;
        padding: 14px 15px;
        font-size: 16px;
        border-radius: 16px;
    }
    .market-form input[type="file"],
    .market-edit-form input[type="file"] {
        min-height: 58px;
        padding: 14px;
        white-space: normal;
    }
    .market-form textarea,
    .market-edit-form textarea {
        min-height: 132px;
    }
    .market-item-card {
        grid-template-columns: 104px 1fr !important;
        gap: 14px !important;
    }
    .market-admin-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .market-admin-actions .btn,
    .market-admin-actions form,
    .market-edit-panel summary {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
@media (max-width: 430px) {
    .market-admin-card {
        margin-inline: -2px;
        padding: 16px !important;
    }
    .market-item-card {
        grid-template-columns: 1fr !important;
    }
    .market-item-media {
        width: 100% !important;
        max-width: 240px !important;
    }
}

/* --------------------------------------------------------------------------
   V22 Admin Tools: backup, version update and user creation
   -------------------------------------------------------------------------- */
.admin-tools-page {
    max-width: 1180px;
    margin: 0 auto;
}
.admin-tools-title {
    margin-bottom: 18px;
}
.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.admin-tool-card {
    display: grid;
    gap: 16px;
}
.admin-tool-card.users-card {
    grid-column: 1 / -1;
}
.admin-tool-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.admin-tool-form label {
    display: grid;
    gap: 7px;
    color: var(--mobile-muted);
    font-weight: 800;
    font-size: 13px;
}
.admin-tool-form label span {
    color: var(--mobile-text);
}
.admin-tool-form input,
.admin-tool-form select,
.admin-tool-form textarea {
    width: 100%;
    min-height: 46px;
    border-radius: 15px;
    border: 1px solid rgba(61,231,255,.18);
    background: rgba(4, 12, 20, .64);
    color: var(--mobile-text);
    padding: 12px 14px;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.admin-tool-form textarea {
    resize: vertical;
    min-height: 110px;
}
.admin-tool-form input[type="file"] {
    min-height: 54px;
    padding: 14px;
}
.admin-tool-form input:focus,
.admin-tool-form select:focus,
.admin-tool-form textarea:focus {
    border-color: rgba(61,231,255,.42);
    box-shadow: 0 0 0 3px rgba(61,231,255,.08);
}
.admin-tool-wide {
    grid-column: 1 / -1;
}
.admin-tool-button,
.primary-action.admin-tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 18px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(61,231,255,.95), rgba(12,144,171,.85));
    color: #031018;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(0,0,0,.24), 0 0 22px rgba(61,231,255,.12);
}
.admin-tool-note {
    color: var(--mobile-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}
.version-status-box {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(61,231,255,.16);
    background: rgba(3, 10, 16, .44);
    border-radius: 17px;
}
.version-status-box span,
.version-status-box small {
    color: var(--mobile-muted);
}
.version-status-box strong {
    color: var(--mobile-cyan);
    font-size: 20px;
}
.admin-users-table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(61,231,255,.12);
}
.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
    color: var(--mobile-text);
}
.admin-users-table th,
.admin-users-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(139,166,180,.12);
}
.admin-users-table th {
    color: var(--mobile-cyan);
    background: rgba(61,231,255,.06);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.admin-users-table tr:last-child td {
    border-bottom: 0;
}
.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(100,116,139,.25);
    color: #dbe8ef;
}
.role-admin {
    background: rgba(61,231,255,.18);
    color: var(--mobile-cyan);
    border-color: rgba(61,231,255,.28);
}
.role-editor {
    background: rgba(45,212,191,.14);
    color: #7df7e5;
    border-color: rgba(45,212,191,.22);
}
.role-viewer {
    background: rgba(148,163,184,.16);
    color: #dbe8ef;
}
@media (max-width: 900px) {
    .admin-tools-grid {
        grid-template-columns: 1fr;
    }
    .admin-tool-card.users-card {
        grid-column: auto;
    }
}
@media (max-width: 560px) {
    .admin-tools-page {
        padding-bottom: 90px;
    }
    .admin-tools-title h1 {
        font-size: 30px;
    }
    .admin-tool-card {
        padding: 18px !important;
        border-radius: 22px !important;
    }
    .admin-tool-form,
    .user-create-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .admin-tool-wide {
        grid-column: auto;
    }
    .admin-tool-form label {
        font-size: 14px;
    }
    .admin-tool-form input,
    .admin-tool-form select,
    .admin-tool-form textarea {
        min-height: 54px;
        font-size: 16px;
        border-radius: 17px;
        padding: 14px 15px;
    }
    .admin-tool-form textarea {
        min-height: 130px;
    }
    .admin-tool-button,
    .primary-action.admin-tool-button {
        width: 100%;
        min-height: 54px;
        font-size: 15px;
    }
    .admin-users-table {
        min-width: 520px;
    }
}

/* --------------------------------------------------------------------------
   V23 Admin Tools: restore backup, apply update and restart
   -------------------------------------------------------------------------- */
.restore-card,
.restart-card {
    min-height: 100%;
}
.single-column-form {
    grid-template-columns: 1fr !important;
}
.danger-tool-card {
    border-color: rgba(248,113,113,.20) !important;
    box-shadow: inset 0 0 0 1px rgba(248,113,113,.05), 0 18px 38px rgba(0,0,0,.18);
}
.danger-action,
.primary-action.danger-action {
    background: linear-gradient(180deg, rgba(248,113,113,.98), rgba(185,28,28,.88)) !important;
    color: #fff !important;
}
.restart-action,
.primary-action.restart-action {
    background: linear-gradient(180deg, rgba(45,212,191,.98), rgba(14,116,144,.88)) !important;
    color: #031018 !important;
}
.warning-note {
    color: #fecaca !important;
}
.restore-status-box strong {
    color: #fecaca !important;
    font-size: 15px !important;
    word-break: break-word;
}
.admin-tool-form input[type="file"]::file-selector-button {
    border: 0;
    border-radius: 11px;
    padding: 8px 11px;
    margin-right: 10px;
    background: rgba(61,231,255,.16);
    color: var(--mobile-cyan);
    font-weight: 900;
    cursor: pointer;
}
@media (max-width: 560px) {
    .restore-card,
    .version-card,
    .restart-card {
        gap: 18px;
    }
    .admin-tool-form input[type="file"] {
        min-height: 66px;
        line-height: 1.35;
    }
}


/* --------------------------------------------------------------------------
   V24 Admin Tools: edit/delete users
   -------------------------------------------------------------------------- */
.admin-user-edit-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.admin-user-edit-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(61,231,255,.13);
    border-radius: 20px;
    background: rgba(3, 10, 16, .38);
}
.admin-user-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 2px;
}
.admin-user-card-head strong {
    color: var(--mobile-text);
    font-size: 17px;
}
.admin-user-card-head small {
    display: block;
    color: var(--mobile-muted);
    margin-top: 3px;
}
.admin-user-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.admin-user-edit-form .admin-user-card-head,
.admin-user-edit-form button {
    grid-column: 1 / -1;
}
.admin-user-edit-form label {
    display: grid;
    gap: 7px;
    color: var(--mobile-muted);
    font-weight: 800;
    font-size: 13px;
}
.admin-user-edit-form label span {
    color: var(--mobile-text);
}
.admin-user-edit-form input,
.admin-user-edit-form select {
    width: 100%;
    min-height: 46px;
    border-radius: 15px;
    border: 1px solid rgba(61,231,255,.18);
    background: rgba(4, 12, 20, .64);
    color: var(--mobile-text);
    padding: 12px 14px;
    outline: none;
}
.admin-user-edit-form input:focus,
.admin-user-edit-form select:focus {
    border-color: rgba(61,231,255,.42);
    box-shadow: 0 0 0 3px rgba(61,231,255,.08);
}
.admin-user-delete-form {
    display: grid;
}
.admin-delete-user-button {
    min-height: 44px;
    border-radius: 15px;
    border: 1px solid rgba(248,113,113,.30);
    background: rgba(127, 29, 29, .28);
    color: #fecaca;
    font-weight: 950;
    cursor: pointer;
}
.admin-delete-user-button:hover:not(:disabled) {
    background: rgba(185, 28, 28, .42);
}
.admin-delete-user-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}
@media (max-width: 900px) {
    .admin-user-edit-list {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 560px) {
    .admin-user-edit-card {
        padding: 14px;
        border-radius: 18px;
    }
    .admin-user-edit-form {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .admin-user-edit-form label {
        font-size: 14px;
    }
    .admin-user-edit-form input,
    .admin-user-edit-form select {
        min-height: 54px;
        font-size: 16px;
        border-radius: 17px;
        padding: 14px 15px;
    }
    .admin-delete-user-button {
        min-height: 52px;
        font-size: 15px;
    }
}


/* --------------------------------------------------------------------------
   V25 safe restart screen
   -------------------------------------------------------------------------- */
.restart-wait-page {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
}
.restart-wait-card {
    width: min(520px, 100%);
    text-align: center;
    display: grid;
    gap: 18px;
    justify-items: center;
}
.restart-wait-card .widget-title {
    justify-content: center;
}
.restart-loader-ring {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    border: 5px solid rgba(61,231,255,.16);
    border-top-color: rgba(61,231,255,.95);
    animation: restartSpin 1s linear infinite;
    box-shadow: 0 0 28px rgba(61,231,255,.14);
}
.restart-status-box {
    width: 100%;
}
@keyframes restartSpin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   V26 Admin Tools mobile overflow fix
   -------------------------------------------------------------------------- */
.admin-tools-page,
.admin-tools-grid,
.admin-tool-card,
.admin-tool-form,
.admin-tool-form label,
.admin-user-edit-list,
.admin-user-edit-card,
.admin-user-edit-form {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.admin-tool-card {
    overflow: hidden;
}
.admin-tool-button,
.primary-action.admin-tool-button,
.admin-delete-user-button,
.admin-user-edit-form button,
.admin-tool-form button {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
}
.admin-tool-form input,
.admin-tool-form select,
.admin-tool-form textarea,
.admin-user-edit-form input,
.admin-user-edit-form select {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}
.version-status-box,
.restore-status-box,
.admin-tool-note,
.muted-text {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}
@media (max-width: 560px) {
    .admin-tools-page.admin-mobile-shell {
        width: 100%;
        max-width: 100vw;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: hidden;
    }
    .admin-tools-grid {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    .admin-tool-card {
        width: 100%;
        max-width: 100%;
        padding: 16px !important;
    }
    .admin-tool-form,
    .single-column-form,
    .user-create-form,
    .admin-user-edit-form,
    .admin-user-delete-form,
    .restart-card form {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    .admin-tool-button,
    .primary-action.admin-tool-button,
    .danger-action,
    .restart-action,
    .admin-delete-user-button,
    .admin-user-edit-form button {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .admin-tool-form input[type="file"] {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 13px;
        padding: 12px !important;
    }
    .admin-tool-form input[type="file"]::file-selector-button {
        max-width: 46%;
        margin-right: 8px;
        padding: 8px 9px;
        white-space: nowrap;
    }
    .version-status-box small,
    .restore-status-box small {
        display: block;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        font-size: 12px;
        line-height: 1.35;
    }
}


/* --------------------------------------------------------------------------
   V27 docker-ready cleanup
   -------------------------------------------------------------------------- */
@media (min-width: 1101px) {
    .app-header .app-menu-button {
        display: none !important;
    }
    .app-header .app-menu-panel {
        display: none !important;
    }
}
.docker-restart-card {
    border-color: rgba(61, 231, 255, .26) !important;
}
.docker-restart-action {
    background: linear-gradient(180deg, #3de7ff, #0f9bb7) !important;
    color: #041018 !important;
}


/* --------------------------------------------------------------------------
   V28 branding tools + clean product branding
   -------------------------------------------------------------------------- */
.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: contain;
    background: rgba(255,255,255,.92);
    padding: 6px;
    box-shadow: 0 12px 26px rgba(0,0,0,.22);
}
.login-brand-logo {
    width: 58px;
    height: 58px;
}
.brand-mark-text {
    width: auto !important;
    min-width: 54px;
    padding: 0 12px;
    font-size: 10px;
    letter-spacing: .02em !important;
    white-space: nowrap;
}
.login-brand .brand-mark-text {
    min-width: 70px;
}
.branding-card {
    border-color: rgba(61,231,255,.22) !important;
}
.branding-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 14px 0 16px;
}
.branding-preview-box {
    min-height: 118px;
    border: 1px solid rgba(139,166,180,.16);
    border-radius: 18px;
    background: rgba(3,8,14,.28);
    padding: 14px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 9px;
    text-align: center;
    overflow: hidden;
}
.branding-preview-box span {
    color: var(--mobile-muted, #8ba6b4);
    font-size: 12px;
    font-weight: 800;
}
.branding-preview-box img {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
}
.favicon-preview-box img {
    max-width: 48px;
    max-height: 48px;
    border-radius: 10px;
}
.branding-check-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(139,166,180,.13);
    border-radius: 14px;
    background: rgba(3,8,14,.18);
}
.branding-check-row input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
}
.branding-check-row span {
    margin: 0 !important;
}
.market-item-placeholder {
    font-size: 13px !important;
    letter-spacing: .05em;
}
@media (max-width: 780px) {
    .brand-logo {
        width: 46px;
        height: 46px;
    }
    .branding-preview-grid {
        grid-template-columns: 1fr;
    }
    .branding-preview-box {
        min-height: 104px;
    }
}


/* --------------------------------------------------------------------------
   V29 header logo + login logo only + non-square branding logo
   -------------------------------------------------------------------------- */
.brand-logo {
    width: auto !important;
    height: 44px !important;
    max-width: 180px;
    border-radius: 0 !important;
    object-fit: contain;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}
.sidebar .brand {
    align-items: center;
}
.sidebar .brand-logo {
    height: 42px !important;
    max-width: 170px;
}
.login-brand {
    justify-content: center;
    margin-bottom: 18px;
}
.login-brand-logo-only {
    display: flex;
    justify-content: center;
}
.login-brand-logo {
    width: min(320px, 100%) !important;
    height: auto !important;
    max-height: 80px;
    max-width: 320px !important;
}
.app-header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}
.header-brand-logo {
    display: block;
    width: auto;
    height: 38px;
    max-width: min(220px, 56vw);
    object-fit: contain;
}
@media (max-width: 780px) {
    .brand-logo {
        height: 40px !important;
        max-width: 160px;
    }
    .login-brand-logo {
        width: min(280px, 100%) !important;
        max-width: 280px !important;
        max-height: 70px;
    }
    .header-brand-logo {
        height: 32px;
        max-width: min(190px, 52vw);
    }
}


/* --------------------------------------------------------------------------
   V30 notifications page + larger header logo
   -------------------------------------------------------------------------- */
.header-brand-logo {
    height: 46px !important;
    max-width: min(260px, 58vw) !important;
}
.header-alert-link {
    position: relative;
}
.header-alert-link .bell-icon {
    display: inline-grid;
    place-items: center;
    line-height: 1;
}
.alert-count-badge {
    position: absolute;
    right: -5px;
    top: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ef4444;
    color: #fff;
    border: 2px solid rgba(5,14,20,.95);
    font-size: 11px;
    font-weight: 1000;
    font-style: normal;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239,68,68,.35);
}
.notifications-page-shell {
    display: grid;
    gap: 16px;
}
.notifications-card {
    overflow: hidden;
}
.notifications-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.notification-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    color: inherit;
    background: rgba(3,8,14,.28);
    border: 1px solid rgba(139,166,180,.14);
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.notification-row:hover {
    transform: translateY(-1px);
    border-color: rgba(61,231,255,.28);
    background: rgba(61,231,255,.07);
}
.notification-row.is-new {
    border-color: rgba(61,231,255,.36);
    box-shadow: inset 0 0 0 1px rgba(61,231,255,.10), 0 18px 38px rgba(61,231,255,.06);
}
.notification-row.danger .notification-icon {
    background: rgba(239,68,68,.18);
    color: #fecaca;
    border-color: rgba(239,68,68,.38);
}
.notification-row.warning .notification-icon {
    background: rgba(245,158,11,.18);
    color: #fde68a;
    border-color: rgba(245,158,11,.38);
}
.notification-icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-weight: 1000;
    border: 1px solid rgba(139,166,180,.18);
    background: rgba(61,231,255,.10);
    color: var(--mobile-cyan, #3de7ff);
}
.notification-body {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.notification-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.notification-topline strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.notification-body span,
.notification-body small,
.empty-notifications span {
    color: var(--mobile-muted, #8ba6b4);
}
.new-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(61,231,255,.14);
    color: var(--mobile-cyan, #3de7ff) !important;
    border: 1px solid rgba(61,231,255,.28);
    font-size: 10px;
    font-weight: 1000;
}
.empty-notifications {
    display: grid;
    gap: 6px;
    padding: 22px;
    border: 1px dashed rgba(139,166,180,.22);
    border-radius: 18px;
    text-align: center;
    background: rgba(3,8,14,.20);
}
@media (max-width: 780px) {
    .header-brand-logo {
        height: 38px !important;
        max-width: min(220px, 54vw) !important;
    }
    .notification-row {
        grid-template-columns: 40px minmax(0, 1fr);
        padding: 12px;
    }
    .notification-icon {
        width: 40px;
        height: 40px;
    }
}
