/* ==================== VARIÁVEIS E RESET ==================== */
:root {
    --color-black: #000000;
    --color-red: #DC2626;
    --color-red-dark: #B91C1C;
    --color-gold: #D4AF37;
    --color-gold-dark: #B8941F;
    --color-white: #FFFFFF;
    --color-gray: #4B5563;
    --color-gray-light: #9CA3AF;
    --color-gray-lighter: #E5E7EB;
    --color-gray-dark: #1F2937;
    --color-bg: #F9FAFB;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-gray);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-black) 0%, var(--color-gray-dark) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.decoration-element {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    background: var(--color-gold);
}

.decoration-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -100px;
}

.decoration-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -100px;
    background: var(--color-red);
}

.decoration-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 10%;
    background: var(--color-gold);
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--color-white);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--color-red);
}

.logo-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-black);
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--color-gray-light);
    font-weight: 400;
}

.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-gray-dark);
    margin-bottom: 8px;
}

.form-group label svg {
    width: 18px;
    height: 18px;
    color: var(--color-gray-light);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-gray-lighter);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--color-gray-dark);
    background: var(--color-white);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.form-group input::placeholder {
    color: var(--color-gray-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-red);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--color-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
}

.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--color-gray-lighter);
}

.login-footer p {
    font-size: 13px;
    color: var(--color-gray-light);
    margin-bottom: 8px;
}

.login-footer strong {
    color: var(--color-gray-dark);
    font-weight: 600;
}

/* ==================== ALERTS ==================== */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-icon {
    font-size: 20px;
    font-weight: 700;
}

.alert-text {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 4px;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* ==================== APP LAYOUT ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-black);
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--color-gold);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: -0.5px;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--color-white);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 4px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.nav-item.active {
    background: var(--color-red);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 0;
}

.nav-logout {
    color: var(--color-danger);
}

.nav-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-gold);
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar.collapsed .user-details {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
}

.top-bar {
    height: var(--topbar-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-lighter);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-gray);
    cursor: pointer;
    padding: 8px;
}

.top-bar-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-black);
    letter-spacing: -0.5px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-bg);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-gray);
}

.date-display svg {
    color: var(--color-red);
}

.content-wrapper {
    flex: 1;
    padding: 32px;
}

/* ==================== DASHBOARD ==================== */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--color-gray-lighter);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-dark) 100%);
    color: var(--color-white);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: var(--color-white);
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: var(--color-black);
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: var(--color-white);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 13px;
    color: var(--color-gray-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-black);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.stat-footer {
    font-size: 12px;
    color: var(--color-gray-light);
}

/* ==================== CARDS ==================== */
.card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-gray-lighter);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-gray-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-black);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg {
    color: var(--color-red);
}

.card-body {
    padding: 24px;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

/* ==================== APPOINTMENTS LIST ==================== */
.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-gray-light);
    transition: var(--transition);
}

.appointment-item:hover {
    background: #F3F4F6;
    transform: translateX(4px);
}

.appointment-item.status-confirmado {
    border-left-color: var(--color-info);
}

.appointment-item.status-em_andamento {
    border-left-color: var(--color-warning);
}

.appointment-item.status-concluido {
    border-left-color: var(--color-success);
}

.appointment-item.status-cancelado {
    border-left-color: var(--color-danger);
    opacity: 0.6;
}

.appointment-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.time-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-black);
}

.time-duration {
    font-size: 12px;
    color: var(--color-gray-light);
}

.appointment-details {
    flex: 1;
}

.appointment-client {
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 2px;
}

.appointment-service {
    font-size: 13px;
    color: var(--color-gray-light);
}

.appointment-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-red);
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-agendado {
    background: #E0E7FF;
    color: #3730A3;
}

.badge-confirmado {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-em_andamento {
    background: #FEF3C7;
    color: #92400E;
}

.badge-concluido {
    background: #D1FAE5;
    color: #065F46;
}

.badge-cancelado {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-falta {
    background: #F3F4F6;
    color: #4B5563;
}

/* ==================== LIST ITEMS ==================== */
.list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.list-item:hover {
    background: var(--color-bg);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-red);
    flex-shrink: 0;
}

.list-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-gold);
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--color-gray-light);
}

.list-item-value {
    font-weight: 700;
    color: var(--color-red);
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state svg {
    color: var(--color-gray-lighter);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--color-gray-light);
    margin-bottom: 20px;
    font-size: 15px;
}

.empty-state-sm {
    text-align: center;
    padding: 24px;
}

.empty-state-sm p {
    color: var(--color-gray-light);
    font-size: 14px;
    margin-bottom: 12px;
}

/* ==================== BUTTONS ==================== */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-ghost {
    background: transparent;
    color: var(--color-gray);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--color-bg);
    transform: none;
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    background: #DC2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block {
    width: 100%;
}

/* ==================== ADDITIONAL STYLES ==================== */
.agendamento-info {
    padding: 20px;
    background: var(--color-bg);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.agendamento-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 8px;
}

.agendamento-info p {
    font-size: 14px;
    color: var(--color-gray);
    margin-bottom: 4px;
}

.valor-destaque {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-red);
    margin-top: 12px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .grid-2-cols {
        grid-template-columns: 1fr;
    }
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
}

.modal-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

#modalContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

#modalContainer.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 600px;
    animation: slideUp 0.3s ease;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-gray-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-black);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-gray);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--color-bg);
}

.modal-form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.modal-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-gray-lighter);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    transition: var(--transition);
}

.modal-form textarea:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.modal-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-gray-lighter);
    border-radius: var(--border-radius);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    background: var(--color-white);
    cursor: pointer;
    transition: var(--transition);
}

.modal-form select:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== LOADING ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--color-white);
    font-weight: 600;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px;
    }
    
    .top-bar {
        padding: 0 20px;
    }
    
    .top-bar-title h1 {
        font-size: 20px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .date-display span {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal {
        max-width: 100%;
    }
}