/* Futuristic Theme - Painel Gestor Aura */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Core Colors */
    --bg-dark: #0a0a12;
    --bg-panel: rgba(20, 20, 35, 0.7);
    --primary-neon: #00f3ff;
    --secondary-neon: #bc13fe;
    --accent-neon: #ff0055;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Status Colors */
    --success: #00ff9d;
    --warning: #ffb800;
    --danger: #ff0055;

    /* Effects */
    --glass-backdrop: blur(12px);
    --neon-glow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.3);
    --purple-glow: 0 0 10px rgba(188, 19, 254, 0.5), 0 0 20px rgba(188, 19, 254, 0.3);

    /* Transitions */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Message Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    animation: scaleIn 0.3s forwards;
}

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

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

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

.templates-grid {
    display: grid;
    gap: 15px;
}

.template-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-neon);
    transform: translateY(-2px);
}

.template-title {
    color: var(--primary-neon);
    font-weight: 600;
    margin-bottom: 5px;
}

.template-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

@keyframes scaleIn {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid var(--border-glass);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: rgba(0, 243, 255, 0.2);
    border-color: var(--primary-neon);
}

input:checked+.slider:before {
    transform: translateX(26px);
    background-color: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon);
}

.slider.round {
    border-radius: 34px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

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

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

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Glassmorphism Utilities */
.glass-panel,
.stat-card,
.client-card,
.add-client-section,
.clients-section,
.revenue-card,
.profile-info-section,
.profile-edit-section,
.security-info-section {
    background: var(--bg-panel);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Generic Padding for Sections */
.add-client-section,
.clients-section,
.profile-info-section,
.profile-edit-section,
.security-info-section {
    padding: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    border: none;
    cursor: pointer;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-neon);
    border: 1px solid var(--primary-neon);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.btn-primary:hover {
    background: var(--primary-neon);
    color: #000;
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(255, 0, 85, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
}

.btn-success {
    background: rgba(0, 255, 157, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.btn-success:hover {
    background: var(--success);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
}

.btn-email {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
    border: 1px solid #ff6b35;
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.1);
}

.btn-email:hover {
    background: #ff6b35;
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: 36px;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary-neon);
    filter: blur(150px);
    opacity: 0.2;
    top: -100px;
    left: -100px;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary-neon);
    filter: blur(150px);
    opacity: 0.15;
    bottom: -100px;
    right: -100px;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out reverse;
}

.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 10;
}

.login-form {
    padding: 50px;
    text-align: center;
}

.logo-container {
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.5));
}

.login-form h1 {
    font-size: 1.8rem;
    background: linear-gradient(to right, #fff, var(--primary-neon));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.login-form h2 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 30px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-neon);
    background: rgba(0, 243, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    color: #fff;
}

/* Garantir que o texto dos inputs seja sempre branco */
.form-group input,
.form-group textarea,
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #fff;
}

.form-group input::-webkit-input-placeholder,
.form-group textarea::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input::-moz-placeholder,
.form-group textarea::-moz-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    z-index: 1001;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
    width: 40px;
    height: auto;
}

.sidebar-header h1 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: transparent;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

.nav-item.active {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-neon);
    color: var(--primary-neon);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
    font-weight: 500;
}

.nav-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #fff;
}

.nav-item.active .nav-count {
    background: var(--primary-neon);
    color: #000;
}

/* Main Content Area */
.main-content-wrapper {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    width: calc(100% - 280px);
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    position: sticky;
    top: 20px;
    z-index: 99;
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 35px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.total::before {
    background: var(--primary-neon);
}

.stat-card.value::before {
    background: var(--success);
}

.stat-card.expired::before {
    background: var(--danger);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-icon {
    font-size: 2rem;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Revenue Card */
.revenue-card {
    padding: 50px;
    margin-bottom: 30px;
}

/* Clients Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.client-card {
    padding: 35px;
    transition: all 0.3s ease;
}

.client-card.hidden {
    display: none !important;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Status Effects */
.client-card.active {
    border: 1px solid rgba(0, 255, 157, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.1);
}

.client-card.active:hover {
    border-color: rgba(0, 255, 157, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.2);
}

.client-card.expired {
    border: 1px solid rgba(255, 0, 85, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.1);
}

.client-card.expired:hover {
    border-color: rgba(255, 0, 85, 0.6);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.2);
}

.client-card.expired_today {
    border: 1px solid rgba(255, 184, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 184, 0, 0.1);
}

.client-card.expired_today:hover {
    border-color: rgba(255, 184, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 184, 0, 0.2);
}

.client-info h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-neon);
}

