/* ==========================================================================
   RvWay Admin — Day / Night mode
   Night (dark) is the default. Day mode turns on with <html data-theme="light">.
   Colours used inside page templates point at these variables, so both modes
   stay in sync. Generated overrides for the template CSS live in rvway-light.css.
   ========================================================================== */

:root {
    --rv-bg: #0a1020;
    --rv-bg2: #0e1729;
    --rv-panel: #111c33;
    --rv-panel2: #16233f;
    --rv-line: #1f3050;
    --rv-line2: #27395c;
    --rv-txt: #e7eefc;
    --rv-muted: #8ba0c4;
    --rv-muted2: #5f739b;
    --rv-hi: #0c1426;
    --rv-glow: #13213e;
    --rv-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

html[data-theme="light"] {
    --rv-bg: #f3f5fa;
    --rv-bg2: #f7f9fc;
    --rv-panel: #ffffff;
    --rv-panel2: #eef2f8;
    --rv-line: #dde4ef;
    --rv-line2: #cbd5e4;
    --rv-txt: #0f1b33;
    --rv-muted: #56657f;
    --rv-muted2: #6b7a94;
    --rv-hi: #f3f5fa;
    --rv-glow: #ffffff;
    --rv-shadow: 0 6px 20px rgba(15, 27, 51, .08);

    /* The scoped variables some pages define on their own wrappers */
    --bg: #f3f5fa; --bg2: #f7f9fc; --panel: #ffffff; --panel2: #eef2f8;
    --line: #dde4ef; --line2: #cbd5e4; --txt: #0f1b33; --muted: #56657f; --muted2: #6b7a94;
}
html[data-theme="light"] .custom-action-wrapper,
html[data-theme="light"] [class*="wrapper"] {
    --bg: #f3f5fa; --bg2: #f7f9fc; --panel: #ffffff; --panel2: #eef2f8;
    --line: #dde4ef; --line2: #cbd5e4; --txt: #0f1b33; --muted: #56657f; --muted2: #6b7a94;
}

/* ---- Toggle button ---------------------------------------------------- */
.rv-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 14px;
    margin: -16px 16px -16px 0; /* sit inside the existing top bar without making it taller */
    border-radius: 999px;
    border: 1px solid var(--rv-line);
    background: var(--rv-panel);
    color: var(--rv-txt);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.rv-theme-toggle:hover { border-color: #2f7bff; }
.rv-theme-toggle:focus-visible { outline: 2px solid #2f7bff; outline-offset: 2px; }
.rv-theme-toggle .rv-icon-sun { color: #f59e0b; }
.rv-theme-toggle .rv-icon-moon { color: #6d8cff; display: none; }
html[data-theme="light"] .rv-theme-toggle .rv-icon-sun { display: none; }
html[data-theme="light"] .rv-theme-toggle .rv-icon-moon { display: inline-block; }

/* ---- Hand-tuned Day mode touches ------------------------------------- */
html[data-theme="light"] body,
html[data-theme="light"] .main_content,
html[data-theme="light"] .main_content_iner {
    background: var(--rv-bg) !important;
    color: var(--rv-txt);
}
html[data-theme="light"] .sidebar,
html[data-theme="light"] .header_iner,
html[data-theme="light"] .footer_part {
    background: #ffffff !important;
    border-color: var(--rv-line) !important;
}
html[data-theme="light"] .sidebar #sidebar_menu > li > a,
html[data-theme="light"] .sidebar #sidebar_menu li ul li a,
html[data-theme="light"] .sidebar .nav_title span {
    color: #26334d !important;
}
html[data-theme="light"] .sidebar #sidebar_menu li.mm-active > a,
html[data-theme="light"] .sidebar #sidebar_menu li > a.active,
html[data-theme="light"] .sidebar #sidebar_menu li > a.active .nav_title span {
    color: #1c5fe0 !important;
}
html[data-theme="light"] .metismenu .has-arrow::after { color: #64748b !important; }
html[data-theme="light"] .card,
html[data-theme="light"] .white_card,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .dropdown-menu {
    background-color: #ffffff !important;
    border-color: var(--rv-line) !important;
    box-shadow: var(--rv-shadow);
}
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] select {
    background-color: #ffffff !important;
    color: var(--rv-txt) !important;
    border: 1px solid var(--rv-line2) !important;
}
html[data-theme="light"] .form-control::placeholder,
html[data-theme="light"] textarea::placeholder { color: #94a3b8 !important; }
html[data-theme="light"] .table-hover thead th,
html[data-theme="light"] table.dataTable thead th {
    background-color: #f1f4f9 !important;
    color: #26334d !important;
}
html[data-theme="light"] .table-hover > tbody > tr:hover td { background-color: #f7f9fc !important; }
html[data-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button { color: #26334d !important; }
html[data-theme="light"] .btn-dark { background-color: #334155; border-color: #334155; color: #fff; }
html[data-theme="light"] .btn-secondary { color: #fff; }
html[data-theme="light"] .callout-banner {
    background: linear-gradient(145deg, #eef4ff, #f7f9fc) !important;
    color: #1d4ed8 !important;
}
html[data-theme="light"] ::-webkit-scrollbar-track { background: #eef2f8; }
html[data-theme="light"] ::-webkit-scrollbar-thumb,
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #cbd5e4; }
html[data-theme="light"] * { scrollbar-color: #cbd5e4 #eef2f8; }
html[data-theme="light"] .sidebar_icon i.text-white { color: #26334d !important; }
html[data-theme="light"] .text-light { color: #26334d !important; }

/* Day-only colours for one-off shades inside templates. These are NOT defined at
   night, so each template falls back to its original colour and Night mode is
   pixel-for-pixel unchanged. */
html[data-theme="light"] {
    --rvl-bg2: #f7f9fc; --rvl-panel: #ffffff; --rvl-panel2: #eef2f8; --rvl-line: #dde4ef;
    --rvl-txt: #0f1b33; --rvl-muted: #56657f;
    --rvl-cyan: #0284c7; --rvl-amber: #b45309; --rvl-green: #15803d;
}

/* Softer zebra rows by day */
html[data-theme="light"] .table-striped > tbody > tr:nth-of-type(odd) > *,
html[data-theme="light"] table.dataTable.stripe tbody tr.odd,
html[data-theme="light"] table.dataTable tbody tr.odd { background-color: #f7f9fc !important; --bs-table-accent-bg: transparent; }
html[data-theme="light"] table.dataTable tbody tr.even { background-color: #ffffff !important; }

/* Buttons and status pills keep readable text by day */
html[data-theme="light"] .btn-danger,
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-success,
html[data-theme="light"] .btn-info,
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-dark { color: #ffffff !important; }
html[data-theme="light"] .btn-outline-secondary,
html[data-theme="light"] .btn-light { color: #26334d !important; }
html[data-theme="light"] .badge.bg-secondary.bg-opacity-25 {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
}
html[data-theme="light"] .text-secondary { color: #64748b !important; }

/* ---- Text editor (Summernote) -------------------------------------------------------
   Full screen used to open *behind* pop-ups with a see-through background, so the text
   piled on top of the page and couldn't be read. Now it covers the whole window, above
   everything, on a solid background, in both Night and Day. */
.note-editor.note-frame.fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 20000 !important;
    background: var(--rv-bg, #0a1020) !important;
    display: flex;
    flex-direction: column;
}
.note-editor.note-frame.fullscreen .note-toolbar {
    flex: 0 0 auto;
}
.note-editor.note-frame.fullscreen .note-editing-area {
    flex: 1 1 auto;
    overflow: auto;
}
.note-editor.note-frame.fullscreen .note-editable {
    height: auto !important;
    min-height: calc(100vh - 60px) !important;
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 32px !important;
    font-size: 16px;
    line-height: 1.6;
}
/* A modal's transform traps "position: fixed"; release it while its editor is full screen. */
.modal-dialog:has(.note-editor.fullscreen) {
    transform: none !important;
}
.note-editor.note-frame .note-editable {
    background: var(--rv-bg2, #0e1729);
    color: var(--rv-txt, #e7eefc);
}
/* The dashboard template greys out lists and bold text; inside the editor, text should look like the article. */
.note-editor .note-editable :is(p, ol, ul, li, td, th, span, strong, b, h1, h2, h3, h4, h5, h6) {
    color: inherit !important;
}
.note-editor .note-editable p,
.note-editor .note-editable li {
    font-weight: 400;
}
.note-editor .note-editable :is(strong, b) {
    font-weight: 700;
}
.note-editor .note-editable p {
    font-size: inherit;
}
/* Show step numbers and bullets (the template hides them). */
.note-editor .note-editable ol {
    list-style: decimal outside !important;
    padding-left: 1.6em !important;
}
.note-editor .note-editable ul {
    list-style: disc outside !important;
    padding-left: 1.6em !important;
}
.note-editor .note-editable li {
    display: list-item !important;
    list-style: inherit !important;
    margin: .2em 0;
}
.note-editor .note-editable h4 {
    font-size: 1.1rem;
    margin: 1.1em 0 .4em;
    color: inherit;
}
.note-editor .note-editable table td,
.note-editor .note-editable table th {
    border: 1px solid var(--rv-line, #1f3050);
    padding: 6px 10px;
}
html[data-theme="light"] .note-editor.note-frame .note-editable {
    background: #ffffff;
    color: #0f1b33;
}
html[data-theme="light"] .note-editor.note-frame.fullscreen {
    background: #f3f5fa !important;
}

/* ==========================================================================
   Sidebar polish + Home command center (2026-10-01)
   ========================================================================== */
.sidebar .rv-group-title { font-size: .68rem; letter-spacing: .08em; color: var(--rv-muted2) !important; padding-top: 14px; }
.sidebar #sidebar_menu > li > a { display: flex; align-items: center; }
.sidebar #sidebar_menu .nav_title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sidebar #sidebar_menu .nav_title > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #2f7bff; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1; flex-shrink: 0; }
.sidebar .mini_sidebar_on .rv-badge, .mini_sidebar .rv-badge { display: none; }
.sidebar #sidebar_menu > li.mm-active > a.has-arrow { color: var(--rv-txt); }

/* Top bar attention bell */
.rv-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--rv-line); background: var(--rv-panel); color: var(--rv-muted); text-decoration: none; margin-right: 10px; }
.rv-bell:hover { color: var(--rv-txt); border-color: var(--rv-line2); }
.rv-bell .rv-badge { position: absolute; top: -6px; right: -6px; }
.rv-topbar-crumb { color: var(--rv-muted); font-size: .85rem; margin-left: 6px; }
.rv-topbar-crumb b { color: var(--rv-txt); font-weight: 600; }

/* Home: command center */
.cc-panel { background: var(--rv-panel); border: 1px solid var(--rv-line); border-radius: 14px; padding: 18px 20px; height: 100%; }
.cc-panel h6 { color: var(--rv-txt); font-weight: 700; margin-bottom: 2px; }
.cc-sub { color: var(--rv-muted); font-size: .82rem; }
.cc-attn { display: flex; align-items: center; gap: 14px; background: var(--rv-panel); border: 1px solid var(--rv-line); border-radius: 14px; padding: 14px 16px; text-decoration: none; height: 100%; transition: .15s; }
.cc-attn:hover { border-color: #2f7bff; transform: translateY(-2px); box-shadow: var(--rv-shadow); }
.cc-attn .ic { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.cc-attn .n { color: var(--rv-txt); font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.cc-attn .l { color: var(--rv-muted); font-size: .8rem; }
.cc-attn.zero .n { color: var(--rv-muted2); }
.cc-attn.hot { border-color: rgba(47,123,255,.55); }
@media (min-width: 1200px) { .cc-attn-col { flex: 1 0 0%; width: auto; } }
.cc-kpi { background: var(--rv-panel); border: 1px solid var(--rv-line); border-radius: 14px; padding: 14px 18px; height: 100%; }
.cc-kpi .l { color: var(--rv-muted); font-size: .8rem; }
.cc-kpi .v { color: var(--rv-txt); font-size: 1.7rem; font-weight: 800; letter-spacing: -.5px; }
.cc-kpi .d { font-size: .8rem; font-weight: 600; }
.cc-up { color: #10b981; } .cc-down { color: #ef4444; } .cc-flat { color: var(--rv-muted); }
.cc-chart { position: relative; height: 230px; }
.cc-feed { list-style: none; margin: 0; padding: 0; }
.cc-feed li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rv-line); }
.cc-feed li:last-child { border-bottom: 0; }
.cc-feed .who { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0; background: #2f7bff; }
.cc-feed .txt { color: var(--rv-txt); font-size: .86rem; min-width: 0; }
.cc-feed .txt b { font-weight: 600; }
.cc-feed .when { color: var(--rv-muted2); font-size: .74rem; white-space: nowrap; margin-left: auto; }
.cc-table { width: 100%; font-size: .86rem; }
.cc-table th { color: var(--rv-muted2); font-weight: 600; font-size: .74rem; text-transform: uppercase; padding: 6px; border-bottom: 1px solid var(--rv-line); text-align: left; }
.cc-table td { color: var(--rv-txt); padding: 8px 6px; border-bottom: 1px solid var(--rv-line); vertical-align: middle; }
.cc-table tr:last-child td { border-bottom: 0; }
.cc-table .muted { color: var(--rv-muted); font-size: .78rem; }
.cc-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.cc-pill.prem { background: rgba(245,158,11,.15); color: #d97706; }
.cc-pill.free { background: rgba(148,163,184,.18); color: #94a3b8; }
.cc-link { color: #2f7bff; text-decoration: none; font-size: .85rem; font-weight: 600; }
.cc-link:hover { text-decoration: underline; }
.cc-empty { color: var(--rv-muted); font-size: .85rem; padding: 14px 0; }
