/* ===========================================
   MEU PLACAR - CSS
   Sistema de comparação Verde vs Laranja
   =========================================== */

/* -----------------------------------------
   1. VARIÁVEIS CSS - Paleta Minecraft Wool
   ----------------------------------------- */
:root {
    /* Cores principais */
    --bg: rgb(248, 241, 228);
    --text: rgb(60, 47, 47);
    --shadow: #3C2F2F;
    --verde: rgb(102, 127, 51);
    --laranja: rgb(216, 127, 51);
    --amarelo: rgb(229, 200, 51);
    --cinza: rgb(153, 153, 153);
    
    /* Medidas */
    --sidebar-width: 25%;
    --content-width: 75%;
    --aba-width: 280px;
    --border-width: 4px;
    --border-radius: 12px;
    --shadow-offset: 4px;
    
    /* Tipografia */
    --font-family: Arial, sans-serif;
    --font-aba: 26px;
    --font-contador: 24px;
    --font-nome: 18px;
}

/* -----------------------------------------
   2. RESET E BASE
   ----------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

/* -----------------------------------------
   3. CONTAINER PRINCIPAL
   ----------------------------------------- */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* -----------------------------------------
   4. SIDEBAR
   ----------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 20px 0;
    gap: 10px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    position: relative;
}

.sidebar::after {
    content: '';
    position: fixed;
    right: var(--content-width);
    top: 0;
    bottom: 0;
    width: var(--border-width);
    background-color: var(--text);
    z-index: 50;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar.grabbing {
    cursor: grabbing;
}

/* -----------------------------------------
   5. ABAS
   ----------------------------------------- */
.aba {
    width: var(--aba-width);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: var(--bg);
    border: var(--border-width) solid var(--text);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: grab;
    transition: all 0.2s ease;
    z-index: 1;
    position: relative;
}

.sidebar.grabbing .aba {
    cursor: grabbing;
}

.aba:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--shadow);
}

.aba-ativa {
    z-index: 100;
    background-color: var(--bg);
    margin-right: calc(-1 * var(--border-width));
}

.aba svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    fill: var(--text);
    stroke: var(--text);
}

.aba span {
    font-size: var(--font-aba);
    font-weight: bold;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Menu de exclusão da aba - botão substitui a aba */
.aba.menu-btn {
    padding: 16px 20px;
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    max-height: 68px;
    box-sizing: border-box;
}

/* -----------------------------------------
   6. BOTÃO ADICIONAR ABA
   ----------------------------------------- */
.btn-adicionar-aba {
    width: var(--aba-width);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: var(--bg);
    border: var(--border-width) solid var(--text);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1;
    position: relative;
    font-family: var(--font-family);
}

.btn-adicionar-aba.aba-ativa {
    z-index: 100;
    background-color: var(--bg);
    margin-right: calc(-1 * var(--border-width));
}

.btn-adicionar-aba:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--shadow);
}

.btn-adicionar-aba.aba-ativa:hover {
    transform: none;
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
}

.btn-adicionar-aba svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    stroke: var(--text);
}

.btn-adicionar-aba span {
    font-size: var(--font-aba);
    font-weight: bold;
    color: var(--text);
}

/* -----------------------------------------
   7. ÁREA DE CONTEÚDO
   ----------------------------------------- */
.content {
    width: var(--content-width);
    flex: 1;
    background-color: var(--bg);
    position: relative;
    z-index: 10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* -----------------------------------------
   8. PLACAR TOTAL (HEADER)
   ----------------------------------------- */
.placar-total {
    height: 80px;
    margin: 20px;
    margin-bottom: 10px;
    position: relative;
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    overflow: hidden;
    display: flex;
}

.placar-total-barra {
    height: 100%;
    transition: flex 0.3s ease;
}

.placar-total-barra.verde {
    background-color: var(--verde);
}

.placar-total-barra.laranja {
    background-color: var(--laranja);
}

.placar-total-contador {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 50px;
    font-size: var(--font-contador);
    font-weight: bold;
    color: white;
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 5;
}

.placar-total-contador.verde {
    left: 20px;
    background-color: var(--verde);
}

.placar-total-contador.laranja {
    right: 20px;
    background-color: var(--laranja);
}

.titulo-input.corrida-titulo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background: transparent;
    border: none;
    outline: none;
    z-index: 5;
    width: 50%;
}

.placar-total.corrida-placar {
    background-color: rgba(255, 255, 255, 0.5);
}

.placar-total.corrida-placar.lider-verde {
    background-color: var(--verde);
}

.placar-total.corrida-placar.lider-laranja {
    background-color: var(--laranja);
}

