/* Estilos gerais */
        *, *::before, *::after { box-sizing: border-box; }
        body {
            font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            color: #222;
            background: linear-gradient(180deg, #fff5f9 0%, #fff 60%);
            margin: 0;
            padding: 20px;
            font-size: 15px;
            line-height: 1.45;
        }
        /* Remove padding do body na tela de login */
        #login body,
        body:has(#login) {
            padding: 0;
        }
        h1, h2, h3 { font-weight: 700; margin: 0 0 12px 0; }
        .main-btn span { font-weight: 600; }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background-color: white;
            padding: 24px;
            border-radius: 14px;
            box-shadow: 0 8px 30px rgba(255, 102, 170, 0.08);
            transition: transform .18s ease, box-shadow .18s ease;
        }
        .container:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(255,102,170,0.08); }

        form {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }
        .form-group {
            margin-bottom: 15px;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input, select, textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button {
            background: linear-gradient(90deg,#ff7bb3 0%, #ff4d94 100%);
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 15px;
        }
        button:hover {
            opacity: 0.95;
        }        .full-width {
            grid-column: 1 / -1;
        }
        
        /* Estilos para recorrência */
        #recorrenciaGroup {
            background: linear-gradient(180deg, #fff9fc, #fff);
            padding: 16px;
            border-radius: 8px;
            border: 1px solid rgba(255, 102, 170, 0.15);
            margin-top: 10px;
        }
        
        #recorrenciaGroup .form-group {
            margin-bottom: 12px;
        }
          .recorrencia-info {
            background: rgba(255, 102, 170, 0.05);
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 13px;
            color: #666;
            margin-top: 8px;
        }
        
        /* Destaque quando recorrência está ativa */
        #recorrenteCheck:checked + label {
            color: #ff4d94;
            font-weight: 600;
        }
        
        .form-group button[type="submit"] {
            background: linear-gradient(90deg, #ff7bb3 0%, #ff4d94 100%);
            transition: all 0.2s ease;
        }
        
        #recorrenteCheck:checked ~ .full-width button[type="submit"] {
            background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
        }
        
        #recorrenteCheck:checked ~ .full-width button[type="submit"]::after {
            content: " (Múltiplos)";
        }#calendar {
            width: 100%;
            /* altura flexível que se adapta ao conteúdo */
            min-height: 520px;
            height: auto;
            /* remove rolagem para permitir expansão completa */
            overflow: visible;
            z-index: 1;
        }
        /* Destaque da data de hoje no calendário */
        #calendar .fc-today {
            background: linear-gradient(180deg, #fff0f6 0%, #ffe6f1 100%);
            border: 1px solid #ff4d94;
            box-shadow: inset 0 0 0 1px rgba(255, 77, 148, 0.25);
        }
        #calendar .fc-today .fc-day-number,
        #calendar .fc-agenda-view .fc-today .fc-day-number,
        #calendar .fc-agenda-view .fc-today .fc-day-header {
            color: #c2185b;
            font-weight: 700;
        }
        .tab-content {
            overflow: auto;
        }
        .summary-header {
            display: grid;
            grid-template-columns: 1fr 1fr auto;
            gap: 20px;
            align-items: end;
            margin-bottom: 20px;
            width: 100%;
            justify-items: stretch;
        }
        .summary-header .form-group {
            margin-bottom: 0;
        }
        .summary-item {
            margin-bottom: 20px;
            background: linear-gradient(180deg,#fff,#fffaf6);
            padding:14px;
            border-radius:10px;
            box-shadow: 0 6px 18px rgba(0,0,0,0.04);
        }

        /* Página inicial */
        #inicio {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 30px;
            padding: 40px 0;
        }
        #inicio h2 {
            margin-bottom: 20px;
        }
        .main-btns {
            display:flex;
            gap:18px;
            flex-wrap:wrap;
        }
        .main-btn {
            background: linear-gradient(90deg,#ff7bb3 0%, #ff4d94 100%);
            color: #fff;
            border: none;
            border-radius: 12px;
            padding: 16px 20px;
            min-width: 180px;
            min-height: 100px;
            display:flex;
            flex-direction:column;
            align-items:center;
            justify-content:center;
            box-shadow: 0 8px 20px rgba(255,77,148,0.12);
            cursor:pointer;
            transition: transform .14s ease, box-shadow .14s ease, opacity .14s;
            text-decoration: none;
            font-size: 16px;
        }
        .main-btn svg { filter: drop-shadow(0 6px 18px rgba(255,77,148,0.12)); width: 48px; height: 48px; }
        .main-btn span { margin-top:10px; font-weight:600; font-size:16px; }

        /* hover / active */
        .main-btn:hover { transform: translateY(-4px); box-shadow: 0 22px 40px rgba(255,77,148,0.14); }
        .main-btn:active { transform: translateY(-1px); }

        /* secondary logout button */
        button.logout-btn {
            background: transparent;
            border: 1px solid rgba(0,0,0,0.08);
            color: #333;
            padding:8px 12px;
            border-radius:10px;
        }        /* Responsividade para telas menores */
        @media (max-width: 768px) {
            body {
                font-size: 16px; /* Aumenta tamanho base da fonte */
            }
            h1, h2, h3 {
                font-size: 20px;
            }
            .container {
                padding: 15px;
            }
            form {
                grid-template-columns: 1fr; /* Ajusta para uma única coluna */
            }
            label {
                font-size: 16px;
            }
            input, select, textarea {
                font-size: 16px; /* Evita zoom em iOS */
                padding: 12px;
            }
            button {
                font-size: 16px;
                padding: 12px 16px;
            }
            .summary-header {
                grid-template-columns: 1fr;
                gap: 10px;
            }
            .main-btns {
                flex-direction: column;
                gap: 16px;
                width: 100%;
            }
            .main-btn {
                min-width: 100%;
                min-height: 120px;
                padding: 20px 16px;
                font-size: 18px;
            }
            .main-btn svg {
                width: 56px;
                height: 56px;
            }
            .main-btn span {
                font-size: 18px;
                margin-top: 12px;
            }
            #calendar {
                /* Remove altura fixa e permite expansão automática */
                height: auto !important;
                min-height: 400px;
                overflow: visible !important;
            }
        }

        /* alterado: breakpoint de 480px -> 390px */
        @media (max-width: 390px) {
            body {
                font-size: 15px;
            }
            h1 {
                font-size: 22px; /* Reduz o tamanho do título */
            }
            h2, h3 {
                font-size: 18px;
            }
            button {
                font-size: 15px; /* Ajusta o tamanho do botão */
                padding: 12px 14px; /* Ajusta o espaçamento do botão */
            }
            input, select, textarea {
                font-size: 15px;
                padding: 11px;
            }
            .main-btns button {
                font-size: 16px;
                padding: 18px 12px;
            }
            .main-btn {
                min-height: 110px;
                min-width: 95%;
                padding: 18px 12px;
                font-size: 16px;
            }
            .main-btn svg {
                width: 44px;
                height: 44px;
            }
            .main-btn span {
                font-size: 16px;
                margin-top: 10px;
            }
            #calendar {
                /* Permite altura automática em dispositivos móveis */
                height: auto !important;
                min-height: 350px;
                overflow: visible !important;
            }
            .summary-item table { min-width: 360px; font-size: 11px; }
        }

        /* Estilos para a tela de login */
        #login {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            width: 100%;
            overflow-x: hidden;
        }
        #login h2 {
            text-align: center;
            margin-bottom: 24px;
        }
        #login button {
            width: 100%;
        }
        #loginErro {
            color: red;
            margin-top: 12px;
            text-align: center;
        }

        /* --- adicione ao final do <style> existente --- */
    /* Responsividade para as tabelas do resumo: voltar ao comportamento de tabela
       e apenas redimensionar / permitir scroll horizontal em telas pequenas. */
    /* ajustado: removida coluna "Entrada" e realinhado índices de colunas */
    .resumo-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .summary-item table {
        font-size: 13px;
        /* table-layout: fixed;  <-- removido para comportamento fluido */
        min-width: 0;
        width: 100%;
        border-collapse: collapse;
        background: #fff;
        border-radius: 6px;
        overflow: hidden;
    }
    .summary-item th, .summary-item td {
        padding: 6px 6px;
        text-align: left;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-bottom: 1px solid #eee;
    }
    .summary-item thead th { background: rgba(255,77,148,0.04); font-weight:600; }

    /* Colunas mais estreitas */
    .summary-item th:nth-child(1),
    .summary-item td:nth-child(1) { /* Dia */
        width: 30px;
        max-width: 30px;
        text-align: left;
        padding-right: 8px;
    }

    /* Horas e Valor Total (mantém compactos) */
    .summary-item th:nth-child(2),
    .summary-item td:nth-child(2) { /* Horas */
        width: 30px;
        max-width: 30px;
        text-align: center;
    }
    .summary-item th:nth-child(3),
    .summary-item td:nth-child(3) { /* Valor Total */
        width: 30px;
        max-width: 30px;
        text-align: right;
        white-space: nowrap;
    }

    /* responsividade ajustada para novos valores */
    @media (max-width: 1024px) {
        .summary-item th:nth-child(1), .summary-item td:nth-child(1) { width: 28px; max-width:28px; }
        .summary-item th:nth-child(2), .summary-item td:nth-child(2) { width: 44px; max-width:44px; }
        .summary-item th:nth-child(3), .summary-item td:nth-child(3) { width: 88px; max-width:88px; }
    }
    /* alterado: breakpoint de 480px -> 390px */
    @media (max-width: 390px) {
        .summary-item th:nth-child(1), .summary-item td:nth-child(1) { width: 24px; max-width:24px; }
        .summary-item th:nth-child(2), .summary-item td:nth-child(2) { width: 36px; max-width:36px; }
        .summary-item th:nth-child(3), .summary-item td:nth-child(3) { width: 72px; max-width:72px; }
    }

    /* garante que textos longos não quebrem layout */
    .summary-item td { overflow: hidden; text-overflow: ellipsis; }

    /* Ajustes de fonte / largura em pontos de quebra (mantendo tabela) */
    @media (max-width: 1024px) {
        .summary-item table { font-size: 12px; min-width: 480px; }
        .summary-item th:nth-child(2), .summary-item td:nth-child(2) { width: 72px; }
        .summary-item th:nth-child(3), .summary-item td:nth-child(3) { width: 56px; }
    }
    @media (max-width: 768px) {
        .summary-item table { font-size: 11px; min-width: 420px; }
        .summary-item th:nth-child(2), .summary-item td:nth-child(2) { width: 64px; }
        .summary-item th:nth-child(3), .summary-item td:nth-child(3) { width: 48px; }
    }
    @media (max-width: 390px) {
        .summary-item table { font-size: 10px; min-width: 360px; }
        .summary-item th:nth-child(2), .summary-item td:nth-child(2) { width: 56px; }
        .summary-item th:nth-child(3), .summary-item td:nth-child(3) { width: 40px; }
    }

    /* Ajustes específicos para iPhone / Safari mobile */
    :root {
        --safe-top: env(safe-area-inset-top);
        --safe-bottom: env(safe-area-inset-bottom);
    }
    html, body {
        height: 100%;
        -webkit-text-size-adjust: 100%; /* impede zoom automático em iOS */
        padding-top: calc(var(--safe-top));
        padding-bottom: calc(var(--safe-bottom));
        overflow-x: hidden;
        max-width: 100vw; /* força limite de largura na viewport */
    }

    .container {
        min-height: calc(100vh - 32px - var(--safe-top) - var(--safe-bottom));
        padding-left: 16px;
        padding-right: 16px;
    }

    /* touch targets maiores para iPhone */
    button, .main-btn {
        -webkit-tap-highlight-color: rgba(0,0,0,0.08);
        touch-action: manipulation;
    }

    /* inputs maiores no mobile */
    @media (max-width: 390px) {
        input, select, textarea, button {
            font-size: 16px;
        }
        .main-btn {
            min-height: 84px;
            padding: 14px;
            min-width: 140px;
        }        #calendar {
            /* Permite altura automática em dispositivos móveis */
            height: auto !important;
            min-height: 350px;
            overflow: visible !important;
        }
        .summary-item table { min-width: 360px; font-size: 11px; }
    }

    /* suaviza scrolling horiz. no iOS */
    .resumo-wrapper {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }    /* Ajustes específicos do FullCalendar para dispositivos móveis */
    .fc-scroller { 
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove barras de rolagem do calendário em dispositivos móveis */
    @media (max-width: 768px) {
        .fc-view-container,
        .fc-view,
        .fc-month-view,
        .fc-scroller {
            overflow: visible !important;
            height: auto !important;
        }
        
        .fc-day-grid-container {
            height: auto !important;
        }
        
        /* Garante que o calendário se expanda completamente */
        .fc-month-view .fc-bg table,
        .fc-month-view .fc-content-skeleton table {
            height: auto !important;
        }
    }

    /* --- Responsividade para Resumo Financeiro --- */
    .resumo-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin: 16px 0;
    }
    .summary-item table {
      width: 100%;
      min-width: 280px;     /* permite encolher em smartphones */
      border-collapse: collapse;
      background: #fff;
      border-radius: 6px;
      overflow: hidden;
    }
    .summary-item th, .summary-item td {
      padding: 6px 8px;
      font-size: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      border-bottom: 1px solid #eee;
    }
    .summary-item thead th {
      background: rgba(255,77,148,0.04);
      font-weight: 600;
    }

    /* colunas com largura base para desktop */
    .summary-item th:nth-child(1),
    .summary-item td:nth-child(1) { width: 100px; }  /* Dia */
    .summary-item th:nth-child(2),
    .summary-item td:nth-child(2) { width: 60px; text-align:center; } /* Horas */
    .summary-item th:nth-child(3),
    .summary-item td:nth-child(3) { width: 120px; text-align:right; } /* Valor Total */

    /* telas médias (tablets, laptops menores) */
    @media (max-width: 1024px) {
      .summary-item th, .summary-item td {
        font-size: 13px;
        padding: 5px 6px;
      }
      .summary-item th:nth-child(1),
      .summary-item td:nth-child(1) { width: 80px; }
      .summary-item th:nth-child(2),
      .summary-item td:nth-child(2) { width: 50px; }
      .summary-item th:nth-child(3),
      .summary-item td:nth-child(3) { width: 100px; }
    }

    /* smartphones grandes e iPhone 15 Pro (~430px de largura) */
    @media (max-width: 430px) {
      .summary-item th, .summary-item td {
        font-size: 12px;
        padding: 4px 5px;
      }
      .summary-item th:nth-child(1),
      .summary-item td:nth-child(1) { width: 60px; }
      .summary-item th:nth-child(2),
      .summary-item td:nth-child(2) { width: 40px; }
      .summary-item th:nth-child(3),
      .summary-item td:nth-child(3) { width: 90px; }
    }

    /* smartphones pequenos */
    @media (max-width: 360px) {
      .summary-item th, .summary-item td {
        font-size: 11px;
        padding: 3px 4px;
      }
      .summary-item th:nth-child(1),
      .summary-item td:nth-child(1) { width: 52px; } 
      .summary-item th:nth-child(2),
      .summary-item td:nth-child(2) { width: 36px; }
      .summary-item th:nth-child(3),
      .summary-item td:nth-child(3) { width: 80px; }
    }

    /* centraliza o conteúdo da coluna "Horas" */
  .summary-item table th:nth-child(2),
  .summary-item table td:nth-child(2) {
    text-align: center;
  }

  /* --- Ajustes para o resumo financeiro --- */
  .summary-item table {
    /* usa auto layout para colunas se ajustarem ao conteúdo */
    table-layout: auto;
    min-width: 0;
  }

  /* primeira coluna (Dia) volta a se ajustar automaticamente */
  .summary-item th:nth-child(1),
  .summary-item td:nth-child(1) {
    width: auto !important;
    max-width: none !important;
  }

  /* centraliza e define largura mínima razoável para Horas */
  .summary-item th:nth-child(2),
  .summary-item td:nth-child(2) {
    width: 40px !important;
    max-width: 40px !important;
    text-align: center !important;
  }

  /* remove quaisquer larguras inválidas definidas anteriormente */
  @media (max-width: 360px) {
    /* corrige bloco com erro de "fiftyFore" removendo-o */
    .summary-item th:nth-child(1),
    .summary-item td:nth-child(1) {
      width: 52px !important;
      max-width: 52px !important;
    }
  }

  /* --- Ajuste para desktop: tabela fixa e colunas proporcionais --- */
  @media (min-width: 1025px) {
    .summary-item table {
      table-layout: fixed;    /* força colunas fixas em desktop */
      min-width: 360px;       /* garante largura mínima */
    }
    /* Dia, Horas e Valor Total em larguras adequadas */
    .summary-item th:nth-child(1),
    .summary-item td:nth-child(1) { width: 100px; }
    .summary-item th:nth-child(2),
    .summary-item td:nth-child(2) { width: 60px; text-align: center; }
    .summary-item th:nth-child(3),
    .summary-item td:nth-child(3) { width: 120px; text-align: right; }
  }

  /* --- Mobile: layout fluido e scroll se necessário --- */
  @media (max-width: 1024px) {
    .summary-item table {
      table-layout: auto;     /* deixa colunas fluírem em telas pequenas */
    }
  }

  /* === OVERRIDE DESKTOP: fixa colunas no resumo financeiro === */
  @media (min-width: 1025px) {
    /* remove scroll horizontal no desktop */
    .resumo-wrapper { overflow-x: hidden !important; }

    /* força layout fixo de colunas */
    .summary-item table {
      table-layout: fixed !important;
      width: 100% !important;
      min-width: 0 !important;
    }
    /* largura da coluna "Dia" */
    .summary-item th:nth-child(1),
    .summary-item td:nth-child(1) {
      width: 90px !important;
      max-width: 90px !important;
    }
    /* largura da coluna "Horas" e centraliza */
    .summary-item th:nth-child(2),
    .summary-item td:nth-child(2) {
      width: 60px !important;
      max-width: 60px !important;
      text-align: center !important;
    }
    /* largura da coluna "Valor Total" e alinha à direita */
    .summary-item th:nth-child(3),
    .summary-item td:nth-child(3) {
      width: 120px !important;
      max-width: 120px !important;
      text-align: right !important;
    }
  }
    
    /* --- ESTILOS DA TELA DE LOGIN --- */
    .login-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        height: 100vh;
        background-image: url('./bg_app.jpg');
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: scroll; /* permite scroll no mobile */
        background-color: #fbeaf3; /* fallback para caso a imagem não carregue */
        padding: 20px;
        position: fixed; /* fixa o container para cobrir toda a viewport */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        overflow-y: auto; /* permite scroll se necessário */
        overflow-x: hidden; /* previne transbordo horizontal */
        margin: 0; /* remove qualquer margem */
    }
    
    .login-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(255, 255, 255, 0.25); /* deixa a imagem aparecer mais no desktop */
        z-index: 0;
    }

    .login-card {
        background: white;
        border-radius: 16px;
        box-shadow: 0 8px 30px rgba(255, 102, 170, 0.1);
        width: 100%;
        max-width: 420px;
        padding: 40px 30px;
        position: relative;
        z-index: 1;
        box-sizing: border-box;
        overflow: hidden; /* evita que inputs/margens estourem o cartão */
    }

    /* Evita overflow horizontal em telas muito pequenas devido ao min-width herdado */
    #login .login-card { min-width: 0; }

    .login-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 30px;
        min-height: 80px;
    }

    .login-logo svg,
    .login-logo img {
        max-width: 100%;
        max-height: 80px;
        object-fit: contain;
    }

    .login-logo-placeholder {
        width: 80px;
        height: 80px;
        background: linear-gradient(135deg, #ff7bb3 0%, #ff4d94 100%);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 32px;
        font-weight: 700;
    }

    .login-card h2 {
        text-align: center;
        margin-bottom: 10px;
        font-size: 24px;
        color: #222;
    }

    .login-card p {
        text-align: center;
        color: #666;
        font-size: 14px;
        margin-bottom: 30px;
    }

    .login-form {
        margin-bottom: 24px;
        display: block !important;
        grid-template-columns: unset !important;
        width: 100%;
        max-width: 100%;
    }

    .login-form .form-group {
        margin-bottom: 16px;
        width: 100%;
        max-width: 100%;
    }

    .login-form label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        font-size: 14px;
        color: #333;
    }

    .login-form input {
        width: 100%;
        max-width: 100%;
        display: block;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 16px;
        transition: border-color 0.2s;
        box-sizing: border-box;
    }

    .login-form input:focus {
        outline: none;
        border-color: #ff4d94;
        box-shadow: 0 0 0 3px rgba(255, 77, 148, 0.1);
    }

    .login-form button {
        width: 100%;
        padding: 14px;
        background: linear-gradient(90deg, #ff7bb3 0%, #ff4d94 100%);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .login-form button:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(255, 77, 148, 0.2);
    }

    .login-form button:active {
        transform: translateY(0);
    }

    .login-divider {
        display: flex;
        align-items: center;
        margin: 24px 0;
        color: #999;
        font-size: 13px;
    }

    .login-divider::before,
    .login-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #ddd;
    }

    .login-divider span {
        padding: 0 12px;
    }

    .social-login {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .social-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 16px;
        border: 1px solid #ddd;
        background: white;
        border-radius: 8px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        transition: all 0.2s;
    }

    .social-btn:hover {
        border-color: #ff4d94;
        background: #fff5f9;
    }

    .social-btn svg {
        width: 18px;
        height: 18px;
    }

    .login-footer {
        text-align: center;
        font-size: 14px;
        color: #666;
    }

    .login-footer a {
        color: #ff4d94;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.2s;
    }

    .login-footer a:hover {
        color: #ff7bb3;
    }

    .login-error {
        color: #dc3545;
        background: #ffe0e6;
        padding: 12px;
        border-radius: 6px;
        margin-top: 12px;
        font-size: 14px;
        display: none;
    }

    .login-error.show {
        display: block;
    }

    .login-success {
        color: #28a745;
        background: #d4edda;
        padding: 12px;
        border-radius: 6px;
        margin-top: 12px;
        font-size: 14px;
        display: none;
    }

    .login-success.show {
        display: block;
    }

    @media (max-width: 600px) {
        .login-card {
            padding: 30px 20px;
            max-width: 100%;
        }

        .login-card h2 {
            font-size: 20px;
        }
    }

    /* Padding extra compacto para telas muito pequenas */
    @media (max-width: 390px) {
        body {
            padding: 0 !important; /* remove padding do body em mobile */
        }

        .login-card {
            padding: 24px 16px;
            margin: 0 10px; /* margem lateral em vez de padding no container */
        }

        .login-container {
            padding: 10px;
            background-size: cover; /* garante cobertura total */
            background-position: center center;
        }

        .login-container::before {
            background: rgba(255, 255, 255, 0.15); /* overlay mais sutil no mobile */
        }

        .social-login {
            grid-template-columns: 1fr;
        }

        .social-btn {
            width: 100%;
        }
    }

    /* TEMA ESCURO */
    body.dark-theme {
        background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 60%);
        color: #e0e0e0;
    }

    body.dark-theme .container {
        background-color: #1e1e1e;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    }

    body.dark-theme .container:hover {
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme h1,
    body.dark-theme h2,
    body.dark-theme h3 {
        color: #ffffff;
    }

    body.dark-theme .summary-header {
        background: linear-gradient(180deg, #2a2a2a, #1e1e1e);
        border-color: rgba(255, 102, 170, 0.1);
    }

    body.dark-theme label {
        color: #b0b0b0;
    }

    body.dark-theme input,
    body.dark-theme select,
    body.dark-theme textarea {
        background-color: #2a2a2a;
        color: #e0e0e0;
        border-color: #3a3a3a;
    }

    body.dark-theme input:focus,
    body.dark-theme select:focus,
    body.dark-theme textarea:focus {
        border-color: #ff7bb3;
        background-color: #2a2a2a;
    }

    body.dark-theme button {
        background: linear-gradient(90deg, #cc6299 0%, #cc4080 100%);
    }

    body.dark-theme button:hover {
        opacity: 0.9;
    }

    body.dark-theme .logout-btn {
        background: #333;
        color: #e0e0e0;
        border: 1px solid #444;
    }

    body.dark-theme .logout-btn:hover {
        background: #444;
    }

    body.dark-theme #calendar {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    body.dark-theme .fc-head {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    body.dark-theme .fc-body {
        background-color: #1e1e1e;
    }

    body.dark-theme .fc-row,
    body.dark-theme .fc-content {
        background-color: #1e1e1e;
        border-color: #3a3a3a;
    }

    body.dark-theme .fc-day {
        background-color: #1e1e1e;
        border-color: #3a3a3a;
    }

    body.dark-theme .fc-today {
        background-color: rgba(255, 77, 148, 0.1);
    }

    body.dark-theme .fc-event {
        background: linear-gradient(90deg, #ff7bb3 0%, #ff4d94 100%);
        border-color: #ff4d94;
    }

    body.dark-theme .fc-title {
        color: #ffffff;
    }

    body.dark-theme .main-btn {
        background: linear-gradient(90deg, #ff7bb3 0%, #ff4d94 100%);
        color: white;
        border: none;
    }

    body.dark-theme .main-btn:hover {
        opacity: 0.9;
    }

    body.dark-theme .tab-btn {
        color: #b0b0b0;
        border-color: #3a3a3a;
    }

    body.dark-theme .tab-btn.active {
        color: #ff7bb3;
        border-color: #ff7bb3;
    }

    body.dark-theme .theme-selector {
        background-color: #2a2a2a;
        border-color: #3a3a3a;
    }

    body.dark-theme .recorrencia-info {
        background: rgba(255, 102, 170, 0.1);
        color: #b0b0b0;
    }

    /* Seletor de Tema */
    .theme-selector {
        display: flex;
        gap: 8px;
        align-items: center;
        padding: 8px 12px;
        background: white;
        border-radius: 8px;
        border: 1px solid #ddd;
        margin-left: 12px;
        float: right;
        margin-top: -10px;
    }

    .theme-selector label {
        display: flex;
        align-items: center;
        gap: 4px;
        margin: 0;
        cursor: pointer;
        font-weight: 600;
        font-size: 13px;
        color: #666;
    }

    .theme-selector input[type="radio"] {
        width: auto;
        margin: 0;
        cursor: pointer;
        accent-color: #ff7bb3;
    }

    .theme-selector input[type="radio"]:checked + label {
        color: #ff7bb3;
    }

    body.dark-theme .theme-selector {
        background-color: #2a2a2a;
        border-color: #3a3a3a;
    }

    body.dark-theme .theme-selector label {
        color: #b0b0b0;
    }

    body.dark-theme .theme-selector input[type="radio"]:checked + label {
        color: #ff7bb3;
    }

    /* Tabelas em Tema Escuro */
    body.dark-theme .summary-item table {
        background-color: #2a2a2a;
        color: #e0e0e0;
    }

    body.dark-theme .summary-item th,
    body.dark-theme .summary-item td {
        border-bottom-color: #3a3a3a;
        color: #e0e0e0;
    }

    body.dark-theme .summary-item thead th {
        background: rgba(255, 77, 148, 0.15);
        color: #e0e0e0;
        font-weight: 600;
    }

    body.dark-theme .summary-item tbody tr:hover {
        background-color: rgba(255, 77, 148, 0.1);
    }

    body.dark-theme .summary-item tbody tr {
        background-color: #2a2a2a;
    }

    body.dark-theme .summary-item tbody tr:nth-child(even) {
        background-color: #252525;
    }

    /* Links nas tabelas */
    body.dark-theme .summary-item a {
        color: #ff7bb3;
        text-decoration: none;
    }

    body.dark-theme .summary-item a:hover {
        text-decoration: underline;
        color: #ff9cc9;
    }

    /* Botões dentro das tabelas */
    body.dark-theme .summary-item button {
        background: linear-gradient(90deg, #cc6299 0%, #cc4080 100%);
        color: white;
        border: none;
        padding: 4px 8px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 12px;
    }

    body.dark-theme .summary-item button:hover {
        opacity: 0.9;
    }

    /* Inputs em tabelas */
    body.dark-theme .summary-item input {
        background-color: #1e1e1e;
        color: #e0e0e0;
        border-color: #3a3a3a;
    }

    body.dark-theme .summary-item input:focus {
        border-color: #ff7bb3;
        background-color: #1e1e1e;
    }

    /* Total row styling em tema escuro */
    body.dark-theme .summary-item tfoot tr {
        background-color: rgba(255, 77, 148, 0.1);
        font-weight: 600;
        border-top: 2px solid #ff7bb3;
    }

    body.dark-theme .summary-item tfoot td {
        color: #ff7bb3;
    }

    /* Box de Resumo Total em Tema Escuro */
    body.dark-theme #resumoTotal {
        background: linear-gradient(135deg, rgba(255, 77, 148, 0.1) 0%, rgba(255, 77, 148, 0.05) 100%) !important;
        border: 1px solid rgba(255, 77, 148, 0.2) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
    }

    body.dark-theme #resumoTotal h3 {
        color: #ff7bb3 !important;
    }

    body.dark-theme #resumoTotal p {
        color: #e0e0e0 !important;
    }

    body.dark-theme #resumoTotal p strong {
        color: #ff9cc9 !important;
    }

    /* Box de Resumo por Local (summary-item) em Tema Escuro */
    body.dark-theme .summary-item {
        background: linear-gradient(135deg, rgba(42, 42, 42, 0.8) 0%, rgba(30, 30, 30, 0.8) 100%) !important;
        border: 1px solid rgba(255, 77, 148, 0.15) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3) !important;
    }

    body.dark-theme .summary-item h3 {
        color: #ff7bb3 !important;
        background: rgba(255, 77, 148, 0.1);
        padding: 8px 12px;
        border-radius: 6px;
    }

    body.dark-theme .summary-item p {
        color: #b0b0b0 !important;
    }

    body.dark-theme .summary-item p strong {
        color: #ff9cc9 !important;
    }

    body.dark-theme .summary-item span {
        color: #e0e0e0 !important;
    }

    /* Labels e spans nos totais */
    body.dark-theme .summary-item strong {
        color: #ff9cc9;
    }

    /* Header do resumo em tema escuro */
    body.dark-theme .summary-header {
        background: linear-gradient(180deg, rgba(42, 42, 42, 0.9) 0%, rgba(30, 30, 30, 0.9) 100%) !important;
        border-color: rgba(255, 77, 148, 0.2) !important;
    }

    body.dark-theme .summary-header label {
        color: #b0b0b0;
    }
