/*
 * Admin page colours in the UQuiz brand: deep purple, violet and orange.
 * Layered over Bootstrap 3, Gentelella (custom.min.css) and bootstrap-table.
 * Loaded from include-css.php; selectors are prefixed with body / .right_col
 * so they win over the libraries that load after it.
 */
:root {
    --ui-page: #F6F4FB;
    --ui-card: #FFFFFF;
    --ui-line: #ECE8F5;
    --ui-line-strong: #DCD4EA;
    --ui-text: #3F3557;
    --ui-heading: #2E1A47;
    --ui-muted: #7B6F93;
    --ui-tint: #F5F1FC;

    --ui-primary: #7C3AED;
    --ui-primary-dark: #6D28D9;
    --ui-primary-ring: rgba(124, 58, 237, .18);
    --ui-orange: #F05A1E;
    --ui-orange-dark: #D9480F;
    --ui-success: #059669;
    --ui-success-dark: #047857;
    --ui-danger: #DC2626;
    --ui-danger-dark: #B91C1C;
    --ui-info: #0EA5E9;
    --ui-info-dark: #0284C7;
}

/* ---------- Page and panels ---------- */

body .right_col {
    background: var(--ui-page);
    color: var(--ui-text);
}
body .right_col a:not(.btn) {
    color: var(--ui-primary-dark);
}
body .right_col a:not(.btn):hover {
    color: var(--ui-primary);
}

body .x_panel {
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(46, 26, 71, .05);
    padding: 14px 20px 18px;
}
body .x_title {
    border-bottom: 1px solid var(--ui-line);
    padding: 2px 0 10px;
    margin-bottom: 14px;
}
body .x_title h2 {
    color: var(--ui-heading);
    font-weight: 600;
    font-size: 17px;
}
body .x_title h2 small {
    color: var(--ui-muted);
    font-size: 12.5px;
}
body .x_content h2,
body .x_content h3,
body .x_content h4 {
    color: var(--ui-heading);
}
body .right_col .text-muted,
body .right_col small.text-muted {
    color: var(--ui-muted);
}
body .right_col hr,
body .ln_solid {
    border-top-color: var(--ui-line);
}

/* Home page stat tiles */
body .tile-stats {
    border-color: var(--ui-line);
    border-radius: 12px;
}
body .tile-stats .count,
body .tile_count .tile_stats_count .count {
    color: var(--ui-heading);
}
body .tile-stats .icon i,
body .tile-stats .icon em {
    color: rgba(124, 58, 237, .22);
}

/* ---------- Buttons ---------- */

body .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
body .btn:focus,
body .btn:active:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--ui-primary-ring);
}

