/* ===================================
   ADMIN PANEL - PREMIUM DESIGN SYSTEM
   =================================== */

/* CSS Variables - Mesma paleta do site principal */
:root {
    /* Colors - Mesma paleta do site */
    --primary-pink: #ffe4e1;
    --primary-pink-dark: #ffc9c4;
    --primary-pink-light: #fff0ee;
    --accent-gold: #c5a059;
    --secondary-gold: #d4b06a;

    /* Neutrals - Mesmos do site */
    --dark-bg: #0a0a0a;
    --card-bg: #1f1f1f;
    --card-hover: #2a2a2a;
    --border-color: rgba(255, 228, 225, 0.2);
    --text-primary: #f9f9f9;
    --text-secondary: #ccc;
    --text-muted: #aeaeae;

    /* Status Colors */
    --success: #00d4aa;
    --success-light: #00ffcc;
    --danger: #ff4757;
    --danger-light: #ff6b7a;
    --warning: #ffa502;
    --info: #4d9bff;

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 228, 225, 0.3);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===================================
   GLOBAL STYLES
   =================================== */

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

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1f1f1f 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 228, 225, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(197, 160, 89, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ===================================
   LOGIN SCREEN
   =================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInUp 0.6s ease;
}

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

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(255, 228, 225, 0.3));
    animation: float 3s ease-in-out infinite;
}

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

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--primary-pink);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-pink);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 228, 225, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Select options styling */
.form-group select option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 10px;
}

.form-group select option:hover,
.form-group select option:checked {
    background: var(--primary-pink);
    color: var(--dark-bg);
}

.btn-login {
    background: var(--primary-pink);
    border: none;
    border-radius: 12px;
    padding: 16px;
    color: var(--dark-bg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 16px rgba(255, 228, 225, 0.3);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 228, 225, 0.4);
    background: var(--primary-pink-light);
}

.btn-login:active {
    transform: translateY(0);
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    text-align: center;
    padding: 12px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 71, 87, 0.2);
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

/* ===================================
   DASHBOARD LAYOUT
   =================================== */

.dashboard-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.dashboard-body {
    display: flex;
    min-height: 100vh;
}

/* ===================================
   SIDEBAR
   =================================== */

.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: all var(--transition-normal);
}

.sidebar-header {
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(255, 228, 225, 0.3));
}

.sidebar-header h2 {
    font-size: 20px;
    color: var(--primary-pink);
    font-family: 'Playfair Display', serif;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-normal);
    text-align: left;
    width: 100%;
}

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

.nav-item:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-pink);
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(255, 228, 225, 0.1);
    color: var(--primary-pink);
    font-weight: 600;
}

.nav-item[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-footer {
    padding: 24px 16px;
    border-top: 1px solid var(--border-color);
}

.btn-logout-sidebar {
    width: 100%;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--danger);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition-normal);
}

.btn-logout-sidebar:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: var(--danger);
    transform: translateY(-2px);
}

/* ===================================
   MAIN CONTENT WRAPPER
   =================================== */

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    min-width: 0;
    /* Prevent flex overflow */
}

.main-header {
    background: rgba(31, 31, 31, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left-mobile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--primary-pink);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 228, 225, 0.1);
}

.header-breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
}

#breadcrumbModule {
    color: var(--primary-pink);
    font-weight: 600;
    font-size: 16px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-profile i {
    font-size: 24px;
    color: var(--primary-pink);
}

.dashboard-content {
    flex: 1;
    padding: 32px;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

.content-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 24px;
}

.content-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.content-title h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.month-selector h3 {
    font-size: 14px;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
    color: var(--primary-pink);
}

