/* General reset */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; 
  -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body, html { height: 100%; background-color: #f3f3f3;}

/* Flex container for split layout */
.container { display: flex; height: 100vh; }

/* Left side image */
.image-side { flex: 1; background: url('../assets/finance.jpg') center/cover no-repeat; }

/* Right side form */
.form-side { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; background: #f7f7f7; }

.form-side h2 { margin-bottom: 20px; color: #333; }

form { width: 100%; max-width: 350px; }

label { display: block; margin-bottom: 5px; color: #555; font-size: 0.9rem; }

input { width: 100%; padding: 16px 12px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; color: #000; }

.inreceita{
  margin-bottom: 15px;

}
button { width: 100%; padding: 16px; background: #00ff5a; color: #fff; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; transition: background 0.3s; }

button:hover { background: #00e652; }

.success-message { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; text-align: center; background: #e9ffe9; color: #2f6627; }
.success-message h2 { margin-bottom: 10px; }

.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 200px; background: #fff; padding: 20px; color: #333; box-shadow: 2px 0 5px rgba(0,0,0,0.1); }
.sidebar h3 { margin-bottom: 20px; color: #555; }
.sidebar ul { 
    list-style: none; 
    margin-top: 0;
    padding: 0 20px;
}
.sidebar li {
    margin-bottom: 14px;
    cursor: pointer;
    color: #555;
    font-size: 0.9rem;
    padding: 10px 12px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.sidebar li:hover {
  background: #e8f9ee;
  color: #00a04b;
}
.sidebar li.active {
  color: #00a04b;
  background: rgba(0, 160, 75, 0.1);
  border-left: 3px solid #00a04b;
  font-weight: 400;
}
.sidebar li a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sidebar-logo {
    width: 100%;
    max-width: 150px;
    display: block;
  
    margin: 40px auto 30px auto;
    object-fit: contain;
}

.content { margin-left: 220px; padding: 20px; } /* top padding adjusted inline, rest handled inline in HTML */

.topbar { position: fixed; left: 200px; right: 0; top: 0; height: 60px; background: #f8f8f8; border-bottom: 1px solid #e0e0e0; display:flex; align-items:center; justify-content:flex-start; padding: 0 20px 0 40px; font-size: 1rem; color:#333; z-index: 100; }
.topbar::before { content: ''; }

/* Barra superior */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .back-link {
    color: #333;
    text-decoration: none;
}

.topbar .page-title {
    font-weight: bold;
}

.topbar .logout-btn {
    color: #d32f2f;
    text-decoration: none;
}

@media (min-width: 769px) {
    .topbar {
        left: 200px; /* Considera a largura da sidebar */
    }
}

/* Mes page topbar (mes.php) */
.mes-topbar {
  display:flex;
  justify-content:flex-start;      /* center horizontally in available width */
  align-items:center;           /* vertical alignment */
  gap: 20px;                    /* space between button and title */
  padding: 0 20px;              /* side padding similar to dashboard */
}
.mes-topbar .back-link {
  margin-top:15px; /* fine-tune vertical alignment */
  display:flex;
  align-items:center;
  gap:6px;
  height:36px;
  padding:0 16px;
  border:1px solid #c8ffd9;
  border-radius:20px;
  text-decoration:none;
  font-weight:600;
  color:#00a04b;
  background:#ffffff;
  transition:background 0.2s;
}
.mes-topbar .back-link:hover { background:#e8f9ee; }
.mes-topbar .page-title {
  display:flex;
  align-items:center;
  font-weight:600;
  height:36px;
  line-height:36px;
}

/* User name in top bar */
.topbar .user-name { display:flex; align-items:center; gap:6px; }
.topbar .user-name strong { color: #43a047; }
.logo-small { width:24px; height:24px; object-fit:contain; }

/* Logout button */
.logout-btn { color: #e53935; border: 2px solid #e53935; padding: 6px 14px; border-radius: 20px; text-decoration: none; font-weight: 600; transition: background 0.2s, color 0.2s; margin-left: auto; }
.logout-btn:hover { background: #e53935; color:#fff; }

/* Months table - Clean organized version */
.months-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.months-table thead th {
  background: #7e57c2;
  color: white;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
}
.months-table tbody td {
  padding: 12px 16px;
 
  vertical-align: middle;
}
.months-table tbody tr:nth-child(even) {
  background: #f9f9f9;
}
.months-table tbody tr:hover {
  background: #f1f1f1;
}

.months-table tbody tr:nth-child(odd) {
  background-color: #e3e5e8;
}

.months-table tbody tr:hover {
  background-color: #c7b8e2;
}

.annual-card { margin-top:20px;grid-column: span 3; background: rgb(255, 255, 255); border:1px solid #c8ffd9; border-radius:6px; padding:30px; text-align:left; margin-bottom:20px; min-height:200px; }
.annual-title { margin-bottom:25px; color:#007f32; font-size:1.1rem; }
.annual-values { display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.annual-values .item { flex:1; text-align:left; }
.annual-values .label { font-size:0.8rem; color:#888; display:block; margin-bottom:4px; }
.annual-values .value { font-weight:400; }
.annual-values .value.positive, .annual-values .value.positiva { color:#00a04b; }
.annual-values .value.negativa, .annual-values .value.negative { color:#d11a1a; }
.annual-card .value.zero { color:#9e9e9e; }
.annual-summary {
  grid-column: span 3;
  display: flex;            /* use flexbox for equal width cards */
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  flex-wrap: wrap;           /* allow wrapping when viewport is narrow */
}
.summary-card {
  background:#fff;
  border:1px solid #c8ffd9;
  border-radius:6px;
  padding:20px;
  display:flex;
  align-items:center;
  gap:15px;
  flex:1;                /* let cards grow to fill available width */
  min-width:180px; 
  height:120px;
}

/* Value cells with subtle background colors */

.value-cell.positive {
  color: #00a04b;
  background-color: rgba(0, 160, 75, 0.1);
}
.value-cell.negative {
  color: #d11a1a;
  background-color: rgba(230, 57, 70, 0.1);
}

/* Action buttons - side by side */
.actions {
  min-width: 120px;
  padding: 8px 6px;
  white-space: nowrap;
}
.actions a {
  display: inline-block;
  margin-right: 6px;
}
.actions a:last-child {
  margin-right: 0;
}

.btn-edit {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #1a73e8;
  
}
.btn-delete {
  background: #fde8e8;
  color: #d11a1a;
  border: 1px solid #d11a1a;
}

.months-table .actions {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.months-table .actions button {
  padding: 3px 8px;
  font-size: 0.8rem;
  border-radius: 3px;
  cursor: pointer;
}

.months-table .actions .btn-edit {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #1a73e8;
}

.months-table .actions .btn-delete {
  background: #fce8e6;
  color: #d93025;
  border: 1px solid #d93025;
}

.months-table .actions button, 
.months-table td.edit-action button, 
.months-table td.delete-action button {
  padding: 8px 16px !important;
  font-size: 0.9rem !important;
  min-width: 80px !important;
}

/* Extra summary cards (toggle + 5) */
.extra-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 20px;
}
.extra-item {
  flex: 1 1 calc(16.66% - 20px); /* 6 itens por linha, ajusta com gap */
  min-width: 160px;
}
.extra-item .summary-card {
  width: 100%;
  height: 90px; /* igual ao toggle */
}
.summary-card .icon-square {
  width:30px;
  height:30px;
}
/* Icon inside annual summary cards (Receita, Despesa, Saldo) */
.annual-summary .icon-square {
  background: url('../img/setaparacima.png') center/contain no-repeat;
}
.summary-card .label { font-size:0.9rem; color:#666; }
.summary-card .value { font-size:1.1rem; font-weight:600; }

/* manter herança de cor padrão exceto quando sobrescrito acima */
.summary-card.receita {
  background:#7e57c2; /* roxo */
  border-color:#7e57c2;
}
.summary-card.despesas {
  background:#e53935; /* vermelho */
  border-color:#e53935;
}
.summary-card.saldo {
  background:#43a047; /* verde */
  border-color:#43a047;
}
/* textos brancos dentro dos cartões coloridos */
.summary-card.receita .label,
.summary-card.receita .value,
.summary-card.despesas .label,
.summary-card.despesas .value,
.summary-card.saldo .label,
.summary-card.saldo .value {
  color:#ffffff;
}

/* Disabled / inativo */
.summary-card.disabled {
  opacity: 0.25;
  pointer-events: none; /* não clicável */
  filter: grayscale(100%);
}
.summary-card.toggle {
  cursor: pointer;
  width: 90px; /* largura igual altura para quadrado */
  height: 90px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background-color: #ffffff;
  height:90px;
}
.summary-card.toggle.hidden {
  background: #ffffff;
  border: 2px dashed;
}
.summary-card.toggle.hidden { background:#ffffff; border:2px dashed #e2e2e2; }

.zero { color:#ffffff; }
.annual-card .saldo { font-weight:600; font-size: 1.1rem; }
.annual-card .guardado { font-weight:600; color:#c6c6c6; }

/* Color helpers */
.positive { color:#00a04b; }
.negative { color:#d11a1a; }
.zero { color:#9e9e9e; }

/* Progress bar styles for dual-color display */
.progress-bar {
  height: 8px;
  background: #374151;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  display: flex; /* Added for side-by-side progress bars */
}

.progress-receita {
  height: 100%;
  background: #10b981;
}

.progress-despesa {
  height: 100%;
  background: #ef4444;
}

/* Table cells with full background colors */
tr td.value-cell {
  
  text-align: center;
  
  display: table-cell; /* Fill entire cell */
}

tr td.value-cell.positive {
  color: #10b981; /* Green text */
 
}

tr td.value-cell.negative {
  color: #ef4444; /* Red text */
}

/* Update receita color in month card to purple */
.month-totals .value.positive {
  color: #7b1fa2; /* Purple matching table title */
}

/* Responsive */
.switch-link { text-align: center; margin-top: 10px; font-size: 0.9rem; }
.switch-link a { color: #00b848; text-decoration: none; }
.switch-link a:hover { text-decoration: underline; }

.saldo-wrapper {
  padding: 8px;
  border-radius: 4px;
}
.saldo-wrapper.positive {
  background-color: rgba(0, 160, 75, 0.1);
}
.saldo-wrapper.negative {
  background-color: rgba(230, 57, 70, 0.1);
}

/* Mobile-specific button sizing */
@media (max-width: 768px) {
  .months-table .actions button {
    padding: 1px 0 !important;
    min-width: 5% !important;
    font-size: 0.45rem !important;
  }
}

.months-table .actions {
  display: flex !important;
  gap: 4px !important;
  justify-content: space-between !important;
}

.months-table .actions button {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: 48% !important;
  padding: 8px 4px !important;
  font-size: 0.85rem !important;
}

/* Hide edit button on mobile */
@media (max-width: 768px) {
    .btn-edit {
        display: none !important;
    }
}

/* Hide edit column header on mobile */
@media (max-width: 768px) {
    .months-table th:nth-child(4) {
        display: none;
    }
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    /* Hide edit column header */
    .months-table th:nth-child(4) {
        display: none;
    }
    
    /* Hide edit column cells */
    .months-table td:nth-child(4) {
        display: none;
    }
    
    /* Hide edit buttons */
    .btn-edit {
        display: none !important;
    }
}

@media (max-width: 768px) {
  .months-table td:first-child {
    display: table-cell !important;

    padding-left: 10px !important;
  }
  
  .type-symbol {
    font-size: 1.2em;
    display: inline !important;
  }
  
  /* Remove old indicator styles */
  .months-table td:first-child:before,
  .months-table td:first-child[data-type]:before {
    display: none !important;
  }
}

/* Dashboard table specific styles */
.dashboard-table.months-table th,
.dashboard-table.months-table td {
    display: table-cell !important;
}

@media (max-width: 768px) {
    .dashboard-table.months-table th,
    .dashboard-table.months-table td {
        display: table-cell !important;
    }
}

@media (max-width: 768px) {
  /* Ensure month column is visible on mobile */
  .dashboard-table.months-table td:first-child {
    color: inherit !important;
    font-size: inherit !important;
    padding-left: 10px !important;
  }
}

/* Month Card Styles */
.month-summary {
  display: flex;
  gap: 15px;
  /*margin: 20px 0;*/
  flex-wrap: wrap;
}

.month-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 15px;
  flex: 1 1 200px; /* Flexible width, minimum 200px */
  min-width: 0; /* Allow shrinking below min-content */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}*/

.month-card-entrada {
  border: 2px solid #7e57c2; /* Purple */
}

.month-card-despesa {
  border: 2px solid #e53935; /* Red */
}

.month-card-saldo {
  border: 2px solid #43a047; /* Green */
}

.card-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 5px;
}

.card-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.month-card-entrada .card-value {
  color: #7e57c2; /* Purple */
}

.month-card-despesa .card-value {
  color: #e53935; /* Red */
}

.month-card-saldo .card-value {
  color: #43a047; /* Green */
}

/* Configuracoes Page Styles */
.settings-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    width: 100%;
}

.settings-list li {
    margin-bottom: 10px;
    width: 100%;
}

.settings-list a {
    display: block;
    padding: 15px;
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.settings-list a:hover {
    background-color: #e9ecef;
}

.container h1 {
    margin-bottom: 20px;
}

/* Mobile Top Navigation */
.mobile-top-nav {
  background-color: #8a2be2;
  color: white;
  padding: 15px 20px;
}

.mobile-nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}

.mobile-nav-content {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-settings-btn {
    width: 50px;
    height: 50px;
    padding: 12px;
    color: white;
}

.gear-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.5A3.5 3.5 0 0 1 8.5 12 3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5 3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97 0-.33-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49 1c-.23-.09-.5 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1 0 .33.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49-1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.66z'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    
}

.modal-content {

    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #fff;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-body p {
    margin: 15px 0;
    font-size: 16px;
}

/* Entry Details Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    
}



.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-body p {
    margin: 15px 0;
    font-size: 16px;
}

/* Switch Styles */
.switch-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 10px;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Switch button styles */
.switch-container {
    background: transparent !important;
    padding: 10px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group select,
.form-group textarea,
.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #000;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        width: 85%;
    }
}

/* Mobile Add Button */
.mobile-only { display: none; }

@media (max-width: 768px) {
  /* Hide regular form on mobile */
  .add-form { display: none !important; }
  
  /* Show mobile button */
  .mobile-only { display: block !important; }
}

/* Desktop Form */
@media (min-width: 769px) {
  .add-form { display: block !important; }
  .mobile-only { display: none !important; }
  .add-form {
    background: none !important;
    border: none !important;
  }
}

/* Mobile Back Button */
.mobile-back-btn {
  display: none;
  padding: 15px 20px;
  background-color: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-back-btn .back-link {
  display: block;
  color: #4b5563;
  font-weight: 500;
  text-decoration: none;
}

@media (max-width: 768px) {
  .mobile-back-btn {
    display: block;
  }
}

.mobile-financial-year {
  display: block;
  margin-top: 20px;
}

/* ======== Base Styles ======== */
/* Table styles */
.months-table td:first-child[data-type="receita"]:before {
    background-color: #00a04b;
}
.months-table td:first-child[data-type="despesa"]:before {
    background-color: #d11a1a;
}
.months-table td:first-child span {
    display: none;
}

/* Card styles */
.month-card-entrada {
    border: 2px solid #7e57c2;
    color: #7e57c2;
}

/* ======== Mobile Styles (max-width: 768px) ======== */
@media (max-width: 768px) {
    /* Table adjustments */
    .months-table td:first-child:before {
        width: 16px;
        height: 16px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .months-table td[data-type="receita"]:first-child:before {
        content: "+";
        color: #00a04b;
        font-weight: bold;
        font-size: 1.2em;
        background: none;
    }
    
    .months-table td[data-type="despesa"]:first-child:before {
        content: "-";
        color: #e53e3e;
        font-weight: bold;
        font-size: 1.2em;
        background: none;
    }
    
    /* Card adjustments */
    .month-summary {
        gap: 10px;
    }
    .month-card {
        flex: 1 1 150px;
        padding: 12px;
    }
    .card-label {
        font-size: 0.8rem;
    }
    .card-value {
        font-size: 1rem;
    }
}

/* ======== Large Screen Styles (min-width: 992px) ======== */
@media (min-width: 992px) {
    .month-card {
        flex: 1;
        max-width: 250px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
  /* Larger table cells for medium and small screens */
  .months-table tbody td {
    padding: 24px 16px !important;
    min-height: 70px !important;
    line-height: 1.5 !important;
  }
  
  .months-table thead th {
    padding: 22px 16px !important;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .add-form .form-row {
    flex-wrap: wrap;
  }
  
  .add-form .btn-submit {
    margin-top: 10px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Hide sidebar and topbar on mobile */
  .sidebar, .topbar {
    display: none !important;
  }
  
  /* Adjust content to full width */
  .content {
    margin-left: 0 !important;
    padding: 20px !important;
    width: 100% !important;
  }
  
  /* Table adjustments for mobile */
  .months-table {
    font-size: 0.9rem;
  }
  
  .months-table tbody td {
    padding: 16px 12px !important;
    min-height: 50px !important;
  }
  
  /* Annual summary cards - side by side on mobile */
  .annual-summary {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }
  
  .annual-summary .summary-card {
    flex: 1 1 calc(33% - 10px) !important;
    min-width: 100px !important;
    height: 120px !important;
    padding: 15px !important;
  }
  
  /* Stack extras vertically */
  .extra-summary {
    flex-direction: column;
  }
  
  /* Tipo column */
  .months-table td:nth-child(1) {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Descrição column */
  .months-table td:nth-child(2) {
    max-width: 80px; /* Reduced from 100px */
  }
  
  /* Make description field wrap text */
  .months-table td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    max-width: 150px;
  }
}

@media (max-width: 768px) {
  /* Stack container vertically on small screens */
  .container { flex-direction: column; }
  
  /* Hide image only on small screens - more specific selector */
  .container .image-side,
  .container .mobile-image {
    display: none !important;
    background-image: none !important;
  }
  
  /* Larger form elements for mobile */
  .form-side input, 
  .form-side button { 
    padding: 20px 16px !important;
    font-size: 1rem !important;
  }
  
  .form-side button { font-size: 1.1rem !important; }
  
  /* Adjust form spacing */
  .form-side { 
    padding: 30px 20px !important;
    width: 100% !important;
  }
  
  /* Larger labels */
  .form-side label { font-size: 1rem !important; }
}

@media (max-width: 768px) {
  /* Move labels below values in summary cards */
  .annual-summary .summary-card {
    flex-direction: column !important;
    justify-content: center !important;
    text-align: center !important;
  }
  
  .annual-summary .value {
    order: 1 !important;
    margin-bottom: 5px !important;
    font-size: 1rem !important;
  }
  
  .annual-summary .label {
    order: 2 !important;
    font-size: 0.8rem !important;
  }
  
  /* Hide extra buttons 2-5 */
  .extra-summary .extra-item:nth-child(n+3) {
    display: none !important;
  }
  
  /* Remove icon from annual summary cards */
  .annual-summary .icon-square {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* Display privacy toggle and Fazer Finanças side by side */
  .extra-summary {
    flex-direction: row !important;
    gap: 10px !important;
    justify-content: space-between !important;
  }
  
  .extra-summary .extra-item {
    flex: 0 0 calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    min-width: 0 !important; /* Allow equal shrinking */
  }
  
  /* Make sure button contents don't affect sizing */
  .extra-summary .summary-card {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 768px) {
  .mes-table .actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    justify-content: space-between !important;
  }
  

}

/* Mobile layout */
@media (max-width: 768px) {
  .mes-table tbody tr td.actions {
    display: flex !important;
    gap: 8px !important;
  }
  
  .mes-table tbody tr td.actions button {
    flex: 1 !important;
    min-width: 45% !important;
    padding: 14px 0 !important;
  }
}

/* New button classes */


.large-edit-btn {
  background-color: #3b82f6 !important;
  color: white !important;
  border: none !important;
}

.large-delete-btn {
  background-color: #ef4444 !important;
  color: white !important;
  border: none !important;
}

/* Compact action buttons */
.months-table .actions button {
  padding: 1px 1px !important;
  font-size: 0.5rem !important;
  min-width: 8px !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

@media (max-width: 768px) {
  .months-table .actions button {
    padding: 1px 0 !important;
    min-width: 5% !important;
    font-size: 0.45rem !important;
  }
}

.months-table .actions {
  display: flex !important;
  gap: 4px !important;
  justify-content: space-between !important;
}

.months-table .actions button {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: 48% !important;
  padding: 8px 4px !important;
  font-size: 0.85rem !important;
}

/* Reduce font size for mobile financial cards */
@media (max-width: 768px) {
    .month-totals .item {
        font-size: 0.9em;
    }
    
    .month-totals .label {
        font-size: 1em;
    }
    
    .month-totals .value,
    .month-totals .value2 {
        font-size: 1.1em;
    }
}

/* Reduce font size for income/expense numbers on mobile */
@media (max-width: 768px) {
    .month-totals .value.positive,
    .month-totals .value.negative {
        font-size: 0.95em !important;
    }
}

/* Style mobile financial year heading */
.mobile-financial-year {
    display: none;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .mobile-financial-year {
        display: block;
        text-align: center;
        font-size: 1.2em;
        color: #333;
    }
    
   
}
.card-subtext{
  font-size:0.7rem;
  font-style: italic;
}
#cordaprevisaovermelha{
  color: #ef4444 ;
}
#cordaprevisaoverde{
  color: #00a04b;
}



@media (max-width: 525px) {
    .month-card-saldo {
        margin-top: -20px !important;
    }
}

.type-symbol {
    color: #00a04b; /* Default green for receita */
    font-weight: bold;
    font-size: 1.5em; /* Larger size */
    display: inline-block;
    width: 24px;
    text-align: center;
}

.type-symbol[data-type="despesa"] {
    color: #e53e3e; /* Red for despesa */
}


    .type-symbol {
        font-size: 1.8em; /* Even larger on mobile */
        color: #00a04b !important; /* Force green for receita */
    }
    
    .type-symbol[data-type="despesa"] {
        color: #e53e3e !important; /* Force red for despesa */
    }

/* Modal Container Styles */
.type-container {
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.descricao-container {
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #0d6efd;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.value-container {
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    background-color: #f8f9fa;
}

/* Color Styles for Receita */
.receita-style {
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

/* Color Styles for Despesa */
.despesa-style {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

/* Add Modal Input Styles */
#addModal input,
#addModal select,
#addModal button {
    font-size: 20px;
    padding: 12px;
    height: auto;
}

#addModal input[type="text"],
#addModal input[type="number"] {
    width: 100%;
    max-width: 400px;
}

#addModal select {
    width: 100%;
    max-width: 400px;
}

#addModal button.btn-submit {
    width: 100%;
    max-width: 400px;
    padding: 15px;
}

/* Save Button Styles */
.btn-salvar {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.btn-salvar:hover {
    background-color: #45a049;
}

/* Active row style */
tr.active {
    background-color: #f0f0f0;
}

/* Configurações Mobile */
@media (max-width: 768px) {
    .settings-list {
        padding: 0;
        margin: 20px 0;
    }
    
    .settings-list li {
        margin-bottom: 15px;
    }
    
    .settings-list a {
        display: block;
        padding: 15px;
        background: #f5f5f5;
        border-radius: 8px;
        text-decoration: none;
        color: #333;
        font-size: 16px;
    }
    
    .settings-list a:hover {
        background: #e0e0e0;
    }
}

/* Mobile Menu */
.mobile-menu-container {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 20px 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.mobile-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.menu-btn {
    width: 60px;
    height: 60px;
    border-radius: 30%;
    background:  #d1b3de;
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-btn {
    background: #7b1fa2;
    color: white;
    font-size: 24px;
}

/* Nav Superior Roxo */
.mobile-top-nav {
    background: #7b1fa2;
    color: white;
}

@media (min-width: 769px) {
    .mobile-top-nav.mobile-only {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-top-nav {
        display: block !important;
    }
}

#logout-box {
    background-color: #ffebee;
    border-color: #ef9a9a !important;
}
#logout-box .logout-link {
    color: #c62828;
    text-decoration: none;
    font-weight: bold;
}
#logout-box:hover {
    background-color: #ffcdd2;
    cursor: pointer;
}

@media (max-width: 768px) {
    .config-container #logout-box {
        width: 100% !important;
        margin-bottom: 10px !important;
        background-color: #ffebee !important;
        border: 1px solid #ef9a9a !important;
    }
    .config-container #logout-box .logout-link {
        font-size: 16px !important;
        padding: 10px 0 !important;
        display: block !important;
        color: #c62828 !important;
    }
}

.config-container a.config-box {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

#logout-box {
    background-color: #ffebee;
    border: 1px solid #ef9a9a !important;
    color: #c62828;
    font-weight: bold;
}

#logout-box:hover {
    background-color: #ffcdd2;
}

@media (max-width: 768px) {
    .config-container a#logout-box {
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 10px 0 !important;
    }
}

/* Entry Modal Colors */
#entryModal .modal-content.receita,
#entryModal .modal-content[data-type='receita'] {
    background-color: #e8f5e9 !important;
    border-left: 5px solid #4caf50 !important;
}

#entryModal .modal-content.despesa,
#entryModal .modal-content[data-type='despesa'] {
    background-color: #ffebee !important;
    border-left: 5px solid #f44336 !important;
}

/* Completed transaction rows */
#lancamentosBody tr[data-status="pago"],
#lancamentosBody tr[data-status="recebido"] {
    background-color: rgba(245, 245, 245, 0.7) !important;
    color: #777 !important;
}

#lancamentosBody tr[data-status="pago"] td,
#lancamentosBody tr[data-status="recebido"] td {
    
    opacity: 0.4 !important;
}

#lancamentosBody tr[data-status="pago"] .action-btn,
#lancamentosBody tr[data-status="recebido"] .action-btn {
    opacity: 0.4 !important;
}
