:root {
    --brand: #8b5e3c;
    --brand-rgb: 139, 94, 60;
    --ink: #14213d;
    --muted: #6f7d91;
    --surface: #ffffff;
    --background: #f4f7fb;
    --line: rgba(20, 33, 61, .08);
    --success: #16a36a;
    --warning: #ef9b29;
    --danger: #e25555;
    --purple: #7659d6;
    --shadow: 0 20px 60px rgba(31, 54, 92, .12);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
}

body {
    color: var(--ink);
    background:
        radial-gradient(
            circle at 12% 2%,
            rgba(var(--brand-rgb), .15),
            transparent 28%
        ),
        linear-gradient(180deg, #f8faff 0%, var(--background) 100%);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    display: block;
    width: 22px;
    height: 22px;
}

#mobileRoot {
    min-height: 100dvh;
}

.mobile-shell {
    position: relative;
    min-height: 100dvh;
    padding-bottom: calc(92px + var(--safe-bottom));
    overflow: hidden;
}

.ambient {
    position: fixed;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .26;
    pointer-events: none;
}

.ambient-one {
    top: -110px;
    right: -100px;
    background: var(--brand);
    animation: ambientMoveOne 10s ease-in-out infinite alternate;
}

.ambient-two {
    bottom: 18%;
    left: -160px;
    background: #2f80ed;
    animation: ambientMoveTwo 12s ease-in-out infinite alternate;
}

@keyframes ambientMoveOne {
    to {
        transform: translate(-30px, 60px) scale(1.16);
    }
}

@keyframes ambientMoveTwo {
    to {
        transform: translate(80px, -30px) scale(.9);
    }
}

/* Splash */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding:
        calc(24px + var(--safe-top))
        24px
        calc(24px + var(--safe-bottom));
    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 42%,
            rgba(255, 255, 255, .18),
            transparent 28%
        ),
        linear-gradient(
            145deg,
            #1f1510 0%,
            var(--brand) 58%,
            #321d12 100%
        );
    transition:
        opacity .55s ease,
        visibility .55s ease,
        transform .65s cubic-bezier(.2, .85, .2, 1);
}

.splash-screen.is-leaving {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.045);
}

.splash-grid {
    position: absolute;
    inset: 0;
    opacity: .13;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, .18) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .18) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
    mask-image:
        radial-gradient(circle, #000 5%, transparent 72%);
}

.splash-content {
    position: relative;
    text-align: center;
    color: #fff;
}

.splash-logo-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    margin: 0 auto 25px;
}

.splash-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, .23);
    border-radius: 34px;
    animation: ringPulse 2.2s ease-out infinite;
}

.splash-ring:nth-child(2) {
    animation-delay: .65s;
}

.splash-ring:nth-child(3) {
    animation-delay: 1.3s;
}

@keyframes ringPulse {
    0% {
        opacity: .9;
        transform: scale(.72);
    }

    100% {
        opacity: 0;
        transform: scale(1.55);
    }
}

.brand-logo {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 82px;
    height: 82px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 25px;
    color: var(--brand);
    background: rgba(255, 255, 255, .96);
    box-shadow:
        0 25px 65px rgba(0, 0, 0, .25),
        inset 0 1px 0 rgba(255, 255, 255, .9);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.brand-logo strong {
    font-size: 27px;
    letter-spacing: -.06em;
}

.splash-content h1 {
    margin: 0;
    font-size: clamp(31px, 8vw, 48px);
    letter-spacing: -.045em;
}

.splash-content p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.splash-progress {
    width: 170px;
    height: 4px;
    margin: 30px auto 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
}

.splash-progress i {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    animation: splashProgress 2.2s ease-in-out infinite;
}

@keyframes splashProgress {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(360%);
    }
}

/* Login */

.login-screen {
    display: grid;
    align-items: center;
    min-height: 100dvh;
    padding:
        calc(28px + var(--safe-top))
        22px
        calc(28px + var(--safe-bottom));
}

