﻿:root {
    --bg: #eef2f7;
    --bg-deep: #d7e0ec;
    --surface: #ffffff;
    --ink: #0f1b2d;
    --muted: #5a6b80;
    --line: #c5d0de;
    --accent: #0b3d91;
    --accent-soft: #d9e6f7;
    --accent-strong: #071e45;
    --accent-mid: #1559b8;
    --warn: #9a6700;
    --warn-soft: #fff3cd;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --info: #175cd3;
    --info-soft: #eff4ff;
    --shadow: 0 18px 40px rgba(15, 27, 45, 0.08);
    --radius: 18px;
    --font: "DM Sans", sans-serif;
    --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(11, 61, 145, 0.14), transparent 28%),
        linear-gradient(180deg, #f7f9fc 0%, var(--bg) 40%, var(--bg-deep) 100%);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201, 213, 222, 0.8);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-main {
    display: contents;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    order: 1;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    min-width: 52px;
    height: 42px;
    padding: 0 0.45rem;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--accent-strong), var(--accent-mid));
    color: white;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.brand-text {
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 0.35rem;
    flex: 1;
    order: 2;
}

.nav a {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 500;
}

.nav a.active,
.nav a:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.userbox {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
    order: 3;
    margin-left: auto;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    min-width: 0;
}

.user-meta strong {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta span {
    font-size: 0.8rem;
    color: var(--muted);
}

.main {
    width: min(1120px, calc(100% - 2rem));
    margin: 1.5rem auto 2rem;
    flex: 1;
}

.main-auth {
    display: grid;
    place-items: center;
    width: min(480px, calc(100% - 2rem));
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1rem 1.5rem 1.75rem;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-head h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: -0.03em;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow);
}

.stat .label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.stat .value {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.panel-body { padding: 1.2rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s ease;
}

.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.9rem; border-radius: 10px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: #edf2f5; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #e2e9ee; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: #f3f6f8; color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f3c1bd; }

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    gap: 0.4rem;
}

.form-row.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

label {
    font-weight: 600;
    font-size: 0.92rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    font: inherit;
    background: #fbfcfd;
    color: var(--ink);
}

textarea { min-height: 96px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(11, 61, 145, 0.28);
    border-color: var(--accent);
    background: white;
}

.auth-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(201, 213, 222, 0.9);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.auth-card .eyebrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.auth-card h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.auth-card .lead {
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.auth-hint {
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: var(--info-soft);
    color: #1849a9;
    font-size: 0.9rem;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: #f7fafb;
}

tr:last-child td { border-bottom: 0; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-draft { background: #eef2f4; color: var(--muted); }
.badge-progress { background: var(--warn-soft); color: var(--warn); }
.badge-done { background: var(--accent-soft); color: var(--accent-strong); }

.progress {
    height: 8px;
    background: #e7edf1;
    border-radius: 999px;
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-mid));
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.store-card,
.entrance-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.store-card:hover,
.entrance-card:hover {
    transform: translateY(-2px);
    border-color: #9eb5c3;
}

.store-card .code,
.entrance-card .code {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.store-card h3,
.entrance-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.brand-card h3 {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.muted { color: var(--muted); }
.stack { display: grid; gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.alert {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success { background: var(--accent-soft); color: var(--accent-strong); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }

.check-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.1rem;
    background: #fbfcfd;
}

.check-item h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.check-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.check-toggle input {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--accent);
}

.photo-box {
    display: grid;
    gap: 0.75rem;
}

.photo-label {
    font-weight: 600;
    font-size: 0.92rem;
}

.photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.photo-actions .btn {
    cursor: pointer;
}

.photo-preview {
    width: min(280px, 100%);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #eef2f4;
}

.photo-preview[hidden] {
    display: none !important;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
}

.breadcrumb a:hover { color: var(--accent-strong); }

.empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--muted);
}

.page-head-status {
    min-width: 180px;
}

.page-head-status .progress {
    margin-top: 0.65rem;
}

.checklist-hint {
    margin: 0;
}

.layout-panel .panel-head {
    align-items: center;
}

.layout-empty {
    display: grid;
    place-items: center;
    gap: 0.55rem;
    padding: 1.5rem 1rem;
    border: 1px dashed rgba(11, 61, 145, 0.3);
    border-radius: 14px;
    background:
        radial-gradient(circle at top left, rgba(11, 61, 145, 0.08), transparent 50%),
        #f7f9fc;
    color: var(--muted);
    text-align: center;
}

.layout-empty p {
    margin: 0;
}

.layout-empty-icon,
.layout-item-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--accent-strong), var(--accent-mid));
    color: white;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.layout-list {
    display: grid;
    gap: 0.75rem;
}

