/* Tank gauge and pump meter readings: the dashboard task card, the reading dialogs,
   the settings dialog and the reconciliation block of the finance report.
   Same visual language as the finance report: glass cards with a thin all-round border,
   gradient icon chips with white icons and gentle entrance motion. */

.fc {
    --fc-t: #1f8f86;
    --fc-n: #3fb6a8;
    --fc-ink: var(--text, #17233b);
    --fc-ink2: var(--text2, #55607a);
    --fc-line: rgba(190, 215, 215, .85);
    --fc-card-a: rgba(255, 255, 255, .78);
    --fc-card-b: rgba(255, 255, 255, .42);
    --fc-hl: rgba(255, 255, 255, .95);
    --fc-field: rgba(255, 255, 255, .92);
    --fc-ok: #1f7a4d;
    --fc-warn: #b07712;
    --fc-bad: #c4553a;
    --fc-gray: #6d7a8c;
    --fc-ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] .fc {
    --fc-t: #5fcfc4;
    --fc-n: #2f9a90;
    --fc-ink: #eef2fa;
    --fc-ink2: #b9c2d6;
    --fc-line: #34504f;
    --fc-card-a: rgba(255, 255, 255, .09);
    --fc-card-b: rgba(255, 255, 255, .03);
    --fc-hl: rgba(255, 255, 255, .08);
    --fc-field: rgba(255, 255, 255, .08);
    --fc-ok: #5fd391;
    --fc-warn: #e8bd5a;
    --fc-bad: #f09479;
    --fc-gray: #a3afc0;
}

/* ---------- 3D card ---------- */
.fc-card {
    --c: var(--fc-t);
    position: relative;
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--c) 26%, var(--fc-line));
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 54%),
        linear-gradient(145deg, var(--fc-card-a), var(--fc-card-b));
    box-shadow:
        0 12px 26px color-mix(in srgb, var(--c) 12%, transparent),
        inset 0 1px 0 var(--fc-hl);
    color: var(--fc-ink);
    animation: fc-rise .5s var(--fc-ease) both;
    transition: transform .3s var(--fc-ease), box-shadow .3s;
}

.fc-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 18px 34px color-mix(in srgb, var(--c) 20%, transparent),
        inset 0 1px 0 var(--fc-hl);
}

.fc-card.is-ok {
    --c: var(--fc-ok);
}

.fc-card.is-warn {
    --c: var(--fc-warn);
}

.fc-card.is-bad {
    --c: var(--fc-bad);
}

.fc-card.is-gray {
    --c: var(--fc-gray);
}

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

.fc-head > div {
    flex: 1;
    min-width: 0;
}

.fc-head h3 {
    margin: 0;
    font-size: 18px;
    color: var(--fc-ink);
}

.fc-head small {
    display: block;
    font-size: 13px;
    color: var(--fc-ink2);
}

.fc-chip {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--c, var(--fc-t)) 70%, #fff), var(--c, var(--fc-t)));
    box-shadow:
        0 8px 18px color-mix(in srgb, var(--c, var(--fc-t)) 32%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .4);
    transition: transform .35s var(--fc-ease);
}

.fc-card:hover .fc-chip {
    transform: rotate(-8deg) scale(1.08);
}

.fc-chip i {
    color: #fff;
    font-size: 24px;
}

.fc-count {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--fc-warn);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    animation: fc-pop .6s var(--fc-ease) both .2s;
}

/* ---------- task rows ---------- */
.fc-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--fc-t) 18%, var(--fc-line));
    background: linear-gradient(145deg, var(--fc-card-a), var(--fc-card-b));
    box-shadow: inset 0 1px 0 var(--fc-hl);
    animation: fc-rise .5s var(--fc-ease) both;
}

.fc-task:nth-child(2) {
    animation-delay: .06s;
}

.fc-task:nth-child(3) {
    animation-delay: .12s;
}

.fc-task .t {
    flex: 1;
    min-width: 0;
}

.fc-task strong {
    display: block;
    font-size: 15.5px;
    color: var(--fc-ink);
}

.fc-task small {
    display: block;
    font-size: 13px;
    color: var(--fc-ink2);
}

.fc-dot {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--fc-warn);
    animation: fc-pulse 1.8s ease-out infinite;
}

.fc-hint {
    margin: 0;
    font-size: 13px;
    color: var(--fc-ink2);
}

/* ---------- buttons ---------- */
.fc-btn,
.fc-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    font: inherit;
    font-size: 15px;
    white-space: nowrap;
    cursor: pointer;
    background: linear-gradient(145deg, var(--fc-n), var(--fc-t));
    box-shadow:
        0 10px 22px color-mix(in srgb, var(--fc-t) 28%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: transform .2s var(--fc-ease), box-shadow .2s;
}

.fc-btn i {
    color: #fff;
}

