/* ===========================================================
   DOCTOR — Document Transfer, Organisation & Retrieval
   Clinic-style theme. Mobile-first, responsive.
   =========================================================== */

:root {
    --doc-teal: #0F6E56;
    --doc-teal-dark: #085041;
    --doc-teal-mid: #1D9E75;
    --doc-teal-soft: #5DCAA5;
    --doc-mint: #E1F5EE;
    --doc-mint-edge: #9FE1CB;
    --ink: #2C2C2A;
    --ink-soft: #5F5E5A;
    --ink-faint: #888780;
    --paper: #ffffff;
    --paper-2: #F7F6F2;
    --line: #E3E1DA;
    --danger: #A32D2D;
    --danger-bg: #FCEBEB;
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--paper-2);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--doc-teal);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ---------- Header banner (clinic nameplate) ---------- */
.doc-header {
    background: var(--doc-teal);
    color: #fff;
}

.doc-header-inner {
    max-width: 880px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.doc-header-inner.centered {
    justify-content: center;
    text-align: center;
}

.doc-header-inner.centered .doc-title-block {
    flex: 0 1 auto;
}

.doc-mark {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--doc-mint);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

    .doc-mark .ti {
        font-size: 24px;
        color: var(--doc-teal);
    }

    .doc-mark .doc-cross {
        position: absolute;
        right: 6px;
        bottom: 6px;
        width: 14px;
        height: 14px;
        background: var(--doc-teal);
        border-radius: 3px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .doc-mark .doc-cross .ti {
            font-size: 11px;
            color: var(--doc-mint);
        }

.doc-title-block {
    flex: 1;
    min-width: 0;
}

.doc-wordmark {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.doc-acronym {
    font-size: 11.5px;
    color: var(--doc-mint-edge);
    margin-top: 2px;
}

    .doc-acronym b {
        color: var(--doc-mint);
        font-weight: 600;
    }

.doc-userbox {
    text-align: right;
    flex-shrink: 0;
}

    .doc-userbox .doc-email {
        font-size: 12px;
        color: var(--doc-mint);
    }

    .doc-userbox .doc-signout {
        font-size: 11.5px;
        color: var(--doc-mint-edge);
    }

        .doc-userbox .doc-signout a {
            color: var(--doc-mint-edge);
        }

            .doc-userbox .doc-signout a:hover {
                color: #fff;
            }

/* ---------- Page container ---------- */
.doc-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 22px 20px 40px;
}

.doc-narrow {
    max-width: 420px;
}

/* ---------- Card ---------- */
.doc-card {
    background: var(--paper);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
}

    .doc-card h1, .doc-card h2 {
        margin: 0 0 4px;
    }

.doc-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 4px;
}

.doc-card-sub {
    font-size: 13px;
    color: var(--ink-soft);
    margin: 0 0 16px;
}

/* ---------- Forms ---------- */
.doc-label {
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 6px;
    display: block;
}

.doc-input {
    width: 100%;
    padding: 10px 12px;
    border: 0.5px solid #C8C6BE;
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    color: var(--ink);
}

    .doc-input:focus {
        outline: none;
        border-color: var(--doc-teal);
        box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
    }

/* ---------- Buttons ---------- */
.doc-btn {
    width: 100%;
    background: var(--doc-teal);
    color: #fff;
    border: none;
    padding: 11px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

    .doc-btn:hover {
        background: var(--doc-teal-dark);
    }

    .doc-btn:disabled {
        background: #B4B2A9;
        cursor: not-allowed;
    }

.doc-btn-sm {
    width: auto;
    background: #fff;
    color: var(--doc-teal);
    border: 0.5px solid var(--doc-teal-soft);
    padding: 7px 14px;
    font-weight: 500;
    font-size: 13px;
}

.doc-btn-sm:hover {
     background: var(--doc-mint);
}

.doc-btn-sm:disabled {
     opacity: 0.5;
     cursor: not-allowed;
     color: var(--ink-faint);
     border-color: var(--line);
}

.doc-btn-sm:disabled:hover {
     background: #fff;
}

.doc-link-btn {
    background: none;
    border: none;
    color: var(--doc-teal);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
}

    .doc-link-btn:hover {
        text-decoration: underline;
    }

/* ---------- Method toggle (Email / SMS) ---------- */
.doc-toggle {
    display: flex;
    background: var(--paper-2);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 18px;
}

    .doc-toggle button {
        flex: 1;
        text-align: center;
        padding: 8px;
        border-radius: 6px;
        font-size: 13px;
        border: none;
        background: none;
        color: var(--ink-soft);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

        .doc-toggle button.active {
            background: #fff;
            color: var(--doc-teal);
            font-weight: 600;
            box-shadow: 0 1px 2px rgba(0,0,0,0.06);
        }

        .doc-toggle button:disabled {
            color: #B4B2A9;
            cursor: not-allowed;
        }

/* ---------- 6-digit code boxes ---------- */
.doc-code {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 18px;
}

    .doc-code input {
        width: 100%;
        text-align: center;
        font-size: 22px;
        padding: 12px 0;
        border: 0.5px solid #C8C6BE;
        border-radius: var(--radius);
        background: #fff;
        color: var(--ink);
    }

        .doc-code input:focus {
            outline: none;
            border: 1.5px solid var(--doc-teal);
            box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
        }

/* ---------- Upload / drop zone ---------- */
.doc-drop {
    border: 1.5px dashed var(--doc-teal-soft);
    background: var(--doc-mint);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-align: center;
    margin-bottom: 18px;
    transition: background 0.15s, border-color 0.15s;
}

    .doc-drop.dragover {
        background: #d4efe5;
        border-color: var(--doc-teal);
    }

    .doc-drop .ti-cloud-upload {
        font-size: 30px;
        color: var(--doc-teal);
    }

.doc-drop-main {
    font-size: 14px;
    color: var(--doc-teal-dark);
    font-weight: 600;
    margin-top: 6px;
}

.doc-drop-sub {
    font-size: 12px;
    color: var(--doc-teal);
    margin-top: 2px;
}

.doc-drop-row {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.doc-chosen {
    font-size: 12.5px;
    color: var(--doc-teal-dark);
    margin-top: 8px;
    min-height: 1em;
}

/* hide the native file input; trigger via label/button */
.doc-file-hidden {
    display: none;
}

/* ---------- Document list ---------- */
.doc-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 2px 10px;
}

    .doc-list-head .lbl {
        font-size: 13px;
        font-weight: 600;
        color: var(--ink-soft);
    }

    .doc-list-head .count {
        font-size: 12px;
        color: var(--ink-faint);
    }

.doc-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-file {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--paper);
    border: 0.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 11px 14px;
}

.doc-file-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--paper-2);
}

    .doc-file-icon .ti {
        font-size: 18px;
        color: var(--ink-soft);
    }

    .doc-file-icon.pdf {
        background: #FCEBEB;
    }

        .doc-file-icon.pdf .ti {
            color: #A32D2D;
        }

    .doc-file-icon.sheet {
        background: #E6F1FB;
    }

        .doc-file-icon.sheet .ti {
            color: #185FA5;
        }

    .doc-file-icon.doc {
        background: #E6F1FB;
    }

        .doc-file-icon.doc .ti {
            color: #185FA5;
        }

    .doc-file-icon.img {
        background: #EAF3DE;
    }

        .doc-file-icon.img .ti {
            color: #3B6D11;
        }

    .doc-file-icon.zip {
        background: #FAEEDA;
    }

        .doc-file-icon.zip .ti {
            color: #854F0B;
        }

