/* Cavaliba custom CSS
 * Classes prefixed with "cv-" are Cavaliba-specific.
 * The prefix avoids collisions with Bootstrap and third-party libraries.
 * cv = Cavaliba
 */

:root {
    --cv-font-family:        'Verdana', sans-serif;
    --cv-font-size-base:     14px;
    --cv-sidebar-width:      214px;
    --cv-brand-color:        #629ffa;
    --cv-sidebar-link-color: #e9ecef;
    --cv-sidebar-active-color: #e9ec00;
    --cv-navbar-height:      70px;
    --cv-toc-width:          180px;
}

*,
::after,
::before {
    box-sizing: border-box;
}

html {
    font-size: var(--cv-font-size-base);
}

body {
    font-family: var(--cv-font-family);
    /* font-size: 0.875rem; */
    opacity: 1;
    overflow-y: scroll;
    margin: 0;
}


.starter-template {
  padding: 3rem 1.5rem;
  text-align: center;
}

.helptext {
    color: grey;
    font-size: 12px;
}

pre {
  margin-bottom: 0rem;
}

/* a {
  color: #000;
  text-decoration: none;

}  */


/* sidebar  */

a {
    cursor: pointer;
    text-decoration: none;
    color: #000;
    font-family: var(--cv-font-family);
}

li {
    list-style: none;
}

h4 {
    font-family: var(--cv-font-family);
    font-size: 1.275rem;
    color: var(--bs-emphasis-color);
}

/* Layout for admin dashboard skeleton */

.wrapper {
    align-items: stretch;
    display: flex;
    width: 100%;
}

#sidebar {
    max-width: var(--cv-sidebar-width);
    min-width: var(--cv-sidebar-width);
    background: var(--bs-dark);
    transition: all 0.35s ease-in-out;
}

.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    overflow: hidden;
    transition: all 0.15s ease-in-out;
    width: 100%;
    background: var(--bs-light-bg-subtle);
}

/* Sidebar Elements Style */

.sidebar-logo {
    padding: 1.15rem;
}

.sidebar-logo a {
    color: var(--cv-sidebar-link-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-logo-app {
    padding: 1.15rem;
}

.sidebar-logo-app a {
    color: #888888;
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
    margin-left: 0;
}

.sidebar-header-active {
    color: var(--cv-sidebar-active-color);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.0rem 1.5rem .375rem;
}

.sidebar-header {
    color: var(--cv-brand-color);
    font-size: 0.95rem;
    padding: 1.0rem 1.5rem .175rem;
}

a.sidebar-link {
    padding: .325rem 1.625rem;
    color: var(--cv-sidebar-link-color);
    position: relative;
    display: block;
    font-size: 0.875rem;
}

.sidebar-link[data-bs-toggle="collapse"]::after {
    border: solid;
    border-width: 0 .075rem .075rem 0;
    content: "";
    display: inline-block;
    padding: 2px;
    position: absolute;
    right: 1.5rem;
    top: 1.4rem;
    transform: rotate(-135deg);
    transition: all .2s ease-out;
}

.sidebar-link[data-bs-toggle="collapse"].collapsed::after {
    transform: rotate(45deg);
    transition: all .2s ease-out;
}

.navbar-expand .navbar-nav {
  margin-left: auto;
}


/* TOC layout */

.cv-content-area {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.cv-main-content {
    flex: 1 1 auto;
    min-width: 0;
}

.cv-toc {
    flex: 0 0 var(--cv-toc-width);
    position: sticky;
    top: var(--cv-navbar-height);
    max-height: calc(100vh - var(--cv-navbar-height) - 20px);
    overflow-y: auto;
    font-size: 0.85rem;
}

.cv-toc:empty {
    display: none;
}

.cv-scrollable-content {
    height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 15px;
}

.cv-monitor-chart-wide   { width: 900px; }
.cv-monitor-chart-medium { width: 720px; }
.cv-monitor-chart-30d    { width: 806px; }

/* Scroll anchors (instance_detail page sections) */
.cv-scroll-anchor {
    scroll-margin-top: 60px;
}

/* Modal inline forms */
.cv-form-inline {
    display: inline;
}

/* Dropdown <button> styled as a dropdown item */
.cv-dropdown-btn {
    border: none;
    background: none;
    text-align: left;
    padding: 0.5rem 1rem;
    width: 100%;
}

/* Search form */
.cv-search-form {
    display: inline-flex;
}
.cv-search-form .form-control {
    display: inline;
}

/* Export file viewer */
.cv-export-preview {
    max-height: 600px;
    overflow-y: auto;
}

/* Sirene message body blocks */
.cv-sirene-msg-body        { background-color: #fff; }
.cv-sirene-msg-sms         { background-color: #cdedfc; }
.cv-sirene-msg-update      { background-color: #eee; }
.cv-sirene-msg-update-sms  { background-color: #ddd; }

/* Sirene new-message page: header row (title + summary box) */
.cv-sirene-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Sirene notification summary box */
.cv-sirene-notify-summary {
    background-color: #eee;
    min-width: 200px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Sirene notification loading spinner (toggled by JS/HTMX) */
.cv-sirene-notify-loading {
    display: none;
    margin-top: 0.5rem;
    text-align: center;
}

/* Larger inline icon */
.cv-icon-lg {
    font-size: 1.2rem;
}

/* Clickable table row */
.cv-row-clickable {
    cursor: pointer;
}

/* Public page message body (preserve newlines) */
.cv-pub-body {
    white-space: pre-wrap;
}

/* content  */
.content {
    flex: 1;
    max-width: 100vw;
    width: 100vw;
}

@media (min-width:768px) {
    .content {
        max-width: auto;
        width: auto;
    }
}



/* Sidebar Toggle */

#sidebar.collapsed {
    margin-left: calc(-1 * var(--cv-sidebar-width));
}

/* Footer and Nav */

@media (max-width:767.98px) {

    .js-sidebar {
        margin-left: calc(-1 * var(--cv-sidebar-width));
    }

    #sidebar.collapsed {
        margin-left: 0;
    }

    .navbar,
    footer {
        width: 100vw;
    }
}
