﻿@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --configly-primary: #4f46e5;
    --configly-primary-hover: #4338ca;
    --configly-primary-light: #eef2ff;
    --configly-background: #f1f4f9;
    --configly-border: #e2e8f0;
    --configly-text: #0f172a;
    --configly-muted: #64748b;
}

html,
body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--configly-background);
    color: var(--configly-text);
}

.page {
    min-height: 100vh;
}

    .page > main {
        min-width: 0;
        overflow-y: auto;
    }

/* MENU */

.configly-sidebar {
    position: relative;
    width: 240px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--configly-border);
    flex-shrink: 0;
    overflow: hidden;
}

.configly-sidebar-vanta {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.1;
}

.configly-brand,
.configly-nav,
.configly-sidebar-footer {
    position: relative;
    z-index: 1;
}

.configly-brand {
    height: 72px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-bottom: 1px solid var(--configly-border);
}

.configly-logo {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient( 135deg, var(--configly-primary), #7c3aed );
    color: white;
}

.configly-brand-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.configly-brand-subtitle {
    font-size: 10px;
    color: #94a3b8;
}

.configly-nav {
    padding: 16px 12px;
    gap: 3px;
}

    .configly-nav .nav-link {
        color: #64748b;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 9px;
        font-size: 14px;
        font-weight: 500;
        transition: .15s ease;
    }

        .configly-nav .nav-link:hover {
            background: #f8fafc;
            color: #0f172a;
        }

        .configly-nav .nav-link.active {
            background: var(--configly-primary-light);
            color: var(--configly-primary);
        }

.nav-icon {
    width: 18px;
    text-align: center;
}

.configly-chat-dot {
    width: 7px;
    height: 7px;
    background: var(--configly-primary);
    border-radius: 50%;
}

.configly-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--configly-border);
    font-size: 12px;
    color: #64748b;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 7px 0;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

/* CHAT */

.configly-chat-page {
    height: 100vh;
    display: flex;
    background: var(--configly-background);
}

.configly-chat-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.configly-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.chat-bubble {
    max-width: 75%;
    padding: 11px 15px;
    border-radius: 16px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}

.chat-bubble-user {
    background: var(--configly-primary);
    color: white;
    border-top-right-radius: 4px;
}

.chat-bubble-agent {
    background: white;
    border: 1px solid var(--configly-border);
    border-top-left-radius: 4px;
}

.configly-agent-avatar {
    width: 29px;
    height: 29px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: linear-gradient( 135deg, var(--configly-primary), #7c3aed );
    color: white;
    font-size: 13px;
}

/* ACTION CARD */

.configly-action-card {
    max-width: 850px;
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    border-color: var(--configly-border);
}

    .configly-action-card .card-header {
        background: #f8f9ff;
        border-color: #eef2ff;
        padding: 13px 16px;
    }

.configly-action-item {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

    .configly-action-item:last-child {
        border-bottom: 0;
    }

.action-label {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 3px;
}

.configly-tool {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 5px;
    background: var(--configly-primary-light);
    color: var(--configly-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* INPUT */

.configly-chat-input {
    padding: 16px 22px 18px;
    background: white;
    border-top: 1px solid var(--configly-border);
}

.configly-textarea {
    min-height: 46px;
    max-height: 120px;
    resize: none;
    border-radius: 12px;
}

    .configly-textarea:focus {
        border-color: var(--configly-primary);
        box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
    }

.configly-send-button {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--configly-primary);
    border-color: var(--configly-primary);
}

    .configly-send-button:hover {
        background: var(--configly-primary-hover);
        border-color: var(--configly-primary-hover);
    }

.configly-input-footer {
    margin-top: 8px;
    font-size: 11px;
}

/* RIGHT PANEL */

.configly-context-panel {
    width: 265px;
    flex-shrink: 0;
    padding: 20px 16px;
    background: white;
    border-left: 1px solid var(--configly-border);
    overflow-y: auto;
}

.configly-section-title {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.configly-context-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}

    .configly-context-row:last-child {
        border-bottom: 0;
    }

.configly-tool-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 9px;
    border-radius: 8px;
    color: #64748b;
    font-size: 12px;
}

    .configly-tool-row:hover {
        background: #f8fafc;
    }

.configly-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
    font-size: 12px;
}

.configly-step-number {
    width: 21px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

    .configly-step-number.active {
        background: var(--configly-primary);
        color: white;
    }

/* SCROLLBAR */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* RESPONSIVE */

@media (max-width: 992px) {

    .configly-context-panel {
        display: none;
    }

    .configly-sidebar {
        width: 210px;
    }
}



/* ========================================
   SETTINGS
   ======================================== */

.configly-settings-page {
    padding: 24px;
}

.settings-container {
    width: 100%;
    max-width: 760px;
}

.configly-settings-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 1px 3px rgba(15, 23, 42, .04);
}

    .configly-settings-card .card-header {
        padding: 16px 20px;
        background: #fff;
        border-bottom: 1px solid #f1f5f9;
    }

.settings-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.settings-label {
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
}

.settings-description {
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
}


/* Individual setting row */

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.settings-section {
    padding: 20px;
}

.settings-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 9px;
    font-size: 16px;
}


