/* Quis Mobile — βασικό στυλ για κινητό (Android, χρήση με ένα χέρι, μεγάλα στοιχεία αφής) */

:root {
    --brand: #301b7b;
    --brand-soft: #ece8f7;
    --bg: #f4f3f8;
    --surface: #ffffff;
    --text: #1d1b26;
    --text-muted: #6b6878;
    --border: #e2e0ea;
    --offline-bg: #ffd966;
    --offline-text: #3d2e00;
    --radius: 12px;
    color-scheme: light;
}

[hidden] {
    display: none !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, Roboto, "Noto Sans", "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

button {
    font: inherit;
}

    button:not(:disabled) {
        cursor: pointer;
    }

    button:disabled {
        opacity: 0.7;
    }

/* ---------- Κέλυφος ---------- */

.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    background: var(--brand);
    color: #fff;
}

.app-header-logo {
    width: 32px;
    height: 32px;
    padding: 4px;
    border-radius: 8px;
    background: #fff;
}

.app-header-title {
    flex: 1;
    font-size: 19px;
    font-weight: 600;
}

/* Εμφανίζεται μόνο όταν το js/pwa.js βάλει την κλάση is-offline στο <html> */
.net-status {
    display: none;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--offline-bg);
    color: var(--offline-text);
    font-size: 14px;
    font-weight: 600;
}

.is-offline .net-status {
    display: inline-flex;
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 16px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.page-title {
    margin: 4px 0 16px;
    font-size: 22px;
}

/* Το FocusOnNavigate (App.razor) εστιάζει τον τίτλο για αναγνώστες οθόνης· δεν χρειάζεται ορατό περίγραμμα */
h1:focus {
    outline: none;
}

/* ---------- Αρχική: ενότητες ---------- */

.module-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.module-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

    .module-tile[aria-disabled="true"] {
        opacity: 0.6;
    }

.module-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
}

.module-name {
    display: block;
    font-weight: 600;
}

.module-note {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
}

