/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #e8f4f8;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Cabeçalho */
.header {
    background-color: #005a8c;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 90, 140, 0.2);
    position: relative;
}

.logo-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid #0077b3;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #a8d8f0;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background-color: #0077b3;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-logout:hover {
    background-color: #0088cc;
}

/* Navegação Desktop */
.navbar {
    background-color: #004d73;
}

.navbar ul {
    display: flex;
    list-style: none;
    padding: 0 30px;
}

.navbar li {
    flex: 1;
}

.navbar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cce7f0;
    text-decoration: none;
    padding: 15px 20px;
    transition: all 0.3s;
    text-align: center;
    justify-content: center;
    border-bottom: 3px solid transparent;
}

.navbar a:hover, .navbar a.active {
    background-color: #005a8c;
    color: white;
    border-bottom: 3px solid #a8d8f0;
}

.navbar i {
    font-size: 1.2rem;
}

/* Botão do menu hambúrguer */
.menu-toggle {
    display: none;
    background: #0077b3;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 1001;
}

.menu-toggle:hover {
    background: #0088cc;
}

/* Overlay do menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 77, 115, 0.5);
    z-index: 999;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* Menu lateral Mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .logo-container {
        padding-right: 70px;
        position: relative;
    }
    
    .user-info {
        display: none !important;
    }
    
    .navbar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #004d73;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        padding-top: 0;
    }
    
    .navbar.active {
        left: 0;
    }
    
    .navbar ul {
        flex-direction: column;
        padding: 0;
    }
    
    .navbar li {
        width: 100%;
        border-bottom: 1px solid #005a8c;
    }
    
    .navbar a {
        padding: 15px 20px;
        justify-content: flex-start;
        border-left: 4px solid transparent;
        border-bottom: none;
    }
    
    .navbar a:hover,
    .navbar a.active {
        border-left: 4px solid #a8d8f0;
        border-bottom: none;
        background: #005a8c;
    }
}

/* Informações do usuário no menu mobile */
.mobile-user-info {
    background: linear-gradient(135deg, #004d73 0%, #005a8c 100%);
    padding: 25px 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #0077b3;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mobile-user-avatar {
    width: 50px;
    height: 50px;
    background: #0077b3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-user-avatar i {
    font-size: 2rem;
    color: #fff;
}

.mobile-user-details {
    flex: 1;
}

.mobile-user-details span {
    display: block;
}

#mobileUserName {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.mobile-barbershop-name {
    font-size: 0.8rem;
    color: #a8d8f0;
}

.mobile-barbershop-name i {
    margin-right: 5px;
    color: #a8d8f0;
}

.mobile-logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-logout-btn:hover {
    background: #c82333;
}

/* Desktop - reset do menu */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
    
    .navbar {
        position: static;
        width: auto;
        height: auto;
        background: #004d73;
        box-shadow: none;
        overflow: visible;
        padding-top: 0;
    }
    
    .navbar ul {
        flex-direction: row;
        padding: 0 30px;
    }
    
    .navbar li {
        width: auto;
        border-bottom: none;
    }
    
    .navbar a {
        padding: 15px 20px;
        border-left: none;
        border-bottom: 3px solid transparent;
        justify-content: center;
    }
    
    .navbar a:hover,
    .navbar a.active {
        border-left: none;
        border-bottom: 3px solid #a8d8f0;
        background: transparent;
    }
    
    .mobile-user-info {
        display: none !important;
    }
    
    .menu-overlay {
        display: none !important;
    }
}

/* Conteúdo principal */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Widget de data e hora */
.datetime-widget {
    background: linear-gradient(135deg, #005a8c 0%, #0088cc 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 90, 140, 0.2);
}

.current-time {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.current-date {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Grid de estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 90, 140, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 90, 140, 0.15);
}

.stat-card i {
    font-size: 2.5rem;
    color: #005a8c;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 1rem;
    color: #2c6e9e;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #005a8c;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 0.9rem;
    color: #2c6e9e;
}

.stat-change.positive { color: #28a745; }
.stat-change.negative { color: #dc3545; }

/* Ações rápidas */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f7fa 0%, #e0f0f5 100%);
    border: 2px solid #a8d8f0;
    border-radius: 10px;
    padding: 30px 15px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s;
}

.action-btn:hover {
    background: linear-gradient(135deg, #005a8c 0%, #0088cc 100%);
    color: white;
    border-color: #005a8c;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 90, 140, 0.2);
}

.action-btn i {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.action-btn span {
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
}

/* Cards de desempenho dos barbeiros */
.barber-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 90, 140, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.barber-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 90, 140, 0.15);
}

/* Estilos da agenda visual */
.calendar-container {
    overflow-x: auto;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 90, 140, 0.1);
}

.calendar-week-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    background: #005a8c;
    color: white;
    font-weight: bold;
    border-bottom: 2px solid #a8d8f0;
    min-width: 800px;
}

