/* Kilates Semijoias - estilos da calculadora */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Playfair+Display:wght@400&display=swap');

:root {
    --bg: #0A0A0A;
    --bg2: #121212;
    --surf: #1A1A1A;
    --surf2: #1E1E1E;
    --border: #2A2A2A;
    --teal: #2F7375;
    --gold: #D4AF37;
    --goldLight: #D4C99A;
    --paper: #E8E3D9;
    --paperDim: rgba(232, 227, 217, .6);
    --paperFaint: rgba(232, 227, 217, .35);
    --w: 480px;
}

* {
    font-family: 'Inter', system-ui, sans-serif;
    box-sizing: border-box
}

html,
body {
    margin: 0;
    background: var(--bg)
}

.app {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--paper);
    display: flex;
    flex-direction: column
}

.app__header {
    width: 100%;
    background: var(--teal);
    height: 68px;
    min-height: 68px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30
}

.header__box {
    width: 100%;
    max-width: 520px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 10px;
    position: relative
}

.header__logo-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    margin-left: 2px
}

.header__logo {
    width: 168px;
    max-width: 168px;
    height: auto;
    max-height: 44px;
    object-fit: contain;
    display: block;
    flex-shrink: 0
}

.header__right {
    width: 52px;
    min-width: 52px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-shrink: 0
}

.btn--restart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 8px;
    min-width: 52px;
    min-height: 46px;
    border-radius: 8px;
    border: 1px solid rgba(232, 227, 217, .12);
    background: rgba(26, 26, 26, .65);
    color: rgba(232, 227, 217, .75);
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
}

.btn--restart:hover {
    background: rgba(26, 26, 26, .95);
    border-color: rgba(212, 175, 55, .28);
    color: var(--paper)
}

.btn--restart:active {
    transform: scale(.97)
}

.btn--restart__icon {
    width: 22px;
    height: 22px;
    display: block;
    color: #D4AF37
}

.btn--restart__label {
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: .5px;
    line-height: 1;
    text-transform: lowercase;
    color: rgba(232, 227, 217, .65);
    text-align: center
}

.app__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: var(--w);
    width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg)
}

.screen__content {
    flex: 1;
    padding: 12px 16px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden
}

.card {
    border-radius: 18px;
    background: var(--surf);
    border: 1px solid var(--border);
    padding: 14px
}

.card__label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--gold)
}

.card__value {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -.02em;
    color: var(--paper);
    margin-top: 6px
}

.card__line {
    height: 2px;
    width: 100%;
    margin-top: 6px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: .6
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.field__label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--paperDim)
}

.field__input {
    width: 100%;
    height: 46px;
    border-radius: 14px;
    background: var(--surf);
    border: 1px solid var(--border);
    padding: 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--paper);
    outline: none;
    transition: border-color .22s ease, box-shadow .22s ease
}

.field__input::placeholder {
    color: rgba(232, 227, 217, .25)
}

.field__input--error {
    border-color: rgba(239, 68, 68, .55) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12)
}

.btn--primary {
    width: 100%;
    height: 50px;
    border-radius: 14px;
    font-weight: 900;
    letter-spacing: .12em;
    font-size: 12px;
    border: 1px solid var(--border);
    transition: all .24s ease;
    will-change: opacity, transform, background
}

.btn--primary--active {
    background: linear-gradient(135deg, #2F7375 0%, #3BA3A5 45%, #2F7375 100%);
    color: #fff;
    border-color: #3BA3A5;
    opacity: 1;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(47, 115, 117, .35)
}

.btn--primary--idle {
    background: var(--surf);
    color: var(--paper);
    opacity: .4;
    cursor: not-allowed
}

.inicio-toast {
    border-radius: 12px;
    background: var(--surf);
    border: 1px solid rgba(239, 68, 68, .35);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--paper);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn .22s ease
}

.inicio-toast__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, .5);
    flex-shrink: 0
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-6px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.conf {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
    height: calc(100dvh - 68px);
    position: relative
}

.conf__top {
    flex-shrink: 0;
    padding: 14px 16px 12px;
    background: var(--bg2);
    border-bottom: 1px solid rgba(212, 175, 55, .15)
}

.steps {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.steps__track {
    display: flex;
    align-items: center;
    gap: 6px
}

.step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    border: 1px solid var(--border)
}

.step--active {
    background: var(--gold);
    color: var(--bg);
    border-color: var(--gold)
}

.step--done {
    background: var(--surf);
    color: var(--gold);
    border-color: rgba(212, 175, 55, .4)
}

.step--todo {
    background: var(--surf);
    color: var(--paperFaint)
}

.step__line {
    width: 14px;
    height: 2px;
    background: var(--surf2)
}

