/**
 * Army Study Live Chat - Master Standalone Web App Stylesheet
 * Subdomain: chat.armystudy.in
 * Pixel-Perfect match to reference Course Panel (media_1790019771211.png)
 * Dual support for PHP Standalone & Express/Node.js web app deployments
 */

:root {
    --ast-primary: #e60028;
    --ast-primary-hover: #cc0024;
    --ast-primary-light: rgba(230, 0, 40, 0.08);
    --ast-yellow: #facc15;
    --ast-teal: #00a884;
    --ast-bg: #f4f6f8;
    --ast-surface: #ffffff;
    --ast-surface-2: #f8fafc;
    --ast-text-primary: #0f172a;
    --ast-text-secondary: #64748b;
    --ast-text-muted: #94a3b8;
    --ast-border: #e2e8f0;
    --ast-border-subtle: #f1f5f9;
    --ast-bubble-student: #ffffff;
    --ast-bubble-agent: #d9fdd3;
    --ast-bubble-agent-text: #111b21;
    --ast-bubble-student-text: #111b21;
    --ast-sidebar-bg: #14171c;
    --ast-sidebar-text: #94a3b8;
    --ast-radius-card: 16px;
    --ast-radius-btn: 10px;
    --ast-radius-pill: 9999px;
    --ast-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --ast-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    --ast-shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.07);
}

/* WHATSAPP WEB DARK MODE PALETTE */
body.dark-mode {
    --ast-bg: #0b141a;
    --ast-surface: #111b21;
    --ast-surface-2: #202c33;
    --ast-text-primary: #e9edef;
    --ast-text-secondary: #8696a0;
    --ast-text-muted: #64748b;
    --ast-border: #2a3942;
    --ast-border-subtle: #202c33;
    --ast-bubble-student: #202c33;
    --ast-bubble-agent: #005c4b;
    --ast-bubble-agent-text: #e9edef;
    --ast-bubble-student-text: #e9edef;
    --ast-sidebar-bg: #111b21;
    --ast-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--ast-bg);
    color: var(--ast-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================================== */
/* 1. LUXURY LIGHT LOGIN SCREEN                               */
/* ========================================================== */
.ast-login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #ffffff 0%, #f1f4f8 100%);
    padding: 24px 16px;
}

body.dark-mode .ast-login-body {
    background: radial-gradient(circle at top, #1e242d 0%, #0b141a 100%);
}

.ast-login-card-wrap {
    width: 100%;
    max-width: 450px;
}

.ast-login-card {
    background: var(--ast-surface);
    border: 1px solid var(--ast-border);
    border-radius: 24px;
    padding: 38px 34px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.06);
    color: var(--ast-text-primary);
    position: relative;
    overflow: hidden;
}

body.dark-mode .ast-login-card {
    background: #111b21;
    border-color: #202c33;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.ast-login-header {
    text-align: center;
    margin-bottom: 24px;
}

.ast-login-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #e60028;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(230, 0, 40, 0.35);
    color: #ffffff;
}

.ast-login-badge {
    display: inline-block;
    background: rgba(250, 204, 21, 0.18);
    color: #b45309;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

body.dark-mode .ast-login-badge {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
}

.ast-login-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--ast-text-primary);
}

.ast-login-header p {
    font-size: 13.5px;
    color: var(--ast-text-secondary);
    line-height: 1.4;
}

/* Master Credentials Info Pill (Clean, Elegant, No Dashed Lines) */
.ast-first-time-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

body.dark-mode .ast-first-time-box {
    background: #182229;
    border-color: #2a3942;
}

.ast-cred-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ast-cred-title {
    color: #0f172a;
    font-size: 12.5px;
    font-weight: 700;
}

body.dark-mode .ast-cred-title {
    color: #e9edef;
}

.ast-btn-autofill {
    background: #e60028;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ast-btn-autofill:hover {
    background: #cc0024;
}

.ast-cred-values {
    font-size: 12.5px;
    color: #475569;
}

body.dark-mode .ast-cred-values {
    color: #8696a0;
}

.ast-cred-values code {
    background: #ffffff;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    font-weight: 700;
    color: #0f172a;
    font-family: monospace;
}

