/* =========================================================
   TOKENS
   ========================================================= */
:root {
    --navy:        #1a3470;
    --navy-dark:   #0f2050;
    --navy-light:  #2a4a90;
    --teal:        #2dc4b4;
    --teal-dark:   #1a9e90;
    --blue-mid:    #1565c0;
    --text:        #0f1c30;
    --text-soft:   #4a5568;
    --muted:       #8896a8;
    --line:        #e2e8f0;
    --surface:     #ffffff;
    --surface-2:   #f7f9fc;
    --surface-3:   #eef2f8;
    --ok:          #059669;
    --ok-bg:       #d1fae5;
    --danger:      #dc2626;
    --danger-bg:   #fee2e2;
    --radius-sm:   8px;
    --radius:      14px;
    --radius-lg:   20px;
    --shadow-sm:   0 1px 4px rgba(15,28,48,.08);
    --shadow:      0 4px 16px rgba(15,28,48,.10);
    --shadow-lg:   0 8px 32px rgba(15,28,48,.14);
    --topbar-h:    64px;
    --max-w:       600px;
    --page-px:     0.85rem;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 15px; }

body {
    margin: 0;
    font-family: "Ubuntu", sans-serif;
    color: var(--text);
    background: var(--surface-3);
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

.bg-shape { display: none; }

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    min-height: var(--topbar-h);
    background: linear-gradient(90deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
    box-shadow: 0 2px 12px rgba(15,28,48,.28);
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }

.brand-logo-link { display: block; line-height: 0; }

.brand-logo {
    height: 32px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; }

.brand-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand-kicker {
    font-family: "Ubuntu Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--teal);
    text-transform: uppercase;
}

.actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

/* =========================================================
   PAGE
   ========================================================= */
.page {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem 0.85rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue-mid) 55%, var(--teal-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.1rem 1.1rem;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    right: -50px; top: -50px;
    width: 180px; height: 180px;
    background: url('/static/logo.png') no-repeat center center / contain;
    opacity: 0.10;
    pointer-events: none;
    filter: brightness(0) invert(1);
    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    left: -30px; bottom: -40px;
    width: 120px; height: 120px;
    background: url('/static/logo.png') no-repeat center center / contain;
    opacity: 0.07;
    pointer-events: none;
    filter: brightness(0) invert(1);
    z-index: 0;
}

/* conte�do acima das decora��es */
.hero > * {
    position: relative;
    z-index: 1;
}

.hero-tag {
    margin: 0;
    font-family: "Ubuntu Mono", monospace;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: var(--teal);
    text-transform: uppercase;
}

.hero h2 {
    margin: 0.1rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.month-label {
    font-family: "Ubuntu Mono", monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    padding: 0 4px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.metric {
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    backdrop-filter: blur(6px);
}

.metric span {
    font-size: 0.68rem;
    color: rgba(255,255,255,.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.metric-add {
    border-color: rgba(74,222,128,.4);
    background: rgba(74,222,128,.10);
}
.metric-add strong { color: #4ade80; }

.metric-sub {
    border-color: rgba(248,113,113,.4);
    background: rgba(248,113,113,.10);
}
.metric-sub strong { color: #f87171; }

.metric-neutral strong { color: #ffe44d; }

.metric-value {
    border-color: rgba(74,222,128,.45);
    background: rgba(74,222,128,.12);
}
.metric-value strong { color: #4ade80; }

/* --- SALDO-BLOCO: layout de equa��o (acumulado - descontado = saldo) ---- */
.saldo-bloco {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
}
.saldo-bloco-titulo {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-soft);
    margin-bottom: .75rem;
}
.saldo-bloco-linha {
    display: flex;
    align-items: stretch;
    gap: .4rem;
    flex-wrap: wrap;
}
.saldo-item {
    flex: 1;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .65rem .85rem;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.saldo-entrada  { border-left: 3px solid #059669; }
.saldo-saida    { border-left: 3px solid #dc2626; }
.saldo-resultado{ border-left: 3px solid #1565c0; }
.saldo-zero     { border-left: 3px solid var(--line); }
.saldo-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-soft);
    line-height: 1.1;
}
.saldo-valor {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--text);
}
.saldo-entrada  .saldo-valor { color: #059669; }
.saldo-saida    .saldo-valor { color: #dc2626; }
.saldo-resultado.saldo-item .saldo-valor { color: #1565c0; }
.saldo-zero .saldo-valor     { color: var(--muted); }
.saldo-sub {
    font-size: .73rem;
    color: var(--muted);
    margin-top: .1rem;
}
.saldo-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--muted);
    flex: 0 0 auto;
    padding: 0 .1rem;
    align-self: center;
}

.daily-rate-form {
    margin-top: 0.6rem;
    color: var(--text);
    font-size: 0.8rem;
}
.daily-rate-form summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.75;
    user-select: none;
    color: var(--text);
}
.daily-rate-form summary:hover { opacity: 1; }
.daily-rate-form form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.daily-rate-form input[type="number"],
.daily-rate-form input[type="text"],
.daily-rate-form input[type="tel"],
.daily-rate-form input[type="date"] {
    width: 130px;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
}
.daily-rate-form input[type="number"]::placeholder,
.daily-rate-form input[type="text"]::placeholder,
.daily-rate-form input[type="tel"]::placeholder { color: var(--muted); }

/* =========================================================
   PAINÉIS
   ========================================================= */
/* -- Painel Admin -- */
.admin-panel {
    padding: 1rem 1.25rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid var(--navy);
}
.admin-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--line);
}
.admin-panel-title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--navy);
}
.admin-panel-month {
    font-size: .8rem;
    color: var(--muted);
    font-weight: 600;
}

/* Dropdown de a��es do painel admin */
.admin-menu-wrap {
    position: relative;
    display: inline-block;
    margin-left: auto;
}

.admin-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(0,0,0,.13);
    z-index: 200;
    overflow: hidden;
}
.admin-menu.open { display: block; }

.admin-menu-item {
    display: block;
    width: 100%;
    padding: .6rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    white-space: nowrap;
    box-sizing: border-box;
}
.admin-menu-item:hover { background: var(--surface-2); }

.admin-menu-btn-whatsapp { color: #15803d; }
.admin-menu-btn-whatsapp:hover { background: #dcfce7; }

.admin-menu-btn-danger { color: var(--danger); }
.admin-menu-btn-danger:hover { background: #fee2e2; }

.admin-menu-sep {
    height: 1px;
    background: var(--line);
}

.admin-menu form { margin: 0; }

.admin-entry-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.admin-entry-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.panel-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.1rem 1rem 1rem;
    border: 1px solid var(--line);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--surface-3);
}

.panel-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.panel-head h3::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 1em;
    background: linear-gradient(180deg, var(--teal) 0%, var(--navy-light) 100%);
    border-radius: 2px;
    flex-shrink: 0;
}

.panel-head small { color: var(--muted); font-size: 0.78rem; }

/* =========================================================
   CARDS DE RESUMO
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}

.card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 4px solid var(--teal);
    border-radius: var(--radius);
    padding: 0.9rem;
    transition: box-shadow .15s;
}

.card:hover { box-shadow: var(--shadow); }

.card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.card h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
}

.card header span {
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--surface-3);
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    white-space: nowrap;
}

.card dl {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.card dl div { display: flex; flex-direction: column; gap: 0.08rem; }

.card dt {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
}

.folga-ok  { color: var(--ok) !important; }
.folga-zero { color: var(--muted) !important; }

.folga-tag {
    font-size: .75em;
    margin-left: .2rem;
    vertical-align: middle;
}

.use-folga-form {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .6rem;
    padding-top: .6rem;
    border-top: 1px solid var(--line);
}
.use-folga-form input[type=date],
.use-folga-form input[type=text] {
    font-size: .8rem;
    padding: .3rem .5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    flex: 1;
    min-width: 90px;
}

.hist-folga-bar {
    padding: .75rem 1rem;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}
.folga-use-form {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.folga-use-form input[type=date],
.folga-use-form input[type=text] {
    font-size: .85rem;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    flex: 1;
    min-width: 110px;
}

.btn-folga {
    background: var(--ok);
    color: #fff;
    border: none;
    font-weight: 700;
    white-space: nowrap;
}
.btn-folga:hover { background: #047857; filter: none; }
.btn-folga:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: .7;
}

.btn-grant-folga {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 700;
    white-space: nowrap;
}
.btn-grant-folga:hover { filter: brightness(1.15); }

/* Pain�is inline do hist�rico (Editar, Folga) � empurram o conte�do, n�o flutuam */
.hist-inline-panel {
    margin-top: .75rem;
    padding: .85rem 1rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius);
}

.hist-inline-panel-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(255,255,255,.85);
    margin: 0 0 .55rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.hist-inline-panel .hist-action-form input[type=date],
.hist-inline-panel .hist-action-form input[type=text],
.hist-inline-panel .hist-action-form input[type=number] {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}

.hist-inline-panel .hist-action-form input::placeholder {
    color: rgba(255,255,255,.55);
}

.gives-folga-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .85rem;
    white-space: nowrap;
    cursor: pointer;
}
.gives-folga-label input[type=checkbox] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.metric-folga strong { color: var(--ok) !important; }

/* =========================================================
   LISTA DE COLABORADORES
   ========================================================= */
.people-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.people-list li {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: background .12s;
}

.people-list li:hover { background: var(--surface-3); }

.person-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.person-main {
    flex: 1;
    min-width: 0;
}

.people-list li strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--navy);
    display: block;
}

