/* FarmoRH — base partilhada com o Farmo'o'Clock: paleta institucional Farmodiética (azul #035F8F / #1099E2, amarelo #FFBB00, Raleway) */

@font-face {
  font-family: "Raleway";
  src: url("fonts/raleway-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Raleway";
  src: url("fonts/raleway-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --azul: #035F8F;
  --azul-escuro: #024469;
  --azul-claro: #1099E2;
  --azul-fundo: #EAF4FB;
  --amarelo: #FFBB00;
  --amarelo-fundo: #FFF6DE;
  --verde: #2E9E5B;
  --verde-fundo: #E5F5EC;
  --vermelho: #D64545;
  --vermelho-fundo: #FBE9E9;
  --laranja: #E07A1F;

  --fundo: #F3F6F9;
  --superficie: #FFFFFF;
  --superficie-2: #F8FAFC;
  --linha: #E3E9EF;
  --linha-forte: #CFD8E1;
  --texto: #1B2733;
  --texto-2: #4A5866;
  --texto-3: #8592A0;

  --raio: 14px;
  --raio-s: 9px;
  --sombra: 0 1px 2px rgba(16, 40, 64, .05), 0 4px 16px rgba(16, 40, 64, .05);
  --sombra-forte: 0 10px 40px rgba(16, 40, 64, .16);
  --foco: 0 0 0 3px rgba(16, 153, 226, .28);
  --lateral: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--texto); background: var(--fundo);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
a { color: var(--azul); text-decoration: none; }
a:hover { color: var(--azul-claro); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 .75em; }
.ic { width: 18px; height: 18px; flex: none; }
.mudo { color: var(--texto-3); }
.pequeno { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.oculto { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--foco); border-radius: 6px; }

/* ------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--superficie); border-right: 1px solid var(--linha); padding: 20px 14px;
}
.marca { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; color: var(--texto); }
.marca img { width: 38px; height: 38px; }
.marca-nome { font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1.05; }
.marca-nome span { color: var(--azul-claro); }
.marca-sub { font-size: 11px; color: var(--texto-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-titulo { font-size: 11px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .07em; padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--texto-2); font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--superficie-2); color: var(--texto); }
.nav a.ativo { background: var(--azul-fundo); color: var(--azul); }
.nav a.ativo .ic { color: var(--azul-claro); }
.nav .contador { margin-left: auto; background: var(--vermelho); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }

.lateral-rodape { margin-top: auto; border-top: 1px solid var(--linha); padding-top: 14px; position: relative; }
.eu { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; color: var(--texto); }
.eu:hover { background: var(--superficie-2); }
.eu-nome { font-weight: 700; font-size: 14px; line-height: 1.2; }
.eu-perfil { font-size: 12px; color: var(--texto-3); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--azul-claro), var(--azul)); color: #fff; font-weight: 700; font-size: 13px;
}
.avatar.s { width: 28px; height: 28px; font-size: 11px; }

.menu-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--superficie);
  border: 1px solid var(--linha); border-radius: 12px; box-shadow: var(--sombra-forte); padding: 6px; z-index: 40;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px;
  color: var(--texto-2); font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--superficie-2); color: var(--texto); }

.principal { min-width: 0; padding: 28px 36px 60px; max-width: 1360px; width: 100%; }
.topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.topo .sub { color: var(--texto-3); margin-top: 4px; font-weight: 500; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* barra inferior em telemóvel */
.barra-movel { display: none; }

/* ------------------------------------------------------------ componentes */
.cartao { background: var(--superficie); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); }
.cartao-corpo { padding: 20px 22px; }
.cartao-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.cartao-cab + .cartao-corpo { padding-top: 14px; }

.grelha { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.kpi { padding: 18px 20px; }
.kpi-rotulo { font-size: 12.5px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 7px; }
.kpi-valor { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; line-height: 1.1; }
.kpi-valor small { font-size: 15px; font-weight: 600; color: var(--texto-3); margin-left: 3px; }
.kpi-nota { font-size: 13px; color: var(--texto-3); margin-top: 4px; font-weight: 500; }
.kpi.destaque { background: linear-gradient(135deg, var(--azul) 0%, #0479B3 100%); border: 0; color: #fff; }
.kpi.destaque .kpi-rotulo, .kpi.destaque .kpi-nota, .kpi.destaque small { color: rgba(255,255,255,.75); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--linha-forte); background: var(--superficie); color: var(--texto);
  font: inherit; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn:hover { border-color: var(--azul-claro); color: var(--azul); }
.btn.primario { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn.primario:hover { background: var(--azul-escuro); border-color: var(--azul-escuro); color: #fff; }
.btn.perigo { color: var(--vermelho); }
.btn.perigo:hover { border-color: var(--vermelho); background: var(--vermelho-fundo); }
.btn.fantasma { border-color: transparent; background: transparent; }
.btn.fantasma:hover { background: var(--superficie-2); }
.btn.icone { width: 38px; padding: 0; }
.btn.s { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.s.icone { width: 32px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-grupo { display: inline-flex; }
.btn-grupo .btn { border-radius: 0; margin-left: -1px; }
.btn-grupo .btn:first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.btn-grupo .btn:last-child { border-radius: 0 10px 10px 0; }

.etq { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--superficie-2); color: var(--texto-2); border: 1px solid var(--linha); white-space: nowrap; }
.etq.verde { background: var(--verde-fundo); color: #1F7543; border-color: transparent; }
.etq.vermelho { background: var(--vermelho-fundo); color: #B02F2F; border-color: transparent; }
.etq.amarelo { background: var(--amarelo-fundo); color: #8A6200; border-color: transparent; }
.etq.azul { background: var(--azul-fundo); color: var(--azul); border-color: transparent; }
.ponto { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* formulários */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .rotulo { font-size: 13px; font-weight: 700; color: var(--texto-2); }
.campo .ajuda { font-size: 12.5px; color: var(--texto-3); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--texto); background: var(--superficie); border: 1px solid var(--linha-forte);
  border-radius: 10px; height: 40px; padding: 0 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238592A0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul-claro); box-shadow: var(--foco); }
input[type=color] { width: 44px; height: 40px; border: 1px solid var(--linha-forte); border-radius: 10px; padding: 4px; background: var(--superficie); cursor: pointer; }
.form-grelha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grelha .largo { grid-column: 1 / -1; }
.secao-form { padding: 22px; border-top: 1px solid var(--linha); }
.secao-form:first-child { border-top: 0; }
.secao-form > h3 { margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--azul); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--linha-forte); font-weight: 650; font-size: 13.5px; cursor: pointer; background: var(--superficie); color: var(--texto-2); transition: all .15s; }
.chip input:checked + span { background: var(--azul); border-color: var(--azul); color: #fff; }
.chip input:focus-visible + span { box-shadow: var(--foco); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filtros .campo { min-width: 150px; }

/* tabelas */
.tabela-envolta { overflow-x: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--linha); background: var(--superficie-2); white-space: nowrap; }
.tabela td { padding: 11px 14px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover td { background: #FAFCFD; }
.tabela tfoot td { font-weight: 800; background: var(--superficie-2); border-top: 1px solid var(--linha-forte); }
.cartao > .tabela-envolta:first-child table th:first-child { border-top-left-radius: var(--raio); }
.pessoa-celula { display: flex; align-items: center; gap: 10px; }
.pessoa-celula .nome { font-weight: 700; white-space: nowrap; }
.pessoa-celula .email { font-size: 12.5px; color: var(--texto-3); }
.inativo td { opacity: .55; }

/* barras horizontais */
.barras { display: flex; flex-direction: column; gap: 12px; }
.barra-linha { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 12px; font-size: 14px; }
.barra-linha .rot { display: flex; align-items: center; gap: 8px; font-weight: 650; min-width: 0; }
.barra-linha .rot span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-fundo { height: 10px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; border: 1px solid var(--linha); }
.barra-cheia { height: 100%; border-radius: 99px; }
.progresso { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 12px; }
.progresso > div { height: 100%; background: var(--amarelo); border-radius: 99px; }
.progresso.claro { background: var(--superficie-2); border: 1px solid var(--linha); }
.progresso.claro > div { background: var(--azul-claro); }

/* fita da semana (início) */
.fita { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.fita-dia { border-radius: 12px; padding: 10px 6px 12px; text-align: center; border: 1px solid var(--linha); background: var(--superficie-2); }
.fita-dia .d { font-size: 12px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; }
.fita-dia .n { font-size: 20px; font-weight: 800; margin: 2px 0 4px; }
.fita-dia .h { font-size: 12.5px; font-weight: 700; color: var(--texto-2); min-height: 18px; }
.fita-dia.feito { background: var(--verde-fundo); border-color: #BFE5CF; }
.fita-dia.feito .h { color: #1F7543; }
.fita-dia.falta { background: var(--vermelho-fundo); border-color: #F2C4C4; }
.fita-dia.falta .h { color: #B02F2F; }
.fita-dia.hoje { background: var(--superficie); border: 2px solid var(--azul-claro); }
.fita-dia.feriado, .fita-dia.ausente { background: var(--amarelo-fundo); border-color: #F5E2A8; }
.fita-dia.feriado .h, .fita-dia.ausente .h { color: #8A6200; font-size: 11px; }
.fita-dia.folga, .fita-dia.futuro { opacity: .55; }

/* alertas */
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.aviso .ic { margin-top: 1px; }
.aviso.ok { background: var(--verde-fundo); color: #1F7543; }
.aviso.erro { background: var(--vermelho-fundo); color: #9E2A2A; }
.aviso.info { background: var(--azul-fundo); color: var(--azul); }
.aviso.atencao { background: var(--amarelo-fundo); color: #7A5600; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--texto); color: #fff; padding: 11px 16px; border-radius: 11px; font-weight: 600; font-size: 14px; box-shadow: var(--sombra-forte); animation: entra .2s ease-out; max-width: 380px; }
.toast.erro { background: var(--vermelho); }
.toast.ok { background: #1F7543; }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } }

.vazio { text-align: center; padding: 40px 20px; color: var(--texto-3); }
.vazio .ic { width: 36px; height: 36px; color: var(--linha-forte); margin-bottom: 8px; }
.vazio strong { display: block; color: var(--texto-2); font-size: 15px; margin-bottom: 4px; }

/* subnavegação do backoffice */
.separadores { display: flex; gap: 4px; border-bottom: 1px solid var(--linha); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.separadores a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 650; color: var(--texto-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.separadores a:hover { color: var(--texto); }
.separadores a.ativo { color: var(--azul); border-bottom-color: var(--azul); }

/* ------------------------------------------------------------ planilha */
.semana-nav { display: flex; align-items: center; gap: 8px; }
.semana-rotulo { font-weight: 750; font-size: 16px; min-width: 170px; text-align: center; }
.planilha-envolta { overflow-x: auto; }
table.planilha { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.planilha th, .planilha td { border-bottom: 1px solid var(--linha); }
.planilha thead th { padding: 12px 6px 10px; font-weight: 700; text-align: center; background: var(--superficie); position: relative; }
.planilha thead th:first-child { text-align: left; padding-left: 22px; border-top-left-radius: var(--raio); }
.planilha thead th:last-child { border-top-right-radius: var(--raio); }
.dia-cab { display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; border-radius: 10px; padding: 4px 2px; border: 0; background: none; font: inherit; width: 100%; color: inherit; }
.dia-cab:hover:not([disabled]) { background: var(--superficie-2); }
.dia-cab[disabled] { cursor: default; }
.dia-cab .dn { font-size: 12px; color: var(--texto-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.dia-cab .dd { font-size: 18px; font-weight: 800; line-height: 1.15; }
.dia-cab .dx { font-size: 10.5px; font-weight: 700; min-height: 15px; color: #8A6200; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th.hoje .dia-cab .dd { background: var(--azul); color: #fff; border-radius: 8px; padding: 0 8px; }
.col-area { text-align: left; padding: 6px 12px 6px 22px; min-width: 170px; }
.area-nome { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.area-nome .ponto { width: 12px; height: 12px; border-radius: 4px; }
.planilha td.c { padding: 6px 4px; text-align: center; }
.celula {
  width: 100%; max-width: 76px; height: 42px; text-align: center; border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-size: 16px; font-weight: 700; background: var(--superficie-2); color: var(--texto); padding: 0 4px;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.celula::placeholder { color: #C5CED7; font-weight: 600; }
.celula:hover { border-color: var(--linha-forte); }
.celula:focus { outline: none; background: #fff; border-color: var(--azul-claro); box-shadow: var(--foco); }
.celula.preenchida { background: var(--azul-fundo); color: var(--azul); }
.celula.a-gravar { border-color: var(--amarelo); }
.celula.gravada { animation: gravou .9s ease-out; }
.celula.erro { border-color: var(--vermelho); background: var(--vermelho-fundo); color: var(--vermelho); }
.celula[readonly] { background: transparent; cursor: not-allowed; color: var(--texto-2); }
.celula[readonly].preenchida { background: #F1F5F8; }
@keyframes gravou { 0% { box-shadow: 0 0 0 3px rgba(46, 158, 91, .45); } 100% { box-shadow: 0 0 0 0 rgba(46, 158, 91, 0); } }
.celula-envolta { position: relative; display: inline-block; width: 100%; max-width: 76px; }
.btn-nota { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--linha-forte); background: #fff; display: none; place-items: center; cursor: pointer; padding: 0; color: var(--texto-3); }
.btn-nota .ic { width: 12px; height: 12px; }
.btn-nota.tem { display: grid; color: var(--azul-claro); border-color: var(--azul-claro); }
.celula-envolta:hover .btn-nota, .celula-envolta:focus-within .btn-nota { display: grid; }
td.dia-feriado, th.dia-feriado, td.dia-ausente, th.dia-ausente { background: repeating-linear-gradient(-45deg, #FFFBF0, #FFFBF0 6px, #FFF6DE 6px, #FFF6DE 12px); }
td.dia-folga, th.dia-folga { background: #FAFBFC; }
.planilha .col-total { font-weight: 800; text-align: center; width: 84px; color: var(--texto-2); }
.planilha tfoot td { padding: 12px 4px; text-align: center; font-weight: 800; background: var(--superficie-2); border-bottom: 0; }
.planilha tfoot td:first-child { text-align: left; padding-left: 22px; border-bottom-left-radius: var(--raio); color: var(--texto-2); }
.planilha tfoot td:last-child { border-bottom-right-radius: var(--raio); }
.total-dia { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
.total-dia .esperado { font-size: 11px; font-weight: 600; color: var(--texto-3); }
.total-dia.completo { color: var(--verde); }
.total-dia.acima { color: var(--laranja); }
.total-semana { font-size: 18px; color: var(--azul); }
.legenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--texto-3); font-weight: 600; padding: 14px 22px; border-top: 1px solid var(--linha); }
.legenda kbd { font-family: inherit; font-size: 11.5px; background: var(--superficie-2); border: 1px solid var(--linha-forte); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--texto-2); }
.estado-gravacao { font-size: 13px; font-weight: 600; color: var(--texto-3); display: inline-flex; align-items: center; gap: 6px; }
.estado-gravacao::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); }
.estado-gravacao.a-gravar::before { background: var(--amarelo); }
.estado-gravacao.erro::before { background: var(--vermelho); }

/* vista de telemóvel da planilha */
.planilha-movel { display: none; }
.dias-movel { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 14px; border-bottom: 1px solid var(--linha); }
.dias-movel button { border: 1px solid var(--linha); background: var(--superficie-2); border-radius: 12px; padding: 6px 0 7px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--texto-2); }
.dias-movel button .dn { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--texto-3); }
.dias-movel button .dd { font-size: 17px; font-weight: 800; }
.dias-movel button .dh { font-size: 11px; font-weight: 700; min-height: 15px; }
.dias-movel button.sel { background: var(--azul); border-color: var(--azul); color: #fff; }
.dias-movel button.sel .dn { color: rgba(255,255,255,.8); }
.dias-movel button.com-horas:not(.sel) .dh { color: var(--verde); }
.linha-movel { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--linha); }
.linha-movel .area-nome { flex: 1; min-width: 0; }
.passo { display: flex; align-items: center; gap: 6px; }
.passo button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--linha-forte); background: var(--superficie); font-size: 20px; font-weight: 700; color: var(--azul); cursor: pointer; display: grid; place-items: center; }
.passo button:active { background: var(--azul-fundo); }
.passo .celula { width: 62px; }
.movel-total { display: flex; justify-content: space-between; padding: 14px 16px; font-weight: 800; background: var(--superficie-2); border-radius: 0 0 var(--raio) var(--raio); }

/* menu de ausência / popover */
.popover { position: absolute; z-index: 60; background: var(--superficie); border: 1px solid var(--linha); border-radius: 12px; box-shadow: var(--sombra-forte); padding: 6px; min-width: 210px; }
.popover h4 { margin: 4px 8px 6px; font-size: 12px; color: var(--texto-3); text-transform: uppercase; letter-spacing: .05em; }
.popover button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--texto-2); text-align: left; }
.popover button:hover { background: var(--superficie-2); color: var(--texto); }
.popover button.sel { color: var(--azul); background: var(--azul-fundo); }
.popover textarea { min-height: 90px; margin-bottom: 8px; }

/* diálogo */
dialog { border: 0; border-radius: 16px; box-shadow: var(--sombra-forte); padding: 0; max-width: 440px; width: calc(100% - 32px); color: var(--texto); }
dialog::backdrop { background: rgba(16, 32, 48, .45); backdrop-filter: blur(2px); }
.dialogo-corpo { padding: 22px 24px; }
.dialogo-acoes { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--superficie-2); border-top: 1px solid var(--linha); }

/* ------------------------------------------------------------ login */
.ecra-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-arte {
  background: radial-gradient(circle at 20% 20%, rgba(16,153,226,.55), transparent 55%), radial-gradient(circle at 80% 90%, rgba(255,187,0,.28), transparent 50%), linear-gradient(140deg, #024469, #035F8F 55%, #0A7CB8);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-arte::after { content: ""; position: absolute; right: -140px; top: 50%; width: 480px; height: 480px; transform: translateY(-50%); border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.login-arte h1 { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; max-width: 460px; }
.login-arte h1 span { color: var(--amarelo); }
.login-arte p { font-size: 17px; opacity: .85; max-width: 420px; margin-top: 16px; font-weight: 500; }
.login-arte .logo-farmo { height: 34px; filter: brightness(0) invert(1); opacity: .9; align-self: flex-start; }
.login-form-lado { display: grid; place-items: center; padding: 40px 24px; background: var(--superficie); }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form .marca { padding: 0 0 8px; }
.separador-ou { display: flex; align-items: center; gap: 12px; color: var(--texto-3); font-size: 13px; font-weight: 600; }
.separador-ou::before, .separador-ou::after { content: ""; flex: 1; height: 1px; background: var(--linha); }
.btn.grande { height: 46px; font-size: 15px; border-radius: 12px; }
.btn.largo { width: 100%; }

.senha-mostrar { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 26px; font-weight: 700; letter-spacing: .06em; background: var(--superficie-2); border: 1px dashed var(--linha-forte); border-radius: 12px; padding: 18px; text-align: center; user-select: all; }

/* ------------------------------------------------------------ responsivo */
@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .principal { padding: 24px 24px 60px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .principal { padding: 18px 16px 96px; }
  h1 { font-size: 22px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .form-grelha { grid-template-columns: 1fr; }
  .barra-movel {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--linha); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .barra-movel a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11px; font-weight: 700; color: var(--texto-3); border-radius: 10px; }
  .barra-movel a.ativo { color: var(--azul); background: var(--azul-fundo); }
  .barra-movel .ic { width: 22px; height: 22px; }
  .topo-movel { display: flex !important; }
  .planilha-desktop { display: none; }
  .planilha-movel { display: block; }
  .ecra-login { grid-template-columns: 1fr; }
  .login-arte { display: none; }
  .barra-linha { grid-template-columns: 96px 1fr 48px; }
  .esconder-movel { display: none !important; }
  .toasts { left: 16px; right: 16px; bottom: 84px; }
}
.topo-movel { display: none; align-items: center; justify-content: space-between; margin: -4px 0 16px; }
.topo-movel .marca { padding: 0; }
.topo-movel .marca img { width: 32px; height: 32px; }

@media print {
  .lateral, .barra-movel, .acoes, .filtros, .separadores { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
  .cartao { box-shadow: none; }
}

/* linhas com projeto/tarefa */
.col-area { position: relative; }
.linha-rot { display: flex; align-items: center; gap: 10px; min-width: 0; }
.linha-rot .ponto { width: 12px; height: 12px; border-radius: 4px; }
.linha-txt { min-width: 0; }
.linha-txt .l1 { font-weight: 700; line-height: 1.25; }
.linha-txt .l2 { font-size: 12px; color: var(--texto-3); font-weight: 600; line-height: 1.25; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-remover-linha { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--linha-forte); background: #fff; color: var(--texto-3); cursor: pointer; display: none; line-height: 1; font-size: 15px; padding: 0; }
tr:hover .btn-remover-linha { display: block; }
.btn-remover-linha:hover { color: var(--vermelho); border-color: var(--vermelho); }
.linha-nova td { padding: 10px 22px; background: var(--superficie-2); }
.linha-movel .linha-rot { flex: 1; }
.nova-linha { display: flex; flex-direction: column; gap: 10px; padding: 4px 6px 6px; }
.nova-linha label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--texto-2); }
.desc-obrig { color: #1A9E9E !important; }
.popover textarea.erro { border-color: var(--vermelho); box-shadow: 0 0 0 3px rgba(214,69,69,.2); }
.linha-movel .celula-envolta { max-width: 62px; }