/* Key value rows */

.settings-value-row {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    border-bottom: 1px solid #f8fafc;
    color: #64748b;
    font-size: 14px;
}

    .settings-value-row:last-child {
        border-bottom: 0;
    }

    .settings-value-row strong {
        color: #0f172a;
        font-weight: 500;
    }


/* Bootstrap switch override */

.configly-switch {
    width: 44px !important;
    height: 24px;
    cursor: pointer;
    border: 0;
    background-color: #e2e8f0;
}

    .configly-switch:checked {
        background-color: var(--configly-primary);
    }

    .configly-switch:focus {
        border-color: transparent;
        box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .12);
    }


/* Accent selector */

.accent-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0;
    background: transparent;
    border: 0;
}

.accent-color {
    width: 38px;
    height: 38px;
    display: block;
    border-radius: 11px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
    outline: 3px solid transparent;
    outline-offset: 3px;
    transition: transform .15s ease, outline-color .15s ease;
}

.accent-option:hover .accent-color {
    transform: scale(1.07);
}

.accent-option.active .accent-color {
    outline-color: var(--accent-outline);
    transform: scale(1.08);
}

.accent-label {
    font-size: 10px;
    font-weight: 500;
}


/* Theme preview */

.settings-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 9px;
}

.configly-preview-button {
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.configly-theme-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.theme-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}


/* Human in the loop */

.approval-message {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 12px;
}


/* Status */

.status-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
}


/* ========================================
   DARK MODE
   ======================================== */

[data-theme="dark"] {
    --configly-background: #0b1220;
    --configly-border: #26324a;
    --configly-text: #f8fafc;
    --configly-muted: #cbd5e1;
}

.configly-logo-dark {
    display: none;
}

[data-theme="dark"] .configly-logo-light {
    display: none;
}

[data-theme="dark"] .configly-logo-dark {
    display: inline-block;
}

[data-theme="dark"] .configly-sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .configly-settings-card,
[data-theme="dark"] .configly-chat-input,
[data-theme="dark"] .chat-bubble-agent,
[data-theme="dark"] .configly-action-card,
[data-theme="dark"] .configly-context-panel,
[data-theme="dark"] .settings-icon,
[data-theme="dark"] .settings-preview {
    background: #111a2e;
    border-color: var(--configly-border);
    color: var(--configly-text);
}

[data-theme="dark"] .configly-brand,
[data-theme="dark"] .configly-sidebar-footer,
[data-theme="dark"] .configly-settings-card .card-header,
[data-theme="dark"] .settings-row,
[data-theme="dark"] .settings-value-row {
    border-color: var(--configly-border);
}

[data-theme="dark"] .configly-brand {
    background: #0b1220;
}

[data-theme="dark"] .configly-nav .nav-link {
    color: var(--configly-muted);
}

    [data-theme="dark"] .configly-nav .nav-link:hover {
        background: #1a2540;
        color: var(--configly-text);
    }

    [data-theme="dark"] .configly-nav .nav-link.active {
        background: rgba(79, 70, 229, .25);
        color: var(--configly-primary);
    }

[data-theme="dark"] .settings-title,
[data-theme="dark"] .settings-label,
[data-theme="dark"] .settings-value-row strong,
[data-theme="dark"] .configly-brand-title {
    color: var(--configly-text);
}