.app-version {
    margin-top: 32px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Κοινά στοιχεία σελίδων ---------- */

.primary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

    .primary-action:active {
        filter: brightness(1.2);
    }

.page-note {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ---------- Διακίνηση: αποτέλεσμα σάρωσης ---------- */

.scan-result {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.scan-result-status {
    margin-bottom: 6px;
    font-weight: 600;
}

    .scan-result-status.is-aade {
        color: #1e7a3a;
    }

    .scan-result-status.is-other {
        color: #9a5b00;
    }

.scan-result-detail {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.secondary-action {
    min-height: 44px;
    margin-bottom: 8px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--brand);
    font-weight: 600;
}

/* ---------- Διακίνηση: κατάσταση δελτίου από την ΑΑΔΕ ---------- */

.delivery-status {
    display: inline-block;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
}

    .delivery-status.is-done {
        background: #dff3e4;
        color: #1e6b34;
    }

    .delivery-status.is-active {
        background: var(--brand-soft);
        color: var(--brand);
    }

    .delivery-status.is-problem {
        background: #fbe3e1;
        color: #9b2c22;
    }

    .delivery-status.is-unknown {
        background: #eceaf0;
        color: var(--text-muted);
    }

.delivery-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin: 0 0 12px;
    font-size: 15px;
}

    .delivery-facts dt {
        color: var(--text-muted);
    }

    .delivery-facts dd {
        margin: 0;
        overflow-wrap: anywhere;
    }

.section-title {
    margin: 16px 0 8px;
    font-size: 16px;
}

/* Χρονολόγιο γεγονότων: κάθετη γραμμή με κουκκίδα ανά γεγονός */
.delivery-events {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

    .delivery-events li {
        position: relative;
        margin-left: 5px;
        padding: 0 0 12px 18px;
        border-left: 2px solid var(--border);
    }

        .delivery-events li::before {
            content: "";
            position: absolute;
            top: 5px;
            left: -6px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--brand);
        }

        .delivery-events li:last-child {
            border-left-color: transparent;
        }

.event-name {
    font-weight: 600;
}

.event-detail {
    font-size: 14px;
    color: var(--text-muted);
}

.scan-result-value {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.scan-result-time {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------- Οθόνη σάρωσης QR (Shared/QrScanner.razor) ---------- */

.scanner {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: #000;
    color: #fff;
}

.scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Πλαίσιο στόχευσης· η σκίαση γύρω του κατευθύνει το μάτι στο κέντρο */
.scanner-frame {
    position: absolute;
    left: 50%;
    top: 45%;
    width: min(70vw, 70vh, 320px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
}

.scanner-message {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.6);
    text-align: center;
}

    .scanner-message small {
        display: block;
        margin-top: 2px;
        font-size: 12px;
        opacity: 0.75;
    }

.scanner-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.scanner-button {
    min-width: 110px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    font-weight: 600;
}

    .scanner-button.is-on {
        background: #ffd966;
    }

/* ---------- Προεπισκόπηση: οθόνες που θα φτιαχτούν (Pages/Preview) ---------- */

.preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    margin: -4px 0 16px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff4d6;
    color: #5c4300;
    font-size: 14px;
}

    .preview-banner a {
        color: inherit;
        font-weight: 600;
    }

.page-intro {
    margin: -8px 0 16px;
    color: var(--text-muted);
    font-size: 15px;
}

.page-subtitle {
    margin: -12px 0 14px;
}

.page-kicker {
    margin: 0 0 4px;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

a.primary-action,
a.secondary-action,
a.danger-action {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.danger-action {
    width: 100%;
    min-height: 52px;
    border: 1px solid #e3b3ae;
    border-radius: 8px;
    background: var(--surface);
    color: #9b2c22;
    font-size: 17px;
    font-weight: 600;
}

.link-action {
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-weight: 600;
}

.action-stack {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

    .action-stack .secondary-action {
        width: 100%;
        min-height: 52px;
        margin: 0;
        font-size: 17px;
    }

.menu-list {
    margin: 0 0 8px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    list-style: none;
}

    .menu-list li + li {
        border-top: 1px solid var(--border);
    }

    .menu-list a {
        display: block;
        padding: 12px 16px;
        color: inherit;
        text-decoration: none;
    }

    .menu-list strong,
    .menu-list span {
        display: block;
    }

    .menu-list span {
        font-size: 14px;
        color: var(--text-muted);
    }

.card {
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.card-title {
    margin-top: 0;
}

.card-text {
    margin: 4px 0 0;
    font-size: 15px;
}

.warning-card {
    border-color: #f0d58a;
    background: #fffaf0;
}

.sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--brand-soft);
    font-size: 14px;
}

.segmented {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding: 4px;
    border-radius: 12px;
    background: #e7e5ee;
}

    .segmented button {
        flex: 1;
        min-height: 40px;
        padding: 0 4px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: var(--text-muted);
        font-size: 13px;
        font-weight: 600;
    }

        .segmented button.is-selected {
            background: var(--surface);
            color: var(--text);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
        }

.note-list {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.note-card {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

.note-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.note-card-number {
    font-weight: 700;
}

.note-card-recipient,
.note-card-meta {
    display: block;
}

.note-card-recipient {
    font-weight: 600;
}

.note-card-meta {
    font-size: 14px;
    color: var(--text-muted);
}

.note-title {
    margin: 0;
}

.delivery-status.is-small {
    flex: none;
    margin: 0;
    padding: 2px 10px;
    font-size: 13px;
}

.line-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .line-list li {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 0;
        border-top: 1px solid var(--border);
    }

        .line-list li:first-child {
            border-top: 0;
        }

.line-qty {
    flex: none;
    font-weight: 600;
    white-space: nowrap;
}

.form-field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

    .form-field label,
    .form-label {
        font-size: 14px;
        font-weight: 600;
        color: var(--text-muted);
    }

    .form-field input,
    .form-field select,
    .form-field textarea {
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text);
        font: inherit;
    }

    .form-field textarea {
        min-height: 96px;
        resize: vertical;
    }

.field-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.choice-list,
.user-list {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    text-align: left;
}

    .choice.is-selected {
        border-color: var(--brand);
        background: var(--brand-soft);
    }

    .choice small {
        display: block;
        font-weight: 400;
        color: var(--text-muted);
    }

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-bottom: 10px;
    font-weight: 600;
}

    .check-row input {
        width: 22px;
        height: 22px;
        accent-color: var(--brand);
    }

.stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .stepper button {
        width: 44px;
        height: 44px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--brand);
        font-size: 22px;
        font-weight: 600;
    }

    .stepper output {
        min-width: 36px;
        font-weight: 700;
        text-align: center;
    }

.hero {
    display: grid;
    justify-items: center;
    gap: 4px;
    margin: 8px 0 12px;
    text-align: center;
}

    .hero svg {
        color: var(--brand);
    }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
    color: var(--text-muted);
    font-size: 14px;
}

    .divider::before,
    .divider::after {
        content: "";
        flex: 1;
        border-top: 1px solid var(--border);
    }

.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.pin-title {
    margin: 8px 0 0;
    text-align: center;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 10px 0 16px;
}

    .pin-dots span {
        width: 14px;
        height: 14px;
        border: 2px solid var(--brand);
        border-radius: 50%;
    }

        .pin-dots span.is-filled {
            background: var(--brand);
        }

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 320px;
    margin: 0 auto;
}

    .pin-pad button {
        min-height: 56px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        color: var(--text);
        font-size: 24px;
        font-weight: 600;
    }

.queue-list {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.queue-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.queue-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
}

.queue-item.is-waiting .queue-icon {
    background: #fff4d6;
    color: #7a5a00;
}

.queue-item.is-sent .queue-icon {
    background: var(--brand-soft);
    color: var(--brand);
}

.queue-item.is-done .queue-icon {
    background: #dff3e4;
    color: #1e6b34;
}

.queue-item.is-failed .queue-icon {
    background: #fbe3e1;
    color: #9b2c22;
}

.queue-title,
.queue-meta,
.queue-state {
    display: block;
}

.queue-title {
    font-weight: 600;
}

.queue-meta {
    font-size: 14px;
    color: var(--text-muted);
}

.queue-state {
    font-size: 14px;
    font-weight: 600;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

    .profile-card small {
        display: block;
        font-size: 14px;
        color: var(--text-muted);
    }

.info-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

    .info-list li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 44px;
        padding: 6px 0;
        border-top: 1px solid var(--border);
    }

        .info-list li:first-child {
            border-top: 0;
        }

        .info-list li span:first-child {
            color: var(--text-muted);
        }

        .info-list li span:last-child {
            text-align: right;
        }

/* Κάτω μπάρα πλοήγησης: οι σελίδες που την έχουν αφήνουν χώρο στο τέλος */
.has-tab-bar {
    padding-bottom: 76px;
}

.tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.tab-bar-item {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 64px;
    padding: 4px 8px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

    .tab-bar-item.active {
        background: var(--brand-soft);
        color: var(--brand);
    }

.tab-badge {
    position: absolute;
    top: 0;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #c62828;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

/* Γραφείο */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.kpi {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-muted);
}

.kpi.is-problem .kpi-value {
    color: #9b2c22;
}

.table-scroll {
    margin-bottom: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.data-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 14px;
}

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        border-top: 1px solid var(--border);
        text-align: left;
        white-space: nowrap;
    }

    .data-table th {
        border-top: 0;
        color: var(--text-muted);
        font-weight: 600;
    }

.chip {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

/* Εικονικό QR ενεργοποίησης (μόνο για την προεπισκόπηση) */
.qr-placeholder {
    width: 176px;
    height: 176px;
    margin: 12px auto 8px;
    border: 10px solid #fff;
    border-radius: 12px;
    background: repeating-conic-gradient(var(--text) 0 25%, #fff 0 50%) 0 0 / 22px 22px;
    box-shadow: 0 0 0 1px var(--border);
}

.code-display {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
}

/* ---------- Ειδοποίηση νέας έκδοσης ---------- */

.update-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 16px;
    border-radius: var(--radius);
    background: var(--text);
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

    .update-banner span {
        flex: 1;
    }

    .update-banner button {
        min-height: 44px;
        padding: 0 18px;
        border: 0;
        border-radius: 8px;
        background: #fff;
        color: var(--brand);
        font-weight: 600;
    }

/* ---------- Φόρμες ---------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* ---------- Σφάλματα / φόρτωση Blazor ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem calc(0.7rem + env(safe-area-inset-bottom)) 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Παρουσιάστηκε σφάλμα."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--brand);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Φόρτωση");
    }