.calendar-time-column, .calendar-day {
    padding: 15px 8px;
    text-align: center;
    border-right: 1px solid #0077b3;
}

.calendar-day:last-child {
    border-right: none;
}

.calendar-week-body {
    min-width: 800px;
}

.calendar-hour-row {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    min-height: 60px;
    border-bottom: 1px solid #cce7f0;
}

.hour-label {
    padding: 8px;
    text-align: center;
    background: #f0f7fa;
    border-right: 1px solid #cce7f0;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-slot {
    border-right: 1px solid #cce7f0;
    padding: 4px;
    min-height: 60px;
    position: relative;
}

.calendar-slot:last-child {
    border-right: none;
}

.appointment-card-calendar {
    background: #0088cc;
    color: white;
    padding: 4px;
    border-radius: 4px;
    font-size: 10px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: transform 0.2s;
}

.appointment-card-calendar:hover {
    transform: scale(1.02);
}

.appointment-card-calendar.concluido { background: #28a745; }
.appointment-card-calendar.cancelado { background: #dc3545; }
.appointment-card-calendar.confirmado { background: #ffc107; color: #333; }

/* Seções */
.section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 90, 140, 0.08);
}

.section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #005a8c;
    font-size: 1.5rem;
    border-bottom: 2px solid #cce7f0;
    padding-bottom: 10px;
}

/* Tabelas */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #005a8c;
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #cce7f0;
}

tr:hover {
    background-color: #f0f7fa;
}

/* Badges de status */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-agendado { background: #e3f2fd; color: #1565c0; }
.status-confirmado { background: #e8f5e9; color: #2e7d32; }
.status-concluido { background: #f3e5f5; color: #7b1fa2; }
.status-cancelado { background: #ffebee; color: #c62828; }
.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #f8d7da; color: #721c24; }
.status-receita { background: #d4edda; color: #155724; }
.status-despesa { background: #f8d7da; color: #721c24; }

/* Botões */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary { background: #005a8c; color: white; }
.btn-primary:hover { background: #0088cc; }

.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }

.btn-warning { background: #ffc107; color: #333; }
.btn-warning:hover { background: #e0a800; }

.btn-danger { background: #dc3545; color: white; }
.btn-danger:hover { background: #c82333; }

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-calendar {
    background: #0088cc;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}

.btn-calendar:hover {
    background: #005a8c;
}

/* Formulários */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 90, 140, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cce7f0;
    border-radius: 4px;
}

/* Alertas */
.alert {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert.hidden { display: none; }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 77, 115, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal.hidden { display: none !important; }

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 90, 140, 0.3);
}

.modal-header {
    background: #005a8c;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    background: #f0f7fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #cce7f0;
}

.detail-row {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #cce7f0;
}

.detail-row strong {
    display: inline-block;
    min-width: 100px;
    color: #2c6e9e;
}

/* Gráficos */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 90, 140, 0.1);
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Badge da barbearia */
.barbershop-badge {
    background: #a8d8f0;
    color: #005a8c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #2c6e9e;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #a8d8f0;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* Filtros */
.filter-select {
    padding: 8px 12px;
    border: 1px solid #cce7f0;
    border-radius: 4px;
}

.date-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #cce7f0;
}

/* Rodapé */
.footer {
    background-color: #005a8c;
    color: #cce7f0;
    padding: 20px 30px;
    text-align: center;
    margin-top: 40px;
}

/* Utilitários */
.hidden { display: none; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-success { color: #28a745; font-weight: bold; }
.text-danger { color: #dc3545; font-weight: bold; }

/* Responsividade geral */
@media (max-width: 992px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .barber-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .appointment-item {
        flex-direction: column;
        text-align: center;
    }
    
    .appointment-meta {
        justify-content: center;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    th, td {
        padding: 10px;
        font-size: 13px;
    }
    
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .calendar-controls {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .current-time {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
    
    .form-container {
        padding: 15px;
    }
    
    .btn {
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    max-width: 180px;
    display: block;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Responsivo para mobile */
@media (max-width: 768px) {
    .logo-img {
        height: 30px;
        max-width: 150px;
    }
}

/* Para telas muito pequenas */
@media (max-width: 480px) {
    .logo-img {
        height: 25px;
        max-width: 120px;
    }
}