﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #F5F7FB;
    color: #102033;
    font-family: "Microsoft JhengHei", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

label {
    color: #1F3558;
    font-weight: 800;
    font-size: 14px;
}

/* Shell */
.app-shell {
    min-height: 100vh;
    padding-bottom: 76px;
}

/* Top Bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 64px;
    padding: 10px 16px;
    background: #08213F;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-weight: 800;
    font-size: 18px;
}

.sub {
    font-size: 12px;
    color: #BFD8FF;
}

.top-link {
    font-size: 13px;
    background: rgba(255, 255, 255, .14);
    padding: 8px 12px;
    border-radius: 999px;
}

.top-button {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

/* Page */
.mobile-page {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 24px 16px 96px;
    box-sizing: border-box;
}

/* Hero */
.hero-card {
    background: linear-gradient(135deg, #08213F, #3C74DC);
    color: white;
    padding: 22px;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(8, 33, 63, .18);
    margin-bottom: 16px;
}

    .hero-card h1,
    .page-title h1 {
        margin: 8px 0;
        font-size: 26px;
    }

    .hero-card p,
    .page-title p {
        margin: 0;
        line-height: 1.5;
    }

    .hero-card p {
        color: #D6E6FF;
    }

.page-title p {
    color: #68748A;
}

.pill {
    display: inline-block;
    background: rgba(255, 255, 255, .16);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

/* Cards */
.card,
.list-card {
    background: white;
    border: 1px solid #D8E5F5;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 8px 18px rgba(31, 53, 88, .06);
}

.page-title,
.hero-card,
.card,
.detail-hero {
    width: 100%;
    box-sizing: border-box;
}

.list-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .list-card strong {
        color: #08213F;
    }

    .list-card span {
        color: #3C74DC;
        font-weight: 700;
    }

    .list-card small {
        color: #68748A;
        line-height: 1.4;
    }

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.module-card {
    min-height: 112px;
    background: white;
    border: 1px solid #D8E5F5;
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 8px 18px rgba(31, 53, 88, .06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .module-card span {
        font-weight: 800;
        color: #08213F;
    }

    .module-card strong {
        color: #3C74DC;
        font-size: 13px;
    }

/* Form */
.input {
    width: 100%;
    height: 42px;
    border: 1px solid #90CAF9;
    border-radius: 14px;
    background: #EAF3FF;
    padding: 0 12px;
    font-size: 15px;
    margin: 8px 0 12px;
}

.textarea {
    width: 100%;
    min-height: 96px;
    border: 1px solid #90CAF9;
    border-radius: 14px;
    background: #EAF3FF;
    padding: 12px;
    font-size: 15px;
    margin: 8px 0 12px;
    font-family: inherit;
    resize: vertical;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.link-button {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
}

.link-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #3C74DC;
    color: white;
}

.btn-secondary {
    background: #EAF3FF;
    color: #08213F;
    border: 1px solid #90CAF9;
}

/* Alert */
.alert {
    background: #FFF4E5;
    border: 1px solid #FFD399;
    color: #8A4B00;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

/* Status */
.status-row {
    display: flex;
    justify-content: space-between;
    margin: 12px 0;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #dfe7f3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 50;
}

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        text-align: center;
        text-decoration: none;
        color: #315be8;
        font-weight: 800;
        font-size: 12px;
    }

        .bottom-nav a.active {
            color: #08213F;
        }

        .bottom-nav a span {
            font-size: 18px;
            line-height: 1;
        }

/* Customer */
.customer-link em {
    font-style: normal;
    color: #3C74DC;
    font-size: 13px;
    font-weight: 800;
    margin-top: 4px;
}

/* Detail */
.detail-hero {
    background: linear-gradient(135deg, #08213F, #3C74DC);
    color: white;
    padding: 20px;
    border-radius: 22px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 12px 28px rgba(8, 33, 63, .18);
}

    .detail-hero strong {
        font-size: 24px;
    }

    .detail-hero span,
    .detail-hero small {
        color: #D6E6FF;
    }

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #EEF3FA;
}

    .info-row span,
    .info-block span {
        color: #68748A;
        font-size: 14px;
    }

    .info-row b {
        text-align: right;
        color: #08213F;
    }

.info-block {
    padding: 10px 0;
    border-bottom: 1px solid #EEF3FA;
}

    .info-block p {
        margin: 4px 0 0;
        color: #08213F;
        line-height: 1.5;
    }

.mini-card {
    background: #F5F9FF;
    border: 1px solid #D8E5F5;
    border-radius: 16px;
    padding: 12px;
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .mini-card strong {
        color: #08213F;
    }

    .mini-card span {
        color: #3C74DC;
        font-weight: 800;
    }

    .mini-card small,
    .muted {
        color: #68748A;
    }

/* Notice */
.notice-item {
    padding: 8px 0;
    color: #1F3558;
    border-bottom: 1px solid #EEF3FA;
    font-weight: 700;
}

    .notice-item:last-child {
        border-bottom: 0;
    }

/* Service Tabs */
.quick-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.tab-btn {
    border: 1px solid #D8E5F5;
    background: white;
    border-radius: 999px;
    height: 38px;
    font-weight: 800;
    color: #3C74DC;
}

    .tab-btn.active {
        background: #3C74DC;
        color: white;
    }

/* Service Cards */
.service-card {
    display: block;
    background: white;
    border: 1px solid #D8E5F5;
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 18px rgba(31, 53, 88, .06);
}

.service-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.service-card h3 {
    margin: 10px 0 6px;
    color: #08213F;
}

.service-card p {
    margin: 0 0 6px;
    color: #3C74DC;
    font-weight: 800;
}

.service-card small {
    display: block;
    color: #68748A;
    line-height: 1.5;
}

.service-action {
    margin-top: 10px;
}

.service-text {
    color: #1F3558;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Status Badge */
.status-badge {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

    .status-badge.pending {
        background: #FFF4E5;
        color: #A15C00;
    }

    .status-badge.doing {
        background: #EAF3FF;
        color: #2459B8;
    }

    .status-badge.done {
        background: #E8F8ED;
        color: #16803A;
    }

    .status-badge.void {
        background: #FFECEC;
        color: #D62828;
    }

/* Mobile layout size fix */
.list-summary {
    width: 100%;
    margin: 14px 0 8px;
    font-size: 15px;
    color: #0f2147;
}

.list-card,
.customer-link {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
    margin: 12px 0;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid #d7e4f7;
    background: #ffffff;
    color: #0f2147;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(15, 33, 71, 0.06);
}

    .list-card strong,
    .customer-link strong {
        display: block;
        font-size: 18px;
        margin-bottom: 8px;
    }

    .list-card span,
    .customer-link span,
    .list-card small,
    .customer-link small,
    .list-card em,
    .customer-link em {
        display: block;
        line-height: 1.7;
    }

    .customer-link em,
    .list-card em {
        margin-top: 8px;
        color: #315be8;
        font-style: normal;
        font-weight: 700;
    }

/* Dashboard Pro UI */
.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-date {
    font-size: 13px;
    color: #D6E6FF;
    font-weight: 700;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 104px;
    background: linear-gradient(135deg, #173C81, #3C74DC);
    color: white;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 10px 24px rgba(23, 60, 129, .18);
}

    .kpi-card::after {
        content: "";
        position: absolute;
        right: -22px;
        bottom: -22px;
        width: 82px;
        height: 82px;
        border-radius: 50%;
        background: rgba(255, 255, 255, .12);
    }

    .kpi-card span {
        display: block;
        font-size: 13px;
        color: #D6E6FF;
        font-weight: 800;
    }

    .kpi-card strong {
        display: block;
        margin-top: 10px;
        font-size: 30px;
        line-height: 1;
        letter-spacing: .5px;
    }

    .kpi-card small {
        display: block;
        margin-top: 8px;
        color: #BFD8FF;
        font-size: 12px;
        font-weight: 700;
    }

    .kpi-card.warning {
        background: linear-gradient(135deg, #8A4B00, #F59E0B);
    }

    .kpi-card.success {
        background: linear-gradient(135deg, #0F6B3A, #22A55A);
    }

    .kpi-card.danger {
        background: linear-gradient(135deg, #8B1E2D, #DC3545);
    }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 10px;
}

    .section-title h2 {
        margin: 0;
        color: #08213F;
        font-size: 18px;
    }

    .section-title span {
        color: #68748A;
        font-size: 13px;
        font-weight: 700;
    }

.module-card {
    position: relative;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

    .module-card::after {
        content: "";
        position: absolute;
        right: -18px;
        bottom: -18px;
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background: rgba(60, 116, 220, .08);
    }

    .module-card:active {
        transform: scale(.98);
        box-shadow: 0 4px 12px rgba(31, 53, 88, .08);
    }

    .module-card .icon {
        width: 38px;
        height: 38px;
        border-radius: 14px;
        background: #EAF3FF;
        color: #3C74DC;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        margin-bottom: 10px;
    }

.notice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notice-pro {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 16px;
    background: #F5F9FF;
    border: 1px solid #D8E5F5;
}

    .notice-pro .dot {
        width: 10px;
        height: 10px;
        min-width: 10px;
        border-radius: 50%;
        background: #3C74DC;
        margin-top: 6px;
    }

    .notice-pro.warning .dot {
        background: #F59E0B;
    }

    .notice-pro.danger .dot {
        background: #DC3545;
    }

    .notice-pro.success .dot {
        background: #22A55A;
    }

    .notice-pro strong {
        display: block;
        color: #08213F;
        font-size: 14px;
        margin-bottom: 2px;
    }

    .notice-pro small {
        display: block;
        color: #68748A;
        line-height: 1.4;
    }

.server-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #E8F8ED;
    color: #16803A;
    font-size: 13px;
    font-weight: 800;
}

    .server-chip.error {
        background: #FFECEC;
        color: #D62828;
    }

.hero-card,
.card,
.module-card,
.list-card {
    backdrop-filter: blur(6px);
}

/* Camera / attachment mobile blocks */
.upload-panel {
    border: 1px dashed #90CAF9;
    background: #F5F9FF;
    border-radius: 18px;
    padding: 16px;
    margin: 12px 0;
}

    .upload-panel strong {
        display: block;
        color: #08213F;
        margin-bottom: 6px;
    }

    .upload-panel small {
        display: block;
        color: #68748A;
        line-height: 1.5;
    }

.file-input {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: white;
    border: 1px solid #D8E5F5;
}

/* Signature Fix */
.signature-canvas {
    width: 100%;
    height: 260px;
    display: block;
    border: 1px solid #90CAF9;
    border-radius: 18px;
    background: #ffffff;
    touch-action: none;
    -ms-touch-action: none;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* 電腦瀏覽器測手機版時，讓畫面不要太窄 */
@media (min-width: 768px) {
    .mobile-page {
        max-width: 820px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .list-card,
    .customer-link {
        width: 100%;
    }
}

/* 真手機寬度 */
@media (max-width: 480px) {
    .mobile-page {
        padding: 18px 12px 88px;
    }

    .hero-card h1,
    .page-title h1 {
        font-size: 24px;
    }

    .card {
        padding: 16px;
    }

    .list-card,
    .customer-link {
        padding: 16px;
        border-radius: 16px;
    }

        .list-card strong,
        .customer-link strong {
            font-size: 16px;
        }

    .kpi-card {
        min-height: 98px;
        padding: 16px;
        border-radius: 20px;
    }

        .kpi-card strong {
            font-size: 26px;
        }

    .module-card {
        min-height: 104px;
        padding: 14px;
    }

    .bottom-nav {
        height: 68px;
    }

        .bottom-nav a {
            font-size: 11px;
        }

    .signature-canvas {
        height: 260px;
    }

    .signature-cal-panel {
        position: relative;
        width: 100%;
        height: 180px;
        margin-top: 14px;
        border: 2px dashed #3C74DC;
        border-radius: 18px;
        background: #F5F9FF;
        touch-action: none;
        user-select: none;
    }

    .signature-cross.horizontal {
        position: absolute;
        left: 20%;
        right: 20%;
        top: 50%;
        height: 2px;
        background: #DC3545;
    }

    .signature-cross.vertical {
        position: absolute;
        top: 20%;
        bottom: 20%;
        left: 50%;
        width: 2px;
        background: #DC3545;
    }

    .signature-cross-dot {
        position: absolute;
        width: 18px;
        height: 18px;
        left: calc(50% - 9px);
        top: calc(50% - 9px);
        border-radius: 50%;
        background: #DC3545;
        border: 3px solid white;
        box-shadow: 0 0 0 2px #DC3545;
    }

    .signature-cal-panel {
        position: relative;
        width: 100%;
        height: 180px;
        margin-top: 14px;
        border: 2px dashed #3C74DC;
        border-radius: 18px;
        background: #F5F9FF;
        touch-action: none;
        user-select: none;
    }

    .signature-cross.horizontal {
        position: absolute;
        left: 20%;
        right: 20%;
        top: 50%;
        height: 2px;
        background: #DC3545;
    }

    .signature-cross.vertical {
        position: absolute;
        top: 20%;
        bottom: 20%;
        left: 50%;
        width: 2px;
        background: #DC3545;
    }

    .signature-cross-dot {
        position: absolute;
        width: 18px;
        height: 18px;
        left: calc(50% - 9px);
        top: calc(50% - 9px);
        border-radius: 50%;
        background: #DC3545;
        border: 3px solid white;
        box-shadow: 0 0 0 2px #DC3545;
    }
}
/* =========================
   ERP Permission UI
========================= */

.permission-denied {
    background: linear-gradient(135deg, #8B1E2D, #DC3545);
    color: white;
    border-radius: 22px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 12px 28px rgba(220, 53, 69, .22);
}

    .permission-denied h2 {
        margin: 0 0 10px;
        font-size: 24px;
    }

    .permission-denied p {
        margin: 0;
        line-height: 1.7;
        color: #FFE8EC;
    }

.readonly-mask {
    position: relative;
    opacity: .78;
    pointer-events: none;
}

.readonly-banner {
    background: #FFF4E5;
    border: 1px solid #FFD399;
    color: #8A4B00;
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-weight: 800;
}

.permission-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EAF3FF;
    color: #2459B8;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 800;
    margin-right: 8px;
    margin-bottom: 8px;
}

    .permission-chip.danger {
        background: #FFECEC;
        color: #D62828;
    }

    .permission-chip.success {
        background: #E8F8ED;
        color: #16803A;
    }

    .permission-chip.warning {
        background: #FFF4E5;
        color: #A15C00;
    }


/* Mobile Product Management */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.scan-row {
    display: grid;
    grid-template-columns: 1fr 96px;
    gap: 8px;
    align-items: start;
}

.scan-input {
    margin-right: 0;
}

.btn-scan {
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: #198754;
    color: white;
    font-weight: 800;
    margin: 8px 0 12px;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

    .action-row .btn-danger {
        grid-column: span 2;
    }

.btn-danger {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    background: #DC3545;
    color: white;
}

.success-alert {
    background: #E8F8ED;
    border-color: #A8E0B8;
    color: #146C2E;
}

.info-alert {
    background: #EAF3FF;
    border-color: #90CAF9;
    color: #1F579A;
}

.product-link em {
    font-style: normal;
    color: #3C74DC;
    font-size: 13px;
    font-weight: 800;
    margin-top: 4px;
}

/* Barcode Scanner */
.barcode-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(8, 33, 63, .82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.barcode-panel {
    width: min(100%, 420px);
    background: white;
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .28);
}

.barcode-title {
    font-weight: 900;
    color: #08213F;
    font-size: 18px;
    margin-bottom: 10px;
}

.barcode-video {
    width: 100%;
    min-height: 260px;
    background: #000;
    border-radius: 16px;
    object-fit: cover;
}

.barcode-hint {
    color: #68748A;
    font-weight: 700;
    margin: 10px 0;
    line-height: 1.5;
}

.barcode-cancel {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: #DC3545;
    color: white;
    font-weight: 900;
}

@media (max-width: 520px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .scan-row {
        grid-template-columns: 1fr;
    }

    .btn-scan {
        margin-top: -4px;
    }
}

/* Barcode Scanner - iPhone compatible controls */
.barcode-open-camera,
.barcode-photo,
.barcode-manual-ok {
    border: 0;
    border-radius: 14px;
    font-weight: 900;
    min-height: 44px;
}

.barcode-open-camera {
    width: 100%;
    background: #3C74DC;
    color: white;
    margin-bottom: 8px;
}

.barcode-photo {
    width: 100%;
    background: #EAF3FF;
    color: #1F579A;
    border: 1px solid #90CAF9;
    margin-bottom: 8px;
}

.barcode-manual-row {
    display: grid;
    grid-template-columns: 1fr 86px;
    gap: 8px;
    margin: 10px 0;
}

.barcode-manual-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #B9C7DA;
    border-radius: 14px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 800;
}

.barcode-manual-ok {
    background: #1F9D55;
    color: white;
}

.barcode-open-camera:disabled,
.barcode-photo:disabled,
.barcode-manual-ok:disabled {
    opacity: .58;
}

/* Public online meter reading */
.public-meter-page .success-card {
    border-color: #B7E4C7;
    background: #F1FFF6;
}

.required {
    color: #C62828;
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 220px;
    border: 2px dashed #90CAF9;
    border-radius: 16px;
    background: #FFFFFF;
    touch-action: none;
    margin: 10px 0 12px;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.button-row .btn-primary,
.button-row .btn-secondary {
    flex: 1;
}

.muted {
    color: #68748A;
    font-size: 13px;
    line-height: 1.5;
}

/* Online meter photo compression / signature lock */
.photo-mini-card small {
    display: block;
    margin-top: 4px;
}

.signature-status {
    border: 1px solid #FFD399;
    background: #FFF8EC;
    color: #8A4B00;
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 900;
    margin: 8px 0 10px;
}

.signature-status.locked {
    border-color: #A8E0B8;
    background: #E8F8ED;
    color: #146C2E;
}

.signature-canvas.signature-locked {
    border-style: solid;
    border-color: #22A559;
    background: #F8FFF9;
}

.signature-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

@media (max-width: 420px) {
    .signature-action-grid {
        grid-template-columns: 1fr;
    }
}

body.erp-signature-fullscreen-open {
    overflow: hidden;
    touch-action: none;
}

.erp-signature-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(5, 18, 34, .94);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.erp-signature-fullscreen-panel {
    width: min(100%, 760px);
    min-height: calc(100dvh - 20px);
    background: #F5F7FB;
    border-radius: 22px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .35);
}

.erp-signature-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.erp-signature-fullscreen-header strong {
    color: #08213F;
    font-size: 20px;
    font-weight: 900;
}

.erp-signature-fullscreen-header button,
.erp-signature-fullscreen-actions button {
    border: 0;
    border-radius: 14px;
    min-height: 46px;
    padding: 0 18px;
    font-weight: 900;
}

.erp-signature-fullscreen-header button,
.erp-signature-fullscreen-actions .secondary {
    background: #EAF3FF;
    color: #1F579A;
    border: 1px solid #90CAF9;
}

.erp-signature-fullscreen-hint {
    color: #68748A;
    font-weight: 800;
    line-height: 1.5;
}

.erp-signature-fullscreen-canvas {
    width: 100%;
    height: calc(100dvh - 190px);
    min-height: 360px;
    flex: 1;
    background: #FFFFFF;
    border: 3px dashed #3C74DC;
    border-radius: 18px;
    touch-action: none;
}

.erp-signature-fullscreen-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 10px;
}

.erp-signature-fullscreen-actions .primary {
    background: #22A559;
    color: white;
    font-size: 18px;
}

@media (orientation: landscape) {
    .erp-signature-fullscreen-panel {
        width: min(100%, 980px);
    }

    .erp-signature-fullscreen-canvas {
        min-height: 220px;
        height: calc(100dvh - 150px);
    }
}