body.dark-mode .ast-cred-values code {
    background: #202c33;
    border-color: #2a3942;
    color: #facc15;
}

.ast-cred-help {
    display: block;
    margin-top: 5px;
    color: var(--ast-text-secondary);
    font-size: 11px;
}

/* Form Groups & Inputs */
.ast-form-group {
    margin-bottom: 18px;
}

.ast-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ast-text-primary);
}

.ast-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ast-input, 
input[type="text"], 
input[type="password"], 
input[type="email"], 
select, 
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--ast-border);
    background: var(--ast-surface-2);
    color: var(--ast-text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

.ast-input:focus, 
input[type="text"]:focus, 
input[type="password"]:focus, 
input[type="email"]:focus, 
select:focus, 
textarea:focus {
    border-color: #e60028;
    box-shadow: 0 0 0 3px rgba(230, 0, 40, 0.12);
}

.ast-pwd-wrap input {
    padding-right: 44px;
}

.ast-pwd-toggle, .ast-btn-eye-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--ast-text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ast-btn-primary.ast-btn-block, 
.ast-btn-submit-login {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: #e60028;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(230, 0, 40, 0.28);
    transition: all 0.15s ease;
}

.ast-btn-primary.ast-btn-block:hover, 
.ast-btn-submit-login:hover {
    background: #cc0024;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(230, 0, 40, 0.35);
}

.ast-btn-primary.ast-btn-block:disabled, 
.ast-btn-submit-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.ast-link-sm, .ast-forgot-link {
    font-size: 12px;
    color: #e60028;
    text-decoration: none;
    font-weight: 600;
}

.ast-link-sm:hover, .ast-forgot-link:hover {
    text-decoration: underline;
}

.ast-login-footer {
    text-align: center;
    margin-top: 24px;
    border-top: 1px solid var(--ast-border);
    padding-top: 16px;
    font-size: 12px;
    color: var(--ast-text-secondary);
}

/* ========================================================== */
/* 2. DEDICATED COURSE PANEL DASHBOARD LAYOUT                 */
/* ========================================================== */
.ast-dedicated-container, 
.ast-panel-wrapper {
    max-width: 1440px;
    margin: 24px auto;
    padding: 0 20px;
}

.ast-dedicated-panel, 
.ast-panel-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ========================================================== */
/* 3. SLEEK DARK LEFT SIDEBAR (Matching media_1790019771211)  */
/* ========================================================== */
.ast-panel-sidebar, 
.ast-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #14171c;
    border-radius: 20px;
    padding: 24px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    min-height: 820px;
    position: sticky;
    top: 24px;
}

/* Brand Header */
.ast-panel-brand, 
.ast-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 18px;
}

.ast-brand-badge-icon, 
.ast-brand-icon {
    width: 44px;
    height: 44px;
    background: #e60028;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(230, 0, 40, 0.35);
    color: #ffffff;
}

.ast-brand-text, 
.ast-brand-titles {
    min-width: 0;
}

.ast-brand-text h2, 
.ast-brand-text h3, 
.ast-brand-titles h2, 
.ast-brand-titles h3 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.ast-brand-sub, 
.ast-sidebar-tag {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #facc15;
    text-transform: uppercase;
    display: block;
    margin-top: 3px;
}

/* Navigation Links */
.ast-panel-nav, 
.ast-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ast-panel-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ast-nav-item, 
.ast-nav-item a, 
a.ast-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}

.ast-nav-item a:hover, 
a.ast-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* Active Crimson Pill with Glowing Yellow Dot */
.ast-nav-item.active, 
.ast-nav-item.active a, 
a.ast-nav-item.active {
    background: #e60028 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(230, 0, 40, 0.35);
}

.ast-nav-dot, 
.ast-active-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #facc15;
    margin-left: auto;
    box-shadow: 0 0 10px #facc15, 0 0 4px #facc15;
    display: inline-block;
    flex-shrink: 0;
}

.ast-nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.ast-nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Counselor Profile Card */
.ast-sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ast-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.ast-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e60028;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ast-user-meta {
    flex: 1;
    min-width: 0;
}