.fc-btn:hover:not(:disabled),
.fc-btn-ghost:hover {
    transform: translateY(-2px);
}

.fc-btn:disabled {
    opacity: .55;
    cursor: default;
}

.fc-btn-ghost {
    color: var(--fc-ink);
    background: linear-gradient(145deg, var(--fc-card-a), var(--fc-card-b));
    border: 1px solid color-mix(in srgb, var(--fc-t) 24%, var(--fc-line));
    box-shadow: inset 0 1px 0 var(--fc-hl);
}

.fc-btn-ghost i {
    color: var(--fc-t);
}

/* ---------- dialog ---------- */
.fc-overlay {
    animation: fc-fade .25s ease both;
}

.fc-modal {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid color-mix(in srgb, var(--fc-t) 30%, var(--fc-line));
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--fc-t) 20%, transparent), transparent 52%),
        linear-gradient(145deg, rgba(250, 253, 253, .93), rgba(240, 247, 247, .9));
    box-shadow:
        0 30px 70px rgba(10, 40, 40, .35),
        inset 0 1px 0 var(--fc-hl);
    color: var(--fc-ink);
    animation: fc-pop .45s var(--fc-ease) both;
}

html[data-theme="dark"] .fc-modal {
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--fc-t) 24%, transparent), transparent 52%),
        linear-gradient(145deg, rgba(24, 38, 46, .94), rgba(16, 26, 34, .92));
}

.fc-modal [data-view]:not([hidden]) {
    display: grid;
    gap: 14px;
}

.fc-x {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: color-mix(in srgb, var(--fc-t) 10%, transparent);
    color: var(--fc-ink);
    font-size: 20px;
    cursor: pointer;
}

.fc-help {
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--fc-t) 24%, var(--fc-line));
    background: color-mix(in srgb, var(--fc-t) 8%, transparent);
}

.fc-help summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
}

.fc-help summary i {
    color: var(--fc-t);
    font-size: 20px;
}

.fc-help ul {
    margin: 8px 0 0;
    padding-inline-start: 22px;
    font-size: 14px;
    line-height: 1.9;
    color: var(--fc-ink2);
}

.fc-rows {
    display: grid;
    gap: 10px;
}

.fc-row {
    --c: var(--fc-t);
    display: grid;
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--c) 26%, var(--fc-line));
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--c) 14%, transparent), transparent 52%),
        linear-gradient(145deg, var(--fc-card-a), var(--fc-card-b));
    box-shadow: inset 0 1px 0 var(--fc-hl);
    animation: fc-rise .45s var(--fc-ease) both;
}

.fc-row:nth-child(2) {
    animation-delay: .06s;
}

.fc-row:nth-child(3) {
    animation-delay: .12s;
}

.fc-row:nth-child(4) {
    animation-delay: .18s;
}

.fc-row-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fc-row-name strong {
    font-size: 16px;
}

.fc-row-name small {
    margin-inline-start: auto;
    font-size: 13px;
    color: var(--fc-ink2);
}

.fc-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border-radius: 14px;
    border: 2px solid color-mix(in srgb, var(--fc-t) 55%, var(--fc-line));
    background: var(--fc-field);
    transition: border-color .2s, box-shadow .2s;
}

.fc-input:focus-within {
    border-color: var(--fc-t);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--fc-t) 18%, transparent);
}

.fc-input input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--fc-ink);
    font: inherit;
    font-size: 24px;
    font-weight: 700;
    direction: ltr;
    text-align: start;
}

.fc-input span {
    font-size: 14px;
    color: var(--fc-ink2);
}

.fc-live {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.8;
    border: 1px solid transparent;
}

.fc-live[hidden] {
    display: none;
}

.fc-live i {
    flex: none;
    font-size: 20px;
}

.fc-live.is-ok {
    background: color-mix(in srgb, var(--fc-ok) 13%, transparent);
    border-color: color-mix(in srgb, var(--fc-ok) 45%, transparent);
}

.fc-live.is-ok i {
    color: var(--fc-ok);
}

.fc-live.is-warn {
    background: color-mix(in srgb, var(--fc-warn) 14%, transparent);
    border-color: color-mix(in srgb, var(--fc-warn) 50%, transparent);
}

.fc-live.is-warn i {
    color: var(--fc-warn);
}

.fc-live.is-bad {
    background: color-mix(in srgb, var(--fc-bad) 13%, transparent);
    border-color: color-mix(in srgb, var(--fc-bad) 50%, transparent);
}

.fc-live.is-bad i {
    color: var(--fc-bad);
}

.fc-live.is-gray {
    background: color-mix(in srgb, var(--fc-gray) 12%, transparent);
    border-color: color-mix(in srgb, var(--fc-gray) 40%, transparent);
}

.fc-live.is-gray i {
    color: var(--fc-gray);
}

.fc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fc-actions .fc-btn {
    flex: 1;
    min-width: 160px;
}

