/* ===================================================================
 *  Aria/Jomashop chatbot UI — shared styles (r61).
 *  Used by /Admin/Aria/* and /Reports/Aria/*.
 *  Loaded via _Layout's <link> tag.
 * =================================================================== */

:root {
    --jma-navy:       #252d38;
    --jma-navy-soft:  #303a48;
    --jma-gold:       #c8a45c;
    --jma-gold-soft:  #e5c98a;
    --jma-bg:         #f6f7f9;
    --jma-line:       #e3e7eb;
    --jma-muted:      #6b7480;
    --jma-text:       #1e242c;
    --jma-success:    #1f9d55;
    --jma-warn:       #d97706;
    --jma-danger:     #d23847;
}

/* ────── Hero header ──────────────────────────────────────────────── */
.jma-hero {
    background: linear-gradient(135deg, var(--jma-navy) 0%, #1a2027 100%);
    color: #fff;
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(37, 45, 56, 0.10);
    position: relative;
    overflow: hidden;
}
.jma-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(200, 164, 92, 0.25) 0%, transparent 50%);
    pointer-events: none;
}
.jma-hero-inner {
    position: relative;
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}
.jma-hero-icon {
    width: 56px; height: 56px;
    background: rgba(200, 164, 92, 0.18);
    border: 1px solid rgba(200, 164, 92, 0.45);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: var(--jma-gold);
    font-size: 26px;
    flex-shrink: 0;
}
.jma-hero h1 {
    font-size: 22px; font-weight: 700;
    margin: 0; letter-spacing: 0.2px;
}
.jma-hero .jma-hero-sub {
    color: rgba(255,255,255,0.72);
    font-size: 13.5px;
    margin-top: 4px;
}
.jma-hero-actions {
    margin-left: auto;
    display: flex; gap: 8px;
    flex-shrink: 0;
}
.jma-hero-actions .btn {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 600;
}
.jma-hero-actions .btn:hover {
    background: rgba(200,164,92,0.22);
    border-color: var(--jma-gold);
    color: #fff;
}
.jma-hero-actions .btn-gold {
    background: var(--jma-gold);
    border-color: var(--jma-gold);
    color: var(--jma-navy);
}
.jma-hero-actions .btn-gold:hover {
    background: var(--jma-gold-soft);
    border-color: var(--jma-gold-soft);
    color: var(--jma-navy);
}

/* ────── Breadcrumb under hero ─────────────────────────────────────── */
.jma-crumbs {
    display: flex; gap: 8px; align-items: center;
    margin: -8px 0 22px;
    font-size: 13px;
    color: var(--jma-muted);
}
.jma-crumbs a {
    color: var(--jma-muted); text-decoration: none;
}
.jma-crumbs a:hover {
    color: var(--jma-navy); text-decoration: underline;
}
.jma-crumbs .sep {
    color: #c4ccd6;
    font-weight: 600;
}

/* ────── Stat tiles ───────────────────────────────────────────────── */
.jma-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.jma-stat {
    background: #fff;
    border: 1px solid var(--jma-line);
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.jma-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,45,56,0.08);
}
.jma-stat-label {
    font-size: 11.5px; letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--jma-muted);
    font-weight: 600;
    margin-bottom: 6px;
}
.jma-stat-value {
    font-size: 28px; font-weight: 700;
    color: var(--jma-text); line-height: 1.1;
}
.jma-stat-sub {
    font-size: 12px; color: var(--jma-muted);
    margin-top: 6px;
}
.jma-stat .jma-stat-icon {
    position: absolute;
    right: 14px; top: 14px;
    color: var(--jma-line);
    font-size: 22px;
    transition: color .15s ease;
}
.jma-stat:hover .jma-stat-icon { color: var(--jma-gold); }
.jma-stat.is-warn .jma-stat-value { color: var(--jma-warn); }
.jma-stat.is-danger .jma-stat-value { color: var(--jma-danger); }
.jma-stat.is-success .jma-stat-value { color: var(--jma-success); }

/* ────── Cards ────────────────────────────────────────────────────── */
.jma-card {
    background: #fff;
    border: 1px solid var(--jma-line);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 18px;
}
.jma-card-h {
    display: flex; align-items: center;
    gap: 10px; margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--jma-line);
}
.jma-card-h h5 {
    margin: 0; font-size: 15px; font-weight: 700;
    color: var(--jma-text);
}
.jma-card-h .bi { color: var(--jma-gold); font-size: 18px; }
.jma-card-h .jma-card-h-actions { margin-left: auto; }

