﻿/* =========================================================
   Modern card-style modal shell (Bootstrap 3 compatible)
   ========================================================= */
/*
.rw-card {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    background: var(--rw-bg-elev-2, #1f2535);
}*/

/* Light theme override */
html.theme-light .rw-card {
    background: #ffffff;
    border-color: #d0d0d0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

/* Muted helper text (same idea as rw-muted in your BS5 screen) */
.rw-muted {
    color: var(--text-muted, #9aa0b5);
}

html.theme-light .rw-muted {
    color: var(--text-muted, #6c757d);
}

/* =========================================================
   Modal header layout (Bootstrap 3, flex-based)
   ========================================================= */

.rw-modal-header {
    /* Override BS3 .modal-header defaults */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 15px;
    background: transparent;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 8px;
}

/* Light theme: softer border */
html.theme-light .rw-modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* Left block (title + subtext) */
.rw-modal-header-main {
    min-width: 0; /* allow text to truncate if very narrow */
}

    .rw-modal-header-main .modal-title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }

    .rw-modal-header-main .small {
        margin-top: 2px;
        font-size: 11px;
    }

/* Right block (pill buttons + X) */
.rw-modal-header-actions {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
}

/* Move the default close button into the flex row visually */
.rw-modal-close {
    float: none; /* cancel BS3 float */
    position: static; /* no absolute positioning */
    margin-left: 6px;
}

/* =========================================================
   Pill-style header buttons (BS5-like in BS3)
   ========================================================= */

.rw-pill-btn {
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 11px;
    line-height: 1.4;
    border-width: 1px;
    border-style: solid;
    text-transform: none;
    font-weight: 500;
}

/* Primary pill ("Add", "Email It" etc.) */
.rw-pill-primary {
    background-color: var(--brand-accent, #5ac18e);
    border-color: var(--brand-accent, #5ac18e);
    color: #ffffff;
}

    .rw-pill-primary:hover,
    .rw-pill-primary:focus {
        background-color: #48a878;
        border-color: #48a878;
        color: #ffffff;
    }

/* Secondary pill ("Cancel") – neutral subtle style */
.rw-pill-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text, #f5f5f5);
}

html.theme-light .rw-pill-secondary {
    background-color: #f1f3f5;
    border-color: #d4d7dd;
    color: #333333;
}

.rw-pill-secondary:hover,
.rw-pill-secondary:focus {
    background-color: rgba(255, 255, 255, 0.16);
}

html.theme-light .rw-pill-secondary:hover,
html.theme-light .rw-pill-secondary:focus {
    background-color: #e6e9ef;
}

/* Tiny elevated look for the panel inside the body */
.rw-panel-elevated {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.rw-modal-header-main {
    display: block;
    padding-top: 10px; /* space above */
    padding-bottom: 12px; /* space below */
}

    /* tighten / control title + subtext spacing */
    .rw-modal-header-main .modal-title {
        margin-bottom: 6px;
    }

    /* optional: slightly larger subtitle line height so it breathes */
    .rw-modal-header-main .rw-muted.small {
        line-height: 1.4;
    }

/* =========================================================
   Modal header layout (Bootstrap 3)
   ========================================================= */

.modal-header.rw-modal-header {
    display: flex;
    align-items: flex-start; /* title block top-aligned with buttons */
    justify-content: space-between; /* title left, buttons right */
    padding: 10px 18px 14px 18px; /* ↑ increase overall header height */
    border-bottom: 1px solid var(--rw-border-subtle, rgba(255,255,255,0.15));
}

/* title + subtitle block (LEFT) */
.rw-modal-header-main {
    flex: 1 1 auto;
    padding-right: 16px; /* breathing room before buttons */
}

    .rw-modal-header-main .modal-title {
        margin: 2px 0 6px 0; /* space between title and subtitle */
        font-size: 16px;
        font-weight: 600;
    }

    .rw-modal-header-main .rw-muted.small {
        display: block;
        line-height: 1.5;
    }

/* actions (RIGHT) */
.rw-modal-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px; /* spacing between Add / Cancel */
}

/* pill buttons reuse your existing style, just ensure they look tidy */
.rw-pill-btn {
    padding: 4px 14px;
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid var(--rw-border-subtle, rgba(255,255,255,0.2));
}

/* move the "X" back to the very left and vertically centre it */
.modal-header.rw-modal-header > .close {
    order: -1; /* ensure it's the first item in flex row */
    margin-right: 10px;
    margin-top: 2px;
}

.modal-header {
    height: 70px;
}



/* Override Bootstrap's .badge:empty rule for our pill buttons */
.badge.rw-pill-btn,
.badge.rw-pill-btn:empty {
    display: inline-flex; /* or inline-block if you prefer */
    align-items: center;
}

.modal-header .badge.rw-pill-btn,
.modal-header .badge.rw-pill-btn:empty {
    display: inline-flex;
    align-items: center;
}


/* Page shell */
.rw-admin-page {
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Header */
.rw-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px 24px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.03); /* light, works for dark/light */
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.rw-page-header-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rw-page-kicker {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: .7;
    margin: 0;
}

.rw-page-title {
    font-size: 20px;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
}

.rw-page-title-accent {
    font-weight: 700;
}

.rw-page-subtitle {
    font-size: 13px;
    margin: 2px 0 0;
    opacity: .75;
}

.rw-page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Primary header action aligned with your modal buttons */
/* Primary CTA button (header action) */
.rw-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    line-height: 1;
    background-color: var(--rw-accent);
    border: 1px solid var(--rw-accent);
    color: #fff;
    text-decoration: none; /* for <a> */
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}

    .rw-primary-action .material-icons {
        font-size: 16px;
    }

    /* Hover/Focus */
    .rw-primary-action:hover,
    .rw-primary-action:focus {
        color: #fff;
        text-decoration: none;
        filter: brightness(0.95); /* safe cross-browser hover treatment */
    }

    .rw-primary-action:active {
        transform: translateY(1px);
        filter: brightness(0.90);
    }

    /* Accessible focus ring */
    .rw-primary-action:focus {
        outline: none;
    }

    .rw-primary-action:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.65);
        outline-offset: 2px;
    }

    /* Disabled states (covers <button disabled> and “disabled” links) */
    .rw-primary-action:disabled,
    .rw-primary-action.disabled,
    .rw-primary-action[aria-disabled="true"] {
        opacity: 0.55;
        cursor: not-allowed;
        pointer-events: none;
        transform: none;
        filter: none;
    }


