/* =========================================================
   Rudra777 Chat — "Operations workspace" theme
   Light slate surfaces, navy hero headers, blue primary actions.
   Loaded last on every page so it can refine chat.css / inline styles.
   ========================================================= */

:root {
    --rt-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --rt-bg: #f4f6fb;
    --rt-surface: #ffffff;
    --rt-surface-2: #f8fafc;
    --rt-border: #e6eaf2;
    --rt-border-strong: #d8dee9;

    --rt-text: #0f172a;
    --rt-text-2: #334155;
    --rt-muted: #64748b;
    --rt-faint: #94a3b8;

    --rt-primary: #2563eb;
    --rt-primary-hover: #1d4ed8;
    --rt-primary-soft: #eef4ff;
    --rt-primary-ring: rgba(37, 99, 235, 0.16);

    --rt-navy-1: #0b1733;
    --rt-navy-2: #13254a;
    --rt-navy-3: #1e3a64;
    --rt-hero: linear-gradient(115deg, var(--rt-navy-1) 0%, var(--rt-navy-2) 55%, var(--rt-navy-3) 100%);

    --rt-radius: 16px;
    --rt-radius-sm: 10px;
    --rt-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
}

body,
button,
input,
select,
textarea,
.btn,
.form-control,
.form-select {
    font-family: var(--rt-font);
}

body:not(.dark-mode) {
    background: var(--rt-bg);
    color: var(--rt-text);
}

::selection {
    background: rgba(37, 99, 235, 0.18);
}

/* ---------- Hero header (shared) ---------- */
.rt-hero {
    position: relative;
    overflow: hidden;
    background: var(--rt-hero);
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(11, 23, 51, 0.18);
}

.rt-hero::after {
    /* soft arc highlight on the right, like the reference header */
    content: '';
    position: absolute;
    right: -120px;
    top: -140px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at 30% 60%, rgba(59, 130, 246, 0.18), transparent 60%);
    pointer-events: none;
}

.rt-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px 28px;
    flex-wrap: wrap;
}

.rt-hero-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
    color: #fff;
    font-size: 1.35rem;
}

.rt-hero-icon.sm {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.1rem;
}

.rt-hero-text {
    min-width: 0;
    flex: 1 1 auto;
}

.rt-crumb {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.78);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.rt-crumb i {
    font-size: 0.55rem;
    opacity: 0.8;
}

.rt-hero h1,
.rt-hero .rt-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.rt-hero p,
.rt-hero .rt-sub {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.82);
}

.rt-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Glass pill buttons inside any navy header */
.rt-hero .btn-outline-light,
.rt-hero .btn-light,
.navbar .btn-outline-light,
.rt-pill {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #f1f5f9 !important;
    border-radius: 999px !important;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    box-shadow: none !important;
    transition: background 150ms ease, border-color 150ms ease;
}

.rt-hero .btn-outline-light:hover,
.rt-hero .btn-light:hover,
.navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    transform: none;
}

.rt-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.rt-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* ---------- Cards / surfaces ---------- */
.rt-page .card,
.rt-card {
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    box-shadow: var(--rt-shadow);
    color: var(--rt-text);
}

/* thin blue accent line along the top edge of section cards */
.rt-page .container > .card,
.rt-card.accent {
    position: relative;
    overflow: hidden;
}

.rt-page .container > .card::before,
.rt-card.accent::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--rt-primary), rgba(59, 130, 246, 0.35) 45%, transparent 85%);
}

.rt-page .h5,
.rt-page .h6,
.rt-page h5,
.rt-page h6 {
    font-weight: 800;
    color: var(--rt-text);
}

.rt-page-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--rt-text);
    margin: 22px 0 14px;
}

/* ---------- Forms ---------- */
.rt-page .form-label,
.rt-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569 !important;
    margin-bottom: 6px;
}

