/* =============================================
   Admark CRM — Admin Styles v2.0.0
   ============================================= */

/* ---- Layout wrapper ---- */
.wats-wrap {
    max-width: 1200px;
}

/* ---- Header ---- */
.wats-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 0;
    padding-bottom: 4px;
}
.wats-header h1 {
    margin: 0;
    padding: 0;
    font-size: 24px;
    color: #1d2327;
}
.wats-header-icon {
    font-size: 30px !important;
    color: #25d366;
    width: 30px !important;
    height: 30px !important;
}
.wats-version {
    background: #25d366;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .5px;
}

/* ---- Navigation Tabs ---- */
.wats-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #25d366;
    margin: 16px 0 20px;
}
.wats-nav-tab {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #50575e;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    transition: background .15s, color .15s;
}
.wats-nav-tab:hover {
    background: #e4f5eb;
    color: #155724;
}
.wats-nav-tab-active {
    background: #fff;
    color: #155724;
    border-color: #25d366;
    border-bottom-color: #fff;
    font-weight: 700;
}

/* ---- Stats Bar ---- */
.wats-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.wats-stat-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-left: 4px solid #25d366;
    border-radius: 6px;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}
.wats-stat-label {
    font-size: 12px;
    color: #646970;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.wats-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #25d366;
    line-height: 1;
}
.wats-stat-value.wats-stat-small {
    font-size: 16px;
    color: #1d2327;
    word-break: break-all;
}
.wats-stat-range {
    flex: 1;
    min-width: 320px;
}
.wats-range-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.wats-range-form input[type="date"] {
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
}
.wats-range-sep {
    color: #aaa;
    font-size: 16px;
}
.wats-range-count {
    background: #25d366;
    color: #fff;
    font-size: 18px;
    padding: 2px 12px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

/* ---- Cards ---- */
.wats-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px 24px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.wats-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 16px;
    padding: 0 0 10px;
    border-bottom: 1px solid #f0f0f1;
}

/* ---- Select / Input ---- */
.wats-select {
    min-width: 260px;
    max-width: 100%;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #1d2327;
}
.wats-select:focus {
    border-color: #25d366;
    outline: 2px solid rgba(37,211,102,.2);
}

/* ---- Primary Button ---- */
.wats-btn-primary.button-primary,
.wats-btn-primary {
    background: #25d366 !important;
    border-color: #1eba55 !important;
    color: #fff !important;
    box-shadow: 0 1px 0 #1eba55 !important;
}
.wats-btn-primary.button-primary:hover {
    background: #1eba55 !important;
}

/* ---- Automation Flow Diagram ---- */
.wats-flow-diagram {
    background: linear-gradient(135deg, #e4f5eb 0%, #f9fffe 100%);
    border-color: #25d366;
}
.wats-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 0 8px;
}
.wats-flow-step {
    background: #fff;
    border: 1.5px solid #25d366;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #155724;
    white-space: nowrap;
}
.wats-flow-arrow {
    color: #25d366;
    font-size: 18px;
    font-weight: 700;
}

/* ---- Automation Cards ---- */
.wats-automation-card {
    transition: border-color .2s, box-shadow .2s;
}
.wats-automation-card.wats-event-enabled {
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37,211,102,.12);
}
.wats-automation-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.wats-automation-meta {
    flex: 1;
}
.wats-automation-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
}
.wats-automation-desc {
    margin: 0;
    font-size: 13px;
    color: #646970;
}
.wats-automation-body {
    padding-left: 64px;
}
.wats-field-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
    margin-bottom: 6px;
}
.wats-placeholder-hint {
    font-weight: 400;
    color: #646970;
    font-size: 12px;
    margin-left: 8px;
    background: #f0f0f1;
    padding: 1px 6px;
    border-radius: 3px;
}

/* ---- Toggle Switch ---- */
.wats-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
}
.wats-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.wats-toggle-slider {
    position: absolute;
    inset: 0;
    background: #c3c4c7;
    border-radius: 26px;
    transition: background .2s;
}
.wats-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.wats-toggle input:checked + .wats-toggle-slider {
    background: #25d366;
}
.wats-toggle input:checked + .wats-toggle-slider::before {
    transform: translateX(22px);
}

/* ---- Message Templates Grid ---- */
.wats-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.wats-template-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
}
.wats-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,211,102,.15);
}
.wats-template-card-header {
    background: #25d366;
    padding: 12px 16px;
    color: #fff;
}
.wats-template-card-header h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.wats-template-placeholders {
    font-size: 11px;
    opacity: .85;
    font-style: italic;
}
.wats-whatsapp-bubble {
    background: #dcf8c6;
    margin: 14px;
    padding: 12px 14px;
    border-radius: 0 12px 12px 12px;
    font-size: 13px;
    line-height: 1.6;
    color: #1d2327;
    flex: 1;
    position: relative;
    border: 1px solid #c3e6a8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    white-space: pre-line;
}
.wats-whatsapp-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid #dcf8c6;
    border-left: 8px solid transparent;
}
.wats-template-trigger {
    margin: 0;
    padding: 10px 14px 12px;
    font-size: 12px;
    color: #646970;
    border-top: 1px solid #f0f0f1;
    background: #fafafa;
}

/* ---- Responsive ---- */
@media (max-width: 782px) {
    .wats-stats-bar {
        flex-direction: column;
    }
    .wats-automation-body {
        padding-left: 0;
    }
    .wats-templates-grid {
        grid-template-columns: 1fr;
    }
    .wats-flow {
        flex-direction: column;
        align-items: flex-start;
    }
    .wats-flow-arrow {
        transform: rotate(90deg);
    }
}