.ast-user-meta strong {
    display: block;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ast-user-meta span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
}

.ast-btn-logout-icon {
    color: #f87171;
    text-decoration: none;
    font-size: 16px;
    padding: 4px;
    transition: transform 0.15s ease;
}

.ast-btn-logout-icon:hover {
    transform: translateX(2px);
}

/* ========================================================== */
/* 4. MAIN CONTENT AREA                                       */
/* ========================================================== */
.ast-panel-main {
    flex: 1;
    min-width: 0;
}

/* TOP HERO CARD */
.ast-hero-card {
    background: var(--ast-surface);
    border-radius: 16px;
    border: 1px solid var(--ast-border);
    border-left: 5px solid #e60028;
    padding: 26px 30px;
    box-shadow: var(--ast-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
}

.ast-hero-card::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -60px;
    width: 220px;
    height: 180px;
    background: radial-gradient(ellipse at center, rgba(250, 204, 21, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ast-hero-left, 
.ast-hero-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.ast-hero-tag {
    display: inline-block;
    color: #e60028;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ast-hero-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ast-text-primary);
}

.ast-hero-desc {
    color: var(--ast-text-secondary);
    font-size: 13.5px;
    line-height: 1.4;
}

.ast-hero-right, 
.ast-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.ast-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--ast-radius-pill);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.ast-btn-primary {
    background: #e60028;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(230, 0, 40, 0.25);
}

.ast-btn-primary:hover {
    background: #cc0024;
    transform: translateY(-1px);
}

.ast-btn-dark {
    background: #111827;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.2);
}

body.dark-mode .ast-btn-dark {
    background: #202c33;
}

.ast-btn-dark:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.ast-btn-light {
    background: var(--ast-surface-2);
    color: var(--ast-text-primary);
    border: 1px solid var(--ast-border);
    padding: 10px 14px;
    border-radius: var(--ast-radius-pill);
}

.ast-btn-light:hover {
    background: var(--ast-border);
}

/* ========================================================== */
/* 5. 4 STAT CARDS ROW (Matching media_1790019771211)        */
/* ========================================================== */
.ast-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.ast-stat-card {
    background: var(--ast-surface);
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: var(--ast-shadow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ast-border);
}

.ast-stat-watermark {
    position: absolute;
    right: -15px;
    bottom: -15px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.12;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

/* Card 1: Red */
.ast-stat-red, 
.ast-stat-card-red {
    border-top: 3.5px solid #e60028;
}
.ast-stat-red .ast-stat-label, 
.ast-stat-card-red .ast-stat-label {
    color: #e60028;
}
.ast-stat-red .ast-stat-watermark, 
.ast-stat-card-red .ast-stat-watermark {
    background: #e60028;
}

/* Card 2: Amber */
.ast-stat-amber, 
.ast-stat-card-amber {
    border-top: 3.5px solid #f59e0b;
}
.ast-stat-amber .ast-stat-label, 
.ast-stat-card-amber .ast-stat-label {
    color: #d97706;
}
.ast-stat-amber .ast-stat-watermark, 
.ast-stat-card-amber .ast-stat-watermark {
    background: #f59e0b;
}

/* Card 3: Green */
.ast-stat-green, 
.ast-stat-card-green {
    border-top: 3.5px solid #10b981;
}
.ast-stat-green .ast-stat-label, 
.ast-stat-card-green .ast-stat-label {
    color: #059669;
}
.ast-stat-green .ast-stat-watermark, 
.ast-stat-card-green .ast-stat-watermark {
    background: #10b981;
}

/* Card 4: Slate Blue */
.ast-stat-blue, 
.ast-stat-card-blue {
    border-top: 3.5px solid #1e293b;
}
body.dark-mode .ast-stat-blue, 
body.dark-mode .ast-stat-card-blue {
    border-top-color: #94a3b8;
}
.ast-stat-blue .ast-stat-label, 
.ast-stat-card-blue .ast-stat-label {
    color: #1e293b;
}
body.dark-mode .ast-stat-blue .ast-stat-label, 
body.dark-mode .ast-stat-card-blue .ast-stat-label {
    color: #94a3b8;
}
.ast-stat-blue .ast-stat-watermark, 
.ast-stat-card-blue .ast-stat-watermark {
    background: #1e293b;
}

.ast-stat-label {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.ast-stat-number {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 6px;
    color: var(--ast-text-primary);
}

.ast-stat-sub {
    font-size: 12px;
    color: var(--ast-text-secondary);
}

/* ========================================================== */
/* 6. 2-COLUMN DASHBOARD GRID (Matching media_1790019771211)  */
/* ========================================================== */
.ast-dash-grid, 
.ast-dashboard-grid {
    display: grid;
    grid-template-columns: 2.1fr 1fr;
    gap: 22px;
}

.ast-dash-card, 
.ast-conversations-card, 
.ast-quick-actions-card {
    background: var(--ast-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--ast-shadow);
    border: 1px solid var(--ast-border);
}

.ast-dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--ast-border);
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.ast-dash-card-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ast-text-primary);
}

.ast-dash-card-sub {
    font-size: 13px;
    color: var(--ast-text-secondary);
}

.ast-link-viewall, 
.ast-view-all {
    color: #e60028;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.ast-link-viewall:hover, 
.ast-view-all:hover {
    text-decoration: underline;
}

/* Recent Conversations List */
.ast-recent-list, 
.ast-conversations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ast-recent-item, 
.ast-conversation-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    transition: all 0.15s ease;
}

.ast-recent-item:hover, 
.ast-conversation-item:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Rectangular Course Batch Preview Thumbnail */
.ast-batch-badge-avatar, 
.ast-batch-thumb {
    width: 64px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

body.dark-mode .ast-batch-badge-avatar, 
body.dark-mode .ast-batch-thumb {
    background: linear-gradient(135deg, #202c33, #111b21);
    border: 1px solid #2a3942;
}

.ast-recent-info {
    flex: 1;
    min-width: 0;
}

.ast-recent-name {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ast-text-primary);
}

.ast-batch-pill {
    font-size: 11px;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 8px;
    border-radius: 6px;
}

body.dark-mode .ast-batch-pill {
    background: #312e81;
    color: #c7d2fe;
}

.ast-recent-meta {
    font-size: 11.5px;
    color: var(--ast-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.ast-dot-sep { opacity: 0.5; }

.ast-status-chip { font-weight: 600; }
.ast-status-new { color: #ef4444; }
.ast-status-open { color: #10b981; }
.ast-status-pending { color: #f59e0b; }
.ast-status-resolved { color: #64748b; }

.ast-recent-msg-preview {
    font-size: 12px;
    color: var(--ast-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ast-recent-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ast-btn-action-reply {
    background: #e60028;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease;
}

.ast-btn-action-reply:hover {
    background: #cc0024;
}

.ast-btn-preview {
    color: var(--ast-text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 8px;
}

.ast-btn-preview:hover {
    color: var(--ast-text-primary);
}

/* RIGHT COLUMN QUICK ACTIONS & SHORTCODE */
.ast-side-card-title {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 800;
    color: var(--ast-text-primary);
}

.ast-side-card-sub {
    margin: 0 0 10px;
    font-size: 12.5px;
    color: var(--ast-text-secondary);
}

.ast-quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ast-qa-btn, 
.ast-action-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
    color: inherit;
}

.ast-qa-btn:hover, 
.ast-action-tile:hover {
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Pastel Icon Tiles (Matching media_1790019771211) */
.ast-qa-icon, 
.ast-tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
}

.ast-qa-pink, .ast-icon-pink { background: #ffe4e6; color: #e11d48; }
.ast-qa-amber, .ast-icon-amber { background: #fef3c7; color: #d97706; }
.ast-qa-green, .ast-icon-green { background: #dcfce7; color: #16a34a; }
.ast-qa-teal, .ast-icon-cyan { background: #cffafe; color: #0891b2; }

.ast-qa-text strong, 
.ast-tile-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ast-text-primary);
}

.ast-qa-text span, 
.ast-tile-text span {
    font-size: 11.5px;
    color: var(--ast-text-secondary);
}

/* Code Boxes for Shortcode & URLs */
.ast-code-box, 
.ast-shortcode-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    border-radius: 10px;
    padding: 8px 12px;
    margin-top: 6px;
    gap: 8px;
}

.ast-code-box code, 
.ast-shortcode-box code {
    font-family: monospace;
    font-size: 12.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ast-text-primary);
}

.ast-btn-copy-code {
    background: #e60028;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.ast-btn-copy-code:hover {
    background: #cc0024;
}

/* ========================================================== */
/* 7. LIVE CHAT DESK (3-COLUMN WHATSAPP WEB LAYOUT)          */
/* ========================================================== */
.ast-desk-body {
    height: 100vh;
    overflow: hidden;
}

.ast-desk-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.ast-desk-header {
    height: 58px;
    background: var(--ast-surface);
    border-bottom: 1px solid var(--ast-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    flex-shrink: 0;
}

.ast-desk-header-left, .ast-desk-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ast-btn-back-dash {
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    color: var(--ast-text-primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.ast-btn-back-dash:hover {
    background: var(--ast-border);
}

.ast-desk-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.ast-brand-dot { color: #10b981; }

.ast-badge-live {
    background: #10b981;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.ast-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    color: var(--ast-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}

.ast-profile-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--ast-text-primary);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
}

.ast-btn-logout-pill {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.ast-desk-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Column 1: Left Conversation Sidebar */
.ast-desk-col-left {
    width: 360px;
    background: var(--ast-surface);
    border-right: 1px solid var(--ast-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.ast-search-filter-box {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ast-border);
}

.ast-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.ast-search-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--ast-text-secondary);
    pointer-events: none;
}

.ast-search-bar input {
    width: 100%;
    padding: 9px 34px 9px 36px;
    border-radius: 8px;
    border: 1px solid var(--ast-border);
    background: var(--ast-surface-2);
    font-size: 13px;
    color: var(--ast-text-primary);
    outline: none;
}

.ast-filter-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.ast-filter-tabs::-webkit-scrollbar {
    height: 3px;
}

.ast-tab {
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    color: var(--ast-text-secondary);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ast-tab.active {
    background: #e60028;
    color: #ffffff;
    border-color: #e60028;
}

.ast-conversation-list {
    flex: 1;
    overflow-y: auto;
}

.ast-conv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ast-border-subtle);
    cursor: pointer;
    transition: background 0.1s ease;
}

.ast-conv-item:hover {
    background: var(--ast-surface-2);
}

.ast-conv-item.active {
    background: var(--ast-primary-light);
    border-left: 4px solid #e60028;
}

.ast-conv-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #cbd5e1;
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ast-conv-content {
    flex: 1;
    min-width: 0;
}

.ast-conv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.ast-conv-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ast-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ast-conv-time {
    font-size: 11px;
    color: var(--ast-text-secondary);
    flex-shrink: 0;
}

.ast-conv-snippet {
    font-size: 12px;
    color: var(--ast-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ast-conv-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.ast-badge-unread {
    background: #e60028;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.ast-conv-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--ast-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: var(--ast-text-secondary);
    background: var(--ast-surface-2);
}

.ast-btn-refresh {
    background: none;
    border: none;
    color: #e60028;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

/* Column 2: Center Active Chat Area */
.ast-desk-col-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #efeae2;
    position: relative;
    overflow: hidden;
}

body.dark-mode .ast-desk-col-center {
    background: #0b141a;
}

.ast-chat-active-header {
    height: 58px;
    background: var(--ast-surface);
    border-bottom: 1px solid var(--ast-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 10;
}

.ast-student-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ast-chat-messages-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Speech Bubbles */
.ast-msg-bubble {
    max-width: 65%;
    padding: 9px 14px;
    border-radius: 12px;
    position: relative;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ast-msg-student {
    align-self: flex-start;
    background: var(--ast-bubble-student);
    color: var(--ast-bubble-student-text);
    border-top-left-radius: 2px;
}

.ast-msg-agent {
    align-self: flex-end;
    background: var(--ast-bubble-agent);
    color: var(--ast-bubble-agent-text);
    border-top-right-radius: 2px;
}

.ast-msg-meta {
    font-size: 10.5px;
    color: var(--ast-text-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.ast-msg-pending {
    opacity: 0.75;
}

/* Audio Voice Notes */
.ast-voice-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.ast-voice-btn-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #00a884;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* Composer Bar */
.ast-chat-composer {
    background: var(--ast-surface);
    border-top: 1px solid var(--ast-border);
    padding: 10px 16px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.ast-composer-textarea {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--ast-border);
    background: var(--ast-surface-2);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ast-text-primary);
    outline: none;
}

.ast-btn-composer {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.ast-btn-composer:hover {
    transform: scale(1.05);
}

.ast-btn-send {
    background: #00a884;
    color: #ffffff;
}

.ast-btn-mic {
    background: #e60028;
    color: #ffffff;
}

/* Column 3: Right Student Drawer */
.ast-desk-col-right {
    width: 320px;
    background: var(--ast-surface);
    border-left: 1px solid var(--ast-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.ast-drawer-header {
    padding: 16px;
    border-bottom: 1px solid var(--ast-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ast-drawer-body {
    padding: 16px;
}

/* ========================================================== */
/* 8. MODALS, TABLES, LIGHTBOX                                */
/* ========================================================== */
.ast-modern-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.ast-modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ast-modern-table th {
    background: var(--ast-surface-2);
    padding: 12px 14px;
    text-align: left;
    color: var(--ast-text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--ast-border);
}

.ast-modern-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--ast-border);
    vertical-align: middle;
}

.ast-role-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
.role-admin { background: #fee2e2; color: #991b1b; }
.role-manager { background: #dbeafe; color: #1e40af; }
.role-agent { background: #dcfce7; color: #166534; }
.role-supervisor { background: #fef9c3; color: #854d0e; }

.ast-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.ast-modal-box {
    background: var(--ast-surface);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border: 1px solid var(--ast-border);
    overflow: hidden;
}

.ast-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ast-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ast-modal-header h3 { font-size: 16px; font-weight: 700; }
.ast-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--ast-text-secondary);
}

.ast-modal-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.ast-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ast-pwd-input-wrap {
    display: flex;
    gap: 8px;
}
.ast-btn-toggle-pwd, .ast-btn-generate-pwd {
    background: var(--ast-surface-2);
    border: 1px solid var(--ast-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--ast-text-primary);
    white-space: nowrap;
}

.ast-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.ast-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}
.ast-alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ast-alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ========================================================== */
/* 9. RESPONSIVE MEDIA QUERIES                                */
/* ========================================================== */
@media (max-width: 1024px) {
    .ast-dedicated-panel, 
    .ast-panel-layout { 
        flex-direction: column; 
    }
    .ast-panel-sidebar, 
    .ast-sidebar { 
        width: 100%; 
        min-height: auto;
        position: static;
    }
    .ast-stat-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .ast-dash-grid, 
    .ast-dashboard-grid { 
        grid-template-columns: 1fr; 
    }
    .ast-desk-col-right {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: -4px 0 20px rgba(0,0,0,0.2);
        display: none;
    }
    .ast-desk-col-right.open { 
        display: flex; 
    }
}

@media (max-width: 768px) {
    .ast-dedicated-container, 
    .ast-panel-wrapper {
        padding: 0 12px;
        margin: 14px auto;
    }
    .ast-stat-grid {
        grid-template-columns: 1fr;
    }
    .ast-hero-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }
    .ast-hero-actions, 
    .ast-hero-right {
        width: 100%;
        justify-content: flex-start;
    }
    .ast-desk-col-left {
        width: 100%;
    }
    .ast-desk-col-center {
        display: none;
        width: 100%;
    }
    .ast-desk-layout.chat-open .ast-desk-col-left,
    .ast-desk-layout.ast-mobile-active-chat .ast-desk-col-left {
        display: none;
    }
    .ast-desk-layout.chat-open .ast-desk-col-center,
    .ast-desk-layout.ast-mobile-active-chat .ast-desk-col-center {
        display: flex;
    }
}