[data-theme="dark"] .settings-description,
[data-theme="dark"] .settings-value-row,
[data-theme="dark"] .configly-brand-subtitle,
[data-theme="dark"] .configly-sidebar-footer {
    color: var(--configly-muted);
}

[data-theme="dark"] .configly-switch {
    background-color: var(--configly-border);
}

[data-theme="dark"] .configly-textarea,
[data-theme="dark"] .form-control {
    background-color: #111a2e;
    border-color: var(--configly-border);
    color: var(--configly-text);
}

    [data-theme="dark"] .configly-textarea::placeholder,
    [data-theme="dark"] .form-control::placeholder {
        color: var(--configly-muted);
    }


/* ========================================
   COURSES
   ======================================== */

.configly-course-card {
    background: #fff;
    border: 1px solid var(--configly-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    transition: box-shadow .15s ease, transform .15s ease;
    cursor: pointer;
    height: 100%;
}

    .configly-course-card:hover {
        box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
        transform: translateY(-1px);
    }

.configly-course-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--configly-primary-light);
    color: var(--configly-primary);
    font-size: 18px;
    margin-bottom: 12px;
}

.configly-course-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--configly-text);
    margin-bottom: 4px;
}

.configly-course-meta {
    font-size: 12px;
    color: var(--configly-muted);
    margin-bottom: 6px;
}

.configly-badge-upcoming {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
}

.configly-schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .15s ease;
}

    .configly-schedule-row:last-child {
        border-bottom: 0;
    }

    .configly-schedule-row:hover {
        background: #f8fafc;
    }

/* Schedule day timeline */
.configly-day-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    padding-bottom: 16px;
}

    .configly-day-step:last-child {
        padding-bottom: 0;
    }

    .configly-day-step::before {
        content: "";
        position: absolute;
        left: 15px;
        top: 34px;
        bottom: 0;
        width: 1px;
        background: var(--configly-border);
    }

    .configly-day-step:last-child::before {
        display: none;
    }

.configly-day-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--configly-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 1;
}

.configly-day-body {
    flex: 1;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
}

.configly-participant-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .15s ease;
}

    .configly-participant-row:last-child {
        border-bottom: 0;
    }

    .configly-participant-row:hover {
        background: #f8fafc;
    }

.configly-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--configly-primary), #7c3aed);
}


/* ========================================
   USERS
   ======================================== */

.configly-user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--configly-border);
    border-radius: 12px;
    padding: 20px;
}

.configly-user-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--configly-primary), #7c3aed);
}

.configly-table-card {
    background: #fff;
    border: 1px solid var(--configly-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

    .configly-table-card table {
        margin-bottom: 0;
    }

    .configly-table-card thead th {
        font-size: 11px;
        font-weight: 600;
        color: var(--configly-muted);
        text-transform: uppercase;
        letter-spacing: .03em;
        border-bottom: 1px solid #f1f5f9;
        background: #f8fafc;
    }

    .configly-table-card tbody tr {
        cursor: pointer;
        transition: background .15s ease;
    }

        .configly-table-card tbody tr:hover {
            background: #f8fafc;
        }

    .configly-table-card td {
        vertical-align: middle;
        font-size: 13px;
        color: var(--configly-text);
    }


/* Dark mode overrides for courses/users */

[data-theme="dark"] .configly-course-card,
[data-theme="dark"] .configly-user-header,
[data-theme="dark"] .configly-table-card {
    background: #111a2e;
    border-color: var(--configly-border);
}

[data-theme="dark"] .configly-schedule-row,
[data-theme="dark"] .configly-participant-row {
    border-color: var(--configly-border);
}

    [data-theme="dark"] .configly-schedule-row:hover,
    [data-theme="dark"] .configly-participant-row:hover,
    [data-theme="dark"] .configly-table-card tbody tr:hover {
        background: #1a2540;
    }

[data-theme="dark"] .configly-day-body {
    background: #1a2540;
}

[data-theme="dark"] .configly-table-card thead th {
    background: #0f1830;
    border-color: var(--configly-border);
}

.configly-impact-text {
    margin-top: 0.25rem;
    white-space: pre-line;
    line-height: 1.45;
}
