/* Limy Agent Analytics — Admin styles */

/* ── Custom font ───────────────────────────────────────────────────── */

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

.wrap .laa-section,
.wrap .laa-section *,
.wrap > h1 {
    font-family: 'DM Sans', system-ui, sans-serif;
}

/* ── Page title ────────────────────────────────────────────────────── */

.wrap > h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 28px;
}

/* ── Section cards ─────────────────────────────────────────────────── */

.laa-section {
    background: #fff;
    border: none;
    border-radius: 16px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.laa-section--connection { border-top: 4px solid #6366f1; }
.laa-section--filtering  { border-top: 4px solid #14b8a6; }
.laa-section--monitor    { border-top: 4px solid #f97316; }

.laa-section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 28px 32px 16px;
    flex-wrap: wrap;
}

.laa-section-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.laa-section-header .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    position: relative;
    top: 2px;
}

.laa-section--connection .dashicons { color: #6366f1; }
.laa-section--filtering .dashicons  { color: #14b8a6; }
.laa-section--monitor .dashicons    { color: #f97316; }

.laa-section-desc {
    flex-basis: 100%;
    margin: 4px 0 0 30px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 400;
}

.laa-section-body {
    padding: 4px 32px 32px;
}

/* ── Form fields ───────────────────────────────────────────────────── */

.laa-section-body .form-table th {
    width: 200px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    padding-top: 22px;
}

.laa-section-body .form-table td {
    padding-top: 22px;
}

.laa-section-body .form-table .description {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

.laa-section-body .form-table input[type="text"],
.laa-section-body .form-table input[type="url"],
.laa-section-body .form-table input[type="number"],
.laa-section-body .form-table textarea {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: #1e293b;
    transition: border-color 0.15s;
}

.laa-section-body .form-table input:focus,
.laa-section-body .form-table textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

/* ── Save button override ──────────────────────────────────────────── */

.wrap .submit .button-primary {
    background: #6366f1;
    border-color: #6366f1;
    border-radius: 8px;
    padding: 8px 28px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-shadow: none;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
    transition: all 0.15s;
}

.wrap .submit .button-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* ── Gap between form and monitor ──────────────────────────────────── */

.wrap > form + .laa-section {
    margin-top: 36px;
}

/* ── API key display ───────────────────────────────────────────────── */

.laa-key-display {
    display: inline-block;
    padding: 6px 14px;
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 13px;
    letter-spacing: 2px;
    color: #4338ca;
}

/* ── Metrics grid ──────────────────────────────────────────────────── */

.laa-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.laa-metric-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.laa-metric-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.laa-metric-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* ── Status dots ───────────────────────────────────────────────────── */

.laa-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.laa-dot--green  { background: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2); }
.laa-dot--yellow { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.laa-dot--red    { background: #f97316; box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2); }

/* ── Error banner ──────────────────────────────────────────────────── */

.laa-error-banner {
    padding: 14px 18px;
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 13px;
    color: #9a3412;
}

.laa-error-banner strong {
    font-weight: 700;
}

.laa-error-banner small {
    color: #c2410c;
}

/* ── Action buttons ────────────────────────────────────────────────── */

.laa-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.laa-actions .button {
    border-radius: 8px;
    padding: 7px 20px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    background: #fff;
    transition: all 0.15s;
}

.laa-actions .button:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}

.laa-actions .button-link-delete {
    border-color: #fecaca;
    color: #dc2626;
    background: #fef2f2;
}

.laa-actions .button-link-delete:hover {
    border-color: #dc2626;
    background: #fee2e2;
    color: #991b1b;
}

/* ── Feedback toast ────────────────────────────────────────────────── */

.laa-feedback {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}

.laa-feedback--ok {
    background: #f0fdfa;
    border: 1.5px solid #99f6e4;
    color: #115e59;
}

.laa-feedback--fail {
    background: #fff7ed;
    border: 1.5px solid #fed7aa;
    color: #9a3412;
}

/* ── Section h3 dividers ───────────────────────────────────────────── */

.laa-section-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    margin-top: 28px;
    margin-bottom: 10px;
    padding-top: 20px;
    border-top: 1.5px solid #f1f5f9;
}

/* ── Checkboxes ────────────────────────────────────────────────────── */

.laa-section-body fieldset label {
    font-size: 13px;
    color: #475569;
    padding: 4px 0;
    display: inline-block;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media screen and (max-width: 782px) {
    .laa-section-header {
        padding: 20px;
    }

    .laa-section-body {
        padding: 4px 20px 20px;
    }

    .laa-section-body .form-table th {
        width: auto;
    }

    .laa-section-desc {
        margin-left: 0;
    }

    .laa-metrics-grid {
        grid-template-columns: 1fr;
    }

    .laa-metric-value {
        font-size: 22px;
    }

    .laa-actions {
        flex-direction: column;
    }
}