.placar-total.corrida-placar.empate .titulo-input.corrida-titulo {
    color: var(--text);
}

/* -----------------------------------------
   9. CONTAINER DE CATEGORIAS
   ----------------------------------------- */
.categorias {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 20px 20px 20px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.categorias::-webkit-scrollbar {
    display: none;
}

.categorias.grabbing {
    cursor: grabbing;
    user-select: none;
}

/* -----------------------------------------
   10. LINHA DE CATEGORIA
   ----------------------------------------- */
.categoria-linha {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 10px;
    min-height: 60px;
}

.categoria-linha.menu-aberto {
    grid-template-columns: 1fr;
}

.categoria-contador {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-contador);
    font-weight: bold;
    color: white;
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.categoria-contador:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--shadow);
}

.categoria-contador.verde {
    background-color: var(--verde);
}

.categoria-contador.laranja {
    background-color: var(--laranja);
}

.categoria-nome {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-nome);
    font-weight: bold;
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: grab;
    padding: 0 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.categoria-nome:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.categoria-nome:active {
    cursor: grabbing;
}

.categoria-linha.lider-verde .categoria-nome {
    background-color: var(--verde);
    color: white;
}

.categoria-linha.lider-laranja .categoria-nome {
    background-color: var(--laranja);
    color: white;
}

.categoria-linha.lider-verde .categoria-nome:hover,
.categoria-linha.lider-laranja .categoria-nome:hover {
    opacity: 0.9;
}

/* -----------------------------------------
   11. BOTÃO ADICIONAR CATEGORIA
   ----------------------------------------- */
.btn-adicionar-categoria {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    background-color: rgba(255, 255, 255, 0.3);
    border: var(--border-width) dashed var(--text);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-adicionar-categoria:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.btn-adicionar-categoria svg {
    width: 32px;
    height: 32px;
    stroke: var(--text);
}

/* -----------------------------------------
   12. INPUT INLINE
   ----------------------------------------- */
.input-categoria {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 10px;
    min-height: 60px;
}

.input-categoria input {
    grid-column: 1 / -1;
    width: 100%;
    height: 100%;
    min-height: 60px;
    font-size: var(--font-nome);
    font-weight: bold;
    font-family: var(--font-family);
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.7);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    text-align: center;
    outline: none;
}

.input-categoria input:focus {
    background-color: rgba(255, 255, 255, 0.9);
}

.input-inline {
    width: 100%;
    height: 100%;
    min-height: 60px;
    font-size: var(--font-nome);
    font-weight: bold;
    font-family: var(--font-family);
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.7);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    text-align: center;
    outline: none;
}

.input-inline:focus {
    background-color: rgba(255, 255, 255, 0.9);
}

.input-inline.input-fixo {
    min-height: 60px;
    max-height: 60px;
    height: 60px;
}

/* -----------------------------------------
   13. MENU DE CONTEXTO
   ----------------------------------------- */
.menu-contexto {
    display: flex;
    gap: 10px;
    min-height: 60px;
}

.menu-contexto.menu-unico {
    justify-content: center;
}

.menu-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: var(--font-nome);
    font-weight: bold;
    font-family: var(--font-family);
    color: white;
    background-color: var(--text);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 #3C2F2F;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    opacity: 0.9;
}

.menu-btn.excluir {
    background-color: var(--laranja);
}

.menu-btn.mover {
    background-color: var(--verde);
}

.menu-btn.cancelar {
    background-color: var(--cinza);
}

.menu-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
}

/* -----------------------------------------
   14. MODO MOVER
   ----------------------------------------- */
.categoria-linha.modo-mover {
    animation: moveUpDown 1.5s ease-in-out infinite;
    transform-origin: center;
}

.categoria-linha.destino-mover .categoria-nome {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.categoria-linha.destino-mover:hover {
    opacity: 0.6;
}

@keyframes moveUpDown {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

/* -----------------------------------------
   15. TELA DE ESCOLHA DE TIPO
   ----------------------------------------- */
.tela-escolha {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 30px;
    padding: 40px;
}

.tela-escolha h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 20px;
}

.opcoes-tipo {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-tipo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 200px;
    height: 180px;
    padding: 30px 40px;
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.btn-tipo:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.btn-tipo svg {
    width: 64px;
    height: 64px;
    fill: var(--text);
    stroke: var(--text);
}

.btn-tipo span {
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
}

/* Corrida de hábitos setup */
.corrida-setup {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.input-dias {
    width: calc(100% - 40px);
    max-width: 600px;
    padding: 15px 20px;
    font-size: 18px;
    font-family: var(--font-family);
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.7);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    text-align: center;
    outline: none;
}

.input-dias::placeholder {
    color: var(--cinza);
}

/* -----------------------------------------
   16. FORMULÁRIO DE CRIAÇÃO
   ----------------------------------------- */
.form-criacao {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px;
    padding: 40px;
}

.form-criacao h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 10px;
}

.form-criacao input {
    width: 300px;
    padding: 15px 20px;
    font-size: 18px;
    font-family: var(--font-family);
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.7);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    text-align: center;
    outline: none;
}