.client-info p {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.client-info strong {
    color: #fff;
}

.client-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
}

.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 15px 50px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 10;
    pointer-events: none;
}

/* Animations */
@keyframes float {

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

    50% {
        transform: translate(20px, 20px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

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

.client-card,
.stat-card {
    animation: fadeIn 0.6s var(--ease-out) forwards;
}

/* Responsive */
/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 30px 10px;
    }

    .sidebar-header h1,
    .nav-text,
    .nav-count {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 15px;
    }

    .nav-icon {
        font-size: 1.5rem;
        margin: 0;
    }

    .main-content-wrapper {
        margin-left: 80px;
        width: calc(100% - 80px);
    }
}

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

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

    .sidebar-header h1,
    .nav-text,
    .nav-count {
        display: block;
    }

    .sidebar-header {
        justify-content: space-between;
    }

    .close-sidebar-btn {
        display: block;
    }

    .nav-item {
        justify-content: flex-start;
    }

    .main-content-wrapper {
        margin-left: 0;
        width: 100%;
        padding: 20px 15px;
    }

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

    .top-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
        /* Flat bottom for seamless look */
        padding: 12px 20px;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 10px;
        background: var(--bg-dark);
        /* Match body background for seamless blend */
        border: none;
        border-bottom: 1px solid var(--border-glass);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        z-index: 1000;
        /* Ensure it's always on top */
    }

    /* Adjust main content to account for fixed header */
    .main-content-wrapper {
        padding-top: 80px;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block !important;
        font-size: 1.4rem;
        color: var(--text-main);
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }

    /* User Menu Mobile Adjustments */
    .user-menu {
        flex-wrap: nowrap;
        gap: 15px;
        width: auto;
        justify-content: flex-end;
    }

    .auto-msg-toggle {
        display: flex !important;
        align-items: center !important;
        margin-right: 0 !important;
        gap: 8px !important;
        order: 1;
    }

    .auto-msg-toggle span {
        display: block;
        /* Restore text visibility */
        font-size: 0.8rem;
        color: var(--text-muted);
        white-space: nowrap;
    }

    /* Compact Switch for Mobile */
    .switch {
        width: 36px;
        height: 18px;
    }

    .slider:before {
        height: 12px;
        width: 12px;
        left: 3px;
        bottom: 3px;
    }

    input:checked+.slider:before {
        transform: translateX(18px);
    }

    .user-info {
        display: none;
        /* Keep user info hidden to save space */
    }

    .user-menu form {
        order: 2;
    }

    .user-menu .btn-danger {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .user-menu .btn-danger i {
        display: none;
        /* Hide icon on mobile button */
    }

    /* Mobile Client Actions */
    .client-actions {
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }

    .client-actions .btn {
        width: auto;
        min-width: 40px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .client-actions .btn i {
        margin: 0;
    }

    .client-actions .btn-success {
        padding: 8px 10px;
    }

    /* Mobile Scroll Optimizations - Simplified */
    body {
        overscroll-behavior-y: none;
    }

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

.mobile-menu-toggle {
    display: none;
}

/* Pagination Styles */
.pagination-container {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 6px;
}

.page-link:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-neon);
    color: var(--primary-neon);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--primary-neon);
    border-color: var(--primary-neon);
    color: #000;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.page-prev,
.page-next {
    padding: 0 16px;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 8px;
    user-select: none;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 768px) {
    .pagination {
        gap: 5px;
    }

    .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.9rem;
    }

    .page-prev,
    .page-next {
        padding: 0 12px;
    }
}