.rt-page .form-control,
.rt-page .form-select {
    background-color: #fff !important;
    border: 1px solid var(--rt-border-strong) !important;
    border-radius: var(--rt-radius-sm) !important;
    color: var(--rt-text) !important;
    font-size: 0.86rem;
    min-height: 38px;
}

.rt-page .form-control::placeholder {
    color: var(--rt-faint) !important;
}

.rt-page .form-control:focus,
.rt-page .form-select:focus {
    border-color: var(--rt-primary) !important;
    box-shadow: 0 0 0 0.2rem var(--rt-primary-ring) !important;
}

.rt-page .form-check-input:checked {
    background-color: var(--rt-primary);
    border-color: var(--rt-primary);
}

/* ---------- Buttons ---------- */
.btn-primary {
    --bs-btn-bg: var(--rt-primary);
    --bs-btn-border-color: var(--rt-primary);
    --bs-btn-hover-bg: var(--rt-primary-hover);
    --bs-btn-hover-border-color: var(--rt-primary-hover);
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
    --bs-btn-disabled-bg: var(--rt-primary);
    --bs-btn-disabled-border-color: var(--rt-primary);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
}

.btn-outline-primary {
    --bs-btn-color: var(--rt-primary);
    --bs-btn-border-color: #bfd3fb;
    --bs-btn-hover-bg: var(--rt-primary-soft);
    --bs-btn-hover-color: var(--rt-primary-hover);
    --bs-btn-hover-border-color: #93b4f7;
    --bs-btn-active-bg: var(--rt-primary-soft);
    --bs-btn-active-color: var(--rt-primary-hover);
}

.btn {
    border-radius: 9px;
}

/* "light" outline buttons were built for dark pages; outside the navy header
   they become neutral slate outline buttons. */
.rt-page .btn-outline-light {
    color: var(--rt-text-2);
    background: #fff;
    border-color: var(--rt-border-strong);
}

.rt-page .btn-outline-light:hover,
.rt-page .btn-outline-light:focus {
    color: var(--rt-primary-hover);
    background: var(--rt-primary-soft);
    border-color: #bfd3fb;
}

.rt-page .rt-hero .btn-outline-light {
    /* keep glass pills in the hero */
    color: #f1f5f9;
}

/* Light text utilities used on formerly-dark pages */
.rt-page .card .text-white,
.rt-page .card .text-light,
.rt-page .modal .text-white,
.rt-page .modal .text-light,
.rt-page .modal-body.text-light {
    color: var(--rt-text) !important;
}

.rt-page .text-white-50:not(.rt-hero *) {
    color: var(--rt-muted) !important;
}

.rt-page .text-muted,
.rt-page .muted {
    color: var(--rt-muted) !important;
}

/* ---------- Tables ---------- */
.rt-page .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--rt-text);
    --bs-table-hover-bg: #f5f8ff;
    --bs-table-hover-color: var(--rt-text);
    color: var(--rt-text);
}

.rt-page .table thead th {
    background: var(--rt-surface-2) !important;
    color: #475569 !important;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--rt-border) !important;
}

.rt-page .table tbody td {
    background: #fff !important;
    border-color: var(--rt-border) !important;
}

.rt-page .table-hover tbody tr:hover td {
    background: #f5f8ff !important;
}

