:root {
    --primary-color: #008069;
    /* Richer WhatsApp Green */
    --primary-dark: #005c4b;
    --accent-color: #00a884;
    --bg-body: #eff2f5;
    --sidebar-bg: #111b21;
    --sidebar-text: #aebac1;
    --sidebar-active: #202c33;
    --card-bg: #ffffff;
    --text-primary: #111b21;
    --text-secondary: #54656f;
    --border-color: #e9edef;
    --danger-color: #ea0038;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-right: 1px solid #222e35;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    gap: 12px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.brand h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.sb-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #8696a0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 30px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--sidebar-text);
    padding: 12px 16px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: var(--accent-color);
}

.credentials-box {
    background-color: #202c33;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: auto;
}

.form-group-sb {
    margin-bottom: 10px;
}

.form-group-sb label {
    display: block;
    font-size: 11px;
    margin-bottom: 4px;
    color: #8696a0;
}

.form-group-sb input {
    width: 100%;
    background: #111b21;
    border: 1px solid #3c4952;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
}

.form-group-sb input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.save-status {
    font-size: 11px;
    color: var(--accent-color);
    display: block;
    text-align: right;
    margin-top: 4px;
    opacity: 0.8;
}

.sidebar-footer {
    border-top: 1px solid #222e35;
    padding-top: 20px;
    font-size: 12px;
    text-align: center;
    color: #8696a0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Global Styles */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    border: 1px solid var(--border-color);
}

.premium-card {
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.premium-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d7db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.premium-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 128, 105, 0.1);
}

.btn-primary-lg {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-primary-lg:hover {
    background-color: var(--primary-dark);
}

.row {
    display: flex;
    gap: 20px;
}

.col-6 {
    flex: 1;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header-sm {
    background: #f0f2f5;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

.json-code {
    padding: 15px;
    font-family: 'Consolas', monospace;
    font-size: 12px;
    color: #333;
    overflow: auto;
    height: 200px;
    display: block;
}

/* Actions Grid (Status View) */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.action-card:hover {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.icon-lg {
    font-size: 32px;
    color: var(--primary-color);
}

.code-block-lg {
    background: #111b21;
    color: #00ffaa;
    padding: 20px;
    border-radius: 8px;
    overflow: auto;
    margin-top: 12px;
    max-height: 400px;
}

/* Webhooks View */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card-blue {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.info-icon {
    color: #1976d2;
    font-size: 24px;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-row {
    display: flex;
    gap: 20px;
}

.config-item {
    flex: 1;
}

.config-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #54656f;
    margin-bottom: 4px;
}

.config-item input {
    width: 100%;
    padding: 8px;
    background: #fff;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    font-family: monospace;
}

.webhook-table {
    width: 100%;
    border-collapse: collapse;
}

.webhook-table th {
    text-align: left;
    padding: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.webhook-table td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.status-badge {
    background: #dcf8c6;
    color: #075e54;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-content-lg {
    background: #fff;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header-bg {
    background: var(--primary-color);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bg-white-icon {
    color: white;
    margin-right: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

.close-modal:hover {
    opacity: 1;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.code-block-fullscreen {
    flex: 1;
    background: #1e1e1e;
    overflow: auto;
    padding: 20px;
}

.code-block-fullscreen pre code {
    color: #d4d4d4;
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

.flex-align {
    display: flex;
    align-items: center;
}

.mt-4 {
    margin-top: 24px;
}

.text-center {
    text-align: center;
    color: #999;
}
/* Phone Wrapper for DDI */
.phone-wrapper {
    display: flex;
    gap: 10px;
}


/* Status Badges */
.status-pill {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.status-pill.approved { background: #dcf8c6; color: #075e54; }
.status-pill.rejected { background: #fde8e8; color: #c53030; }
.status-pill.pending { background: #feecdc; color: #c05621; }

.mt-4 { margin-top: 24px; }

