:root {
    --bg: #07111f;
    --bg2: #0d1728;
    --panel: rgba(12, 23, 40, 0.86);
    --panel2: rgba(17, 31, 53, 0.96);
    --line: rgba(130, 177, 255, 0.18);
    --text: #eef6ff;
    --muted: #95a8c4;
    --green: #39d96b;
    --green2: #1fb84f;
    --red: #ff4d5f;
    --red2: #ff2f43;
    --cyan: #37d6ff;
    --input: rgba(255, 255, 255, 0.08);
    --shadow: 0 18px 40px rgba(0, 0, 0, .35);
    --radius: 26px;
    --radius2: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: radial-gradient(circle at top, #15325b 0%, #091321 35%, #050b15 100%);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
    padding: 24px 0;
}

.hidden {
    display: none !important;
}

/* Layout */
.app-shell {
    display: flex;
    justify-content: center;
    padding: 0 12px 12px 12px;
}

.phone-frame {
    width: 100%;
    max-width: 460px;
    margin-top: 14px;
    background: linear-gradient(180deg, #0d1728, #09111d);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 38px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
    overflow: hidden;
}

.screen {
    padding: 12px;
}

/* Optional header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--cyan);
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(57, 217, 107, .15), 0 0 16px rgba(57, 217, 107, .55);
}

/* Alerts */
.alert {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
}

    .alert.success {
        background: rgba(57, 217, 107, .14);
        border: 1px solid rgba(57, 217, 107, .25);
        color: #a4ffc1;
    }

    .alert.error {
        background: rgba(255, 77, 95, .14);
        border: 1px solid rgba(255, 77, 95, .25);
        color: #ffc0c7;
    }

/* Cards */
.camera-card,
.panel-card,
.list-card {
    background: var(--panel);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.camera-card {
    margin-top: 0;
    margin-bottom: 14px;
    overflow: hidden;
}

.panel-card {
    padding: 16px;
    margin-bottom: 14px;
}

.list-card {
    padding: 14px;
}

/* Camera */
.camera-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.camera-stage {
    position: relative;
    height: 250px;
    background: #000;
    overflow: hidden;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Scan overlay */
.scan-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-label {
    position: absolute;
    top: 18px;
    padding: 8px 18px;
    border-radius: 12px;
    background: rgba(57, 217, 107, .95);
    color: #05120a;
    font-weight: 900;
    letter-spacing: .08em;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.scan-frame {
    width: 74%;
    height: 70%;
    position: relative;
    border-radius: 20px;
    box-shadow: inset 0 0 0 2px rgba(57, 217, 107, .5);
}

    .scan-frame::before,
    .scan-frame::after {
        content: "";
        position: absolute;
        border-radius: 20px;
    }

    .scan-frame::before {
        top: 0;
        left: 0;
        width: 44px;
        height: 44px;
        border-top: 6px solid var(--green);
        border-left: 6px solid var(--green);
    }

    .scan-frame::after {
        right: 0;
        bottom: 0;
        width: 44px;
        height: 44px;
        border-right: 6px solid var(--green);
        border-bottom: 6px solid var(--green);
    }

/* Form */
.field-group {
    margin-bottom: 16px;
}

    .field-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 700;
        color: var(--text);
    }

.row-inline {
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    gap: 10px;
    align-items: center;
}

.text-input {
    width: 100%;
    height: 52px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--input);
    color: var(--text);
    outline: none;
    font-size: 16px;
}

    .text-input::placeholder {
        color: #7f93b2;
    }

    .text-input:focus {
        border-color: rgba(55, 214, 255, .55);
        box-shadow: 0 0 0 4px rgba(55, 214, 255, .12);
    }

/* Select */
.select-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 42px;
    background-image: linear-gradient(45deg, transparent 50%, #9fb3d1 50%), linear-gradient(135deg, #9fb3d1 50%, transparent 50%);
    background-position: calc(100% - 22px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
    background-size: 8px 8px, 8px 8px;
    background-repeat: no-repeat;
}

    .select-input option {
        color: #111;
    }

/* Buttons */
.icon-btn {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 900;
    box-shadow: var(--shadow);
}

    .icon-btn.icon-green {
        background: linear-gradient(180deg, #3df57b, #22b451);
        color: #05210e;
    }

    .icon-btn.icon-red {
        background: linear-gradient(180deg, #ff6677, #ff3348);
        color: #fff;
    }

    .icon-btn.big {
        width: 72px;
        height: 72px;
        border-radius: 22px;
    }

/* Old photo card if still used */
.photo-card {
    display: grid;
    grid-template-columns: 72px 1fr 72px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
}

.camera-btn {
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-size: 32px;
    background: linear-gradient(180deg, #ffffff, #d9e5f5);
    box-shadow: var(--shadow);
}

/* New photo control */
.photo-control {
    margin-top: 15px;
    margin-bottom: 18px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 27, 50, .78);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.photo-btn {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .photo-btn img {
        width: 52px;
        opacity: .9;
        transition: transform .2s;
    }

    .photo-btn:hover img {
        transform: scale(1.05);
    }

    .photo-btn.delete img {
        width: 50px;
    }

.photo-preview-wrap {
    flex: 1;
    height: 100px;
    margin: 0 10px;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    border: 1px dashed rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

    .photo-preview.show {
        display: block;
    }

.photo-empty {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

/* Location row */
.location-row {
    width: 100%;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    gap: 12px;
    align-items: center;
}

.status-dot-green {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2bdc6c;
    box-shadow: 0 0 0 6px rgba(43, 220, 108, .15);
    cursor: pointer;
    animation: pulseGreen 1.5s infinite;
}

.status-dot-red {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ff3b4f;
    box-shadow: 0 0 0 6px rgba(255, 59, 79, .15);
    justify-self: end;
    cursor: pointer;
    animation: pulseRed 2s infinite;
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(43, 220, 108, .7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(43, 220, 108, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(43, 220, 108, 0);
    }
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 79, .6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255, 59, 79, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 79, 0);
    }
}

/* Legacy scan button if still exists */
.scan-dot-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: #d9dde3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
}

.scan-dot-inner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: block;
    background: linear-gradient(180deg, #39d96b, #25b553);
    box-shadow: 0 0 0 3px rgba(57, 217, 107, .18), 0 0 12px rgba(57, 217, 107, .45);
}

.location-clear-btn {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff5c6b, #ff2f43);
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

/* Submit */
.submit-btn {
    width: 100%;
    height: 62px;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    background: linear-gradient(180deg, #3af877, #24b34f);
    color: #04200d;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(36, 179, 79, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

    .submit-btn .arrow {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(4, 32, 13, .14);
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* List */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

    .list-header h2 {
        margin: 0;
        font-size: 18px;
    }

    .list-header span {
        color: var(--muted);
        font-size: 13px;
    }

.record-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-row {
    display: grid;
    grid-template-columns: 1fr 72px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--panel2);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 20px;
}

.record-main {
    display: grid;
    grid-template-columns: 68px 1fr;
    gap: 12px;
    align-items: center;
}

.record-image {
    width: 68px;
    height: 68px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
}

    .record-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.no-image {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.record-info {
    min-width: 0;
}

.top-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.time {
    font-weight: 800;
    color: var(--cyan);
}

.litre {
    font-weight: 900;
    color: #aef0bf;
}

.bottom-line {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

.delete-btn {
    height: 54px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(180deg, #ff6374, #ff3348);
    color: #fff;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.empty-state {
    padding: 18px;
    text-align: center;
    color: var(--muted);
    background: rgba(255, 255, 255, .03);
    border-radius: 18px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 18, .78);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    z-index: 2;
    width: calc(100% - 24px);
    max-width: 420px;
    margin: 40px auto;
    padding: 16px;
    background: linear-gradient(180deg, #101d31, #091321);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .modal-header h3 {
        margin: 0;
    }

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
}

.modal-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.delete-qr-box {
    min-height: 220px;
    margin: 14px 0;
    padding: 14px;
    background: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.secondary-btn {
    height: 48px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 800;
    background: rgba(255, 255, 255, .09);
    color: #fff;
}

    .secondary-btn.danger {
        background: rgba(255, 77, 95, .18);
        color: #ffc4ca;
    }

.delete-scan-result {
    min-height: 22px;
    margin-top: 12px;
    color: var(--cyan);
    font-weight: 700;
}

/* Mobile */
@media (max-width: 420px) {
    .screen {
        padding: 12px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .row-inline {
        grid-template-columns: 52px 1fr 52px;
    }

    .photo-card {
        grid-template-columns: 64px 1fr 64px;
    }

    .camera-btn,
    .icon-btn.big {
        width: 64px;
        height: 64px;
    }

    .photo-btn {
        width: 64px;
        height: 64px;
    }

        .photo-btn img {
            width: 46px;
        }

    .location-row {
        grid-template-columns: 34px 1fr 34px;
        gap: 10px;
    }

    .status-dot-green,
    .status-dot-red {
        width: 22px;
        height: 22px;
    }
}
.record-row {
    position: relative;
}

.delete-fab {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff6b7a 0%, #ff3d57 100%);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(255, 61, 87, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    z-index: 3;
}

    .delete-fab:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 18px rgba(255, 61, 87, 0.45);
        filter: brightness(1.03);
    }

    .delete-fab:active {
        transform: scale(0.96);
    }

    .delete-fab:focus-visible {
        outline: 2px solid rgba(255,255,255,0.9);
        outline-offset: 2px;
    }