:root {
    --bt-primary: #1F5E4B;
    --bt-primary-dark: #174a3b;
    --bt-primary-light: #2a7d65;
    --bt-secondary: #E8D8B5;
    --bt-secondary-dark: #d4c49e;
    --bt-accent: #C85A2E;
    --bt-accent-light: #e06a38;
    --bt-bg: #F7F4ED;
    --bt-text: #2E2E2E;
    --bt-text-muted: #6c757d;
    --bt-sidebar-width: 260px;
    --bt-sidebar-collapsed: 70px;
}

/* Global */
body { background-color: var(--bt-bg); color: var(--bt-text); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
a { color: var(--bt-primary); }
a:hover { color: var(--bt-primary-dark); }

/* Buttons */
.btn-primary { background-color: var(--bt-primary); border-color: var(--bt-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--bt-primary-dark); border-color: var(--bt-primary-dark); }
.btn-primary:active { background-color: var(--bt-primary-dark) !important; border-color: var(--bt-primary-dark) !important; }
.btn-outline-primary { color: var(--bt-primary); border-color: var(--bt-primary); }
.btn-outline-primary:hover { background-color: var(--bt-primary); border-color: var(--bt-primary); }
.btn-accent { background-color: var(--bt-accent); border-color: var(--bt-accent); color: #fff; }
.btn-accent:hover { background-color: var(--bt-accent-light); border-color: var(--bt-accent-light); color: #fff; }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--bt-sidebar-width);
    background: linear-gradient(180deg, var(--bt-primary) 0%, var(--bt-primary-dark) 100%);
    color: #fff; z-index: 1040;
    transition: width 0.3s ease;
    overflow-y: auto; overflow-x: hidden;
}
.sidebar .brand { padding: 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 0.75rem; }
.sidebar .brand img { height: 36px;  }
.sidebar .brand h5 { margin: 0; font-size: 1.1rem; font-weight: 600; white-space: nowrap; }
.sidebar .nav-section { padding: 1rem 0; }
.sidebar .nav-section-title { padding: 0 1rem; margin-bottom: 0.5rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.5; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1rem; color: rgba(255,255,255,0.75);
    font-size: 0.9rem; text-decoration: none;
    transition: all 0.2s ease; border-left: 3px solid transparent;
}
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,0.15); border-left-color: var(--bt-accent); }
.sidebar .nav-link i { font-size: 1.1rem; width: 24px; text-align: center; }

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

/* Top Bar */
.topbar {
    background: #fff; border-bottom: 1px solid #e5e5e5;
    padding: 0.75rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 1030;
}
.topbar .sidebar-toggle { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--bt-text); padding: 0.25rem; }
.topbar .user-menu { display: flex; align-items: center; gap: 1rem; }
.topbar .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bt-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.85rem;
}

/* Cards */
.card { border: none; border-radius: 0.75rem; }
.card.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; }
.stat-card { border-left: 4px solid var(--bt-primary); }
.stat-card.accent { border-left-color: var(--bt-accent); }
.stat-card.success { border-left-color: #198754; }
.stat-card.info { border-left-color: #0dcaf0; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--bt-text); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--bt-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-icon { font-size: 2rem; opacity: 0.3; }

/* Tables */
.table { font-size: 0.9rem; }
.table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bt-text-muted); border-bottom: 2px solid #dee2e6; }

/* Status Badges */
.badge-draft { background-color: #6c757d; }
.badge-scheduled { background-color: #0dcaf0; color: #000; }
.badge-sending { background-color: #ffc107; color: #000; }
.badge-sent { background-color: #198754; }
.badge-sent_with_errors { background-color: #fd7e14; }
.badge-paused { background-color: #fd7e14; }
.badge-cancelled { background-color: #dc3545; }
.badge-subscribed { background-color: #198754; }
.badge-unsubscribed { background-color: #dc3545; }
.badge-pending { background-color: #ffc107; color: #000; }
.badge-cleaned { background-color: #6c757d; }
.badge-active { background-color: #198754; }
.badge-inactive { background-color: #6c757d; }

/* Login Layout */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bt-primary) 0%, var(--bt-primary-dark) 40%, #0f3d2f 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.login-bg::before {
    content: ''; position: absolute; top: -50%; right: -50%;
    width: 100%; height: 200%;
    background: radial-gradient(ellipse, rgba(200,90,46,0.15) 0%, transparent 70%);
    animation: loginGlow 8s ease-in-out infinite alternate;
}
@keyframes loginGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, 5%); }
}
.login-card {
    background: #fff; border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%; max-width: 420px;
    padding: 2.5rem; position: relative; z-index: 1;
}
.login-card .brand-logo { text-align: center; margin-bottom: 2rem; }
.login-card .brand-logo img { height: 48px; }
.login-card .brand-logo h4 { margin-top: 0.5rem; color: var(--bt-primary); font-weight: 700; }

/* Admin sidebar */
.sidebar.admin-sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}
.sidebar.admin-sidebar .nav-link.active { border-left-color: #e94560; }

/* Flash Messages */
.flash-message {
    position: fixed; top: 4rem; right: 1.5rem; z-index: 9999;
    min-width: 320px; max-width: 480px;
    animation: slideIn 0.3s ease-out;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Breadcrumbs */
.breadcrumb { font-size: 0.85rem; margin-bottom: 0.5rem; }
.breadcrumb-item a { text-decoration: none; }

/* Page headers */
.container-fluid h2 i { opacity: 0.7; }

/* DataTables overrides */
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--bt-primary) !important; color: #fff !important; border-color: var(--bt-primary) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--bt-secondary) !important; border-color: var(--bt-secondary) !important; }

/* Landing Page */
.landing-hero {
    min-height: 90vh; display: flex; align-items: center;
    background: linear-gradient(135deg, var(--bt-primary) 0%, var(--bt-primary-dark) 100%);
    color: #fff; position: relative; overflow: hidden;
}
.landing-hero::after {
    content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
    height: 80px; background: var(--bt-bg);
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
}
.landing-hero h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.1; }
.landing-hero .lead { font-size: 1.25rem; opacity: 0.9; }
.landing-section { padding: 5rem 0; }
.landing-section:nth-child(even) { background: #fff; }
.feature-card {
    text-align: center; padding: 2rem;
    border-radius: 1rem; transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff; height: 100%;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.feature-card .feature-icon { font-size: 2.5rem; color: var(--bt-primary); margin-bottom: 1rem; }
.pricing-card { text-align: center; padding: 2rem; border-radius: 1rem; background: #fff; transition: transform 0.3s ease; }
.pricing-card:hover { transform: translateY(-5px); }
.pricing-card.featured { border: 2px solid var(--bt-accent); position: relative; }
.pricing-card.featured::before {
    content: 'POPULAR'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--bt-accent); color: #fff; padding: 0.2rem 1rem; border-radius: 2rem;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
}
.pricing-card .price { font-size: 3rem; font-weight: 800; color: var(--bt-primary); }
.pricing-card .price span { font-size: 1rem; font-weight: 400; color: var(--bt-text-muted); }

/* Responsive */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .landing-hero h1 { font-size: 2.5rem; }
}

/* Signal animation for landing */
.signal-lines { position: absolute; right: 10%; top: 50%; transform: translateY(-50%); }
.signal-line {
    width: 200px; height: 200px; border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%; position: absolute;
    animation: signalPulse 3s ease-out infinite;
}
.signal-line:nth-child(2) { animation-delay: 0.5s; }
.signal-line:nth-child(3) { animation-delay: 1s; }
.signal-line:nth-child(4) { animation-delay: 1.5s; }
@keyframes signalPulse {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* Transitions */
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
