/* ===========================
   SISTEMA SAS - CSS GLOBAL
   =========================== */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #1e40af;
    --success-color: #5cb85c;
    --warning-color: #f0ad4e;
    --danger-color: #d9534f;
    --info-color: #5bc0de;
    --dark-bg: #1e3a5f;
    --card-bg: #ffffff;
    --light-bg: #f5f7fa;
    --text-dark: #2d3748;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --sidebar-width: 90px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   PÁGINA DE LOGIN
   =========================== */

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-box .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: var(--text-dark);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 143, 0.1);
}

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

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

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(30, 58, 143, 0.2);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 58, 143, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 2px 4px rgba(92, 184, 92, 0.2);
}

.btn-success:hover {
    background: #4cae4c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(92, 184, 92, 0.3);
}

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

.btn-warning:hover {
    background-color: #d97706;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

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

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-full {
    width: 100%;
}

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

/* ===========================
   LAYOUT COM SIDEBAR
   =========================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    color: var(--dark-bg);
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    border-right: 1px solid var(--border-color);
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-header .user-info {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    margin-bottom: 0;
}

.sidebar-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 11px;
    gap: 6px;
}

.sidebar-menu a:hover {
    background: rgba(30, 58, 143, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-menu a.active {
    background: rgba(30, 58, 143, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-menu a .icon {
    margin-right: 0;
    font-size: 1.5rem;
}

.sidebar-menu a .icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    background: var(--light-bg);
    min-height: 100vh;
}

.page-header {
    background: #ffffff;
    padding: 24px 32px;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* ===========================
   CARDS
   =========================== */

.card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
}

.card-body {
    padding: 0;
}

/* ===========================
   STAT CARDS
   =========================== */

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

.stat-card {
    background: #ffffff;
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s ease;
    position: relative;
}

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

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

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

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.stat-card .stat-info {
    font-size: 0.8rem;
    color: var(--text-light);
}

.stat-card .stat-info {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* ===========================
   TABLES
   =========================== */

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
}

table thead {
    background: #f8fafc;
}

table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    font-size: 14px;
}

table tbody tr {
    transition: all 0.15s ease;
}

table tbody tr:hover {
    background: #f8fafc;
}

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

.table-actions {
    display: flex;
    gap: 8px;
}

/* ===========================
   BADGES
   =========================== */

.badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    border: none;
}

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

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

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

.badge-danger {
    background: #e91e63;
    color: white;
}

.badge-secondary {
    background: #e2e8f0;
    color: var(--text-dark);
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius-md);
    max-width: 640px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

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

.modal-body {
    margin-bottom: 20px;
}

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

/* ===========================
   GRIDS & UTILITIES
   =========================== */

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

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

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

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

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

.text-muted {
    color: var(--text-light);
}

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

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

/* ===========================
   ALERTS
   =========================== */

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* ===========================
   LOADING & ANIMATIONS
   =========================== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   SUBSCRIPTION CARDS (NOVO ESTILO)
   =========================== */

.subscription-title {
    text-align: center;
    margin-bottom: 40px;
}

.subscription-title h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.4;
}

.subscription-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px 0;
}

.subscription-card {
    background: #ffffff;
    border-radius: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.subscription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    transition: height 0.3s ease;
}

.subscription-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.subscription-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

/* Cores dos cards */
.card-green {
    border: 3px solid #00d4aa;
}

.card-green::before {
    background: #00d4aa;
}

.card-blue {
    border: 3px solid #0095ff;
}

.card-blue::before {
    background: #0095ff;
}

.card-dark {
    border: 3px solid #1e3a5f;
}

.card-dark::before {
    background: #1e3a5f;
}