.people-list li > div > span {
    font-size: 0.75rem;
    color: var(--muted);
    display: block;
    margin-top: 0.1rem;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Dropdown ? por card de colaborador */
.card-menu-wrap {
    position: relative;
    display: inline-block;
}

.card-menu-btn {
    font-size: 1.1rem;
    line-height: 1;
    padding: .25rem .55rem;
    letter-spacing: .05em;
}

.card-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 175px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    z-index: 300;
    overflow: hidden;
}
.card-menu.open { display: block; }

.card-menu-item {
    display: block;
    width: 100%;
    padding: .55rem .9rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    white-space: nowrap;
    box-sizing: border-box;
}
.card-menu-item:hover { background: var(--surface-2); }
.card-menu-item-warn  { color: var(--danger); }
.card-menu-item-warn:hover { background: #fee2e2; }

.card-menu form { margin: 0; }

/* Painel de edi��o expans�vel abaixo do card */
.card-edit-panel {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--line);
}

/* =========================================================
   STATUS
   ========================================================= */
.status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.status.on  { background: var(--ok-bg);     color: var(--ok);     }
.status.off { background: var(--danger-bg); color: var(--danger); }

/* =========================================================
   FORMULÁRIOS
   ========================================================= */
.entry-form,
.inline-form,
.small-form,
.login-form {
    display: grid;
    gap: 0.55rem;
}