.fc-actions .fc-btn-ghost {
    min-width: 110px;
}

.fc-steps {
    display: flex;
    gap: 6px;
}

.fc-steps i {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--fc-line);
}

.fc-steps i.on {
    background: var(--fc-t);
}

/* result badges */
.fc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: var(--c, var(--fc-t));
}

.fc-done {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 10px 0 4px;
    text-align: center;
}

.fc-done .fc-chip {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    animation: fc-pop .6s var(--fc-ease) both;
}

.fc-done .fc-chip i {
    font-size: 34px;
}

/* ---------- settings ---------- */
.fc-set {
    display: grid;
    gap: 0;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--fc-t) 24%, var(--fc-line));
    overflow: hidden;
}

.fc-set-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--fc-line);
}

.fc-set-row:last-child {
    border-bottom: 0;
}

.fc-set-row.is-main {
    background: color-mix(in srgb, var(--fc-t) 9%, transparent);
}

.fc-set-row .t {
    flex: 1;
    min-width: 0;
}

.fc-set-row strong {
    display: block;
    font-size: 15px;
}

.fc-set-row small {
    display: block;
    font-size: 12.5px;
    color: var(--fc-ink2);
}

.fc-num,
.fc-time {
    width: 96px;
    height: 40px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--fc-t) 30%, var(--fc-line));
    background: var(--fc-field);
    color: var(--fc-ink);
    font: inherit;
    font-size: 15px;
    text-align: center;
    direction: ltr;
}

.fc-seg {
    display: flex;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--fc-t) 30%, var(--fc-line));
    overflow: hidden;
}

.fc-seg button {
    padding: 8px 14px;
    border: 0;
    background: transparent;
    color: var(--fc-ink2);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.fc-seg button.on {
    background: linear-gradient(145deg, var(--fc-n), var(--fc-t));
    color: #fff;
}

.fc-switch {
    position: relative;
    flex: none;
    width: 56px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: var(--fc-gray);
    cursor: pointer;
    transition: background .25s;
}

.fc-switch i {
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: inset-inline-start .25s var(--fc-ease);
}

.fc-switch.on {
    background: var(--fc-ok);
}

.fc-switch.on i {
    inset-inline-start: 29px;
}

.fc-set.is-off .fc-set-row:not(.is-main) {
    opacity: .45;
    pointer-events: none;
}

/* ---------- finance report block ---------- */
.fc-report {
    display: grid;
    gap: 14px;
}

.fc-answer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fc-answer strong {
    display: block;
    font-size: 17px;
}

.fc-answer small {
    color: var(--fc-ink2);
    font-size: 13.5px;
}

.fc-tanks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.fc-tank-fig {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fc-tank-fig span {
    display: grid;
    padding: 6px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--c, var(--fc-t)) 9%, transparent);
    font-size: 12.5px;
    color: var(--fc-ink2);
    text-align: center;
}

.fc-tank-fig b {
    direction: ltr;
    unicode-bidi: isolate;
    font-size: 17px;
    color: var(--fc-ink);
}

.fc-table-wrap {
    overflow-x: auto;
}

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

.fc-table th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--fc-line);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fc-ink2);
    text-align: start;
}

.fc-table td {
    padding: 9px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--fc-line) 60%, transparent);
    color: var(--fc-ink);
}

.fc-table tr {
    animation: fc-rise .4s var(--fc-ease) both;
}

.fc-table .num {
    direction: ltr;
    text-align: start;
    font-weight: 700;
}

.fc-more {
    justify-self: center;
}

.fc-foot {
    margin: 0;
    font-size: 13px;
    line-height: 1.9;
    color: var(--fc-ink2);
}

/* ---------- motion ---------- */
@keyframes fc-rise {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98);
    }

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

@keyframes fc-pop {
    0% {
        opacity: 0;
        transform: scale(.6);
    }

    70% {
        transform: scale(1.08);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fc-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fc-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--fc-warn) 55%, transparent);
    }

    100% {
        box-shadow: 0 0 0 12px transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fc-card,
    .fc-task,
    .fc-row,
    .fc-modal,
    .fc-overlay,
    .fc-count,
    .fc-dot,
    .fc-table tr,
    .fc-done .fc-chip {
        animation: none;
    }

    .fc-card,
    .fc-chip,
    .fc-btn,
    .fc-btn-ghost {
        transition: none;
    }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
    .fc-modal {
        width: 100vw;
        max-height: 94vh;
        align-self: end;
        border-radius: 26px 26px 0 0;
    }

    .fc-task {
        flex-wrap: wrap;
    }

    .fc-task .fc-btn {
        width: 100%;
    }

    .fc-actions {
        flex-direction: column-reverse;
    }

    .fc-actions .fc-btn,
    .fc-actions .fc-btn-ghost {
        width: 100%;
    }

    .fc-set-row {
        flex-wrap: wrap;
    }
}
