:root {
    --primary: #00a884; /* WhatsApp Brand Green */
    --primary-dark: #008069;
    --secondary: #53bdeb;
    --accent: #00a884;
    --background: #ffffff; /* White 70% component */
    --surface: #f0f2f5; 
    --surface-border: #e9edef;
    --text: #111b21; /* Black 10% component */
    --text-muted: #667781;
    --success: #00a884;
    --danger: #ea0038;
    --warning: #ffbc2c;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(11, 27, 33, 0.1);
    --shadow: 0 12px 24px rgba(11, 27, 33, 0.08);
}

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

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #00806915, #f0f2f5), 
                url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 56c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-2-74c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm34 5c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-56 57c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm56 24c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-45-70c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm23 10c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z'/%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 3rem;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.gradient-text {
    color: var(--primary);
    display: inline-block;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-field {
    width: 100%;
    background: #ffffff; /* White component */
    border: 1px solid var(--surface-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 168, 132, 0.1);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.input-wrapper .input-field {
    padding-left: 2.75rem;
}

.input-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(0, 168, 132, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    background-color: #33e073;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

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

.btn-secondary {
    background-color: var(--surface-border);
    color: var(--text);
}

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

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

.btn-sm {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    width: auto;
}

/* Navbar navigation items styling */
.navbar {
    position: sticky;
    top: 1.25rem;
    z-index: 100;
    margin: 1.25rem 2rem 3.5rem;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 5rem;
    box-shadow: 0 10px 40px rgba(11, 27, 33, 0.06);
    transition: all 0.3s ease;
}

@media (min-width: 1200px) {
    .navbar {
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.6rem 1.1rem;
    border-radius: 5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(0, 168, 132, 0.05);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(0, 168, 132, 0.1);
}

.nav-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

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

.stat-card {
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
}

.stat-val {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
    color: var(--primary);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.1); color: var(--success); border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Campaign Filter Bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--surface-border);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 168, 132, 0.05);
}

.campaign-card {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border: 1px solid var(--surface-border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.campaign-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.campaign-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.campaign-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.campaign-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: #d1d7db; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #8696a0; }

/* Mobile Bottom Navigation (Hidden on Desktop) */
.mobile-nav {
    display: none;
}

/* Mobile Utility */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }
    .navbar {
        margin: 0.75rem 1rem 2rem;
        padding: 0.6rem 1.25rem;
        background: rgba(255, 255, 255, 0.8);
    }
    
    .nav-group {
        display: none;
    }

    .mobile-nav {
        display: flex;
        position: fixed !important;
        bottom: 0 !important;
        left: 0;
        right: 0;
        padding: 0.6rem 0.5rem calc(1.75rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border-top: 1px solid rgba(0,0,0,0.05);
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.04);
    }

    .mobile-nav-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
        color: var(--text-muted);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .mobile-nav-link i {
        font-size: 1.35rem;
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .mobile-nav-link.active {
        color: var(--primary);
    }

    .mobile-nav-link.active i {
        transform: scale(1.1) translateY(-2px);
    }
    
    .dashboard-container {
        padding: 1.5rem 1rem 8rem;
    }
    
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem;
    }

    /* Horizontal scroll for quick actions */
    .mobile-actions {
        display: flex;
        overflow-x: auto;
        gap: 1rem;
        padding-bottom: 1rem;
        margin: 0 -1rem; /* Full bleed */
        padding-left: 1rem;
        padding-right: 1rem;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    .mobile-actions::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    .action-card {
        flex: 0 0 140px;
        height: 140px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
        padding: 1.25rem !important;
        font-size: 0.85rem;
        font-weight: 700;
        border-radius: 1.75rem;
        color: var(--text);
        text-decoration: none;
    }

    .action-card i {
        font-size: 1.75rem;
        color: var(--primary);
    }

    .stat-card {
        padding: 1.75rem 1.5rem !important;
        border-radius: 1.5rem;
        border-top: none;
        background: linear-gradient(135deg, #ffffff 0%, #f9fbfc 100%);
        border: 1px solid rgba(0, 168, 132, 0.08);
        position: relative;
        overflow: hidden;
    }

    .stat-card::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 100px;
        height: 100px;
        background: radial-gradient(circle at top right, rgba(0, 168, 132, 0.05), transparent);
        border-radius: 0 0 0 100%;
    }

    .stat-val {
        font-size: 2.5rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        margin: 0.25rem 0;
    }

    header h1 {
        font-size: 1.8rem !important;
        letter-spacing: -0.03em;
    }

    .stat-val {
        font-size: 2.2rem;
        font-weight: 900;
    }

    .input-field {
        font-size: 16px !important; /* Forces iOS not to zoom */
        padding: 0.85rem 1.1rem;
        border-color: #e9edef;
    }

    .btn {
        padding: 0.85rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 1rem;
    }

    /* Table modernization for mobile */
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--surface-border) !important;
        border-radius: 1.25rem;
        padding: 1rem;
        background: #fff;
    }

    td {
        border: none !important;
        padding: 0.5rem 0 !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        font-size: 0.9rem;
    }

    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-hide {
        display: none !important;
    }
}

/* Image Upload Preview Styles */
.upload-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--glass-border);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: var(--glass-bg);
    transition: border-color 0.3s ease;
}

.upload-preview:hover {
    border-color: var(--primary);
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
}

/* --- TOAST NOTIFICATIONS (VELOCITA) --- */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.75rem;
    border-radius: 1.25rem;
    color: #111b21;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 320px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: toast-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
    font-weight: 600;
}

.toast.success { border-left: 6px solid #25D366; }
.toast.error { border-left: 6px solid #ff4757; color: #ff4757; }
.toast.warning { border-left: 6px solid #ffa502; }

.toast i { font-size: 1.25rem; }

@keyframes toast-in {
    from { transform: translateX(120%) scale(0.9); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast.fade-out {
    animation: toast-out 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes toast-out {
    to { transform: translateX(120%) scale(0.8); opacity: 0; }
}

/* --- LIVE VALIDATION INDICATORS --- */
.input-field:focus:invalid {
    border-color: #ff4757 !important;
    box-shadow: 0 0 0 4px rgba(255, 71, 87, 0.1) !important;
}

.input-field:focus:valid:not(:placeholder-shown) {
    border-color: #25D366 !important;
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.1) !important;
}