.entry-form,
.inline-form {
    grid-template-columns: 1fr;
    margin-bottom: 0.9rem;
}

.small-form { margin-top: 0.5rem; }

input,
select {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.62rem 0.8rem;
    width: 100%;
    background: var(--surface);
    color: var(--text);
    font-family: "Ubuntu", sans-serif;
    font-size: 0.9rem;
    transition: border-color .15s, box-shadow .15s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45,196,180,.18);
}

/* =========================================================
   LANÇAMENTOS
   ========================================================= */
.table-wrap { overflow-x: auto; }
table { display: none; }

th, td { padding: 0.6rem; border-bottom: 1px solid var(--line); text-align: left; }
th { font-size: 0.82rem; color: var(--muted); }

.entry-cards { display: grid; gap: 0.6rem; }

.entry-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: var(--shadow-sm);
}

.entry-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.entry-card-name  { font-weight: 700; font-size: 0.92rem; color: var(--navy); }
.entry-card-date  { color: var(--muted); font-size: 0.78rem; }
.entry-card-note  { color: var(--text-soft); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hours.pos { color: var(--ok);     font-weight: 700; }
.hours.neg { color: var(--danger); font-weight: 700; }

.locked { color: var(--muted); font-size: 0.82rem; }

.empty {
    color: var(--muted);
    text-align: center;
    padding: 1.2rem 0;
    font-size: 0.88rem;
}

/* =========================================================
   DETAILS
   ========================================================= */
details summary {
    cursor: pointer;
    color: var(--navy-light);
    font-size: 0.84rem;
    font-weight: 600;
    list-style: none;
    padding: 0.25rem 0;
}

details summary::-webkit-details-marker { display: none; }

/* =========================================================
   BOTÕES
   ========================================================= */
.btn {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue-mid) 55%, var(--teal-dark) 100%);
    color: #fff;
    font-family: "Ubuntu", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: filter .15s, transform .1s;
    white-space: nowrap;
}

