:root {
    --primary: #075e54;
    --primary-dark: #054c44;
    --primary-light: #128c7e;
    --accent: #25d366;
    --accent-hover: #1ebe57;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: #0f3460;
    --text-light: #f8f9fa;
    --text-muted: #8d99ae;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --border-color: #e9ecef;
    --bg-light: #f5f6fa;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
}
.login-card .logo { text-align: center; margin-bottom: 32px; }
.login-card .logo h2 { color: var(--primary); font-weight: 700; margin: 0; }
.login-card .logo p { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s;
}
.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand h5 { color: #fff; margin: 0; font-size: 16px; font-weight: 600; }
.sidebar-brand small { color: var(--text-muted); font-size: 12px; }
.sidebar-nav { padding: 12px 0; }
.sidebar-nav .nav-section {
    padding: 12px 24px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: #c9d1d9;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--accent);
}
.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 15px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}
.topbar {
    background: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar .page-title { font-size: 18px; font-weight: 600; color: #333; }
.topbar .user-info { display: flex; align-items: center; gap: 12px; }
.topbar .user-info .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}
.content-wrapper { padding: 24px; }

/* Stats Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.stat-icon.bg-primary-soft { background: rgba(7,94,84,0.1); color: var(--primary); }
.stat-icon.bg-success-soft { background: rgba(37,211,102,0.1); color: var(--accent); }
.stat-icon.bg-warning-soft { background: rgba(255,193,7,0.12); color: #e6a800; }
.stat-icon.bg-danger-soft { background: rgba(220,53,69,0.1); color: #dc3545; }
.stat-icon.bg-info-soft { background: rgba(13,202,240,0.1); color: #0dcaf0; }
.stat-icon.bg-purple-soft { background: rgba(111,66,193,0.1); color: #6f42c1; }

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

/* Status Badges */
.badge-status { font-size: 12px; padding: 5px 12px; border-radius: 20px; font-weight: 500; }
.badge-draft { background: #e9ecef; color: #6c757d; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-changes { background: #fde2e2; color: #c0392b; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-scheduled { background: #cce5ff; color: #004085; }
.badge-sending { background: #d1ecf1; color: #0c5460; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-cancelled { background: #e2e3e5; color: #383d41; }
.badge-error { background: #f8d7da; color: #721c24; }

/* Tables */
.table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom-width: 2px;
}
.table td { vertical-align: middle; }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 10px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border-color);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item .timeline-date {
    font-size: 12px;
    color: var(--text-muted);
}
.timeline-item .timeline-text {
    font-size: 14px;
    color: #333;
}

/* Progress bars */
.progress { height: 8px; border-radius: 4px; }
.progress-bar { background: var(--accent); }

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-success {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-success:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.btn-whatsapp {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-whatsapp:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(7,94,84,0.15);
}

/* Alerts */
.alert { border-radius: 10px; border: none; }

/* Mobile */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
}
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
    }
    .sidebar-overlay.show { display: block; }
}
@media (max-width: 576px) {
    .content-wrapper { padding: 16px; }
    .stat-card .stat-value { font-size: 20px; }
}

/* DataTable overrides */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
}

/* Utility */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.cursor-pointer { cursor: pointer; }
.fs-sm { font-size: 13px; }
.rounded-lg { border-radius: 12px; }