body .btn-primary { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff; }
body .btn-primary:hover,
body .btn-primary:focus,
body .btn-primary:active { background: var(--ui-primary-dark); border-color: var(--ui-primary-dark); color: #fff; }

/* The yellow "Add" buttons become UQuiz orange */
body .btn-warning { background: var(--ui-orange); border-color: var(--ui-orange); color: #fff; }
body .btn-warning:hover,
body .btn-warning:focus,
body .btn-warning:active { background: var(--ui-orange-dark); border-color: var(--ui-orange-dark); color: #fff; }

body .btn-success { background: var(--ui-success); border-color: var(--ui-success); color: #fff; }
body .btn-success:hover,
body .btn-success:focus,
body .btn-success:active { background: var(--ui-success-dark); border-color: var(--ui-success-dark); color: #fff; }

body .btn-danger { background: var(--ui-danger); border-color: var(--ui-danger); color: #fff; }
body .btn-danger:hover,
body .btn-danger:focus,
body .btn-danger:active { background: var(--ui-danger-dark); border-color: var(--ui-danger-dark); color: #fff; }

body .btn-info { background: var(--ui-info); border-color: var(--ui-info); color: #fff; }
body .btn-info:hover,
body .btn-info:focus,
body .btn-info:active { background: var(--ui-info-dark); border-color: var(--ui-info-dark); color: #fff; }

body .btn-default { background: #fff; border-color: var(--ui-line-strong); color: var(--ui-text); }
body .btn-default:hover,
body .btn-default:focus,
body .btn-default:active { background: var(--ui-tint); border-color: var(--ui-line-strong); color: var(--ui-heading); }

/* ---------- Forms ---------- */

body .right_col label,
body .modal label {
    color: var(--ui-heading);
    font-weight: 600;
}
body .form-control {
    border-color: var(--ui-line-strong);
    border-radius: 8px;
    box-shadow: none;
    color: var(--ui-text);
}
body .form-control:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-primary-ring);
}
body .form-control::placeholder {
    color: #A99FBD;
}
body label.error,
body .right_col label.error {
    color: var(--ui-danger);
    font-weight: 500;
}

/* ---------- Tables (bootstrap-table) ---------- */

body .right_col .fixed-table-container {
    border-color: var(--ui-line);
    border-radius: 10px;
    overflow: hidden;
}
body .right_col .table > thead > tr > th,
body .right_col .fixed-table-container thead th {
    background: var(--ui-tint);
    color: var(--ui-heading);
    font-weight: 600;
    border-bottom: 1px solid var(--ui-line);
}
body .right_col .table > tbody > tr > td,
body .right_col .fixed-table-container tbody td {
    border-color: var(--ui-line);
    color: var(--ui-text);
}
body .right_col .table-striped > tbody > tr:nth-of-type(odd) {
    background: #FBFAFE;
}
body .right_col .table > tbody > tr:hover > td {
    background: var(--ui-tint);
}
body .right_col .table > tbody > tr.selected > td {
    background: #EDE6FB;
}
body .right_col .fixed-table-pagination .pagination-info,
body .right_col .fixed-table-pagination .page-list {
    color: var(--ui-muted);
}

body .pagination > li > a,
body .pagination > li > span {
    color: var(--ui-primary-dark);
    border-color: var(--ui-line);
}
body .pagination > li > a:hover,
body .pagination > li > span:hover {
    background: var(--ui-tint);
    color: var(--ui-primary);
}
body .pagination > .active > a,
body .pagination > .active > a:hover,
body .pagination > .active > span,
body .pagination > .active > a:focus {
    background: var(--ui-primary);
    border-color: var(--ui-primary);
    color: #fff;
}

/* Status pills */
body .label {
    border-radius: 999px;
    padding: .3em .8em;
    font-weight: 600;
}
body .label-success { background: #D1FAE5; color: #065F46; }
body .label-danger  { background: #FEE2E2; color: #991B1B; }
body .label-warning { background: #FFEDD5; color: #9A3412; }
body .label-info    { background: #E0F2FE; color: #075985; }
body .label-primary { background: #EDE9FE; color: #5B21B6; }
body .label-default { background: #F1EEF7; color: var(--ui-text); }

/* ---------- Alerts and modals ---------- */

body .alert {
    border-radius: 10px;
}
body .alert-success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
body .alert-danger  { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
body .alert-warning { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
body .alert-info    { background: #F0F9FF; border-color: #BAE6FD; color: #075985; }

body .modal-content {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(46, 26, 71, .25);
}
body .modal-header {
    border-bottom: 1px solid var(--ui-line);
}
body .modal-title {
    color: var(--ui-heading);
    font-weight: 600;
}

/* ---------- Footer ---------- */

body footer {
    background: var(--ui-card);
    border-top: 1px solid var(--ui-line);
    color: var(--ui-muted);
}

@media (prefers-reduced-motion: reduce) {
    body .btn {
        transition: none;
    }
}

/* Page headings and home tiles */
body .right_col h1,
body .right_col h2,
body .right_col h3 {
    color: var(--ui-heading);
}
body .tile-stats {
    background: var(--ui-card);
}
body .tile-stats h3 {
    color: var(--ui-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}
body .tile-stats p {
    color: var(--ui-muted);
}

/* =====================================================================
 * Typography and layout
 * ===================================================================== */

body,
body .right_col,
body .left_col,
body .top_nav,
body .modal,
body .btn,
body .form-control,
body .tooltip,
body .popover {
    font-family: 'Plus Jakarta Sans', "Helvetica Neue", Roboto, Arial, sans-serif;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body .right_col {
    padding: 18px 24px 32px !important;
}
body .right_col > br:first-child,
body .right_col > .row > br:first-child {
    display: none;
}

/* Panels: roomier, with a violet accent before the title */
body .x_panel {
    padding: 20px 24px 24px;
    margin-bottom: 20px;
}
body .x_title {
    padding: 0 0 14px;
    margin-bottom: 18px;
}
body .x_title h2 {
    position: relative;
    padding-left: 14px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
    white-space: normal;
    overflow: visible;
}
body .x_title h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--ui-primary), var(--ui-orange));
}
body .x_title h2 small {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--ui-tint);
    color: var(--ui-muted);
    font-size: 11.5px;
    font-weight: 600;
    vertical-align: middle;
}
body .x_content {
    padding: 0;
}
body .x_content > p,
body .x_content ol,
body .x_content ul:not(.nav):not(.dropdown-menu):not(.pagination) {
    color: var(--ui-text);
    line-height: 1.65;
}
body .right_col code {
    background: var(--ui-tint);
    color: var(--ui-primary-dark);
    border-radius: 6px;
    padding: 2px 6px;
}

/* =====================================================================
 * Forms
 * ===================================================================== */

body .right_col label,
body .modal label {
    font-size: 13px;
    margin-bottom: 6px;
}
body .form-control {
    height: 42px;
    padding: 9px 14px;
    font-size: 14px;
    background-color: #FFFFFF;
    transition: border-color .15s, box-shadow .15s;
}
body textarea.form-control {
    height: auto;
    min-height: 90px;
}
body select.form-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%237B6F93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
}
body select.form-control[multiple] {
    background-image: none;
    padding-right: 14px;
    height: auto;
}
body input[type="file"].form-control {
    height: auto;
    padding: 6px;
    color: var(--ui-muted);
    cursor: pointer;
}
body input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 7px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--ui-tint);
    color: var(--ui-primary-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s;
}
body input[type="file"]::file-selector-button:hover {
    background: #EAE2FA;
}
body input[type="checkbox"],
body input[type="radio"] {
    accent-color: var(--ui-primary);
}
body .right_col .form-group {
    margin-bottom: 18px;
}
body .right_col .help-block,
body .right_col small.text-muted {
    font-size: 12px;
    margin-top: 6px;
    display: inline-block;
}

/* Buttons: a touch taller, icon gap, gentle lift */
body .btn:not(.btn-xs):not(.btn-sm) {
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
}
body .btn:not(.btn-xs):not(.btn-default):hover {
    box-shadow: 0 4px 12px rgba(46, 26, 71, .15);
}
body .btn em,
body .btn i {
    margin-right: 2px;
}

/* =====================================================================
 * Tables
 * ===================================================================== */

body .right_col .bootstrap-table {
    margin-top: 6px;
}
body .right_col .fixed-table-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
body .right_col .fixed-table-toolbar .bs-bars,
body .right_col .fixed-table-toolbar .search,
body .right_col .fixed-table-toolbar .columns {
    float: none;
    margin: 0;
}
body .right_col .fixed-table-toolbar .search {
    margin-left: auto;
    position: relative;
}
body .right_col .fixed-table-toolbar .search::before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ui-muted);
    font-size: 12px;
    pointer-events: none;
}
body .right_col .fixed-table-toolbar .search input {
    width: 240px;
    height: 38px;
    padding-left: 34px;
    border-radius: 999px;
}
body .right_col .fixed-table-toolbar .columns .btn,
body .right_col .fixed-table-toolbar .columns .btn-group > .btn {
    height: 38px;
    padding: 0 12px;
    background: #FFFFFF;
    border: 1px solid var(--ui-line-strong);
    color: var(--ui-muted);
    border-radius: 8px !important;
    margin-left: 6px;
}
body .right_col .fixed-table-toolbar .columns .btn:hover {
    color: var(--ui-primary-dark);
    background: var(--ui-tint);
}
body .right_col .fixed-table-toolbar .bs-bars .btn {
    height: 38px;
    min-width: 38px;
}

body .right_col .fixed-table-container {
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    background: #FFFFFF;
}
body .right_col .bootstrap-table .table {
    border: 0;
    margin: 0;
}
body .right_col .bootstrap-table .table > thead > tr > th {
    border: 0;
    border-bottom: 1px solid var(--ui-line);
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ui-muted);
    vertical-align: middle;
}
body .right_col .bootstrap-table .table > thead > tr > th .th-inner {
    padding: 12px 14px;
}
body .right_col .bootstrap-table .table > tbody > tr > td {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--ui-line);
    padding: 12px 14px;
    vertical-align: middle;
    font-size: 13.5px;
}
body .right_col .bootstrap-table .table > tbody > tr:first-child > td {
    border-top: 0;
}
body .right_col .table-striped > tbody > tr:nth-of-type(odd) {
    background: transparent;
}
body .right_col .bootstrap-table .table td img {
    border-radius: 6px;
    object-fit: cover;
}
body .right_col .fixed-table-pagination {
    padding: 4px 2px 0;
}
body .right_col .fixed-table-pagination .pagination {
    margin: 12px 0 0;
}
body .right_col .pagination > li > a,
body .right_col .pagination > li > span {
    margin-left: 4px;
    border-radius: 8px !important;
    min-width: 34px;
    text-align: center;
}
body .right_col .no-records-found td {
    padding: 28px 14px !important;
    color: var(--ui-muted);
    text-align: center;
}

/* Row actions: soft square icon buttons instead of tiny solid ones */
body .right_col .table .btn-xs,
body .right_col td .btn-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 2px 3px 2px 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: none;
}
body .right_col td .btn-xs.btn-primary { background: #EDE9FE; color: #6D28D9; }
body .right_col td .btn-xs.btn-primary:hover { background: #7C3AED; color: #FFFFFF; }
body .right_col td .btn-xs.btn-danger { background: #FEE2E2; color: #B91C1C; }
body .right_col td .btn-xs.btn-danger:hover { background: #DC2626; color: #FFFFFF; }
body .right_col td .btn-xs.btn-success { background: #D1FAE5; color: #047857; }
body .right_col td .btn-xs.btn-success:hover { background: #059669; color: #FFFFFF; }
body .right_col td .btn-xs.btn-warning { background: #FFEDD5; color: #C2410C; }
body .right_col td .btn-xs.btn-warning:hover { background: #F05A1E; color: #FFFFFF; }
body .right_col td .btn-xs.btn-default { background: #F1EEF7; color: var(--ui-text); }
body .right_col td .btn-xs.btn-default:hover { background: #E4DEF0; }

/* =====================================================================
 * Modals and alerts
 * ===================================================================== */

body .modal-backdrop.in {
    opacity: .45;
    background: #1C0F2E;
}
body .modal-header {
    padding: 18px 24px;
}
body .modal-title {
    font-size: 17px;
    font-weight: 700;
}
body .modal-body {
    padding: 22px 24px;
}
body .modal-header .close {
    opacity: .5;
    font-size: 26px;
    font-weight: 400;
}
body .alert {
    padding: 12px 16px;
    font-weight: 500;
}
body label.alert {
    display: block;
}

/* =====================================================================
 * Home dashboard (home.php)
 * ===================================================================== */

.dash-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 26px 28px;
    margin-bottom: 22px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 92% 20%, rgba(240, 90, 30, .35), transparent 40%),
        linear-gradient(120deg, #3D014D 0%, #5B21B6 60%, #7C3AED 100%);
    color: #FFFFFF;
    box-shadow: 0 12px 30px rgba(61, 1, 77, .22);
}
body .right_col .dash-hero h1 {
    margin: 2px 0 6px;
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.dash-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
}
.dash-hero .dash-hero__date {
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.dash-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
body .right_col a.dash-hero__action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 13.5px;
    transition: background-color .15s;
}
body .right_col a.dash-hero__action:hover {
    background: rgba(255, 255, 255, .24);
    color: #FFFFFF;
}

.dash-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.dash-tile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    box-shadow: 0 1px 3px rgba(46, 26, 71, .05);
    transition: transform .15s, box-shadow .15s;
}
a.dash-tile:hover,
a.dash-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(46, 26, 71, .1);
    outline: none;
}
.dash-tile__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 19px;
}
.dash-tile__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dash-tile__count {
    color: var(--ui-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.dash-tile__label {
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 600;
}
.dash-tile--violet .dash-tile__icon { background: #EDE9FE; color: #6D28D9; }
.dash-tile--purple .dash-tile__icon { background: #F3E8FF; color: #9333EA; }
.dash-tile--orange .dash-tile__icon { background: #FFEDD5; color: #EA580C; }
.dash-tile--amber  .dash-tile__icon { background: #FEF3C7; color: #B45309; }
.dash-tile--blue   .dash-tile__icon { background: #DBEAFE; color: #1D4ED8; }
.dash-tile--green  .dash-tile__icon { background: #D1FAE5; color: #047857; }
.dash-tile--teal   .dash-tile__icon { background: #CCFBF1; color: #0F766E; }
.dash-tile--pink   .dash-tile__icon { background: #FCE7F3; color: #BE185D; }

.dash-chart__canvas {
    width: 100%;
    height: 320px;
}
.dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 320px;
    color: var(--ui-muted);
    font-weight: 600;
}
.dash-empty em {
    font-size: 34px;
    color: #DDD3F0;
}

/* =====================================================================
 * Small screens and motion
 * ===================================================================== */

@media (max-width: 767px) {
    body .right_col {
        padding: 14px 12px 24px !important;
    }
    body .x_panel {
        padding: 16px;
    }
    body .right_col .fixed-table-toolbar .search,
    body .right_col .fixed-table-toolbar .search input {
        width: 100%;
        margin-left: 0;
    }
    .dash-hero {
        padding: 20px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .dash-tile,
    body .form-control,
    body input[type="file"]::file-selector-button,
    body .right_col a.dash-hero__action {
        transition: none;
    }
}

/* Keep each row's action buttons on one line (the last column holds them) */
body .right_col .bootstrap-table .table > tbody > tr > td:last-child {
    white-space: nowrap;
}

/* =====================================================================
 * Drag-to-reorder lists (Category Order pages, Daily Quiz)
 * The pages set grey bars with #id selectors, so these use #ids too.
 * ===================================================================== */

body .right_col #sortable-row,
body .right_col #sortable-row-2 {
    padding-left: 0;
    list-style: none;
    counter-reset: sort-item;
}
body .right_col #sortable-row li,
body .right_col #sortable-row-2 li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 14px 10px 40px;
    background: #FFFFFF;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    color: var(--ui-text);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(46, 26, 71, .04);
    transition: border-color .15s, box-shadow .15s;
}
body .right_col #sortable-row li::before,
body .right_col #sortable-row-2 li::before {
    content: "\f0c9";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 14px;
    color: #C9BEDD;
    font-size: 12px;
}
body .right_col #sortable-row li:hover,
body .right_col #sortable-row-2 li:hover {
    border-color: #C4B5FD;
    box-shadow: 0 4px 12px rgba(46, 26, 71, .08);
}
body .right_col #sortable-row li img,
body .right_col #sortable-row-2 li img {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
}
body .right_col #sortable-row li .remove-row,
body .right_col #sortable-row-2 li .remove-row {
    margin-left: auto;
}
body .right_col #sortable-row li.ui-state-highlight,
body .right_col #sortable-row-2 li.ui-state-highlight {
    height: 44px;
    background: var(--ui-tint);
    border: 2px dashed #C4B5FD;
    box-shadow: none;
}
body .right_col #sortable-row li.ui-sortable-helper,
body .right_col #sortable-row-2 li.ui-sortable-helper {
    border-color: var(--ui-primary);
    box-shadow: 0 12px 28px rgba(46, 26, 71, .18);
}

/* =====================================================================
 * Plain tables (not bootstrap-table), e.g. School Provisioning, Payments
 * ===================================================================== */

body .right_col table.table:not(.fixed-table-container table) {
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
}
body .right_col table.table:not(.fixed-table-container table) > thead > tr > th {
    padding: 11px 14px;
    font-size: 11.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ui-muted);
    border-bottom: 1px solid var(--ui-line);
}
body .right_col table.table:not(.fixed-table-container table) > tbody > tr > td {
    padding: 11px 14px;
    vertical-align: middle;
    border-top: 1px solid var(--ui-line);
}
body .right_col table.table:not(.fixed-table-container table) > tbody > tr:first-child > td {
    border-top: 0;
}
body .right_col .x_content > h4,
body .right_col .x_content h4 {
    margin-top: 22px;
    font-weight: 700;
}

/* =====================================================================
 * Badges form (badges.php): its own classes, styled like form-control
 * ===================================================================== */

body .badge-form .badge-field-container {
    background: #FFFFFF;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
body .badge-form h5 {
    color: var(--ui-heading);
    font-weight: 700;
    font-size: 14px;
}
body .badge-form label {
    text-transform: capitalize;
}
body .badge-form input:not([type="file"]),
body .badge-form textarea,
body .badge-form select {
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--ui-text);
    font: inherit;
}
body .badge-form input:focus,
body .badge-form textarea:focus,
body .badge-form select:focus {
    outline: none;
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-primary-ring);
}
body .badge-form button.btn {
    margin-top: 6px;
}

/* =====================================================================
 * On/off switches (Switchery, e.g. System Configurations)
 * Switchery writes its green into inline styles, so match and override them.
 * ===================================================================== */

body .switchery[style*="rgb(38, 185, 154)"],
body .switchery[style*="#26B99A"],
body .switchery[style*="#26b99a"] {
    background-color: var(--ui-primary) !important;
    border-color: var(--ui-primary) !important;
    box-shadow: var(--ui-primary) 0 0 0 16px inset !important;
}
body .switchery {
    transition: background-color .2s, border-color .2s, box-shadow .2s !important;
}

/* =====================================================================
 * Login (index.php)
 * ===================================================================== */

body.login-page {
    margin: 0;
    background: var(--ui-page);
    color: var(--ui-text);
}
.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}
.login-brand {
    display: flex;
    align-items: flex-end;
    padding: 56px;
    color: #FFFFFF;
    background:
        radial-gradient(circle at 85% 15%, rgba(240, 90, 30, .45), transparent 38%),
        radial-gradient(circle at 10% 90%, rgba(183, 148, 246, .35), transparent 40%),
        linear-gradient(140deg, #200030 0%, #3D014D 45%, #6D28D9 100%);
}
.login-brand__inner {
    max-width: 440px;
}
.login-brand__eyebrow {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, .7);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.login-brand h2 {
    margin: 0 0 24px;
    color: #FFFFFF;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
}
.login-brand ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.login-brand li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, .88);
    font-size: 15px;
    font-weight: 500;
}
.login-brand li em {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
    font-size: 14px;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
}
.login-card__logo {
    width: 170px;
    height: auto;
    margin-bottom: 28px;
}
body.login-page .login-card h1 {
    margin: 0 0 6px;
    color: var(--ui-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.login-card__lead {
    margin: 0 0 26px;
    color: var(--ui-muted);
    font-size: 15px;
}
.login-field {
    margin-bottom: 18px;
}
body.login-page .login-field > label {
    display: block;
    margin-bottom: 6px;
    color: var(--ui-heading);
    font-size: 13px;
    font-weight: 600;
}
.login-input {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.login-input > em {
    position: absolute;
    left: 15px;
    top: 15px;
    color: var(--ui-muted);
    font-size: 14px;
    pointer-events: none;
}
body.login-page .login-input .form-control {
    flex: 1 1 100%;
    height: 46px;
    padding-left: 42px;
    padding-right: 46px;
    font-size: 15px;
}
.login-reveal {
    position: absolute;
    right: 6px;
    top: 5px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
}
.login-reveal:hover,
.login-reveal:focus-visible {
    background: var(--ui-tint);
    color: var(--ui-primary-dark);
    outline: none;
}
/* jQuery Validate puts its message right after the input */
body.login-page .login-input label.error {
    flex-basis: 100%;
    margin: 6px 0 0;
    color: var(--ui-danger);
    font-size: 12.5px;
    font-weight: 500;
}
body.login-page #result {
    margin-bottom: 14px;
}
body.login-page .login-submit {
    width: 100%;
    height: 48px;
    margin-top: 6px;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 10px;
}
body.login-page .login-submit:disabled {
    opacity: .7;
}
.login-card__foot {
    margin: 28px 0 0;
    color: var(--ui-muted);
    font-size: 12.5px;
    text-align: center;
}

@media (max-width: 860px) {
    .login-shell {
        grid-template-columns: 1fr;
    }
    .login-brand {
        display: none;
    }
    .login-panel {
        min-height: 100vh;
    }
}