.layout-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(20, 33, 43, 0.04);
}

.layout-item-body {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.layout-item-body strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-item-body .muted {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
}

.layout-rename {
    position: relative;
}

.layout-rename > summary {
    list-style: none;
    cursor: pointer;
}

.layout-rename > summary::-webkit-details-marker {
    display: none;
}

.layout-rename-form {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 5;
    display: grid;
    gap: 0.45rem;
    width: min(260px, 70vw);
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.layout-upload {
    margin-top: 0.25rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.layout-upload-grid {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 0.9rem;
}

.layout-file-field {
    position: relative;
}

.layout-file-field input.layout-file-input[type="file"],
input#layout_pdfs[type="file"] {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.layout-file-box {
    border: 1px solid rgba(11, 61, 145, 0.18);
    border-radius: 16px;
    background:
        radial-gradient(circle at top left, rgba(11, 61, 145, 0.1), transparent 45%),
        linear-gradient(180deg, #ffffff 0%, #f2f6fc 100%);
    overflow: hidden;
}

.layout-file-box-main {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.05rem 1.1rem;
}

.layout-file-box-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--accent-strong), var(--accent-mid));
    color: #fff;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(11, 61, 145, 0.22);
}

.layout-file-box-text {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    flex: 1;
}

.layout-file-box-text strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.layout-file-box-text span {
    font-size: 0.86rem;
    color: var(--muted);
}

.layout-file-btn {
    min-width: 118px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.layout-file-list {
    list-style: none;
    margin: 0;
    padding: 0.85rem 1.1rem 1.1rem;
    border-top: 1px solid rgba(11, 61, 145, 0.12);
    display: grid;
    gap: 0.5rem;
    background: rgba(217, 230, 247, 0.45);
}

.layout-file-list[hidden] {
    display: none !important;
}

.layout-file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 6px 16px rgba(20, 33, 43, 0.04);
    font-size: 0.9rem;
}

.layout-file-list li span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    color: var(--ink);
    font-weight: 500;
}

.layout-file-list li span:last-child {
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-family: var(--mono);
    flex-shrink: 0;
}

@media (max-width: 860px) {
    .layout-item {
        flex-wrap: wrap;
    }

    .layout-item-actions {
        width: 100%;
    }

    .layout-item-actions .btn,
    .layout-item-actions form,
    .layout-item-actions details {
        flex: 1 1 auto;
    }

    .layout-item-actions .btn,
    .layout-item-actions form .btn,
    .layout-item-actions summary {
        width: 100%;
    }

    .layout-file-box-main {
        flex-wrap: wrap;
    }

    .layout-file-btn {
        width: 100%;
    }
}

.camera-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: end center;
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(10, 18, 24, 0.72);
}

.camera-modal[hidden] {
    display: none !important;
}

.camera-sheet {
    width: min(520px, 100%);
    background: #101820;
    color: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.camera-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}

.camera-head .btn-ghost {
    color: #d7e0e7;
    border-color: rgba(255, 255, 255, 0.2);
}