.doc-file-body {
    flex: 1;
    min-width: 0;
}

.doc-file-name {
    font-size: 14px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-file-meta {
    font-size: 11.5px;
    color: var(--ink-faint);
}

.doc-file-act {
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px;
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
}

    .doc-file-act .ti {
        font-size: 18px;
    }

    .doc-file-act.del {
        color: var(--danger);
    }

    .doc-file-act:hover {
        opacity: 0.7;
    }

.doc-empty {
    text-align: center;
    color: var(--ink-faint);
    font-size: 14px;
    padding: 28px 0;
}

/* ---------- Flash messages ---------- */
.doc-flash {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

    .doc-flash.ok {
        background: var(--doc-mint);
        color: var(--doc-teal-dark);
    }

    .doc-flash.err {
        background: var(--danger-bg);
        color: var(--danger);
    }

/* ---------- Footer note ---------- */
.doc-foot {
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-faint);
    margin-top: 16px;
}

    .doc-foot .ti {
        font-size: 13px;
        vertical-align: -2px;
    }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
    .doc-header-inner {
        padding: 14px 16px;
        gap: 11px;
    }

    .doc-wordmark {
        font-size: 19px;
    }

    .doc-acronym {
        font-size: 10.5px;
    }

    .doc-userbox .doc-email {
        font-size: 11px;
    }

    .doc-main {
        padding: 18px 14px 32px;
    }

    .doc-card {
        padding: 18px 16px;
    }

    .doc-code {
        gap: 5px;
    }

        .doc-code input {
            font-size: 19px;
            padding: 10px 0;
        }
    /* keep the user box from crowding the wordmark on small screens */
    .doc-userbox .doc-email {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ============================================================
   Header navigation (desktop inline + mobile hamburger)
   Colours tuned for the TEAL header background.
   Replace the previous nav block at the end of site.css with this.
   ============================================================ */

.doc-nav {
    margin-left: auto; /* push to the right of the header */
    display: flex;
    align-items: center;
}

/* The hamburger button — hidden on desktop, light so it shows on teal */
.doc-burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 26px;
    color: var(--doc-mint);
    padding: 6px;
    line-height: 1;
}

/* Desktop: links laid out inline, in mint tones to read on teal */
.doc-navlinks {
    display: flex;
    align-items: center;
    gap: 18px;
}

    .doc-navlinks .doc-navname {
        font-weight: 600;
        color: #fff;
        font-size: 14px;
    }

    .doc-navlinks a {
        color: var(--doc-mint);
        text-decoration: none;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }

        .doc-navlinks a:hover {
            color: #fff;
            text-decoration: none;
        }

/* ---- Mobile: below 640px, collapse to a hamburger dropdown ---- */
@media (max-width: 640px) {
    .doc-burger {
        display: block;
    }

    .doc-navlinks {
        display: none; /* hidden until hamburger toggles */
        position: absolute;
        top: 100%;
        right: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: #fff;
        border: 1px solid #E1E8E4;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        padding: 8px 0;
        min-width: 190px;
        z-index: 50;
    }

        .doc-navlinks.open {
            display: flex; /* shown when hamburger clicked */
        }
        /* inside the white dropdown, use dark text (not mint) */
        .doc-navlinks .doc-navname {
            color: var(--doc-teal);
            padding: 8px 16px 10px;
            border-bottom: 1px solid #EEF2F0;
            width: 100%;
            box-sizing: border-box;
        }

        .doc-navlinks a {
            color: var(--ink);
            padding: 10px 16px;
            width: 100%;
            box-sizing: border-box;
            font-size: 15px;
        }

            .doc-navlinks a:hover {
                color: var(--doc-teal);
                background: #F4F8F6;
            }

    .doc-header-inner {
        position: relative;
    }
}

/* ============================================================
   Page-edit section (Download page / Upload page + file picker)
   Append to site.css
   ============================================================ */

.doc-page-edit {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

/* Download and Upload buttons: equal width regardless of label */
.doc-page-btn {
    min-width: 150px;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.doc-page-upload {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    width: 100%;
}

.doc-page-file {
    font-size: 13px;
    min-width: 0;
    flex: 1 1 200px;
    max-width: 100%;
}

/* Small disabled state for the outline buttons */
.doc-btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--ink-faint);
    border-color: var(--line);
}

    .doc-btn-sm:disabled:hover {
        background: #fff;
    }

/* Portrait / narrow: file picker drops onto its own line, below Upload */
@media (max-width: 520px) {
    .doc-page-file {
        flex-basis: 100%;
    }
}