.step__line--done {
    background: rgba(212, 175, 55, .4)
}

.conf__meta {
    margin-top: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between
}

.conf__cat-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--gold)
}

.conf__cat-name {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1;
    margin-top: 4px;
    color: var(--paper)
}

.conf__qtd-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--paperFaint);
    text-align: right
}

.conf__qtd-value {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700
}

.conf__input-card {
    margin-top: 12px;
    border-radius: 16px;
    background: var(--surf);
    border: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.conf__list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px 340px;
    background: var(--bg);
    border-bottom: none;
    -webkit-overflow-scrolling: touch;
}

.empty {
    margin-top: 20px;
    text-align: center
}

.empty__icon {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--surf);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(212, 175, 55, .3);
    font-size: 18px
}

.empty__text {
    margin-top: 10px;
    font-size: 12px;
    color: var(--paperFaint);
    font-weight: 600
}

.empty__hint {
    font-size: 10px;
    color: rgba(232, 227, 217, .3);
    margin-top: 4px
}

.piece {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    background: var(--surf);
    border: 1px solid var(--border);
    padding: 0 14px;
    height: 48px;
    margin-bottom: 6px
}

.piece__left {
    display: flex;
    align-items: center;
    gap: 10px
}

.piece__badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: rgba(212, 175, 55, .7)
}

.piece__remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--paper);
    font-size: 13px;
    font-weight: 700
}

.conclude-bar {
    position: fixed;
    bottom: calc(252px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--w);
    background: var(--bg);
    border-top: none;
    padding: 0 12px 8px;
    z-index: 25;
}

.conclude-bar__inner {
    max-width: var(--w);
    margin: 0 auto
}

.alert {
    margin-bottom: 8px;
    border-radius: 10px;
    background: var(--surf);
    border: 1px solid rgba(212, 175, 55, .3);
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--paper)
}

.btn--conclude {
    width: 100%;
    height: 50px;
    border-radius: 14px;
    font-weight: 900;
    letter-spacing: .12em;
    font-size: 12px;
    background: linear-gradient(135deg, #2F7375 0%, #3BA3A5 45%, #2F7375 100%);
    color: #fff;
    border: 1px solid #3BA3A5;
    opacity: 1;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(47, 115, 117, .35)
}

.keypad-wrap {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--w);
    background: var(--bg);
    border-top: 1px solid rgba(212, 175, 55, .18);
    z-index: 30;
    padding-top: 8px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, .3)
}

.kp {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
    background: var(--bg);
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px))
}

.kp--compact {
    gap: 10px;
    padding: 12px
}

.kp__ph {
    min-height: 48px;
    background: transparent
}

.kp__k {
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    user-select: none
}

.kp__k--num {
    background: var(--surf2);
    color: var(--paper)
}

.kp__k--tool {
    background: var(--bg2);
    color: var(--paper)
}

.kp__k--primary {
    background: var(--paper);
    color: var(--bg);
    border-color: var(--gold);
    box-shadow: 0 0 16px rgba(212, 175, 55, .25);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .06em
}

.kp__k--dis {
    background: var(--surf);
    color: rgba(232, 227, 217, .3)
}

.kp__k--jump {
    background: linear-gradient(135deg, #2F7375 0%, #3BA3A5 100%);
    color: #fff;
    border-color: #3BA3A5;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: .08em;
    box-shadow: 0 2px 10px rgba(47, 115, 117, .3);
    display: flex;
    align-items: center;
    justify-content: center
}

.kp__k--jump:active {
    transform: scale(.96)
}

.resumo {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg)
}

.resumo__inner {
    padding: 16px 16px 0
}

.resumo__title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--paper)
}

.resumo__title-accent {
    color: var(--gold)
}

.card--gold {
    border-color: rgba(212, 175, 55, .3);
    background: linear-gradient(180deg, var(--surf2), var(--bg2))
}

.screen[hidden],
.conf[hidden],
.resumo[hidden] {
    display: none !important
}

.header__restarted {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    background: #E8E3D9;
    color: #0A0A0A;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 10
}

.inicio-fields {
    display: grid;
    gap: 12px;
    margin-bottom: 4px
}

.inicio-start {
    position: relative
}

.inicio-start__overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    cursor: not-allowed
}

.card--error {
    border-color: rgba(239, 68, 68, .45)
}

.steps__item {
    display: flex;
    align-items: center;
    gap: 6px
}

.steps__count {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    color: rgba(232, 227, 217, .4)
}

.conf__qtd-units {
    color: rgba(232, 227, 217, .6)
}

.conf__piece-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    color: rgba(232, 227, 217, .4)
}

.conf__piece-value {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -.02em
}

.piece__name {
    font-size: 13px;
    font-weight: 700
}