/* Card + table wrapper */
.rw-card {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 45px rgba(15, 23, 42, 0.06);
}

.theme-dark .rw-card {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
}

.rw-table-card {
    padding: 10px 16px 16px;
}

/* Toolbar above DataTable */
.rw-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 4px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 6px;
}

.rw-table-toolbar-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.rw-table-caption {
    font-size: 13px;
    font-weight: 600;
}

.rw-table-meta {
    font-size: 12px;
    opacity: .7;
}

.rw-table-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rw-table-wrapper {
    padding-top: 6px;
}

/* DataTables + table tweaks */
.dt-user-table {
    font-size: 12px;
}

    .dt-user-table > thead > tr > th {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        border-bottom-width: 1px;
        white-space: nowrap;
    }

    .dt-user-table > tbody > tr > td {
        vertical-align: middle;
    }

    .dt-user-table tbody tr:hover {
        background-color: rgba(148, 163, 184, 0.12);
    }

/* DataTables wrapper alignment */
.dataTables_wrapper .dataTables_filter {
    text-align: left;
    float: none;
    margin: 0 0 6px;
}

    .dataTables_wrapper .dataTables_filter label {
        font-weight: 400;
    }

    .dataTables_wrapper .dataTables_filter input {
        margin-left: 6px;
        border-radius: 999px;
        padding: 4px 10px;
        border: 1px solid rgba(148, 163, 184, 0.7);
        font-size: 12px;
    }

/* Buttons to match your modal buttons / custom-button */
.dataTables_wrapper .dt-buttons .btn,
.rw-dt-buttons .btn {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    border: none;
    box-shadow: none;
    margin-right: 4px;
}

    .dataTables_wrapper .dt-buttons .btn:hover,
    .rw-dt-buttons .btn:hover {
        opacity: .9;
    }

/* Selected row */
.dataTables_wrapper .dataTables_info {
    font-size: 11px;
    opacity: .7;
}

/* Checkbox column centering */
.dt-user-table td.text-center {
    vertical-align: middle;
}


/* Page shell – sits on top of col-md-10 col-md-offset-2 */
.rw-admin-page {
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Header */
.rw-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px 24px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.theme-dark .rw-page-header {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.18);
}

.rw-page-header-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rw-page-kicker {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: .7;
    margin: 0;
}

.rw-page-title {
    font-size: 20px;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
}

