@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --whatsapp-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --sidebar-width: 240px;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-size: 0.875rem; /* Compact 14px base font */
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Modern Compact Sidebar Navigation */
.app-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.brand-badge {
    background: var(--whatsapp-gradient);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

.sidebar-menu {
    padding: 12px 10px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 14px 8px 6px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.825rem;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-bottom: 3px;
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: #f1f5f9;
    color: #4f46e5;
}

.sidebar-link.active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}

.sidebar-link.active-whatsapp {
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

.sidebar-link-desc {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 1px;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    flex-shrink: 0;
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
    display: none;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease, width 0.25s ease;
}

.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.main-content {
    padding: 20px 24px;
    flex-grow: 1;
}

/* Page Banner Description Box */
.page-description-banner {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid #6366f1;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.page-description-banner.whatsapp-banner {
    border-left-color: #10b981;
}

.page-banner-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.page-banner-desc {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Modern Cards */
.card-glass {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.card-glass:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-lg);
}

/* Colored Stat Cards */
.stat-card {
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.stat-card.total { 
    background: #f5f3ff; 
    border: 1px solid #ddd6fe;
}

.stat-card.success { 
    background: #ecfdf5; 
    border: 1px solid #a7f3d0;
}

.stat-card.failed { 
    background: #fff1f2; 
    border: 1px solid #fecdd3;
}

.stat-card-num {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 4px;
}

/* Progress Bar */
.progress-container {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--border-color);
}

.progress-bar-custom {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #10b981, #6366f1);
    transition: width 0.3s ease;
}

/* Tables Modern Styling */
.table-custom {
    color: var(--text-primary);
    vertical-align: middle;
    font-size: 0.85rem;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
}

.table-custom td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Form Controls */
.form-control, .form-select {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12) !important;
}

.per-page-select {
    min-width: 120px !important;
    padding-right: 2.25rem !important;
    font-size: 0.825rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    cursor: pointer;
}

.input-group-text {
    background-color: #ffffff !important;
    border-color: var(--border-color) !important;
    color: #64748b !important;
    font-size: 0.85rem;
    padding: 8px 12px;
}

/* Buttons */
.btn-primary-gradient {
    background: var(--primary-gradient);
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary-gradient:hover {
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    color: #ffffff !important;
}

.btn-whatsapp-gradient {
    background: var(--whatsapp-gradient);
    border: none;
    color: #ffffff !important;
    font-weight: 600;
    padding: 9px 18px;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-whatsapp-gradient:hover {
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: #ffffff !important;
}

/* Mobile View Adjustments */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.4);
        backdrop-filter: blur(4px);
        z-index: 1040;
    }
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .top-navbar {
        padding: 8px 12px;
        min-height: 52px;
    }
    .top-navbar .btn-sm {
        padding: 4px 8px;
    }
    .main-content {
        padding: 14px 12px;
    }
    .stat-card-num {
        font-size: 1.35rem;
    }
}

@media (max-width: 575.98px) {
    .w-sm-auto {
        width: 100% !important;
    }
    .btn-sm {
        padding: 7px 12px;
        font-size: 0.8rem;
    }
    .page-description-banner {
        padding: 12px 14px;
        border-radius: 10px;
    }
    .page-banner-title {
        font-size: 1.05rem;
    }
    .page-banner-desc {
        font-size: 0.775rem;
    }
    .input-group .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .table-custom th, .table-custom td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