.camera-stage {
    position: relative;
    background: #000;
    aspect-ratio: 3 / 4;
    max-height: min(68vh, 560px);
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.camera-status {
    position: absolute;
    inset: auto 1rem 1rem;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.9rem;
}

.camera-status.is-error {
    background: rgba(180, 35, 24, 0.85);
}

.camera-controls {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.55rem;
    padding: 0.85rem 1rem 1rem;
}

.camera-controls .btn {
    min-height: 48px;
}

body.camera-open {
    overflow: hidden;
}

@media (min-width: 861px) {
    .camera-modal {
        place-items: center;
    }

    .camera-stage {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 860px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(11, 61, 145, 0.1), transparent 40%),
            linear-gradient(180deg, #f7fafb 0%, var(--bg) 50%, var(--bg-deep) 100%);
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0.7rem 0.85rem 0.75rem;
        padding-top: calc(0.7rem + env(safe-area-inset-top));
        padding-left: calc(0.85rem + env(safe-area-inset-left));
        padding-right: calc(0.85rem + env(safe-area-inset-right));
    }

    .topbar-main {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.65rem;
        order: 1;
    }

    .brand {
        gap: 0.5rem;
        min-width: 0;
        flex: 1;
        order: initial;
    }

    .userbox {
        order: initial;
        margin-left: 0;
    }

    .brand-mark {
        min-width: 46px;
        width: auto;
        height: 36px;
        font-size: 0.6rem;
        border-radius: 10px;
    }

    .brand-text {
        font-size: 0.92rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .userbox {
        gap: 0.45rem;
    }

    .user-meta strong {
        font-size: 0.82rem;
        max-width: 88px;
    }

    .user-meta span {
        display: none;
    }

    .btn-logout {
        padding: 0.4rem 0.65rem;
        font-size: 0.82rem;
        min-height: 36px;
        border-radius: 10px;
    }

    .nav {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        width: 100%;
        flex: none;
        order: 2;
        gap: 0.3rem;
        padding: 0.3rem;
        background: #eef3f6;
        border-radius: 14px;
    }

    .nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 40px;
        padding: 0.45rem 0.4rem;
        border-radius: 10px;
        font-size: 0.88rem;
        text-align: center;
        white-space: nowrap;
    }

    .nav a.active {
        background: white;
        color: var(--accent-strong);
        box-shadow: 0 1px 3px rgba(20, 33, 43, 0.08);
    }

    .main {
        width: min(1120px, calc(100% - 1.1rem));
        margin: 1rem auto 5.5rem;
    }

    .main-auth {
        width: min(480px, calc(100% - 1.1rem));
        margin: 1.25rem auto 2rem;
        align-content: center;
    }

    .footer {
        padding: 0.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
        font-size: 0.82rem;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    .page-head h1 {
        font-size: 1.45rem;
        line-height: 1.2;
    }

    .page-head p {
        font-size: 0.92rem;
    }

    .page-head-status {
        width: 100%;
        min-width: 0;
        padding: 0.85rem 1rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow);
    }

    .page-head .actions,
    .actions {
        width: 100%;
    }

    .page-head .actions .btn,
    .page-head .actions form {
        flex: 1 1 auto;
    }

    .page-head .actions form {
        display: flex;
    }

    .page-head .actions form .btn {
        width: 100%;
    }

    .grid-2,
    .grid-3,
    .form-row.two {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat {
        padding: 0.9rem 1rem;
        border-radius: 14px;
    }

    .stat .value {
        font-size: 1.45rem;
    }

    .panel {
        border-radius: 16px;
    }

    .panel-head,
    .panel-body {
        padding: 0.95rem 1rem;
    }

    .auth-card {
        padding: 1.35rem 1.2rem;
        border-radius: 20px;
    }

    .auth-card h1 {
        font-size: 1.55rem;
    }

    .auth-card .lead {
        font-size: 0.95rem;
        margin-bottom: 1.15rem;
    }

    th, td {
        padding: 0.75rem 0.8rem;
        font-size: 0.9rem;
    }

    .store-card,
    .entrance-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .store-card:hover,
    .entrance-card:hover {
        transform: none;
    }

    .check-item {
        padding: 1rem;
        border-radius: 14px;
    }

    .check-item h3 {
        font-size: 1rem;
        line-height: 1.35;
    }

    .check-toggle {
        padding: 0.55rem 0.7rem;
        background: white;
        border: 1px solid var(--line);
        border-radius: 12px;
    }

    .check-toggle input {
        width: 1.25rem;
        height: 1.25rem;
        flex-shrink: 0;
    }

    .photo-preview {
        width: 100%;
        max-width: none;
    }

    .photo-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .photo-actions .btn {
        width: 100%;
        min-height: 44px;
        padding: 0.7rem 0.6rem;
        font-size: 0.9rem;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px; /* cegah zoom otomatis di iOS */
        padding: 0.8rem 0.85rem;
    }

    textarea {
        min-height: 88px;
    }

    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 40px;
    }

    .checklist-actions {
        position: sticky;
        bottom: calc(0.65rem + env(safe-area-inset-bottom));
        z-index: 15;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
        margin-top: 0.35rem;
        padding: 0.65rem;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(20, 33, 43, 0.12);
        backdrop-filter: blur(10px);
    }

    .checklist-actions .btn-ghost {
        grid-column: 1 / -1;
    }

    .checklist-hint {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .table-wrap {
        margin: 0 -0.15rem;
        border-radius: 0 0 16px 16px;
    }

    .breadcrumb {
        font-size: 0.84rem;
        gap: 0.3rem;
    }
}

@media (max-width: 420px) {
    .user-meta {
        display: none;
    }

    .brand-text {
        font-size: 0.88rem;
    }

    .nav a {
        font-size: 0.84rem;
        min-height: 38px;
    }

    .grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .stat .label {
        font-size: 0.8rem;
    }

    .photo-actions {
        grid-template-columns: 1fr;
    }
}