/* Preço */
.subscription-price {
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.subscription-price .price-symbol {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 8px;
}

.subscription-price .price-value {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

/* Features */
.subscription-features {
    list-style: none;
    padding: 0;
    margin: 0 0 35px 0;
    text-align: left;
}

.subscription-features li {
    padding: 12px 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
}

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

/* Botões */
.subscription-btn {
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
}

.subscription-btn .btn-icon {
    font-size: 1.3rem;
}

.btn-green {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.btn-green:hover {
    background: linear-gradient(135deg, #00b894 0%, #009d7d 100%);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.5);
    transform: scale(1.02);
}

.btn-blue {
    background: linear-gradient(135deg, #0095ff 0%, #0077cc 100%);
    box-shadow: 0 4px 15px rgba(0, 149, 255, 0.4);
}

.btn-blue:hover {
    background: linear-gradient(135deg, #0077cc 0%, #0066b3 100%);
    box-shadow: 0 6px 20px rgba(0, 149, 255, 0.5);
    transform: scale(1.02);
}

.btn-dark {
    background: linear-gradient(135deg, #1e3a5f 0%, #152d47 100%);
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.4);
}

.btn-dark:hover {
    background: linear-gradient(135deg, #152d47 0%, #0d1f32 100%);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.5);
    transform: scale(1.02);
}

/* ===========================
   PRICING CARDS
   =========================== */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.pricing-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.pricing-card.featured {
    border-color: #0078d4;
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.featured-badge {
    position: absolute;
    top: 20px;
    right: -35px;
    background: #0078d4;
    color: white;
    padding: 6px 40px;
    font-size: 12px;
    font-weight: 700;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.pricing-header {
    padding: 32px 24px 24px;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
}

.pricing-basic .pricing-header {
    background: linear-gradient(135deg, #00d2d3 0%, #00b3b4 100%);
    color: white;
    border-bottom-color: #00b3b4;
}

.pricing-professional .pricing-header {
    background: linear-gradient(135deg, #0078d4 0%, #0062ad 100%);
    color: white;
    border-bottom-color: #0062ad;
}

.pricing-enterprise .pricing-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    border-bottom-color: #1a202c;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pricing-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.pricing-value .currency {
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0.9;
}

.pricing-value .amount {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.pricing-value .period {
    font-size: 1rem;
    opacity: 0.85;
}

.pricing-body {
    padding: 32px 24px;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pricing-features li {
    padding: 12px 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

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

.pricing-features li:hover {
    padding-left: 8px;
    color: var(--primary-color);
}

.pricing-footer {
    padding: 0 24px 32px;
}

.btn-pricing {
    width: 100%;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-pricing-basic {
    background: linear-gradient(135deg, #00d2d3 0%, #00b3b4 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 210, 211, 0.3);
}

.btn-pricing-basic:hover {
    background: linear-gradient(135deg, #00b3b4 0%, #009899 100%);
    box-shadow: 0 6px 20px rgba(0, 210, 211, 0.4);
    transform: translateY(-2px);
}

.btn-pricing-professional {
    background: linear-gradient(135deg, #0078d4 0%, #0062ad 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.btn-pricing-professional:hover {
    background: linear-gradient(135deg, #0062ad 0%, #004c87 100%);
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.4);
    transform: translateY(-2px);
}

.btn-pricing-enterprise {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

.btn-pricing-enterprise:hover {
    background: linear-gradient(135deg, #1a202c 0%, #0f1419 100%);
    box-shadow: 0 6px 20px rgba(45, 55, 72, 0.4);
    transform: translateY(-2px);
}

/* ===========================
   SEGMENTAÇÃO DE CLIENTES
   =========================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
}

.form-section {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    background: white;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.segment-rules {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.segment-rule {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    background: #fafafa;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: slideIn 0.3s ease forwards;
}

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

.segment-rule:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.rule-logic {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logic-btn {
    padding: 8px 16px;
    border: 2px solid #d0d0d0;
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
    color: #666;
}

.logic-btn:hover {
    border-color: var(--primary-color);
    background: #f0f0f0;
}

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

.logic-e.active {
    background: #4a90e2;
    border-color: #4a90e2;
}

.logic-ou.active {
    background: #7b68ee;
    border-color: #7b68ee;
}

.rule-fields {
    display: grid;
    grid-template-columns: 1fr 0.8fr 1fr;
    gap: 12px;
    flex: 1;
}

.rule-field {
    display: flex;
    flex-direction: column;
}

.rule-field label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

.rule-field .form-input,
.rule-field .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.rule-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.action-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.btn-delete {
    background: #e53e3e;
    color: white;
}

.btn-delete:hover {
    background: #c53030;
}

.btn-edit {
    background: #718096;
    color: white;
}

.btn-edit:hover {
    background: #4a5568;
}

.btn-add {
    background: #2d3748;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
}

.btn-add:hover {
    background: #1a202c;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.mt-30 {
    margin-top: 30px;
}

/* ===========================
   ACESSO RÁPIDO A MÓDULOS
   =========================== */

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.quick-access-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    box-shadow: var(--shadow-md);
}

.quick-access-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.quick-access-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.quick-access-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.quick-access-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ===========================
   CAMPANHAS DE COMPRA
   =========================== */

.campaign-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.campaign-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.campaign-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-purple {
    border-left-color: #9333ea;
}

.stat-blue {
    border-left-color: #3b82f6;
}

.stat-green {
    border-left-color: #10b981;
}

.stat-orange {
    border-left-color: #f59e0b;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-dark);
}

.stat-content p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat-change {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-change.positive {
    background: #d1fae5;
    color: #065f46;
}

.stat-change.negative {
    background: #fee2e2;
    color: #991b1b;
}

.campaign-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.chart-placeholder {
    min-height: 300px;
    background: #f9fafb;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.campaign-table th,
.campaign-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.campaign-table th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campaign-table tbody tr {
    transition: background 0.2s ease;
}

.campaign-table tbody tr:hover {
    background: #f9fafb;
}

.link-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-truncate {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.modal-lg {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.generated-link {
    background: #f9fafb;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--primary-color);
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
}

.detail-item label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.detail-item strong {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

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

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

.card-actions {
    display: flex;
    gap: 8px;
}

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

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subscription-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .rule-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .segment-rule {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rule-actions {
        justify-content: center;
    }
    
    .campaign-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .campaign-filters {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

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

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

    .stats-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .table-actions {
        flex-direction: column;
    }
    
    .subscription-cards-wrapper {
        grid-template-columns: 1fr;
    }
    
    .subscription-title h2 {
        font-size: 1.4rem;
    }
    
    .subscription-price .price-value {
        font-size: 3.5rem;
    }
    
    .segment-rule {
        padding: 15px;
    }
    
    .rule-logic {
        flex-direction: row;
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .campaign-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .campaign-filters {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .link-truncate {
        max-width: 150px;
    }
    
    .campaign-table {
        font-size: 0.85rem;
    }
    
    .campaign-table th,
    .campaign-table td {
        padding: 8px;
    }
}
