/* Plik wyglądu strony stany_licznikow.php */

/*
 * Wspólna skala całej strony.
 * Zmniejsza proporcjonalnie tekst, liczniki, ikony, odstępy i obramowania.
 */
:root {
    zoom: 0.50;
}

        :root {
            --orange: #ff7a00;
            --orange-dark: #e65d00;
            --orange-soft: #fff2d7;
            --orange-border: #ffb43d;
            --blue: #1574df;
            --blue-dark: #0757b9;
            --blue-soft: #eaf5ff;
            --blue-border: #86c5ff;
            --green: #1f8a3b;
            --ink: #111827;
            --muted: #667085;
            --white: #ffffff;
            --shadow: 0 18px 50px rgba(31, 41, 55, 0.13);
        }

        * {
            box-sizing: border-box;
        }

        html {
            min-height: 100%;
        }

        body {
            min-height: 100vh;
            margin: 0;
            padding: 18px;
            color: var(--ink);
            font-family: "Segoe UI", Arial, sans-serif;
            background:
                radial-gradient(circle at 20% 0%, rgba(255, 205, 112, 0.30), transparent 34%),
                linear-gradient(135deg, #fffdf8 0%, var(--orange-soft) 100%);
            transition: background 0.25s ease;
        }

        body.water-mode {
            background:
                radial-gradient(circle at 80% 0%, rgba(112, 190, 255, 0.28), transparent 34%),
                linear-gradient(135deg, #fbfdff 0%, var(--blue-soft) 100%);
        }

        .home-button {
            position: fixed;
            z-index: 1000;
            left: 18px;
            bottom: 18px;
            display: grid;
            place-items: center;
            width: 58px;
            height: 58px;
            color: #ffffff;
            background: linear-gradient(135deg, #ff9d1c, var(--orange-dark));
            border: 3px solid #ffffff;
            border-radius: 50%;
            box-shadow: 0 7px 20px rgba(17, 24, 39, 0.28);
            text-decoration: none;
            zoom: 2;
        }

        .home-button:hover {
            transform: translateY(-2px);
        }

        .home-button svg {
            width: 29px;
            height: 29px;
        }

        body.water-mode .home-button {
            background: linear-gradient(135deg, #2e94ff, var(--blue-dark));
        }

        button,
        input {
            font: inherit;
        }

        .page-shell {
            width: min(1480px, 100%);
            margin: 0 auto;
            overflow: hidden;
            background: rgba(255, 255, 255, 0.90);
            border: 2px solid var(--orange-border);
            border-radius: 28px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(8px);
            transition: border-color 0.25s ease;
        }

        body.water-mode .page-shell {
            border-color: var(--blue-border);
        }

        .topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 24px;
            padding: 22px 34px;
            background: linear-gradient(90deg, rgba(255, 244, 219, 0.96), rgba(255, 255, 255, 0.96));
            border-bottom: 1px solid rgba(255, 122, 0, 0.25);
            transition: background 0.25s ease, border-color 0.25s ease;
        }

        body.water-mode .topbar {
            background: linear-gradient(90deg, rgba(234, 245, 255, 0.96), rgba(255, 255, 255, 0.96));
            border-bottom-color: rgba(21, 116, 223, 0.25);
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 18px;
            min-width: 0;
        }

        .brand-icon {
            display: grid;
            place-items: center;
            flex: 0 0 auto;
            width: 86px;
            height: 86px;
            color: var(--orange);
            background: linear-gradient(145deg, #fff8d9, #ffd778);
            border: 4px solid #ffc23d;
            border-radius: 50%;
            box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(255, 122, 0, 0.20);
        }

        body.water-mode .brand-icon {
            color: var(--blue);
            background: linear-gradient(145deg, #eff8ff, #bde1ff);
            border-color: #75bfff;
            box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(21, 116, 223, 0.18);
        }

        .brand-icon svg {
            width: 48px;
            height: 48px;
        }

        .brand-copy h1 {
            margin: 0;
            font-size: clamp(30px, 4vw, 54px);
            line-height: 1.02;
            letter-spacing: -1.5px;
        }

        .brand-copy p {
            margin: 8px 0 0;
            font-size: clamp(15px, 1.7vw, 22px);
            color: #2d2d2d;
        }

        .medium-switch {
            display: grid;
            grid-template-columns: 1fr 1fr;
            min-width: 460px;
            padding: 5px;
            background: #ffffff;
            border: 1px solid #d7dce2;
            border-radius: 22px;
            box-shadow: 0 8px 22px rgba(16, 24, 40, 0.10);
        }

        .medium-button {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 14px;
            min-height: 84px;
            padding: 12px 24px;
            color: var(--ink);
            background: transparent;
            border: 0;
            border-radius: 17px;
            cursor: pointer;
            font-size: 31px;
            font-weight: 750;
            transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
        }

        .medium-button:hover {
            transform: translateY(-1px);
        }

        .medium-button svg {
            width: 43px;
            height: 43px;
        }

        .medium-button[data-medium="prad"] svg {
            color: var(--orange);
        }

        .medium-button[data-medium="woda"] svg {
            color: var(--blue);
        }

        .medium-button.active[data-medium="prad"] {
            color: #ffffff;
            background: linear-gradient(135deg, #ff9d1c, var(--orange-dark));
            box-shadow: 0 8px 20px rgba(255, 122, 0, 0.28);
        }

        .medium-button.active[data-medium="woda"] {
            color: #ffffff;
            background: linear-gradient(135deg, #2e94ff, var(--blue-dark));
            box-shadow: 0 8px 20px rgba(21, 116, 223, 0.27);
        }

        .medium-button.active svg {
            color: #ffffff;
        }

        .content {
            padding: 18px 38px 30px;
        }

        .search-box {
            display: grid;
            grid-template-columns: auto minmax(180px, 1fr) auto;
            align-items: center;
            gap: 18px;
            padding: 12px 16px 12px 24px;
            background: rgba(255, 255, 255, 0.84);
            border: 1px solid rgba(255, 122, 0, 0.34);
            border-radius: 20px;
            box-shadow: 0 7px 20px rgba(16, 24, 40, 0.06);
            transition: border-color 0.25s ease;
        }

        body.water-mode .search-box {
            border-color: rgba(21, 116, 223, 0.34);
        }

        .search-label {
            display: flex;
            align-items: center;
            gap: 13px;
            white-space: nowrap;
            font-size: clamp(17px, 2vw, 25px);
            font-weight: 750;
        }

        .home-symbol {
            width: 43px;
            height: 43px;
            color: var(--orange);
            transition: color 0.25s ease;
        }

        body.water-mode .home-symbol {
            color: var(--blue);
        }

        .search-box input[type="text"] {
            width: 100%;
            min-height: 66px;
            padding: 10px 20px;
            color: var(--ink);
            background: #ffffff;
            border: 2px solid #cbd5e1;
            border-radius: 14px;
            outline: none;
            font-size: clamp(24px, 3vw, 38px);
            font-weight: 750;
            text-transform: uppercase;
            box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.06);
        }

        .search-box input[type="text"]:focus {
            border-color: var(--orange);
            box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.14);
        }

        body.water-mode .search-box input[type="text"]:focus {
            border-color: var(--blue);
            box-shadow: 0 0 0 4px rgba(21, 116, 223, 0.14);
        }

        .search-button {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 11px;
            min-width: 190px;
            min-height: 66px;
            padding: 10px 22px;
            color: #ffffff;
            background: linear-gradient(135deg, #ff9d1c, var(--orange-dark));
            border: 0;
            border-radius: 14px;
            cursor: pointer;
            font-size: clamp(20px, 2.2vw, 30px);
            font-weight: 750;
            box-shadow: 0 7px 17px rgba(255, 122, 0, 0.25);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        body.water-mode .search-button {
            background: linear-gradient(135deg, #2e94ff, var(--blue-dark));
            box-shadow: 0 7px 17px rgba(21, 116, 223, 0.24);
        }

        .search-button:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
        }

        .search-button svg {
            width: 35px;
            height: 35px;
        }

        .alert {
            margin-top: 14px;
            padding: 13px 18px;
            border-radius: 14px;
            font-weight: 700;
        }

        .alert.error {
            color: #9f1c1c;
            background: #fff0f0;
            border: 1px solid #ffb4b4;
        }

        .alert.success {
            color: #155f2b;
            background: #ebfaef;
            border: 1px solid #9bd9aa;
        }

        .meter-panel {
            display: none;
            margin-top: 16px;
            padding: 18px 20px;
            background: rgba(255, 250, 240, 0.76);
            border: 1px solid rgba(255, 122, 0, 0.32);
            border-radius: 20px;
            transition: background 0.25s ease, border-color 0.25s ease;
        }

        .meter-panel.active {
            display: block;
        }

        body.water-mode .meter-panel {
            background: rgba(240, 248, 255, 0.78);
            border-color: rgba(21, 116, 223, 0.30);
        }

        .plot-title {
            margin: 0 0 6px;
            text-align: center;
            font-size: 18px;
            color: var(--muted);
        }

        .plot-title strong {
            color: var(--ink);
        }

        .meters-grid {
            display: grid;
            grid-template-columns: 1fr 1px 1fr;
            align-items: stretch;
            gap: 26px;
        }

        .meters-divider {
            width: 1px;
            min-height: 100%;
            background: linear-gradient(transparent, rgba(120, 120, 120, 0.32), transparent);
        }

        .meter-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-width: 0;
            padding: 4px 8px 0;
        }

        .meter-card.previous {
            opacity: 0.67;
            filter: saturate(0.72);
        }

        .meter-title {
            margin: 0 0 8px;
            text-align: center;
            font-size: clamp(24px, 2.7vw, 34px);
            line-height: 1.15;
        }

        .meter-shell {
            position: relative;
            display: grid;
            place-items: center;
            width: min(100%, 390px);
            aspect-ratio: 1 / 0.90;
            padding: 34px;
            background:
                linear-gradient(145deg, #eef1f3 0%, #ffffff 45%, #c9cfd3 100%);
            border: 13px solid #5f6b74;
            border-radius: 50% 50% 43% 43%;
            box-shadow:
                inset 0 0 0 5px #dbe0e4,
                inset 0 -22px 26px rgba(60, 70, 78, 0.12),
                0 14px 24px rgba(15, 23, 42, 0.20);
        }

        .meter-card.previous .meter-shell {
            border-color: #aeb6bc;
            box-shadow:
                inset 0 0 0 5px #e4e7e9,
                inset 0 -22px 26px rgba(60, 70, 78, 0.08),
                0 12px 20px rgba(15, 23, 42, 0.12);
        }

        .meter-screw {
            position: absolute;
            width: 24px;
            height: 24px;
            background: radial-gradient(circle at 35% 30%, #ffffff, #8b9297 58%, #3f4549 62%, #dfe3e5 70%);
            border: 1px solid #6f767b;
            border-radius: 50%;
            box-shadow: 0 2px 3px rgba(0, 0, 0, 0.22);
        }

        .meter-screw::after {
            content: "";
            position: absolute;
            top: 10px;
            left: 4px;
            width: 14px;
            height: 2px;
            background: #33383c;
            transform: rotate(45deg);
            border-radius: 2px;
        }

        .screw-top { top: 18px; left: calc(50% - 12px); }
        .screw-left { left: 21px; top: 57%; }
        .screw-right { right: 21px; top: 57%; }
        .screw-bottom { bottom: 18px; left: calc(50% - 12px); }

        .meter-face {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-width: 0;
        }

        .meter-medium-icon {
            width: 48px;
            height: 48px;
            color: var(--orange);
            margin-bottom: -3px;
        }

        body.water-mode .meter-medium-icon {
            color: var(--blue);
        }

        .meter-unit {
            margin-bottom: 12px;
            font-size: clamp(24px, 3vw, 34px);
            font-weight: 850;
        }

        .counter-window {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: min(100%, 250px);
            max-width: 100%;
            min-height: 74px;
            padding: 8px;
            overflow-x: auto;
            background: linear-gradient(#12171b, #2a3035);
            border: 5px solid #3b444a;
            border-radius: 9px;
            box-shadow:
                inset 0 4px 8px rgba(0, 0, 0, 0.75),
                0 2px 0 rgba(255, 255, 255, 0.75);
            scrollbar-width: thin;
        }

        .digit-cell {
            display: inline-grid;
            place-items: center;
            flex: 0 0 auto;
            width: clamp(34px, 4vw, 50px);
            height: clamp(48px, 5.2vw, 62px);
            color: #ffffff;
            background:
                linear-gradient(90deg, rgba(255,255,255,0.04), transparent 30%, transparent 70%, rgba(255,255,255,0.04)),
                linear-gradient(#0b0d0f 0 49%, #252a2e 50% 52%, #090b0c 53% 100%);
            border-right: 1px solid #3f464b;
            border-left: 1px solid #050607;
            font-family: "Arial Narrow", "Segoe UI", Arial, sans-serif;
            font-size: clamp(33px, 4.5vw, 52px);
            font-weight: 650;
            line-height: 1;
            text-shadow: 0 2px 2px rgba(0, 0, 0, 0.9);
        }

        .digit-cell:first-child {
            border-radius: 4px 0 0 4px;
        }

        .digit-cell:last-child {
            border-radius: 0 4px 4px 0;
        }

        .digit-empty {
            width: 70px;
            border-radius: 4px !important;
        }

        .digit-separator,
        .digit-other {
            display: inline-grid;
            place-items: end center;
            align-self: stretch;
            flex: 0 0 auto;
            min-width: 17px;
            padding-bottom: 4px;
            color: #ffffff;
            font-size: clamp(30px, 4vw, 46px);
            font-weight: 800;
        }

        .meter-slot {
            position: relative;
            width: 68%;
            height: 24px;
            margin-top: 20px;
            background: linear-gradient(#111619, #020303 52%, #171d21);
            border: 4px solid #d0d5d8;
            border-radius: 8px;
            box-shadow: inset 0 3px 6px rgba(0,0,0,0.75);
        }

        .meter-slot::before {
            content: "";
            position: absolute;
            top: -7px;
            left: 50%;
            width: 3px;
            height: 31px;
            background: #101315;
            border-radius: 2px;
        }

        .meter-slot::after {
            content: "";
            position: absolute;
            top: 1px;
            right: -24px;
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-left: 15px solid #3c4449;
        }

        .date-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            min-width: 280px;
            max-width: 100%;
            margin-top: 14px;
            padding: 10px 18px;
            color: #5b6167;
            background: #f4f4f2;
            border: 2px solid #d7d8d8;
            border-radius: 13px;
            font-size: clamp(18px, 2.3vw, 28px);
            font-weight: 700;
        }

        .meter-card.current .date-badge {
            color: #155f2b;
            background: #e8f8eb;
            border-color: #8dd49b;
        }

        body.water-mode .meter-card.current .date-badge {
            color: #0757b9;
            background: #e9f5ff;
            border-color: #86c5ff;
        }

        .date-badge svg {
            width: 29px;
            height: 29px;
        }

        .replacement-box {
            display: flex;
            align-items: flex-start;
            gap: 18px;
            margin: 18px 2px 0;
            padding: 14px 22px;
            color: #4b2a00;
            background: linear-gradient(90deg, #fff7dc, #fffaf0);
            border: 1px solid #f2b332;
            border-radius: 14px;
        }

        body.water-mode .replacement-box {
            color: #063e79;
            background: linear-gradient(90deg, #e8f5ff, #f5fbff);
            border-color: #74baf7;
        }

        .replacement-box svg {
            flex: 0 0 auto;
            width: 50px;
            height: 50px;
            color: #f39a00;
        }

        body.water-mode .replacement-box svg {
            color: var(--blue);
        }

        .replacement-box strong {
            display: block;
            margin-bottom: 5px;
            font-size: 21px;
        }

        .replacement-box p {
            margin: 0;
            font-size: 17px;
            line-height: 1.45;
            white-space: pre-line;
        }

        .info-box {
            display: grid;
            grid-template-columns: auto minmax(0, 1fr) auto;
            align-items: center;
            gap: 18px;
            margin: 14px 2px 0;
            padding: 15px 20px;
            color: #0b2e68;
            background: linear-gradient(90deg, #e9f3ff, #f5f9ff);
            border: 1px solid #94c3ff;
            border-radius: 14px;
        }

        .info-icon {
            display: grid;
            place-items: center;
            width: 52px;
            height: 52px;
            color: #ffffff;
            background: linear-gradient(145deg, #3d9cff, #0757b9);
            border-radius: 50%;
            font-size: 32px;
            font-weight: 850;
        }

        .info-copy strong {
            display: block;
            margin-bottom: 5px;
            font-size: 20px;
        }

        .info-copy p {
            margin: 0;
            font-size: 16px;
            line-height: 1.45;
        }

        .info-copy a {
            color: #0757b9;
            font-weight: 750;
        }

        .remarks-button {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 11px;
            min-width: 210px;
            min-height: 62px;
            padding: 10px 22px;
            color: #ffffff;
            background: linear-gradient(135deg, #ff9d1c, var(--orange-dark));
            border-radius: 13px;
            text-decoration: none;
            font-size: 28px;
            font-weight: 750;
            box-shadow: 0 7px 17px rgba(255, 122, 0, 0.23);
        }

        body.water-mode .remarks-button {
            background: linear-gradient(135deg, #2e94ff, var(--blue-dark));
            box-shadow: 0 7px 17px rgba(21, 116, 223, 0.22);
        }

        .remarks-button svg {
            width: 37px;
            height: 37px;
        }

        .empty-note {
            margin: 28px 0 8px;
            text-align: center;
            color: var(--muted);
            font-size: 18px;
        }

        .admin-box {
            margin-top: 22px;
            padding: 22px;
            background: #ffffff;
            border: 2px dashed #94a3b8;
            border-radius: 18px;
        }

        .admin-box h2 {
            margin: 0 0 6px;
            font-size: 26px;
        }

        .admin-box > p {
            margin: 0 0 18px;
            color: var(--muted);
        }

        .admin-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(150px, 1fr));
            gap: 14px;
        }

        .admin-field {
            display: grid;
            gap: 7px;
        }

        .admin-field label {
            font-weight: 750;
        }

        .admin-field input {
            width: 100%;
            min-height: 47px;
            padding: 8px 10px;
            background: #ffffff;
            border: 1px solid #aab4c1;
            border-radius: 9px;
        }

        .admin-save {
            margin-top: 16px;
            padding: 12px 22px;
            color: #ffffff;
            background: #1f7a36;
            border: 0;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 750;
            font-size: 17px;
        }

        @media (max-width: 1050px) {
            .topbar {
                align-items: stretch;
                flex-direction: column;
            }

            .medium-switch {
                width: 100%;
                min-width: 0;
            }

            .search-box {
                grid-template-columns: 1fr auto;
            }

            .search-label {
                grid-column: 1 / -1;
            }

            .admin-grid {
                grid-template-columns: repeat(2, minmax(150px, 1fr));
            }
        }

        @media (max-width: 760px) {
            body {
                padding: 0;
            }

            .page-shell {
                min-height: 100vh;
                border-width: 0;
                border-radius: 0;
            }

            .topbar,
            .content {
                padding-left: 16px;
                padding-right: 16px;
            }

            .brand {
                align-items: flex-start;
            }

            .brand-icon {
                width: 62px;
                height: 62px;
                border-width: 3px;
            }

            .brand-icon svg {
                width: 34px;
                height: 34px;
            }

            .brand-copy h1 {
                letter-spacing: -0.5px;
            }

            .medium-button {
                min-height: 66px;
                padding: 8px 10px;
                font-size: 22px;
            }

            .medium-button svg {
                width: 32px;
                height: 32px;
            }

            .search-box {
                grid-template-columns: 1fr;
                gap: 11px;
                padding: 15px;
            }

            .search-label {
                grid-column: auto;
            }

            .search-button {
                width: 100%;
                min-width: 0;
            }

            .meters-grid {
                grid-template-columns: 1fr;
                gap: 15px;
            }

            .meters-divider {
                width: 100%;
                height: 1px;
                min-height: 1px;
                background: linear-gradient(90deg, transparent, rgba(120, 120, 120, 0.32), transparent);
            }

            .meter-shell {
                width: min(100%, 340px);
                border-width: 10px;
            }

            .meter-card.previous {
                opacity: 0.75;
            }

            .date-badge {
                min-width: 0;
                width: min(100%, 320px);
            }

            .info-box {
                grid-template-columns: auto minmax(0, 1fr);
            }

            .remarks-button {
                grid-column: 1 / -1;
                width: 100%;
            }

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

        @media (max-width: 420px) {
            .topbar {
                padding-top: 15px;
            }

            .brand {
                gap: 10px;
            }

            .brand-icon {
                width: 52px;
                height: 52px;
            }

            .brand-icon svg {
                width: 28px;
                height: 28px;
            }

            .medium-button {
                gap: 7px;
                font-size: 19px;
            }

            .medium-button svg {
                width: 27px;
                height: 27px;
            }

            .content {
                padding: 12px 10px 22px;
            }

            .meter-panel {
                padding: 14px 7px;
            }

            .meter-shell {
                padding: 24px;
            }

            .counter-window {
                min-width: 0;
                width: 100%;
            }

            .replacement-box,
            .info-box {
                padding: 13px;
            }
        }