.login-card {
    width: min(440px, 100%);
    margin: auto;
    padding: 27px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 32px;
    background: rgba(255, 255, 255, .88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    animation: cardEnter .65s cubic-bezier(.2, .9, .2, 1);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(22px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 30px;
}

.login-brand .brand-logo {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
    border-radius: 20px;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 15px 34px rgba(var(--brand-rgb), .28);
}

.login-brand .brand-logo strong {
    font-size: 20px;
}

.login-brand span {
    display: block;
    margin-bottom: 4px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-brand h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -.03em;
}

.login-copy {
    margin-bottom: 24px;
}

.login-copy h2 {
    margin: 0 0 8px;
    font-size: 30px;
    letter-spacing: -.045em;
}

.login-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.field {
    display: block;
    margin-top: 15px;
}

.field > span {
    display: block;
    margin: 0 0 8px 4px;
    color: #34425a;
    font-size: 11px;
    font-weight: 750;
}

.field-control {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(247, 249, 253, .9);
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.field-control:focus-within {
    border-color: rgba(var(--brand-rgb), .42);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(var(--brand-rgb), .08);
}

.field-control svg {
    width: 19px;
    color: var(--muted);
}

.field-control input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
}

.primary-button {
    position: relative;
    width: 100%;
    min-height: 57px;
    margin-top: 22px;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    color: #fff;
    background:
        linear-gradient(
            135deg,
            var(--brand),
            color-mix(in srgb, var(--brand), #000 16%)
        );
    box-shadow: 0 17px 34px rgba(var(--brand-rgb), .27);
    font-weight: 800;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.primary-button:active {
    transform: scale(.98);
}

.primary-button::after {
    position: absolute;
    top: -100%;
    left: -50%;
    width: 45%;
    height: 300%;
    content: "";
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, .24),
            transparent
        );
    transform: rotate(24deg);
    animation: buttonShine 4s ease-in-out infinite;
}

@keyframes buttonShine {
    0%,
    45% {
        left: -60%;
    }

    70%,
    100% {
        left: 140%;
    }
}

.login-footer {
    margin-top: 22px;
    color: #9aa5b5;
    font-size: 10px;
    text-align: center;
}

/* Main app */

.app-header {
    position: relative;
    padding:
        calc(18px + var(--safe-top))
        18px
        20px;
    color: #fff;
    background:
        radial-gradient(
            circle at 86% 5%,
            rgba(255, 255, 255, .18),
            transparent 31%
        ),
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--brand), #000 13%),
            var(--brand)
        );
    border-radius: 0 0 31px 31px;
    box-shadow: 0 17px 45px rgba(var(--brand-rgb), .24);
}

.app-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.employee {
    display: flex;
    gap: 12px;
    align-items: center;
}

.employee-avatar {
    display: grid;
    place-items: center;
    width: 47px;
    height: 47px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 16px;
    color: var(--brand);
    background: #fff;
    font-size: 14px;
    font-weight: 850;
    box-shadow: 0 12px 25px rgba(0, 0, 0, .14);
}

.employee small {
    display: block;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .7);
    font-size: 10px;
}

.employee strong {
    display: block;
    font-size: 16px;
}

.header-action {
    position: relative;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 15px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(12px);
}

.header-action i {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border: 2px solid var(--brand);
    border-radius: 50%;
    background: #fff;
}

.shift-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 23px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(16px);
}

.shift-card small {
    display: block;
    color: rgba(255, 255, 255, .68);
    font-size: 10px;
}

.shift-card strong {
    display: block;
    margin-top: 5px;
    font-size: 19px;
}

.shift-button {
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    color: var(--brand);
    background: #fff;
    font-size: 11px;
    font-weight: 850;
}

.content {
    padding: 18px;
}

.operation-summary {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 13px;
}

.summary-card {
    position: relative;
    min-height: 142px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 25px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 14px 36px rgba(31, 54, 92, .08);
}