.rw-page-title-accent {
    font-weight: 700;
}

.rw-page-subtitle {
    font-size: 13px;
    margin: 2px 0 0;
    opacity: .75;
}

.rw-page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Primary action uses your existing .custom-button base */
/*.rw-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
}

    .rw-primary-action .material-icons {
        font-size: 16px;
    }*/

/* Card + table wrapper */
.rw-card {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 45px rgba(15, 23, 42, 0.06);
}

.theme-dark .rw-card {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
}

.rw-table-card {
    padding: 10px 16px 16px;
}

/* Toolbar above DataTable */
.rw-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 4px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 6px;
}

.rw-table-toolbar-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.rw-table-caption {
    font-size: 13px;
    font-weight: 600;
}

.rw-table-meta {
    font-size: 12px;
    opacity: .7;
}

.rw-table-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rw-table-wrapper {
    padding-top: 6px;
}

/* DataTables general look */
.dt-user-table {
    font-size: 12px;
}

    .dt-user-table > thead > tr > th {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        border-bottom-width: 1px;
        white-space: nowrap;
    }

    .dt-user-table > tbody > tr > td {
        vertical-align: middle;
    }

    .dt-user-table tbody tr:hover {
        background-color: rgba(148, 163, 184, 0.12);
    }

/* DataTables filter box */
.dataTables_wrapper .dataTables_filter {
    text-align: left;
    float: none;
    margin: 0 0 6px;
}

    .dataTables_wrapper .dataTables_filter label {
        font-weight: 400;
    }

    .dataTables_wrapper .dataTables_filter input {
        margin-left: 6px;
        border-radius: 999px;
        padding: 4px 10px;
        border: 1px solid rgba(148, 163, 184, 0.7);
        font-size: 12px;
    }

/* Buttons in custom header slot */
.rw-dt-buttons .btn,
.dataTables_wrapper .dt-buttons .btn {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    border: none;
    box-shadow: none;
    margin-right: 4px;
}

    .rw-dt-buttons .btn:hover,
    .dataTables_wrapper .dt-buttons .btn:hover {
        opacity: .9;
    }

/* Misc */
.dataTables_wrapper .dataTables_info {
    font-size: 11px;
    opacity: .7;
}

.dt-user-table td.text-center {
    vertical-align: middle;
}


/* Make brand accent follow your global rw-accent token */
/* Tie brand accent to your existing rw-accent token */
:root,
html.theme-dark {
    --brand-accent: var(--rw-accent);
}

/* Primary pill – for Save/Add buttons */
.rw-pill-primary {
    background-color: var(--brand-accent, #5ac18e);
    border-color: var(--brand-accent, #5ac18e);
    color: #ffffff;
}

    .rw-pill-primary:hover,
    .rw-pill-primary:focus {
        background-color: #48a878; /* static darker shade */
        border-color: #48a878;
        color: #ffffff;
    }

/* Secondary pill – Cancel / neutral actions */
.rw-pill-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f5f5f5;
}

html.theme-light .rw-pill-secondary {
    background-color: #f1f3f5;
    border-color: #d4d7dd;
    color: #333333;
}

    html.theme-light .rw-pill-secondary:hover,
    html.theme-light .rw-pill-secondary:focus {
        background-color: #e6e9ef;
    }

/* Shared pill button look – works on <input>, <button>, <a>, etc. */
.rw-pill-btn,
.rw-pill-primary,
.rw-pill-secondary {
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 11px;
    line-height: 1.4;
    border-width: 1px;
    border-style: solid;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* PRIMARY pill – accent color */
.btn.rw-pill-primary,
input[type="submit"].rw-pill-primary,
input[type="button"].rw-pill-primary {
    background-color: var(--rw-accent);
    border-color: var(--rw-accent);
    color: #fff;
}

    /* Hover/active for primary */
    .btn.rw-pill-primary:hover,
    .btn.rw-pill-primary:focus,
    input[type="submit"].rw-pill-primary:hover,
    input[type="submit"].rw-pill-primary:focus,
    input[type="button"].rw-pill-primary:hover,
    input[type="button"].rw-pill-primary:focus {
        background-color: #48a878; /* static darker shade */
        border-color: #48a878;
        color: #fff;
    }

/* SECONDARY pill – subtle/neutral */
.btn.rw-pill-secondary,
input[type="submit"].rw-pill-secondary,
input[type="button"].rw-pill-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f5f5f5;
}

/* Light theme variant for secondary */
html.theme-light .btn.rw-pill-secondary,
html.theme-light input[type="submit"].rw-pill-secondary,
html.theme-light input[type="button"].rw-pill-secondary {
    background-color: #f1f3f5;
    border-color: #d4d7dd;
    color: #333;
}

/* Shared pill look */
.btn.rw-pill-primary,
.btn.rw-pill-secondary,
input[type="submit"].rw-pill-primary,
input[type="submit"].rw-pill-secondary,
input[type="button"].rw-pill-primary,
input[type="button"].rw-pill-secondary {
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* Ensure our primary CTA styling wins vs Bootstrap + custom-button */
.btn.rw-primary-action,
a.btn.rw-primary-action,
button.btn.rw-primary-action,
input.btn.rw-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    line-height: 1;
    background-color: var(--rw-accent);
    border: 1px solid var(--rw-accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, border-color .15s ease, transform .05s ease, filter .15s ease;
}

    .btn.rw-primary-action:hover,
    .btn.rw-primary-action:focus {
        color: #fff;
        text-decoration: none;
        filter: brightness(0.95);
    }

    .btn.rw-primary-action:active {
        transform: translateY(1px);
        filter: brightness(0.90);
    }

    .btn.rw-primary-action:focus {
        outline: none;
    }

    .btn.rw-primary-action:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.65);
        outline-offset: 2px;
    }

    .btn.rw-primary-action:disabled,
    .btn.rw-primary-action.disabled,
    .btn.rw-primary-action[aria-disabled="true"] {
        opacity: 0.55;
        cursor: not-allowed;
        pointer-events: none;
        transform: none;
        filter: none;
    }

    .btn.rw-primary-action .material-icons {
        font-size: 16px;
    }





