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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --gray: #64748b;
    --light: #f8fafc;
    --white: #ffffff;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s;
    z-index: 1000;
}

/* Botão de Collapse no Sidebar */
.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

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

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    margin: 0;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .user-info span,
.sidebar.collapsed .btn-logout span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

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

.sidebar.collapsed .sidebar-collapse-btn {
    margin: 0 auto;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.875rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .btn-logout {
    width: 45px;
    padding: 0.75rem;
    justify-content: center;
}

/* Ajuste do main-content quando sidebar está collapsed */
.sidebar.collapsed ~ .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }
    
    .sidebar:hover,
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 260px;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Área sensível para abrir menu */
    body::before {
        content: '';
        position: fixed;
        left: 0;
        top: 0;
        width: 20px;
        height: 100%;
        z-index: 999;
    }
}

/* Transições suaves */
.sidebar,
.sidebar .sidebar-text,
.sidebar .nav-link span,
.sidebar .user-info span,
.sidebar .btn-logout,
.main-content {
    transition: all 0.3s ease;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

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

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border-left: 4px solid var(--white);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.user-info i {
    font-size: 1.5rem;
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(239,68,68,0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Top Bar */

/* Content Sections */
.content-section {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s;
}

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

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

.page-header {
    display: flex;
    justify-content: center; position: relative;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99,102,241,0.3);
}

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    cursor: pointer;
}

.stat-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.875rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dashboard-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.data-item:hover {
    background: #e8eaf6;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-item:active {
    transform: translateX(3px);
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

thead {
    background: var(--light);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.875rem;
    text-transform: uppercase;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--light);
}

tr:hover {
    background: var(--light);
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-ativo {
    background: #d1fae5;
    color: #065f46;
}

.status-inativo {
    background: #fee2e2;
    color: #991b1b;
}

.status-ativa {
    background: #d1fae5;
    color: #065f46;
}

.status-trial {
    background: #dbeafe;
    color: #1e40af;
}

.status-suspensa {
    background: #fef3c7;
    color: #92400e;
}

.status-vencida {
    background: #fee2e2;
    color: #991b1b;
}

.status-ativa,
.status-active {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    font-weight: 600;
}

.status-trial {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    color: #5b21b6;
    font-weight: 600;
}

.status-suspensa,
.status-suspended {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #9a3412;
    font-weight: 600;
}

.status-vencida,
.status-overdue {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.status-cancelada,
.status-cancelled {
    background: #f3f4f6;
    color: #6b7280;
    font-weight: 600;
}

.status-trial_expirado {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
    font-weight: 600;
}

.status-inativa,
.status-inactive {
    background: #e5e7eb;
    color: #4b5563;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.badge-db {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.status-badge.status-ativo {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.status-badge.status-inativo {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    font-weight: 600;
}

.badge-vencida {
    background: #dc2626;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.row-vencida {
    background-color: #fef2f2 !important;
}

.row-vencida:hover {
    background-color: #fee2e2 !important;
}

.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
}

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

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2001;
}

.modal.active {
    display: block;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

/* Notification Templates */
.notification-templates {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.template-card {
    padding: 2rem;
    background: var(--light);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-5px);
}

.template-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

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

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


    .search-box {
        width: 200px;
    }

    .dashboard-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.plan-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.plan-featured {
    border-color: var(--primary);
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

.plan-featured::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}

.plan-featured .plan-header h3,
.plan-featured .plan-title h3,
.plan-featured .plan-order,
.plan-featured .plan-price,
.plan-featured .plan-description,
.plan-featured .plan-limit,
.plan-featured .plan-features {
    color: white;
}

.plan-featured .plan-order {
    background: rgba(255, 255, 255, 0.2);
}

.plan-header {
    margin-bottom: 1rem;
}

.plan-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.plan-badge {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge-premium {
    background: var(--warning);
}

.plan-featured .plan-badge {
    background: rgba(255,255,255,0.3);
    color: white;
}

.plan-price {
    text-align: center;
    margin: 1.5rem 0;
    font-weight: 700;
}

.plan-price .currency {
    font-size: 1.5rem;
    vertical-align: top;
}

.plan-price .amount {
    font-size: 3rem;
}

.plan-price .period {
    font-size: 1rem;
    color: var(--gray);
    font-weight: 400;
}

.plan-featured .plan-price .period {
    color: rgba(255,255,255,0.8);
}

.plan-description {
    text-align: center;
    color: var(--gray);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.plan-limit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.plan-featured .plan-limit {
    background: rgba(255,255,255,0.2);
    color: white;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex-grow: 1;
}

.plan-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.plan-featured .plan-features li {
    border-bottom-color: rgba(255,255,255,0.2);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features i {
    color: var(--success);
    font-size: 0.9rem;
}

.plan-featured .plan-features i {
    color: rgba(255,255,255,0.9);
}

.plan-card .btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: auto;
}

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

.plan-featured .btn-primary:hover {
    background: var(--light);
    color: var(--primary-dark);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

.modal-header h2 {
    margin: 0;
    color: var(--dark);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.3s;
}

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

.modal-body {
    margin: 1.5rem 0;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Plans Management */
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.plans-stats {
    display: flex;
    gap: 1rem;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-badge i {
    font-size: 1rem;
}

.stat-badge.stat-active {
    color: var(--success);
}

.stat-badge.stat-active i {
    color: var(--success);
}

.stat-badge.stat-inactive {
    color: var(--warning);
}

.stat-badge.stat-inactive i {
    color: var(--warning);
}

.plans-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.plan-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.plan-order {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray);
    background: var(--light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.plan-inactive {
    opacity: 0.6;
    filter: grayscale(50%);
    position: relative;
}

.plan-inactive::after {
    content: 'INATIVO';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gray);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.plan-badge-inactive {
    background: var(--gray) !important;
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.modal-large {
    max-width: 800px !important;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

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

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

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

input[type="color"] {
    height: 40px;
    padding: 0.25rem;
}

/* Plan Card Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plan-card {
    animation: slideInUp 0.5s ease-out;
}

.plan-card:nth-child(1) { animation-delay: 0.1s; }
.plan-card:nth-child(2) { animation-delay: 0.2s; }
.plan-card:nth-child(3) { animation-delay: 0.3s; }
.plan-card:nth-child(4) { animation-delay: 0.4s; }
.plan-card:nth-child(5) { animation-delay: 0.5s; }

.plan-badge {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive Grid Improvements */
@media (max-width: 1200px) {
    .plans-cards {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .plans-toolbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .plans-stats {
        width: 100%;
        justify-content: center;
    }
    
    .plans-cards {
        grid-template-columns: 1fr;
    }
}

/* Tenant Details Modal */
.tenant-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-section {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 8px;
}

.detail-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-grid > div {
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
}

.detail-grid strong {
    color: var(--gray);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
}

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

/* Tenants Grid - Cards Layout Horizontal */
.tenants-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.tenant-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.tenant-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-left-width: 6px;
}

.tenant-card.status-ativo {
    border-left-color: var(--success);
}

.tenant-card.status-suspenso {
    border-left-color: var(--warning);
}

.tenant-card.status-inativo {
    border-left-color: var(--gray);
}

.tenant-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
}

.tenant-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.tenant-card.status-ativo .tenant-icon {
    background: linear-gradient(135deg, var(--success), #22c55e);
    box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}

.tenant-card.status-suspenso .tenant-icon {
    background: linear-gradient(135deg, var(--warning), #fb923c);
    box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}

.tenant-card.status-inativo .tenant-icon {
    background: linear-gradient(135deg, var(--gray), #94a3b8);
    box-shadow: 0 2px 8px rgba(100,116,139,0.25);
}

.tenant-info {
    flex: 1;
    min-width: 0;
}

.tenant-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tenant-cnpj {
    font-size: 0.8rem;
    color: var(--gray);
    font-family: 'Courier New', monospace;
}

.tenant-status-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.tenant-status-badge.ativo {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.tenant-status-badge.suspenso {
    background: linear-gradient(135deg, #fed7aa, #fbbf24);
    color: #78350f;
}

.tenant-status-badge.inativo {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

.tenant-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 2rem;
    align-items: center;
}

.tenant-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tenant-detail-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}

.tenant-detail-item i {
    width: 18px;
    text-align: center;
    color: var(--primary);
    font-size: 0.9rem;
}

.tenant-detail-value {
    color: var(--dark);
    font-weight: 500;
}

.tenant-subscription {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border-left: 3px solid var(--primary);
    min-width: 200px;
}

.tenant-subscription-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.tenant-subscription-plan {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tenant-subscription-plan i {
    color: var(--primary);
    font-size: 0.85rem;
}

.tenant-subscription-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.tenant-subscription-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray);
}

.tenant-subscription-date {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tenant-subscription-date i {
    font-size: 0.7rem;
}

.tenant-subscription-date.vencida {
    color: var(--danger);
    font-weight: 600;
}

.tenant-db-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tenant-db-status.conectado {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.tenant-db-status.desconectado {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.tenant-db-status i {
    font-size: 0.75rem;
}

.tenant-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: fit-content;
}

.tenant-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: auto;
}

.tenant-actions .btn i {
    font-size: 0.85rem;
}

.tenant-actions .btn:hover {
    transform: scale(1.05);
}

.tenant-no-subscription {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border-left: 3px solid var(--warning);
    text-align: center;
    color: #78350f;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 200px;
}

/* Responsive - Cards viram verticais em telas menores */
@media (max-width: 1200px) {
    .tenant-card {
        grid-template-columns: auto 1fr;
        gap: 1rem;
    }
    
    .tenant-content {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tenant-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .tenant-card {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .tenant-header {
        min-width: auto;
    }
    
    .tenant-content {
        gap: 0.75rem;
    }
    
    .tenant-actions .btn {
        flex: 1;
        min-width: 100px;
    }

/* Modal de Assinatura */
.subscription-step {
    padding: 1.5rem 0;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.plan-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plan-option:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.plan-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0f4ff, #e0e7ff);
    box-shadow: 0 8px 20px rgba(99,102,241,0.2);
}

.plan-option h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.plan-option .plan-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.75rem 0;
}

.plan-option .plan-price span {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 400;
}

.plan-option .plan-features {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.75rem;
    line-height: 1.6;
}

.selected-plan-info {
    background: linear-gradient(135deg, #f0f4ff, #e0e7ff);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.selected-plan-info h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-plan-info p {
    color: var(--dark);
    margin: 0.25rem 0;
}

/* Badge simples para status do banco de dados */
.db-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.7rem;
}

.db-badge.conectado {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

.db-badge.desconectado {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

/* Grid de 3 colunas para formulário compacto */
.form-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
}

/* Modal mais largo */
.modal-wide {
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
}

.modal-wide .modal-body {
    max-height: calc(90vh - 140px);
    overflow-y: auto;
}

@media (max-width: 1200px) {
    .form-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal-wide {
        max-width: 800px;
    }
}

@media (max-width: 768px) {
    .form-grid-3col {
        grid-template-columns: 1fr;
    }
    .modal-wide {
        max-width: 95%;
        width: 95%;
    }
}

/* Integrações - Badges e Status */
.integration-info p { margin: 0.75rem 0; line-height: 1.6; }
.integration-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.webhook-url { 
    display: block; 
    padding: 0.75rem; 
    background: #1e293b; 
    color: #10b981; 
    border-radius: 6px; 
    font-family: monospace; 
    font-size: 0.85rem; 
    margin: 0.5rem 0;
    overflow-x: auto;
}
.mt-4 { margin-top: 2rem; }

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.settings-tab-content {
    display: none;
}

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

/* Template Editor */
.templates-section h3 {
    margin-bottom: 1rem;
}

.template-editor-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.template-editor-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.template-header h4 {
    margin: 0;
    color: var(--dark);
    font-size: 1.125rem;
}

.template-trigger {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.template-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.template-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    resize: vertical;
}

.template-textarea:focus,
.template-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Automation Items */
.automation-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.automation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.automation-header h4 {
    margin: 0;
    font-size: 1rem;
}

.automation-item p {
    margin: 0;
    color: var(--gray);
    font-size: 0.875rem;
    margin-left: 3.5rem;
}

/* 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: #cbd5e1;
    transition: 0.4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success);
}

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


/* Botão Menu Mobile */
    }
}

/* Botão apenas com ícone */
.btn-icon-only {
    width: 45px;
    height: 45px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-icon-only:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.page-header .btn-icon-only {
    position: absolute;
    right: 0;
}