/* ---------- Modals ---------- */
.rt-page .modal-content {
    background: #fff;
    border: 1px solid var(--rt-border);
    border-radius: var(--rt-radius);
    color: var(--rt-text);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.rt-page .modal-header,
.rt-page .modal-footer {
    border-color: var(--rt-border);
}

.rt-page .btn-close-white {
    filter: none;
}

/* =========================================================
   Agent panel (support chat)
   ========================================================= */
body:not(.dark-mode) .navbar,
.navbar {
    background: var(--rt-hero) !important;
    border-radius: 16px !important;
    padding: 12px 18px !important;
    box-shadow: 0 8px 24px rgba(11, 23, 51, 0.16) !important;
    border: none;
}

.navbar::before {
    background: radial-gradient(circle at 92% -40%, rgba(59, 130, 246, 0.22), transparent 45%) !important;
}

.navbar-brand {
    font-weight: 800 !important;
    font-size: 1.15rem !important;
    letter-spacing: -0.01em;
    text-shadow: none !important;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.navbar .rt-crumb {
    margin-bottom: 1px;
    font-size: 0.62rem;
}

.navbar .text-white.small {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: none !important;
    font-size: 0.78rem;
}

#toggleDark {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}

#toggleDark:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    transform: none !important;
}

body:not(.dark-mode) .chat-sidebar,
body:not(.dark-mode) .chat-area {
    background: var(--rt-surface) !important;
    border: 1px solid var(--rt-border) !important;
    box-shadow: var(--rt-shadow) !important;
}

body:not(.dark-mode) .bg-chat,
body:not(.dark-mode) #chat-content {
    background: #f7f9fc !important;
}

/* =========================================================
   Login
   ========================================================= */
.rt-login body,
body.rt-login {
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(37, 99, 235, 0.08), transparent 60%),
        var(--rt-bg) !important;
}

.rt-login .login-card {
    border: 1px solid var(--rt-border) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.10) !important;
    border-radius: 20px !important;
}

.rt-login .login-header {
    background: var(--rt-hero) !important;
    position: relative;
    overflow: hidden;
    text-align: left !important;
    padding: 28px 28px !important;
    display: flex;
    align-items: center;
    gap: 16px;
}

.rt-login .login-header::after {
    content: '';
    position: absolute;
    right: -90px;
    top: -110px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at 30% 60%, rgba(59, 130, 246, 0.2), transparent 60%);
}

.rt-login .login-header .rt-hero-icon i {
    font-size: 1.3rem;
    margin: 0;
    filter: none;
}

.rt-login .login-header h1 {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    text-shadow: none !important;
}

.rt-login .login-header p {
    margin-top: 4px !important;
    font-size: 0.8rem !important;
    color: rgba(226, 232, 240, 0.82);
}

.rt-login .login-body {
    padding: 28px !important;
}

.rt-login .form-label {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569 !important;
}

.rt-login .form-label i {
    display: none;
}

.rt-login .form-control,
.rt-login .input-group-text {
    border-color: var(--rt-border-strong) !important;
    border-radius: var(--rt-radius-sm);
}

.rt-login .input-group-text {
    background: var(--rt-surface-2) !important;
    color: var(--rt-muted) !important;
}

.rt-login .input-group:focus-within .form-control,
.rt-login .input-group:focus-within .input-group-text,
.rt-login .form-control:focus {
    border-color: var(--rt-primary) !important;
    box-shadow: none !important;
}

.rt-login .input-group:focus-within {
    box-shadow: 0 0 0 0.2rem var(--rt-primary-ring);
    border-radius: var(--rt-radius-sm);
}

.rt-login .btn-login {
    background: var(--rt-primary) !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28) !important;
}

.rt-login .btn-login:hover {
    background: var(--rt-primary-hover) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .rt-hero-inner {
        padding: 18px;
        gap: 14px;
    }

    .rt-hero h1,
    .rt-hero .rt-title {
        font-size: 1.3rem;
    }

    .rt-hero-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .navbar .rt-crumb {
        display: none;
    }
}

/* Login: header chevron must not inherit the big legacy header icon size */
.rt-login .login-header .rt-crumb i {
    font-size: 0.55rem;
    margin: 0;
    opacity: 0.8;
    filter: none;
}

/* Outreach: remaining dark-era surfaces */
html.outreach-page .outreach-stat-card .h4 {
    font-weight: 800;
    color: var(--rt-text);
}

html.outreach-page .form-check-label {
    color: var(--rt-text-2) !important;
}

/* Dark mode: sidebar search stays readable */
body.dark-mode #conv-search::placeholder {
    color: #7c8aa0;
}

@media (max-width: 1100px) {
    .navbar .rt-crumb {
        display: none;
    }
}