.btn:active { transform: scale(.97); }
.btn:hover  { filter: brightness(1.08); }

/* ghost na topbar (fundo escuro) */
.topbar .btn-ghost {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
}

/* ghost em painéis (fundo claro) */
.panel .btn-ghost,
.admin-panel .btn-ghost,
.login-card .btn-ghost,
.page-wrap .btn-ghost {
    background: var(--surface);
    color: var(--navy);
    border: 1.5px solid var(--line);
}

.btn-ghost {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
}

.btn-danger { background: var(--danger); }

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    border: none;
}

/* =========================================================
   PILLS
   ========================================================= */
.pill {
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    background: rgba(45,196,180,.2);
    color: var(--teal);
    font-size: 0.73rem;
    font-weight: 700;
    border: 1px solid rgba(45,196,180,.35);
    white-space: nowrap;
}

.pill-open {
    background: rgba(255,255,255,.14);
    color: rgba(255,255,255,.88);
    border: 1px solid rgba(255,255,255,.25);
}

/* =========================================================
   NAV DROPDOWN (nome do colaborador)
   ========================================================= */
.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.pill-dropdown {
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    background: rgba(45,196,180,.2);
    color: var(--teal);
    font-size: 0.73rem;
    font-weight: 700;
    border: 1px solid rgba(45,196,180,.35);
    white-space: nowrap;
    cursor: pointer;
    letter-spacing: .01em;
    transition: background .15s;
}
.pill-dropdown:hover,
.pill-dropdown.open {
    background: rgba(45,196,180,.35);
}

.nav-dropdown-menu {
    display: none;
    position: fixed;
    top: var(--topbar-h);
    right: .75rem;
    min-width: 170px;
    background: #1a3d38;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    overflow: hidden;
    z-index: 500;
    flex-direction: column;
    pointer-events: none;
}
.nav-dropdown-menu.open {
    display: flex;
    pointer-events: auto;
}

.nav-dropdown-menu a,
.nav-dropdown-menu button {
    display: block;
    width: 100%;
    padding: .6rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255,255,255,.88);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    white-space: nowrap;
    box-sizing: border-box;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu button:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.nav-dropdown-menu form {
    margin: 0;
    border-top: 1px solid rgba(255,255,255,.1);
}

/* =========================================================
   ALERTAS
   ========================================================= */
.alerts { display: grid; gap: 0.5rem; }

.alert {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    font-size: 0.88rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--line);
}

.alert-success { border-left: 4px solid var(--ok); }
.alert-info    { border-left: 4px solid var(--blue-mid); }
.alert-warning { border-left: 4px solid #d97706; }
.alert-danger  { border-left: 4px solid var(--danger); }

/* =========================================================
   LOGIN
   ========================================================= */
.login-wrap {
    min-height: 70vh;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(480px, 100%);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--line);
}

.login-card h2 {
    margin: 0 0 1.1rem;
    font-size: 1.2rem;
    color: var(--navy);
}