.summary-card::after {
    position: absolute;
    right: -35px;
    bottom: -50px;
    width: 115px;
    height: 115px;
    content: "";
    border-radius: 50%;
    background: rgba(var(--brand-rgb), .08);
}

.summary-card > span {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    color: var(--brand);
    background: rgba(var(--brand-rgb), .1);
}

.summary-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 13px;
    font-size: 28px;
    letter-spacing: -.05em;
}

.summary-card small {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: 10px;
}

.summary-card.accent {
    color: #fff;
    background:
        linear-gradient(
            145deg,
            var(--purple),
            #5840bd
        );
}

.summary-card.accent > span {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.summary-card.accent small {
    color: rgba(255, 255, 255, .7);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 25px 2px 13px;
}

.section-head small {
    display: block;
    margin-bottom: 4px;
    color: var(--brand);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.section-head h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.035em;
}

.section-head button {
    border: 0;
    color: var(--brand);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
}

.task-list {
    display: grid;
    gap: 12px;
}

.task-card {
    position: relative;
    display: grid;
    grid-template-columns: 5px 1fr auto;
    gap: 13px;
    align-items: center;
    padding: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 22px;
    background: rgba(255, 255, 255, .91);
    box-shadow: 0 13px 33px rgba(31, 54, 92, .075);
    animation: taskEnter .5s both;
    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.task-card:active {
    transform: scale(.985);
}

@keyframes taskEnter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.task-priority {
    width: 5px;
    height: 49px;
    border-radius: 99px;
    background: var(--warning);
}

.task-priority.high {
    background: var(--danger);
}

.task-priority.low {
    background: var(--success);
}

.task-copy small {
    display: block;
    color: var(--muted);
    font-size: 9px;
}

.task-copy strong {
    display: block;
    margin: 5px 0 6px;
    font-size: 13px;
    letter-spacing: -.015em;
}

.task-meta {
    display: flex;
    gap: 9px;
    align-items: center;
    color: var(--muted);
    font-size: 9px;
}

.task-meta span {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.task-meta svg {
    width: 13px;
    height: 13px;
}

.task-status {
    padding: 7px 9px;
    border-radius: 10px;
    color: #9a5d16;
    background: #fff5df;
    font-size: 8px;
    font-style: normal;
    font-weight: 850;
    white-space: nowrap;
}

.task-card.in-progress .task-status {
    color: #2f5daf;
    background: #edf4ff;
}

.task-card.approval .task-status {
    color: #6e4ec4;
    background: #f1edff;
}

.task-card.completed .task-status {
    color: #13734b;
    background: #eafaf2;
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 500;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: calc(74px + var(--safe-bottom));
    padding:
        8px
        8px
        calc(8px + var(--safe-bottom));
    border-top: 1px solid rgba(20, 33, 61, .07);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -12px 34px rgba(31, 54, 92, .08);
    backdrop-filter: blur(20px);
}

.bottom-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    border-radius: 15px;
    color: #98a3b3;
    background: transparent;
    font-size: 9px;
    font-weight: 750;
}

.bottom-nav button.active {
    color: var(--brand);
    background: rgba(var(--brand-rgb), .075);
}

.bottom-nav svg {
    width: 20px;
    height: 20px;
}

/* Modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 800;
    opacity: 0;
    visibility: hidden;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(6px);
    transition: .25s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 810;
    max-height: 91dvh;
    padding:
        12px
        18px
        calc(22px + var(--safe-bottom));
    overflow-y: auto;
    border-radius: 29px 29px 0 0;
    background: #fff;
    box-shadow: 0 -28px 70px rgba(15, 23, 42, .2);
    transform: translateY(110%);
    transition: transform .38s cubic-bezier(.22, .85, .25, 1);
}

.bottom-sheet.show {
    transform: translateY(0);
}

.sheet-handle {
    width: 43px;
    height: 5px;
    margin: 0 auto 18px;
    border-radius: 99px;
    background: #d8dee9;
}

.sheet-kicker {
    color: var(--brand);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.sheet-title {
    margin: 6px 0 7px;
    font-size: 24px;
    letter-spacing: -.04em;
}

.sheet-description {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 18px;
}

.detail-grid article {
    padding: 12px 8px;
    border-radius: 15px;
    background: #f5f7fb;
    text-align: center;
}

.detail-grid svg {
    width: 18px;
    height: 18px;
    margin: 0 auto 7px;
    color: var(--brand);
}

.detail-grid small {
    display: block;
    color: var(--muted);
    font-size: 8px;
}

.detail-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 10px;
}

.evidence-area {
    display: none;
    margin-top: 18px;
}

.evidence-area.show {
    display: block;
    animation: cardEnter .35s ease;
}

.evidence-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.evidence-action {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 105px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 19px;
    color: var(--ink);
    background: #f7f9fc;
    text-align: center;
}

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

.evidence-action strong {
    margin-top: 8px;
    font-size: 11px;
}

.evidence-action small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 8px;
}

.evidence-action input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.evidence-preview {
    display: none;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 18px;
    background: #edf1f7;
}

.evidence-preview.show {
    display: block;
}

.evidence-preview img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.note-area {
    margin-top: 14px;
}

.note-area span {
    display: block;
    margin: 0 0 7px 3px;
    font-size: 10px;
    font-weight: 800;
}

.note-area textarea {
    width: 100%;
    min-height: 88px;
    padding: 13px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: none;
    color: var(--ink);
    background: #f7f9fc;
}

.sheet-action {
    width: 100%;
    min-height: 55px;
    margin-top: 17px;
    border: 0;
    border-radius: 17px;
    color: #fff;
    background: var(--brand);
    font-weight: 850;
}

.sheet-action.secondary {
    color: var(--brand);
    background: rgba(var(--brand-rgb), .1);
}

/* Toast and connection */

.mobile-toast {
    position: fixed;
    right: 16px;
    bottom: calc(91px + var(--safe-bottom));
    left: 16px;
    z-index: 1500;
    padding: 14px 17px;
    opacity: 0;
    visibility: hidden;
    border-radius: 17px;
    color: #fff;
    background: #16223a;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .23);
    font-size: 11px;
    font-weight: 750;
    transform: translateY(15px);
    transition: .25s ease;
}

.mobile-toast.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.connection-pill {
    position: fixed;
    top: calc(9px + var(--safe-top));
    right: 9px;
    z-index: 650;
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid rgba(20, 33, 61, .06);
    border-radius: 12px;
    color: #126b47;
    background: rgba(239, 252, 245, .94);
    box-shadow: 0 8px 24px rgba(31, 54, 92, .09);
    font-size: 8px;
    font-weight: 850;
    backdrop-filter: blur(14px);
}

.connection-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22b573;
    box-shadow: 0 0 0 4px rgba(34, 181, 115, .12);
}

.connection-pill.offline {
    color: #9b4a18;
    background: rgba(255, 247, 237, .95);
}

.connection-pill.offline i {
    background: #f08b36;
    box-shadow: 0 0 0 4px rgba(240, 139, 54, .12);
}

.empty-state {
    padding: 38px 20px;
    border: 1px dashed rgba(20, 33, 61, .13);
    border-radius: 22px;
    color: var(--muted);
    background: rgba(255, 255, 255, .72);
    text-align: center;
}

@media (min-width: 760px) {
    .mobile-shell {
        width: 100%;
        max-width: 620px;
        margin: auto;
        border-right: 1px solid rgba(20, 33, 61, .05);
        border-left: 1px solid rgba(20, 33, 61, .05);
        background: rgba(247, 249, 253, .76);
        box-shadow: 0 0 90px rgba(31, 54, 92, .1);
    }

    .bottom-nav {
        right: 50%;
        left: auto;
        width: 620px;
        transform: translateX(50%);
    }
}
