/*
 * Tilpasninger til hjemmesiden (oven på det originale tablet-design i style.css).
 * Tabletten fylder hele browservinduet, og der er login og offentlige sider til klienter.
 */

body {
    background: #0b0f0d;
}

/* Tabletten fylder hele skærmen i stedet for at ligne en tablet i spillet */
.tablet-container {
    animation: none;
}

.tablet-frame {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
}

.tablet-window {
    border-radius: 0;
}

.dialog {
    max-height: calc(100vh - 48px);
}

/* Login / opsætning ---------------------------------------------------------- */

#auth-layer {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
    background:
        radial-gradient(ellipse at top, rgba(200, 163, 90, 0.08), transparent 60%),
        var(--paper-deep);
}

#auth-layer.active {
    display: flex;
}

.auth-card {
    width: min(440px, 100%);
    padding: 30px 32px 26px;
    border: 1px solid var(--line-heavy);
    background: var(--paper);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    animation: rise 0.18s ease-out;
}

.auth-brand {
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 3px double var(--line-heavy);
}

.auth-brand .paper-brand .brand-name {
    font-size: 26px;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 500;
}

.auth-card > p {
    margin: 0 0 18px;
    color: var(--ink-soft);
    font-size: 13.5px;
    line-height: 1.55;
}

.auth-card .form-grid {
    grid-template-columns: 1fr;
}

.auth-card .form-actions .btn {
    width: 100%;
    height: 40px;
}

/* Offentlige sider (faktura-, dokument- og portal-links, booking) ---------- */

body.public-mode #viewer-layer {
    background:
        radial-gradient(ellipse at top, rgba(200, 163, 90, 0.07), transparent 60%),
        #0b0f0d;
    padding: 16px;
}

body.public-mode #viewer-layer .viewer-wrap,
body.public-mode #viewer-layer .sheet-viewer {
    max-height: calc(100dvh - 32px);
}

.viewer-wrap .portal-body,
.viewer-wrap .booking-body {
    overflow-y: auto;
}

.sheet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.public-sheet .sheet-scroll {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.public-sheet .sheet-scroll .paper {
    flex-shrink: 0;
}

.public-note,
.public-sign {
    flex-shrink: 0;
    padding: 18px 22px;
    border: 1px solid #b9ae9b;
    border-left: 4px solid #c8a35a;
    background: #fffdf8;
    color: #1c1a17;
    font-size: 14px;
    line-height: 1.55;
}

.public-note.done {
    border-left-color: #4f7a4a;
}

.public-sign h3 {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
}

.public-sign p {
    margin: 0 0 12px;
    color: #46413a;
}

.public-sign .btn {
    --ink: #1c1a17;
    --line-heavy: #1c1a17;
    --accent: #7b1e22;
    --on-accent: #fff;
}

.public-sign-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #d8d0c1;
}

.public-sign-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #d8d0c1;
}

.public-sign-row > span:first-child {
    display: flex;
    flex-direction: column;
}

.public-sign-row small {
    color: #7d7568;
}

.public-sign-row > span:last-child {
    display: flex;
    gap: 8px;
}

.booking-board {
    margin-bottom: 18px;
}

a.btn {
    text-decoration: none;
}

/* Underskrift i et vindue */
.sign-layer {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.6);
}

.sign-layer .prompt-top {
    padding: 20px 26px 12px;
}

.sign-layer .prompt-top h2 {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 500;
    color: var(--ink);
}

.sign-layer .prompt-body {
    padding: 0 26px;
}

.sign-layer .prompt-actions {
    justify-content: flex-end;
}

.sign-layer .form-error {
    margin-top: 10px;
}

/* Print-vindue: kun papiret */
body.print-page {
    overflow: visible;
    height: auto;
    background: #fff;
}

body.print-page .paper,
body.print-page .business-card {
    margin: 0 auto;
    box-shadow: none;
}