.form-criacao input:focus {
    background-color: rgba(255, 255, 255, 0.9);
}

.form-criacao .botoes {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.form-criacao .btn-criar {
    padding: 15px 40px;
    background-color: var(--verde);
    color: white;
    font-size: 18px;
    font-weight: bold;
    font-family: var(--font-family);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-criacao .btn-voltar {
    padding: 15px 40px;
    background-color: var(--cinza);
    color: white;
    font-size: 18px;
    font-weight: bold;
    font-family: var(--font-family);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* -----------------------------------------
   17. CLASSIFICAÇÃO - HEADER
   ----------------------------------------- */
.classificacao-header {
    height: 80px;
    margin: 20px;
    margin-bottom: 10px;
    position: relative;
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.classificacao-header .contador {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-contador);
    font-weight: bold;
    color: white;
    width: 60px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.classificacao-header .contador.verde {
    left: 15px;
    background-color: var(--verde);
}

.classificacao-header .contador.laranja {
    right: 15px;
    background-color: var(--laranja);
}

.classificacao-header .titulo-input {
    font-size: 24px;
    font-weight: bold;
    font-family: var(--font-family);
    color: var(--text);
    background: transparent;
    border: none;
    text-align: center;
    outline: none;
    max-width: 60%;
}

/* -----------------------------------------
   18. CLASSIFICAÇÃO - LINHA DE ITEM
   ----------------------------------------- */
.item-linha {
    display: grid;
    grid-template-columns: 60px 60px 1fr 60px 60px;
    gap: 10px;
    min-height: 60px;
}

.item-linha.menu-aberto {
    grid-template-columns: 1fr;
}

.item-posicao {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
}

.item-posicao.primeiro {
    background-color: var(--amarelo);
    color: var(--text);
}

.item-posicao.segundo {
    background-color: var(--cinza);
    color: white;
}

.item-posicao.terceiro {
    background-color: var(--laranja);
    color: white;
}

.item-media {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
}

.item-media.primeiro {
    background-color: var(--amarelo);
    color: var(--text);
}

.item-media.segundo {
    background-color: var(--cinza);
    color: white;
}

.item-media.terceiro {
    background-color: var(--laranja);
    color: white;
}

.item-nome {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-nome);
    font-weight: bold;
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    padding: 0 10px;
    text-align: center;
}

.item-nome.primeiro {
    background-color: var(--amarelo);
    color: var(--text);
}

.item-nome.segundo {
    background-color: var(--cinza);
    color: white;
}

.item-nome.terceiro {
    background-color: var(--laranja);
    color: white;
}

.item-nota {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
}

.item-nota.verde {
    background-color: var(--verde);
}

.item-nota.laranja {
    background-color: var(--laranja);
}

.item-nota input {
    width: 100%;
    height: 100%;
    font-size: 18px;
    font-weight: bold;
    font-family: var(--font-family);
    color: white;
    background: transparent;
    border: none;
    text-align: center;
    outline: none;
}

.item-nota input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Hide number input spinners */
.item-nota input::-webkit-outer-spin-button,
.item-nota input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.item-nota input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* -----------------------------------------
   19. CORRIDA DE HÁBITOS - HEADER
   ----------------------------------------- */
.corrida-header {
    height: 80px;
    margin: 20px;
    margin-bottom: 10px;
    position: relative;
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.corrida-header.lider-verde {
    background-color: var(--verde);
}

.corrida-header.lider-laranja {
    background-color: var(--laranja);
}

.corrida-header .contador {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-contador);
    font-weight: bold;
    color: white;
    width: 60px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.corrida-header .contador.verde {
    left: 15px;
    background-color: var(--verde);
}

.corrida-header .contador.laranja {
    right: 15px;
    background-color: var(--laranja);
}

.corrida-header.lider-verde .contador.verde,
.corrida-header.lider-laranja .contador.laranja {
    background-color: rgba(255, 255, 255, 0.3);
}

.corrida-header .titulo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text);
    transition: color 0.3s ease;
}

.corrida-header.lider-verde .titulo,
.corrida-header.lider-laranja .titulo {
    color: white;
}

/* -----------------------------------------
   20. CORRIDA DE HÁBITOS - LINHA DE DIA
   ----------------------------------------- */
.dia-linha {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 10px;
    min-height: 60px;
}

.dia-linha.menu-aberto {
    grid-template-columns: 1fr;
}

.dia-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dia-checkbox:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--shadow);
}