/* ────── Quick-link cards (bottom of dashboard) ────────────────────── */
.jma-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.jma-link {
    display: flex; align-items: center; gap: 12px;
    background: #fff;
    border: 1px solid var(--jma-line);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--jma-text);
    transition: all .15s ease;
}
.jma-link:hover {
    border-color: var(--jma-gold);
    box-shadow: 0 4px 14px rgba(200,164,92,0.15);
    color: var(--jma-text);
    text-decoration: none;
    transform: translateY(-2px);
}
.jma-link-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--jma-navy) 0%, var(--jma-navy-soft) 100%);
    color: var(--jma-gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.jma-link-text strong { display: block; font-size: 14px; color: var(--jma-text); }
.jma-link-text small  { color: var(--jma-muted); font-size: 12px; }

/* ────── Modern table ─────────────────────────────────────────────── */
.jma-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.jma-table thead th {
    background: #f1f3f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
    color: var(--jma-muted);
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--jma-line);
}
.jma-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13.5px;
    vertical-align: middle;
}
.jma-table tbody tr:hover { background: #fafbfc; }
.jma-table tbody tr:last-child td { border-bottom: none; }
.jma-table .text-end { text-align: right; }

/* ────── Status badges ────────────────────────────────────────────── */
.jma-badge {
    display: inline-flex; align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.jma-badge.open     { background: #e6f6ed; color: var(--jma-success); }
.jma-badge.escal    { background: #fff4e6; color: var(--jma-warn); }
.jma-badge.closed   { background: #eef0f3; color: var(--jma-muted); }
.jma-badge.danger   { background: #fde8eb; color: var(--jma-danger); }
.jma-badge.navy     { background: var(--jma-navy); color: #fff; }
.jma-badge.gold     { background: var(--jma-gold); color: var(--jma-navy); }

/* ────── Live "open / closed" pill ─────────────────────────────────── */
.jma-live-status {
    display: inline-flex; align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}
.jma-live-status.open {
    background: rgba(31,157,85,0.15);
    color: var(--jma-success);
    border: 1px solid rgba(31,157,85,0.30);
}
.jma-live-status.closed {
    background: rgba(108,117,125,0.12);
    color: var(--jma-muted);
    border: 1px solid rgba(108,117,125,0.25);
}
.jma-live-status .dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.jma-live-status.open .dot {
    background: var(--jma-success);
    box-shadow: 0 0 0 4px rgba(31,157,85,0.18);
    animation: jma-pulse 1.8s infinite;
}
.jma-live-status.closed .dot { background: #adb5bd; }
@keyframes jma-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(31,157,85,0.50); }
    70%  { box-shadow: 0 0 0 8px rgba(31,157,85,0);    }
    100% { box-shadow: 0 0 0 0   rgba(31,157,85,0);    }
}

/* ────── Day-of-week schedule grid (BusinessHours admin) ──────────── */
.jma-day-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 110px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}
.jma-day-row:last-child { border-bottom: none; }
.jma-day-row .jma-day-name {
    font-weight: 700;
    color: var(--jma-text);
    font-size: 14px;
}
.jma-day-row.is-closed .jma-day-name { color: var(--jma-muted); }
.jma-day-row .form-control { font-size: 13px; }

/* ────── Empty state ─────────────────────────────────────────────── */
.jma-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--jma-muted);
}
.jma-empty .bi {
    font-size: 36px; color: var(--jma-line);
    display: block; margin-bottom: 10px;
}

/* ────── Conversation transcript (drill-down view) ────────────────── */
.jma-msg {
    margin-bottom: 14px;
    max-width: 80%;
    display: flex; flex-direction: column;
    gap: 4px;
}
.jma-msg.user      { margin-left: auto; align-items: flex-end; }
.jma-msg.assistant { margin-right: auto; }
.jma-msg.tool      { margin: 0 auto; max-width: 100%; }
.jma-msg-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.jma-msg.assistant .jma-msg-label { color: #1f6feb; }
.jma-msg.user      .jma-msg-label { color: var(--jma-text); }
.jma-msg.tool      .jma-msg-label { color: var(--jma-muted); }
.jma-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px; line-height: 1.5;
    white-space: pre-wrap;
}
.jma-msg.user .jma-msg-bubble {
    background: var(--jma-navy); color: #fff;
    border-radius: 14px 14px 4px 14px;
}
.jma-msg.assistant .jma-msg-bubble {
    background: #eef5ff;
    border-radius: 14px 14px 14px 4px;
}
.jma-msg.tool .jma-msg-bubble {
    background: #fffbe6; font-size: 12px;
    font-family: Menlo, Consolas, monospace;
}