/* =========================================================
   HIST�RICO DO COLABORADOR
   ========================================================= */
.hist-hero {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 65%, var(--blue-mid) 100%);
    color: #fff;
    padding: 1.1rem var(--page-px) 0.9rem;
    position: relative;
    overflow: hidden;
}

/* marca d'�gua � logo cortada no canto direito */
.hist-hero::after {
    content: '';
    position: absolute;
    right: -3.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 11rem;
    height: 11rem;
    background: url('/static/logo.png') no-repeat center center / contain;
    opacity: 0.10;
    pointer-events: none;
    filter: brightness(0) invert(1);
    z-index: 0;
}

/* garante que o conte�do fique acima da marca d'�gua */
.hist-hero > * {
    position: relative;
    z-index: 1;
}

.hist-collab-edit {
    margin-top: 0.5rem;
}

.hist-collab-edit summary {
    color: rgba(255,255,255,.92);
}

.hist-collab-edit .small-form {
    margin-top: 0.45rem;
}

.hist-collab-edit input {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.28);
    color: #fff;
}

.hist-collab-edit input::placeholder {
    color: rgba(255,255,255,.62);
}

.hist-hero-back { margin-bottom: 0.6rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Dropdown de a��es no hist�rico */
.hist-actions-wrap {
    position: relative;
    display: inline-block;
}

.hist-actions-menu {
    display: none;
    position: fixed;
    top: 0;      /* calculado via JS */
    left: 0;     /* calculado via JS */
    min-width: 270px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    z-index: 1000;
}
.hist-actions-menu.open { display: block; }

.hist-action-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s;
}
.hist-action-item:hover { background: var(--surface-2); }

.hist-action-sep {
    height: 1px;
    background: var(--line);
}

.hist-action-section {
    padding: .7rem 1rem;
}

.hist-action-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin: 0 0 .5rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.folga-badge {
    background: var(--ok-bg);
    color: var(--ok);
    font-size: .72rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 99px;
    text-transform: none;
    letter-spacing: 0;
}

.hist-action-details {
    border-bottom: 1px solid var(--line);
}
.hist-action-details:last-child { border-bottom: none; }
.hist-action-details > summary {
    padding: .65rem 1rem;
    cursor: pointer;
    list-style: none;
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .5rem;
    user-select: none;
    transition: background .15s;
}
.hist-action-details > summary::-webkit-details-marker { display: none; }
.hist-action-details > summary::after {
    content: '�';
    margin-left: auto;
    font-size: 1.15rem;
    color: var(--muted);
    transition: transform .2s;
}
.hist-action-details[open] > summary::after { transform: rotate(90deg); }
.hist-action-details > summary:hover { background: var(--surface-2); }
.hist-action-details > .hist-action-section {
    border-top: 1px solid var(--line);
}

    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.hist-action-form input[type=date],
.hist-action-form input[type=text],
.hist-action-form input[type=number],
.hist-action-form input[type=tel],
.hist-action-form input[type=password] {
    font-size: .85rem;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    width: 100%;
    box-sizing: border-box;
}



.hist-hero-body { margin-bottom: 0.75rem; }

.hist-name {
    font-size: clamp(1.3rem, 4vw, 1.75rem);
    font-weight: 700;
    margin: 0.1rem 0 0.25rem;
}

.hist-role {
    font-size: 0.85rem;
    opacity: .8;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.hist-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    overflow: hidden;
    margin-top: 1rem;
}

.hist-month {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    overflow: hidden;
}

.hist-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.hist-month-head h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.hist-month-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mstat {
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--line);
}