@media print {
    body.print-page .paper {
        border: none;
        max-width: none;
        padding: 0;
    }
}

/* Klienter ------------------------------------------------------------------ */

.client-cell {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 10px;
}

.client-avatar {
    width: 28px;
    height: 28px;
    border: 1px solid var(--rule-strong);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.client-hero {
    display: flex;
    align-items: center;
    gap: 20px;
}

.client-photo {
    width: 92px;
    height: 92px;
    padding: 0;
    border: 1px solid var(--line-heavy);
    background: var(--sheet);
    cursor: zoom-in;
    flex-shrink: 0;
}

.client-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picker-create {
    margin-top: 6px;
}

.signer-manual,
.attachment-add {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.signer-manual input,
.attachment-add input {
    flex: 1;
    min-width: 0;
}

/* Fakturabilag ------------------------------------------------------------- */

.attachment-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--rule);
}

.attachment-row img {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border: 1px solid var(--rule-strong);
    flex-shrink: 0;
}

.attachment-row .mono {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.due-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 34px;
}

.invoice-attachments {
    margin-top: 26px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
}

.invoice-attachments > span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.invoice-attachments > div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.invoice-attachments a {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--ink-soft);
    text-decoration: none;
}

.invoice-attachments img {
    display: block;
    width: 150px;
    height: 110px;
    object-fit: cover;
    border: 1px solid var(--rule-strong);
    background: var(--paper-deep);
}

.invoice-attachments small {
    font-size: 10.5px;
}

.action-hint {
    margin: -2px 0 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.evidence-url {
    display: block;
    color: var(--accent);
    word-break: break-all;
}

/* Medarbejdere: plads til flere knapper */
.cols-employees {
    grid-template-columns: minmax(170px, 1.2fr) minmax(130px, 0.9fr) 80px minmax(90px, 0.6fr) minmax(360px, 1.6fr);
}

/* Indstillinger ------------------------------------------------------------- */

.settings-logo-preview {
    margin: 16px 0 6px;
    padding: 18px 20px;
    border: 1px solid #d8d0c1;
    background: #fffdf8;
    color: #1c1a17;
    --muted: #7d7568;
    --rule-strong: #b9ae9b;
}

.settings-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.settings-row {
    display: grid;
    grid-template-columns: minmax(160px, 2fr) minmax(70px, 0.7fr) minmax(90px, 0.8fr) minmax(120px, 0.9fr) 70px;
    gap: 8px;
    align-items: center;
}

.settings-row.head {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.settings-row.grade-row {
    grid-template-columns: 24px minmax(140px, 1fr) 100px 70px;
}

.settings-row input:not([type=checkbox]) {
    width: 100%;
    min-width: 0;
}

.check-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 12px;
    white-space: nowrap;
}

/* Mindre skærme og telefoner ------------------------------------------------- */

@media (max-width: 900px) {
    .top-bar {
        flex-wrap: wrap;
        gap: 10px 18px;
        padding: 10px 16px;
    }

    .top-bar .date-time {
        display: none;
    }

    .brand-block .brand-name {
        font-size: 22px;
    }

    .brand-block .brand-subtitle {
        display: none;
    }

    .main-layout {
        flex-direction: column;
    }

    .module-nav {
        flex-direction: row;
        width: 100%;
        max-height: none;
        padding: 6px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--rule-strong);
    }

    .module-folder {
        display: flex;
        align-items: center;
        margin: 0;
    }

    .module-folder-header,
    .module-index,
    .nav-footer {
        display: none;
    }

    .module-button {
        white-space: nowrap;
    }

    .page {
        padding: 18px 16px 30px !important;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .page-actions {
        flex-wrap: wrap;
    }

    .table {
        overflow-x: auto;
    }

    .table-head,
    .table-row {
        min-width: 760px;
    }

    .paper {
        padding: 32px 22px 30px;
    }

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

.invoice-totals span:last-child,
.invoice-lines td.num {
    white-space: nowrap;
}