.btn-month-nav {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.btn-month-nav:hover {
    color: var(--primary-pink);
    background: rgba(255, 228, 225, 0.1);
}

.content-actions {
    display: flex;
    gap: 12px;
}

.btn-action {
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.btn-revenue {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-revenue:hover {
    background: #10b981;
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-expense {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-expense:hover {
    background: #f43f5e;
    color: #fff;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--primary-pink);
    color: var(--dark-bg);
    box-shadow: 0 4px 16px rgba(255, 228, 225, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 228, 225, 0.4);
    background: var(--primary-pink-light);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
    box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 212, 170, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: white;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 71, 87, 0.4);
}

/* ===================================
   CALENDAR / AGENDA
   =================================== */

.week-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.week-navigation h3 {
    font-size: 20px;
    font-weight: 600;
    min-width: 250px;
    text-align: center;
}

.btn-week,
.btn-month {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.btn-week:hover,
.btn-month:hover {
    background: rgba(255, 228, 225, 0.1);
    border-color: var(--primary-pink);
    color: var(--primary-pink);
}

.calendar-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
}

.calendar-day {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-height: 200px;
    transition: all var(--transition-normal);
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-pink);
    transform: translateY(-2px);
}

.day-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.day-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-pink);
    text-transform: uppercase;
}

.day-date {
    font-size: 12px;
    color: var(--text-muted);
}

.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.appointment-item {
    background: rgba(255, 228, 225, 0.1);
    border: 1px solid rgba(255, 228, 225, 0.3);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.appointment-item:hover {
    background: rgba(255, 228, 225, 0.15);
    transform: translateX(4px);
}

.appointment-time {
    font-weight: 700;
    color: var(--primary-pink);
    display: block;
    margin-bottom: 4px;
}

.appointment-client {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.appointment-service {
    color: var(--text-muted);
    font-size: 12px;
    display: block;
}

.no-appointments {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* ===================================
   FINANCIAL SECTION
   =================================== */

.month-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.month-selector h3 {
    font-size: 18px;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.financial-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
}

.summary-card.revenue::before {
    background: var(--success);
}

.summary-card.expenses::before {
    background: var(--danger);
}

.summary-card.balance::before {
    background: var(--accent-gold);
}

.summary-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.summary-card.revenue .card-icon {
    background: rgba(0, 212, 170, 0.1);
    color: var(--success);
}

.summary-card.expenses .card-icon {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

.summary-card.balance .card-icon {
    background: rgba(197, 160, 89, 0.1);
    color: var(--accent-gold);
}

.card-content h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.card-content .amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

/* ===================================
   ADMIN TABLE
   =================================== */

.transactions-container {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
}

.table-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-box {
    position: relative;
    width: 240px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px 8px 32px;
    color: var(--text-primary);
    font-size: 13px;
    transition: all var(--transition-normal);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-pink);
    background: rgba(255, 255, 255, 0.08);
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: rgba(0, 0, 0, 0.1);
    padding: 12px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 12px 24px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 228, 225, 0.05);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

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

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

.category-badge {
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    background: rgba(255, 228, 225, 0.05);
    border: 1px solid rgba(255, 228, 225, 0.1);
    color: var(--text-secondary);
}

.table-amount {
    font-weight: 600;
    font-size: 14px;
}

.table-amount.revenue {
    color: var(--success);
}

.table-amount.expense {
    color: var(--danger);
}

.btn-table-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-fast);
    padding: 8px;
    border-radius: 8px;
}

.delete-action:hover {
    color: var(--danger);
    background: rgba(255, 71, 87, 0.1);
}

.no-data-message {
    padding: 60px;
    text-align: center;
    color: var(--text-muted);
}

.no-data-message i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}


.no-transactions {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ===================================
   MODAL
   =================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp 0.4s ease;
}

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

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h3 i {
    color: var(--primary-pink);
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--danger);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-form {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ===================================
   APPOINTMENT DETAILS MODAL
   =================================== */

.appointment-details {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-normal);
}

.detail-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-pink);
}

.detail-row.full-width {
    grid-column: 1 / -1;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 228, 225, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-pink);
    font-size: 18px;
    flex-shrink: 0;
}

.detail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-content label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-content span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

    .sidebar {
        position: fixed;
        left: -280px;
        transition: all var(--transition-normal);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.active {
        left: 0;
    }

    .main-wrapper {
        width: 100%;
    }

    .main-header {
        padding: 12px 20px;
        position: sticky;
        top: 0;
    }

    .dashboard-content {
        padding: 20px;
    }

    /* Ocultar elementos antigos se ainda existirem no DOM */
    .dashboard-header,
    .dashboard-nav {
        display: none !important;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-header h2 {
        font-size: 24px;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .financial-summary {
        grid-template-columns: 1fr;
    }

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

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

    .transaction-actions button {
        width: 100%;
    }

    .modal-content {
        margin: 20px;
    }

    .login-card {
        padding: 32px 24px;
    }
}

@media (max-width: 480px) {

    .week-navigation h3,
    .month-selector h3 {
        font-size: 16px;
        min-width: 180px;
    }

    .transaction-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .transaction-delete {
        align-self: flex-end;
        margin-left: 0;
    }
}

/* ===================================
   SCROLLBAR STYLING
   =================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-pink);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-pink-light);
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(31, 31, 31, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-pink);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
    animation: toastSlideIn 0.4s ease forwards;
    transform-origin: right center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

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

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

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

.toast-icon {
    font-size: 20px;
    color: var(--primary-pink);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: block;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-pink);
    width: 100%;
    transform-origin: left;
    animation: toastProgress 4s linear forwards;
}

.toast.confirm {
    border-left-color: var(--warning);
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
}

.toast.confirm .toast-progress {
    display: none;
}

.toast-confirm-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.btn-confirm-yes,
.btn-confirm-no {
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-confirm-yes:hover {
    background: var(--danger-light);
}

.btn-confirm-no {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-confirm-no:hover {
    background: rgba(255, 255, 255, 0.15);
}

.toast.success .toast-progress {
    background: var(--success);
}

.toast.error .toast-progress {
    background: var(--danger);
}

.toast.warning .toast-progress {
    background: var(--warning);
}

/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

.toast.hiding {
    animation: toastSlideOut 0.4s ease forwards;
}

/* Automatic Sync Styling */
.admin-table tr.automatic-row td {
    background: rgba(255, 228, 225, 0.02);
}

.admin-table tr.automatic-row:hover td {
    background: rgba(255, 228, 225, 0.04);
}

.admin-table .fa-magic {
    color: var(--accent-gold);
    font-size: 10px;
    margin-left: 8px;
    opacity: 0.8;
}

/* ===================================
   BI / INSIGHTS STYLES
   =================================== */

.bi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.bi-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all var(--transition-normal);
}

.bi-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-5px);
    border-color: rgba(255, 228, 225, 0.3);
}