.mstat.pos { background: #dcfce7; color: #166534; }
.mstat.neg { background: #fee2e2; color: #991b1b; }
.mstat.net { background: #dbeafe; color: var(--navy); }

/* tabela dentro do hist�rico (o reset global esconde <table>) */
.hist-month table,
.hist-content table,
.ponto-section table,
.card table {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.hist-month thead,
.hist-content thead,
.ponto-section thead,
.card thead { background: var(--bg); }

.hist-month th,
.hist-content th,
.ponto-section th,
.card th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; }

.hist-month td, .hist-month th,
.hist-content td, .hist-content th,
.ponto-section td, .ponto-section th,
.card td, .card th { padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }

.hist-month tbody tr:last-child td,
.hist-content tbody tr:last-child td,
.ponto-section tbody tr:last-child td,
.card tbody tr:last-child td { border-bottom: none; }

.hist-month tbody tr:hover,
.hist-content tbody tr:hover,
.ponto-section tbody tr:hover,
.card tbody tr:hover { background: var(--surface-hover, rgba(0,0,0,.03)); }

/* -- Dialog / Modal ------------------------------------------ */
dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 95%;
}
dialog::backdrop {
  background: rgba(15, 28, 48, .6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* =========================================================
   LINHA COM DIREITO A FOLGA (tom amarelo suave)
   ========================================================= */
tr.row-gives-folga td {
    background: rgba(250, 204, 21, 0.08);
    border-bottom-color: rgba(250, 204, 21, 0.22);
}
tr.row-gives-folga:hover td {
    background: rgba(250, 204, 21, 0.15);
}

/* =========================================================
   RODAPÉ DA LISTA DE AÇÕES (scroll padding em aparelhos iOS)
   ========================================================= */
.hist-actions-footer {
    height: max(1.5rem, env(safe-area-inset-bottom, 1rem));
    min-height: 1.5rem;
    flex-shrink: 0;
}

/* Garante que o menu admin também seja rolável em telas pequenas */
.admin-menu {
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

/* =========================================================
   RESUMO DO COLABORADOR — layout compacto
   ========================================================= */

/* Hero-metrics: 4 colunas no hist-hero (mais compacto) */
.hist-hero .hero-metrics {
    grid-template-columns: repeat(4, 1fr);
    gap: .4rem;
}
.hist-hero .metric {
    padding: .45rem .6rem;
}
.hist-hero .metric strong {
    font-size: 1rem;
}
.hist-hero .metric span {
    font-size: .62rem;
}

/* saldo-bloco mais compacto dentro de pconf-wrap */
.pconf-wrap .saldo-bloco {
    padding: .65rem .85rem;
}
.pconf-wrap .saldo-bloco-titulo {
    font-size: .68rem;
    margin-bottom: .5rem;
}
.pconf-wrap .saldo-item {
    padding: .4rem .6rem;
    min-width: 90px;
}
.pconf-wrap .saldo-valor {
    font-size: 1.1rem;
}
.pconf-wrap .saldo-label {
    font-size: .65rem;
}
.pconf-wrap .saldo-sub {
    font-size: .68rem;
}
.pconf-wrap .saldo-sep {
    font-size: 1.1rem;
}

/* ─── Progresso de batidas do dia ───────────────────────────────────────── */
.pconf-day-progress {
    background: rgba(0,0,0,.04);
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 12px;
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
}
.pconf-dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .7rem;
}
.pconf-dp-title {
    font-size: .82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .65;
}
.pconf-dp-count {
    font-size: .85rem;
    font-weight: 700;
    color: var(--teal);
}
.pconf-dp-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
}
.pconf-dp-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .55rem .3rem;
    border-radius: 8px;
    text-align: center;
}
.pconf-dp-time {
    font-size: .9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pconf-dp-label {
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    opacity: .65;
}
.pconf-dp-done {
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.35);
    color: var(--teal);
}
.pconf-dp-now {
    background: rgba(251,191,36,.15);
    border: 2px solid #fbbf24;
    color: #92400e;
}
.pconf-dp-pending {
    background: rgba(0,0,0,.04);
    border: 1px dashed rgba(0,0,0,.18);
    color: var(--muted);
}
.pconf-dp-note {
    font-size: .79rem;
    margin-top: .65rem;
    text-align: center;
    opacity: .7;
}
.pconf-dp-ready {
    color: var(--teal);
    font-weight: 600;
    opacity: 1;
}
