@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f7fa;
    --text-color: #333;
    --border-color: #ddd;
    --white: #fff;
    --danger-color: #d9534f;
    --success-color: #5cb85c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Formulários --- */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* --- Botões --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #357abd;
    color: var(--white);
    text-decoration: none;
}

.btn-danger { background-color: var(--danger-color); }
.btn-danger:hover { background-color: #c9302c; }

.btn-success { background-color: var(--success-color); }
.btn-success:hover { background-color: #4cae4c; }

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* --- Alertas e Mensagens --- */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

/* --- Tabelas --- */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--border-color);
    font-weight: 500;
}

/* --- Status --- */
.status {
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
}
.status-available {
    background-color: #dff0d8;
    color: #3c763d;
}
.status-in-use {
    background-color: #f2dede;
    color: #a94442;
}

/* --- Navegação --- */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}
.header-nav nav a, .header-nav nav span {
    margin-left: 1rem;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
}

/* --- Estilos específicos do Admin --- */
.admin-section {
    background-color: #f9f9f9;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* --- Layout de Cartões para Contas --- */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.account-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.account-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.card-body {
    padding: 1rem;
    flex-grow: 1;
}

.card-footer {
    padding: 1rem;
    background-color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* --- Estilos do Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    animation: fadeIn 0.3s;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: black;
}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.95);}
    to {opacity: 1; transform: scale(1);}
}

.loader {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.copy-btn {
    background-color: #777;
}
.copy-btn:hover {
    background-color: #555;
}

.whatsapp-btn {
    background-color: #25D366;
}
.whatsapp-btn:hover {
    background-color: #1DAE54;
}

.welcome-message {
    text-align: center;
    padding: 4rem 1rem;
}

.profile-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

/* --- Bottom Navigation Bar (Mobile) --- */
.bottom-nav {
    display: none; /* Escondido por padrão em telas grandes */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1001; /* Acima do modal overlay */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 12px 0;
    color: #888;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.nav-item:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* Media Query para telas móveis */
@media (max-width: 768px) {
    .header-nav nav {
        display: none; /* Esconde a navegação do topo no mobile */
    }

    .bottom-nav {
        display: flex; /* Mostra a navegação de baixo no mobile */
    }

    .container {
        padding-bottom: 80px; /* Adiciona espaço no final do container para não sobrepor o conteúdo */
    }
}

/* --- Lista de Sacadores --- */
.sacadores-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sacador-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.sacador-card h3 {
    margin: 0 0 0.25rem 0;
}

.sacador-card p {
    margin: 0;
    color: #666;
}

/* --- Layout do Painel Admin --- */
.admin-layout {
    display: flex;
    gap: 2rem;
}

.admin-sidebar {
    flex: 0 0 200px; /* Não cresce, não encolhe, base de 200px */
}

.admin-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-sidebar a {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-sidebar a:hover {
    background-color: var(--secondary-color);
}

.admin-sidebar a.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.admin-content {
    flex-grow: 1;
}

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { display: none; } /* Sidebar é escondida e a bottom nav assume */

    /* Tabela responsiva */
    .table thead {
        display: none;
    }
    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }
    .table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 6px;
    }
    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        font-weight: 500;
    }
}

/* --- Badges de Categoria --- */
.category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2em 0.6em;
    border-radius: 10px;
    color: var(--white);
    margin-left: 0.5rem;
}

.cat-baixo {
    background-color: #3498db; /* Azul */
}

.cat-medio {
    background-color: #e74c3c; /* Vermelho */
}

.cat-alto {
    background-color: #e74c3c; /* Vermelho */
}

/* --- Cabeçalho da Lista --- */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* --- Estilos da Página de Boas-Vindas --- */
.welcome-container {
    text-align: center;
}

.welcome-message h1 {
    font-size: 2.5rem;
}

.welcome-message p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

.login-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.login-card {
    background-color: var(--white);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.login-card h2 i {
    margin-right: 0.5rem;
}

.btn-block {
    display: block;
    width: 100%;
    margin: 1.5rem 0 0.5rem;
}

@media (max-width: 768px) {
    .login-options { grid-template-columns: 1fr; }
}