.bi-card.highlight {
    background: rgba(255, 228, 225, 0.05);
    border-color: rgba(255, 228, 225, 0.1);
}

.bi-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bi-card-header i {
    color: var(--primary-pink);
    font-size: 16px;
}

.bi-card-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

.bi-card-value.mini {
    font-size: 20px;
}

.bi-card-footer {
    font-size: 12px;
    color: var(--text-muted);
}

/* Simple Bar Chart */
.bi-chart-container {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
}

.bi-placeholder-chart {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bar-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.chart-bar {
    width: 30px;
    background: var(--primary-pink);
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 1s ease;
    opacity: 0.6;
}

.chart-bar:hover {
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 228, 225, 0.4);
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--primary-pink);
    font-weight: 700;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
}

.chart-labels span {
    width: 30px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

@media (max-width: 1200px) {
    .bi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .bi-grid {
        grid-template-columns: 1fr;
    }
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.actions-group {
    display: flex;
    gap: 12px;
}

#copyInviteLinkBtn {
    background: rgba(197, 160, 89, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(197, 160, 89, 0.2);
}

#copyInviteLinkBtn:hover {
    background: var(--accent-gold);
    color: white;
}

/* Back to site button (desktop sidebar footer) */
.btn-back-site {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    margin-bottom: 8px;
}

.btn-back-site:hover {
    color: var(--primary-pink);
    background: rgba(255, 228, 225, 0.06);
    border-color: rgba(255, 228, 225, 0.3);
}

.btn-back-site i {
    font-size: 16px;
}

/* nav-item as anchor (mobile bottom nav) */
.nav-item-link {
    text-decoration: none;
    color: var(--text-muted);
}

.nav-item-link:hover,
.nav-item-link:focus {
    color: var(--primary-pink);
    background: rgba(255, 228, 225, 0.08);
}

/* On mobile, hide the desktop back button since it's in the nav */
@media (max-width: 768px) {
    .btn-back-site {
        display: none;
    }
}


/* ===================================
   RESPONSIVE - MOBILE
   =================================== */

@media (max-width: 768px) {

    /* Hide sidebar toggle button (not needed anymore) */
    .btn-sidebar-toggle {
        display: none !important;
    }

    /* Dashboard layout: stack vertically */
    .dashboard-body {
        flex-direction: column;
    }

    /* Sidebar becomes a fixed bottom navigation bar */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 200;
        background: rgba(31, 31, 31, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 0;
    }

    /* Hide sidebar header and footer on mobile */
    .sidebar-header,
    .sidebar-footer {
        display: none;
    }

    /* Nav becomes horizontal row */
    .sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 8px 4px;
        gap: 0;
        width: 100%;
    }

    /* Nav items become compact icon+label columns */
    .nav-item {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        padding: 8px 4px;
        border-radius: 10px;
        font-size: 10px;
        align-items: center;
        justify-content: center;
        min-height: 52px;
    }

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

    .nav-item span {
        font-size: 10px;
        letter-spacing: 0;
    }

    /* Active nav item highlight */
    .nav-item.active {
        background: rgba(255, 228, 225, 0.1);
        color: var(--primary-pink);
    }

    /* Main content: add padding at bottom so it doesn't hide behind bottom nav */
    .dashboard-content {
        padding: 20px 16px;
        padding-bottom: 80px;
    }

    /* Header adjustments */
    .dashboard-header {
        padding: 12px 16px;
    }

    /* Content header stacks on mobile */
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 20px;
    }

    .content-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Calendar grid: 1 column on very small screens */
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Financial summary: 1 column */
    .financial-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* BI grid: 2 columns on mobile */
    .bi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Modal full screen on mobile */
    .modal-content {
        margin: 0;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Table horizontal scroll */
    .admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .bi-grid {
        grid-template-columns: 1fr;
    }

    .bi-card-value {
        font-size: 26px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .actions-group {
        width: 100%;
        justify-content: stretch;
    }

    .actions-group button {
        flex: 1;
    }
}