/* Light Theme */
.theme-light .tox-tinymce {
    background-color: white;
    color: black;
}

.theme-light .tox-editor-container {
    background-color: white;
    color: black;
}

.theme-light .tox-toolbar {
    background-color: #f5f5f5;
    color: black;
}

.theme-light .tox-statusbar {
    background-color: #f0f0f0;
}

/* Dark Theme */
.theme-dark .tox-tinymce {
    background-color: #333;
    color: white;
}

.theme-dark .tox-editor-container {
    background-color: #333;
    color: white;
}

.theme-dark .tox-toolbar {
    background-color: #444;
    color: white;
}

.theme-dark .tox-statusbar {
    background-color: #555;
}


/* Light Theme Styles */
body.light-theme .container-xl {
    padding: 20px;
    background-color: #fafafa;
}

body.light-theme .table-wrapper {
    background-color: #ffffff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

body.light-theme #searchInput {
    background-color: #f9f9f9;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.3s ease;
}

    body.light-theme #searchInput::placeholder {
        color: #aaa;
    }

body.light-theme #progressBar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
}

body.light-theme #jstree {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
}

/* Dark Theme Styles */
body.dark-theme .container-xl {
    padding: 20px;
    background-color: #333;
}

body.dark-theme .table-wrapper {
    background-color: #444;
    border: 1px solid #555;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

body.dark-theme #searchInput {
    background-color: #555;
    color: #fff;
    border: 1px solid #666;
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.3s ease;
}

    body.dark-theme #searchInput::placeholder {
        color: #bbb;
    }

body.dark-theme #progressBar {
    height: 8px;
    background-color: #666;
    border-radius: 4px;
}

body.dark-theme #jstree {
    background-color: #444;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 15px;
    color: #fff;
}

/* Progress Bar Animation */
#progressBar {
    transition: width 1s ease-in-out;
}

/* Light Theme Styles */
body.light-theme #searchInput {
    background-color: #fff;
    color: #333; /* Darker text color for better visibility */
    border: 1px solid #ccc;
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.3s ease;
}

    body.light-theme #searchInput::placeholder {
        color: #888; /* Light gray for placeholder text */
    }

/* Dark Theme Styles */
body.dark-theme #searchInput {
    background-color: #444;
    color: #fff; /* White text for dark theme */
    border: 1px solid #666;
    padding: 10px;
    width: 100%;
    border-radius: 6px;
    transition: all 0.3s ease;
}

    body.dark-theme #searchInput::placeholder {
        color: #bbb; /* Lighter gray placeholder text */
    }

/* Focus State for both themes */
body .rw-page-header input:focus {
    border-color: #4CAF50; /* Green border on focus */
    outline: none; /* Remove outline */
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5); /* Subtle green shadow */
}

