/*
 * Theme palettes — Purple, Blue, Violet (gradient)
 *
 * DEFAULT (console + public pages): theme-violet (see js/app.js, body.theme-violet).
 * Purple / blue remain in CSS for reference; console theme switcher is removed.
 *
 * VIOLET (default):
 *   Banner gradient: #4A90E2 → #9B59B6
 *   Primary: #4A90E2   Secondary: #9B59B6
 *
 * PURPLE / BLUE: legacy palette definitions only.
 */

/* =============================================================
   CSS CUSTOM PROPERTIES — define all palettes
   ============================================================= */

/* --- Purple (default) --- */
body,
body.theme-purple {
    --theme-darkest:  #4A2FC0;
    --theme-primary:  #5B3FD6;
    --theme-mid:      #6B52E8;
    --theme-accent:   #9585F0;
    --theme-light:    #B8AEF5;
    --theme-lightest: #EDE9FD;
    --theme-sidebar:  #2D2150;
    --theme-sidebar-active: #3B2D6B;
    --theme-sidebar-submenu: #352868;
    --theme-sidebar-header: #241A42;
    --theme-sidebar-text: #c4b8f0;
    --theme-sidebar-text-dim: #b0a3e0;
    --theme-sidebar-border: #4A3880;
    --theme-gradient: linear-gradient(135deg, #5B3FD6, #6B52E8);
    --theme-gradient-hover: linear-gradient(135deg, #4A2FC0, #5B3FD6);
    --theme-login-gradient: linear-gradient(160deg, #4A2FC0 0%, #5B3FD6 25%, #7B65E8 50%, #9585F0 75%, #B8AEF5 100%);
}

/* --- Blue --- */
body.theme-blue {
    --theme-darkest:  #1E6AB8;
    --theme-primary:  #2B7FD4;
    --theme-mid:      #4A9AE8;
    --theme-accent:   #6BB6FF;
    --theme-light:    #A3D4FF;
    --theme-lightest: #E8F4FF;
    --theme-sidebar:  #152540;
    --theme-sidebar-active: #1E3A5F;
    --theme-sidebar-submenu: #1A3050;
    --theme-sidebar-header: #0F1D33;
    --theme-sidebar-text: #9DC4E8;
    --theme-sidebar-text-dim: #7FAFD6;
    --theme-sidebar-border: #2A4A6B;
    --theme-gradient: linear-gradient(135deg, #2B7FD4, #4A9AE8);
    --theme-gradient-hover: linear-gradient(135deg, #1E6AB8, #2B7FD4);
    --theme-login-gradient: linear-gradient(160deg, #1E6AB8 0%, #2B7FD4 25%, #4A9AE8 50%, #6BB6FF 75%, #A3D4FF 100%);
}

/* --- Violet (blue→purple gradient banner, light-theme-first) --- */
body.theme-violet {
    --theme-darkest:  #357ABD;
    --theme-primary:  #4A90E2;
    --theme-mid:      #6B75D4;
    --theme-accent:   #9B59B6;
    --theme-light:    #B794F6;
    --theme-lightest: #F8F9FA;
    --theme-sidebar:  #2A3550;
    --theme-sidebar-active: #3B4A6E;
    --theme-sidebar-submenu: #352868;
    --theme-sidebar-header: #1E2840;
    --theme-sidebar-text: #9DC4E8;
    --theme-sidebar-text-dim: #7FAFD6;
    --theme-sidebar-border: #3A4A6B;
    --theme-gradient: linear-gradient(135deg, #4A90E2, #9B59B6);
    --theme-gradient-hover: linear-gradient(135deg, #357ABD, #8E44AD);
    --theme-login-gradient: linear-gradient(160deg, #4A90E2 0%, #6B75D4 25%, #9B59B6 50%, #B794F6 75%, #E9ECEF 100%);
}


/* =============================================================
   1. NAVBAR / HEADER
   ============================================================= */
.skin-purple .main-header .navbar {
    background: var(--theme-gradient) !important;
}
.skin-purple .main-header .navbar .sidebar-toggle:hover {
    background-color: var(--theme-darkest) !important;
}
.skin-purple .main-header .logo {
    background: var(--theme-darkest) !important;
}
.skin-purple .main-header .logo:hover {
    background: var(--theme-darkest) !important;
    opacity: 0.9;
}
.skin-purple .main-header li.user-header {
    background-color: var(--theme-primary) !important;
}
@media (max-width: 767px) {
    .skin-purple .main-header .navbar .dropdown-menu li a:hover {
        background: var(--theme-darkest) !important;
    }
}


/* =============================================================
   2. SIDEBAR
   ============================================================= */
.skin-purple .wrapper,
.skin-purple .main-sidebar,
.skin-purple .left-side {
    background-color: var(--theme-sidebar) !important;
}
.skin-purple .sidebar-menu > li.header {
    background: var(--theme-sidebar-header) !important;
    color: var(--theme-accent) !important;
}
.skin-purple .sidebar-menu > li > a {
    border-left: 3px solid transparent;
}
.skin-purple .sidebar-menu > li:hover > a,
.skin-purple .sidebar-menu > li.active > a,
.skin-purple .sidebar-menu > li.menu-open > a {
    background: var(--theme-sidebar-active) !important;
    border-left-color: var(--theme-accent) !important;
    color: #fff !important;
}
.skin-purple .sidebar a {
    color: var(--theme-sidebar-text) !important;
}
.skin-purple .sidebar a:hover {
    color: #fff !important;
}
.skin-purple .treeview-menu > li > a {
    color: var(--theme-sidebar-text-dim) !important;
}
.skin-purple .treeview-menu > li.active > a,
.skin-purple .treeview-menu > li > a:hover {
    color: #ffffff !important;
}
.skin-purple .sidebar-menu > li > .treeview-menu {
    background: var(--theme-sidebar-submenu) !important;
}
.skin-purple .user-panel > .info,
.skin-purple .user-panel > .info > a {
    color: var(--theme-light) !important;
}
.skin-purple .sidebar-form {
    border-color: var(--theme-sidebar-border) !important;
}
.skin-purple .sidebar-form input[type="text"],
.skin-purple .sidebar-form .btn {
    background: var(--theme-sidebar-active) !important;
    border-color: var(--theme-sidebar-border) !important;
    color: var(--theme-light) !important;
}


/* =============================================================
   3. ALL BUTTONS → 2-color system
   ============================================================= */
.btn-primary {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary.active, .open > .dropdown-toggle.btn-primary {
    background: var(--theme-darkest) !important;
    border-color: var(--theme-darkest) !important;
    color: #fff !important;
}

.btn-success {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #fff !important;
}
.btn-success:hover, .btn-success:focus, .btn-success:active,
.btn-success.active, .open > .dropdown-toggle.btn-success {
    background: var(--theme-darkest) !important;
    border-color: var(--theme-darkest) !important;
    color: #fff !important;
}

.btn-info {
    background: transparent !important;
    border: 1px solid var(--theme-accent) !important;
    color: var(--theme-primary) !important;
}
.btn-info:hover, .btn-info:focus, .btn-info:active,
.btn-info.active, .open > .dropdown-toggle.btn-info {
    background: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: #fff !important;
}

.btn-warning {
    background: var(--theme-accent) !important;
    border-color: var(--theme-accent) !important;
    color: #fff !important;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active,
.btn-warning.active, .open > .dropdown-toggle.btn-warning {
    background: var(--theme-mid) !important;
    border-color: var(--theme-mid) !important;
    color: #fff !important;
}

.btn-danger {
    background: transparent !important;
    border: 1px solid var(--theme-primary) !important;
    color: var(--theme-primary) !important;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active,
.btn-danger.active, .open > .dropdown-toggle.btn-danger {
    background: var(--theme-primary) !important;
    border-color: var(--theme-darkest) !important;
    color: #fff !important;
}

.btn-default {
    background: #fff !important;
    border-color: var(--theme-light) !important;
    color: var(--theme-primary) !important;
}
.btn-default:hover, .btn-default:focus {
    background: var(--theme-lightest) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-primary) !important;
}

.btn-primary:disabled, .btn-primary.disabled,
.btn-success:disabled, .btn-success.disabled,
.btn-warning:disabled, .btn-warning.disabled {
    background: var(--theme-light) !important;
    border-color: var(--theme-light) !important;
    opacity: 0.7;
}


/* =============================================================
   4. LINKS
   ============================================================= */
a { color: var(--theme-primary); }
a:hover, a:focus { color: var(--theme-darkest); }


/* =============================================================
   5. BOX / CARD ACCENTS
   ============================================================= */
.box-primary  { border-top-color: var(--theme-primary) !important; }
.box-info     { border-top-color: var(--theme-accent) !important; }
.box-success  { border-top-color: var(--theme-primary) !important; }
.box-warning  { border-top-color: var(--theme-accent) !important; }
.box-danger   { border-top-color: var(--theme-primary) !important; }
.box-default  { border-top-color: var(--theme-light) !important; }

.box-solid.box-primary > .box-header {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #fff;
}


/* =============================================================
   6. LABELS & BADGES
   ============================================================= */
.label-primary, .badge-primary { background-color: var(--theme-primary) !important; }
.label-success, .badge-success { background-color: var(--theme-primary) !important; }
.label-info,    .badge-info    { background-color: var(--theme-accent) !important; }
.label-warning, .badge-warning { background-color: var(--theme-accent) !important; color: #fff !important; }
.label-danger,  .badge-danger  { background-color: var(--theme-primary) !important; }
.label-default, .badge-default { background-color: var(--theme-light) !important; color: #444 !important; }


/* =============================================================
   7. PAGINATION
   ============================================================= */
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #fff !important;
}
.pagination > li > a,
.pagination > li > span { color: var(--theme-primary); }
.pagination > li > a:hover {
    background-color: var(--theme-lightest);
    color: var(--theme-primary);
}


/* =============================================================
   8. NAV-TABS
   ============================================================= */
.nav-tabs-custom > .nav-tabs > li.active {
    border-top-color: var(--theme-primary) !important;
}
.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active > a:hover {
    color: var(--theme-primary) !important;
}


/* =============================================================
   9. PROGRESS BARS
   ============================================================= */
.progress-bar, .progress-bar-primary, .progress-bar-success, .progress-bar-green {
    background-color: var(--theme-primary) !important;
}
.progress-bar-info, .progress-bar-warning, .progress-bar-aqua, .progress-bar-yellow {
    background-color: var(--theme-accent) !important;
}
.progress-bar-danger, .progress-bar-red {
    background-color: var(--theme-primary) !important;
}


/* =============================================================
   10. TEXT COLORS
   ============================================================= */
.text-primary, .text-purple { color: var(--theme-primary) !important; }
.text-red    { color: var(--theme-primary) !important; }
.text-green  { color: var(--theme-accent) !important; }
.text-yellow { color: var(--theme-accent) !important; }
.text-aqua   { color: var(--theme-primary) !important; }
.text-blue   { color: var(--theme-primary) !important; }


/* =============================================================
   11. BACKGROUND COLORS
   ============================================================= */
.bg-purple { background-color: var(--theme-primary) !important; color: #fff !important; }
.bg-aqua   { background-color: var(--theme-primary) !important; color: #fff !important; }
.bg-red    { background-color: var(--theme-primary) !important; color: #fff !important; }
.bg-green  { background-color: var(--theme-accent) !important; color: #fff !important; }
.bg-yellow { background-color: var(--theme-accent) !important; color: #fff !important; }
.bg-blue   { background-color: var(--theme-primary) !important; color: #fff !important; }
.bg-orange { background-color: var(--theme-accent) !important; color: #fff !important; }
.bg-maroon { background-color: var(--theme-darkest) !important; color: #fff !important; }


/* =============================================================
   12. INFO-BOX ICONS
   ============================================================= */
.info-box-icon.bg-aqua  { background: var(--theme-primary) !important; }
.info-box-icon.bg-green { background: var(--theme-accent) !important; }
.info-box-icon.bg-red   { background: var(--theme-darkest) !important; }
.info-box-icon.bg-yellow{ background: var(--theme-accent) !important; }
.info-box-icon.bg-blue  { background: var(--theme-primary) !important; }


/* =============================================================
   13. LOGIN PAGE
   ============================================================= */
.login-page {
    background: var(--theme-login-gradient) !important;
}
.login-box-body {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.login-logo img {
    border-radius: 16px;
}


/* =============================================================
   14. FORM FOCUS
   ============================================================= */
.form-control:focus {
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 0.2rem rgba(91, 63, 214, 0.12);
}
body.theme-blue .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(43, 127, 212, 0.12);
}


/* =============================================================
   15. DROPDOWN
   ============================================================= */
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
    background-color: var(--theme-primary);
    color: #fff;
}


/* =============================================================
   16. TOGGLE SWITCHES
   ============================================================= */
input.ios-switch:checked,
.icheckbox_square-blue.checked {
    background: var(--theme-gradient) !important;
}


/* =============================================================
   17. ALERTS & CALLOUTS
   ============================================================= */
.callout.callout-info, .callout.callout-success {
    border-left-color: var(--theme-primary) !important;
}
.callout.callout-warning { border-left-color: var(--theme-accent) !important; }
.callout.callout-danger  { border-left-color: var(--theme-primary) !important; }

.alert-info, .alert-success {
    background-color: var(--theme-lightest) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-darkest) !important;
}
.alert-warning {
    background-color: var(--theme-lightest) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-primary) !important;
}
.alert-danger {
    background-color: var(--theme-lightest) !important;
    border-color: var(--theme-primary) !important;
    color: var(--theme-darkest) !important;
}


/* =============================================================
   18. SMALL-BOX
   ============================================================= */
.small-box.bg-aqua, .small-box.bg-green,
.small-box.bg-yellow, .small-box.bg-red, .small-box.bg-purple {
    background: var(--theme-primary) !important;
}
.small-box:hover { opacity: 0.92; }


/* =============================================================
   19. TABLE HIGHLIGHT ROWS
   ============================================================= */
.table > tbody > tr.success > td, .table > tbody > tr.success > th,
.table > tbody > tr.info > td,    .table > tbody > tr.info > th,
.table > tbody > tr.warning > td,  .table > tbody > tr.warning > th,
.table > tbody > tr.danger > td,   .table > tbody > tr.danger > th {
    background-color: var(--theme-lightest) !important;
}


/* =============================================================
   20. AGENT WIDGET
   ============================================================= */
.agent-fab {
    background: var(--theme-gradient) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.agent-fab:hover {
    background: var(--theme-gradient-hover) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}
.agent-panel-header {
    background: var(--theme-gradient) !important;
}
.agent-msg.user .agent-msg-bubble {
    background: var(--theme-gradient) !important;
}
.agent-chip:hover {
    background: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}
.agent-scope-badge {
    background: var(--theme-gradient) !important;
}
.agent-send-btn {
    background: var(--theme-gradient) !important;
}
.agent-send-btn:hover:not(:disabled) {
    background: var(--theme-gradient-hover) !important;
}
.agent-input:focus {
    border-color: var(--theme-mid) !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08) !important;
}
.agent-download-btn {
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}
.agent-download-btn:hover {
    background: var(--theme-primary) !important;
    color: #fff !important;
}
.agent-back-link:hover { color: var(--theme-primary) !important; }
.agent-card-icon        { color: var(--theme-primary) !important; }


/* =============================================================
   21. THEME SWITCHER BUTTON (navbar) — disabled; header control commented in index.jsp
   =============================================================
.theme-toggle-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    color: #fff;
    padding: 3px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.theme-toggle-btn:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.15);
}
.theme-toggle-btn .theme-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
body.theme-purple .theme-toggle-btn .theme-dot,
body .theme-toggle-btn .theme-dot {
    background: #9585F0;
}
body.theme-blue .theme-toggle-btn .theme-dot {
    background: #6BB6FF;
}
body.theme-violet .theme-toggle-btn .theme-dot {
    background: linear-gradient(135deg, #4A90E2, #9B59B6);
}
   ============================================================= */


/* =============================================================
   22. UTILITY CLASSES (for inline-style replacements)
   ============================================================= */
.theme-text-primary { color: var(--theme-primary) !important; }
.theme-bg-lightest  { background-color: var(--theme-lightest) !important; }
