/* Reset e Variáveis */
:root {
    --primary: #8B4513;
    --primary-dark: #6B3410;
    --primary-light: #A0522D;
    --secondary: #D4AF37;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --dark: #1F2937;
    --light: #F9FAFB;
    --white: #FFFFFF;
    --border: #E5E7EB;
    --text: #374151;
    --text-light: #6B7280;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --shadow-lg: rgba(0, 0, 0, 0.2);
    --sidebar-width: 280px;
    --header-height: 70px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--light);
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    max-width: 420px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 16px;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.login-footer p {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.login-footer small {
    color: var(--text);
    font-size: 12px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group label i {
    margin-right: 6px;
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

select.form-control {
    cursor: pointer;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #C4A027;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background-color: #DC2626;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-info {
    background-color: var(--info);
    color: var(--white);
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    position: relative;
    color: var(--text);
    font-size: 18px;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--primary);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 32px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-left-color: var(--secondary);
}

.nav-item i {
    font-size: 18px;
    width: 24px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.user-info i {
    font-size: 36px;
}

.user-info div {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 500;
    font-size: 14px;
}

.user-info small {
    font-size: 12px;
    opacity: 0.8;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.main-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--danger);
    color: var(--white);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.user-menu:hover {
    background-color: var(--light);
}

/* Content Area */
.content-area {
    padding: 24px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark);
}

/* Dashboard */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.metric-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--shadow-md);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.metric-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.metric-icon.bg-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.metric-icon.bg-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.metric-icon.bg-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.metric-content {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.chart-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

/* Tables */
.table-responsive {
    background: var(--white);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.data-table thead {
    background-color: var(--light);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--light);
}

.text-center {
    text-align: center;
}

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

.status-active {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-inactive {
    background-color: #FEE2E2;
    color: #991B1B;
}

.status-pending {
    background-color: #FEF3C7;
    color: #92400E;
}

.status-confirmed {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.status-completed {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-cancelled {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

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

/* Performance Card */
.performance-row {
    display: grid;
    gap: 20px;
}

.performance-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
}

.performance-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

/* Filters */
.calendar-filters,
.sales-filters,
.report-filters {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.calendar-filters .form-group,
.sales-filters .form-group,
.report-filters .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* Appointments Calendar */
.appointments-calendar {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    min-height: 500px;
}

/* Reports */
.report-content {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px var(--shadow);
    min-height: 400px;
}

/* Barber Area */
.barber-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--white);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    color: var(--text);
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--white);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Sale Items */
.sale-items {
    margin-bottom: 20px;
}

.sale-item {
    background: var(--light);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}

.sale-item-actions {
    display: flex;
    align-items: flex-end;
}

.sale-total {
    background: var(--primary);
    color: var(--white);
    padding: 16px;
    border-radius: 8px;
    text-align: right;
    margin-bottom: 20px;
}

.sale-total h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.sale-total .total-value {
    font-size: 32px;
    font-weight: 700;
}

/* Stock Alert */
.stock-alert {
    color: var(--danger);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .metrics-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .section-header .btn {
        width: 100%;
    }

    .calendar-filters,
    .sales-filters,
    .report-filters {
        flex-direction: column;
    }

    .calendar-filters .form-group,
    .sales-filters .form-group,
    .report-filters .form-group {
        width: 100%;
        min-width: 0;
    }

    .barber-actions {
        flex-direction: column;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .action-buttons {
        flex-direction: column;
    }

    #toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .header-title h1 {
        font-size: 18px;
    }

    .content-area {
        padding: 16px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .main-header,
    .section-header button,
    .action-buttons {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 0;
    }
}