.piece__value {
    font-size: 13px;
    font-weight: 900
}

.piece__actions {
    display: flex;
    align-items: center;
    gap: 10px
}

.resumo__warn {
    margin-top: 12px;
    border-radius: 12px;
    background: var(--surf);
    border: 1px solid rgba(212, 175, 55, .3);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700
}

.resumo__grid {
    margin-top: 16px;
    display: grid;
    gap: 10px
}

.resumo__split {
    display: grid;
    grid-template-columns: 1fr 1px 1fr
}

.resumo__split-cell {
    padding: 14px
}

.resumo__split-line {
    background: var(--border);
    width: 1px
}

.resumo__split-line--gold {
    background: rgba(212, 175, 55, .25)
}

.resumo__amount {
    font-size: 20px;
    font-weight: 900;
    margin-top: 4px
}

.resumo__sold {
    font-size: 26px;
    font-weight: 900;
    margin-top: 4px
}

.comissao {
    margin-top: 16px
}

.comissao__row {
    display: flex;
    align-items: center;
    gap: 10px
}

.comissao__input-wrap {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px
}

.comissao__input {
    width: 48px;
    background: transparent;
    font-size: 20px;
    font-weight: 900;
    color: var(--paper);
    border: none;
    outline: none
}

.comissao__pct {
    font-size: 18px;
    font-weight: 900;
    color: rgba(232, 227, 217, .4)
}

.comissao__presets {
    display: flex;
    gap: 6px
}

.comissao__preset {
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    border: 1px solid var(--border);
    background: var(--bg2);
    color: rgba(232, 227, 217, .6);
    cursor: pointer
}

.comissao__preset--on {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--bg)
}

.comissao__values {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.comissao__box {
    border-radius: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 10px
}

.comissao__box-value {
    font-size: 14px;
    font-weight: 900;
    margin-top: 2px
}

.haver {
    margin-top: 16px;
    padding: 0;
    overflow: hidden
}

.haver__input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px
}

.haver__prefix {
    font-size: 14px;
    font-weight: 900;
    color: var(--paper)
}

.haver__input {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 16px;
    font-weight: 900;
    color: var(--paper);
    outline: none;
    width: 100%
}

.haver__rest {
    padding: 14px;
    background: rgba(212, 175, 55, .06)
}

.haver__rest-value {
    font-size: 20px;
    font-weight: 900;
    margin-top: 4px
}

.tabela {
    margin-top: 16px;
    padding: 0;
    overflow: hidden
}

.tabela__head {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between
}

.tabela__hint {
    font-size: 10px;
    font-weight: 700;
    color: rgba(232, 227, 217, .4)
}

.tabela__cols,
.tabela__row,
.tabela__total {
    display: grid;
    grid-template-columns: 1fr 60px 90px;
    padding: 0 14px;
    align-items: center
}

.tabela__cols {
    padding: 8px 14px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    color: rgba(232, 227, 217, .4);
    border-bottom: 1px solid var(--border)
}

.tabela__row {
    height: 38px;
    font-size: 11px;
    border-bottom: 1px solid var(--border)
}

.tabela__row-name {
    font-weight: 700;
    font-size: 10px
}

.tabela__right {
    text-align: right
}

.tabela__total {
    height: 44px;
    background: var(--bg2);
    font-weight: 900;
    font-size: 11px
}

.tabela__gold {
    text-align: right;
    color: var(--gold)
}

.resumo__actions {
    margin-top: 20px;
    display: grid;
    gap: 10px;
    padding-bottom: 20px
}

.btn--pdf {
    width: 100%;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2F7375 0%, #3BA3A5 45%, #2F7375 100%);
    color: #fff;
    font-weight: 900;
    letter-spacing: .1em;
    font-size: 11px;
    border: 1px solid #3BA3A5;
    box-shadow: 0 4px 18px rgba(47, 115, 117, .35);
    cursor: pointer
}

.btn--whatsapp {
    width: 100%;
    height: 54px;
    border-radius: 14px;
    background: #25D366;
    border: 1px solid #25D366;
    color: #fff;
    font-weight: 900;
    letter-spacing: .1em;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 211, 102, .35);
    cursor: pointer
}

.btn--back {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    color: rgba(232, 227, 217, .6);
    cursor: pointer
}

.pdf-ready {
    border-radius: 10px;
    background: rgba(212, 175, 55, .15);
    border: 1px solid rgba(212, 175, 55, .3);
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    text-align: center
}

@media (max-width:390px) {
    .conf__cat-name {
        font-size: 26px
    }

    .kp {
        gap: 6px;
        padding: 8px
    }

    .conf__list {
        max-height: none
    }

    .header__logo {
        width: 150px;
        max-width: 150px;
        max-height: 40px
    }
}