.dia-checkbox.marcado.verde {
    background-color: var(--verde);
}

.dia-checkbox.marcado.laranja {
    background-color: var(--laranja);
}

.dia-checkbox svg {
    width: 32px;
    height: 32px;
    stroke: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dia-checkbox.marcado svg {
    opacity: 1;
}

.dia-centro {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: var(--font-nome);
    font-weight: bold;
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    padding: 0 10px;
    transition: all 0.3s ease;
}

.dia-centro.verde {
    background-color: var(--verde);
    color: white;
}

.dia-centro.laranja {
    background-color: var(--laranja);
    color: white;
}

.dia-centro.ambos {
    background: linear-gradient(to right, var(--verde) 50%, var(--laranja) 50%);
    color: white;
}

.dia-centro .dia-numero {
    z-index: 1;
}

.dia-centro .horario {
    position: absolute;
    font-size: var(--font-nome);
    top: 50%;
    transform: translateY(-50%);
}

.dia-centro .horario.esquerda {
    left: 25%;
    transform: translate(-50%, -50%);
}

.dia-centro .horario.direita {
    left: 75%;
    right: auto;
    transform: translate(-50%, -50%);
}

.dia-centro.ambos .horario.esquerda {
    left: 25%;
    transform: translate(-50%, -50%);
}

.dia-centro.ambos .horario.direita {
    left: 75%;
    right: auto;
    transform: translate(-50%, -50%);
}

.dia-centro .horario.centro {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* -----------------------------------------
   21. HISTÓRICO
   ----------------------------------------- */
.historico-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.historico-header {
    height: 80px;
    margin: 20px;
    margin-bottom: 10px;
    position: relative;
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
    transition: all 0.3s ease;
}

.historico-header.lider-verde {
    background-color: var(--verde);
}

.historico-header.lider-laranja {
    background-color: var(--laranja);
}

.historico-titulo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text);
    transition: color 0.3s ease;
    flex: 1;
    text-align: center;
}

.historico-header.lider-verde .historico-titulo,
.historico-header.lider-laranja .historico-titulo {
    color: white;
}

.btn-voltar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--cinza);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-voltar:hover {
    opacity: 0.9;
}

.btn-voltar svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.historico-header h2 {
    font-size: 24px;
    color: var(--text);
}

.historico-lista {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 20px 20px 20px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.historico-lista::-webkit-scrollbar {
    display: none;
}

.historico-lista.grabbing {
    cursor: grabbing;
    user-select: none;
}

/* Layout do histórico similar às categorias */
.historico-item-linha {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 10px;
    min-height: 60px;
}

.historico-item-linha.verde .historico-acao {
    background-color: var(--verde);
    color: white;
}

.historico-item-linha.laranja .historico-acao {
    background-color: var(--laranja);
    color: white;
}

.historico-contador {
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
}

.historico-contador.verde {
    background-color: var(--verde);
}

.historico-contador.laranja {
    background-color: var(--laranja);
}

.historico-contador.invisivel {
    opacity: 0;
    pointer-events: none;
}

.historico-acao {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-nome);
    font-weight: bold;
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
    padding: 0 10px;
    text-align: center;
}

.historico-item-linha.data-criacao {
    grid-template-columns: 1fr;
}

.historico-item-linha.data-criacao .historico-acao {
    flex: 1;
}

/* Histórico para outros tipos (item, dia) */
.historico-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.5);
    border: var(--border-width) solid var(--text);
    border-radius: var(--border-radius);
    box-shadow: 0 var(--shadow-offset) 0 var(--shadow);
}

.historico-item .indicador {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.historico-item .indicador.verde {
    background-color: var(--verde);
}

.historico-item .indicador.laranja {
    background-color: var(--laranja);
}

.historico-item .texto {
    flex: 1;
    font-size: 16px;
    color: var(--text);
}

.historico-item .data {
    font-size: 14px;
    color: var(--cinza);
}

.historico-vazio {
    text-align: center;
    padding: 40px;
    color: var(--cinza);
    font-size: 18px;
}

/* -----------------------------------------
   22. RESPONSIVIDADE
   ----------------------------------------- */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 30%;
        --aba-width: 200px;
    }
    
    .aba span,
    .btn-adicionar-aba span {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .content {
        width: 100%;
        border-left: none;
    }
}
