/* 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;
}

/* Version + copyright line under the sidebar app name */
.sidebar-version {
    color: var(--cv-sidebar-link-color);
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* version number links to the online release notes - same muted look as the
   line it sits in, underlined on hover only */
.sidebar-version a {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.sidebar-version a:hover {
    text-decoration: underline;
}

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

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

/* SIDEBAR_ENV badge next to the app name - Bootstrap's .badge is
   inline-block with line-height:1, which defaults to vertical-align:
   baseline and sits low next to the larger sidebar-logo text */
.sidebar-logo .badge {
    vertical-align: middle;
}

.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;
}

/* Top navbar - same light grey as dashboard section backgrounds */
.navbar-expand.px-3.border-bottom {
    background-color: var(--bs-secondary-bg, #e9ecef);
}


/* TOC layout */

/* Flash messages (django messages) - fixed bottom-right toast stack, out of the
   document flow so the 3s auto-dismiss never shifts the page vertically.
   z-index 1090 = Bootstrap's toast layer, above modals (1055) and popovers. */
.cv-flash-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1090;
    width: 34rem;
    max-width: calc(100vw - 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* one alert per message, stacked; the severity colour comes from the
   alert-info/-success/-warning/-danger class MESSAGE_TAGS puts on it
   (core/settings.py). The accent bar + border reuse that same colour. */
.cv-flash-item {
    margin-bottom: 0;
    border-width: 2px;
    border-left-width: 0.4rem;
    font-weight: 500;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.3);
    animation: cv-flash-in 0.45s ease-out both;
}

/* slide in from the right with a small overshoot, to catch the eye */
@keyframes cv-flash-in {
    from {
        opacity: 0;
        transform: translateX(2.5rem) scale(0.97);
    }
    60% {
        opacity: 1;
        transform: translateX(-0.3rem) scale(1.02);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* several messages cascade instead of arriving all at once */
.cv-flash-item:nth-child(2) {
    animation-delay: 0.12s;
}

.cv-flash-item:nth-child(3) {
    animation-delay: 0.24s;
}

.cv-flash-item:nth-child(n + 4) {
    animation-delay: 0.36s;
}

@media (prefers-reduced-motion: reduce) {
    .cv-flash-item {
        animation: none;
    }
}

.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; }

.cv-cmt-item.up::before {
    content: "⬤";
    color: #4CAF50;
    font-size: 15px;
    display: inline-block;
    margin: 0 5px 0 0;
}
.cv-cmt-item.down::before {
    content: "⬤";
    color: #F44336;
    font-size: 15px;
    display: inline-block;
    margin: 0 5px 0 0;
}
.cv-cmt-item.na::before {
    content: "⬤ ";
    color: #777;
    font-size: 15px;
    display: inline-block;
    margin: 0 5px 0 0;
}

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

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

/* Configuration page form (app_home/configuration.html) - Django form widgets
   render bare <input>/<select>/<textarea> with no Bootstrap classes, so style
   them here instead of adding class="form-control" to every field definition
   in configuration_form.py */
.cv-config-form .card-header {
    text-transform: capitalize;
    font-weight: 600;
}
.cv-config-form input:not([type="checkbox"]):not([type="radio"]),
.cv-config-form select,
.cv-config-form textarea {
    display: block;
    width: 100%;
    max-width: 480px;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}
.cv-config-form textarea {
    max-width: 100%;
}

/* Admin tools page (app_home/admintools.html) - compact list of maintenance
   actions, one row per action, grouped in a card with a separate "danger
   zone" card for destructive operations. The whole row is the trigger
   (.cv-admintools-row on a <button> opening a confirm modal, or an <a> to a
   dedicated view) - there is no separate action button on the right */
.cv-admintools-row {
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}
.cv-admintools-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    font-size: 1rem;
}
.cv-admintools-item {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.cv-admintools-item .cv-admintools-desc {
    font-size: 0.8125rem;
}

/* Keyname rename tool (app_home/keyname.html) - form + dry-run/real-run report */
.cv-keyname-input {
    max-width: 32rem;
}
.cv-keyname-force {
    padding: 0.75rem;
}
.cv-keyname-mono {
    font-family: var(--bs-font-monospace);
    font-size: 0.875rem;
}
.cv-keyname-summary th {
    width: 12rem;
    font-weight: 600;
}
.cv-keyname-detail {
    font-size: 0.875rem;
}

/* Factory reset report (app_home/factory_reset.html) */
.cv-factory-report {
    font-size: 0.875rem;
}
.cv-factory-report th {
    width: 14rem;
    font-weight: 600;
}

/* 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: flex;
    align-items: center;
    width: 100%;
}
.cv-search-form .input-group {
    flex: 1;
}
.cv-search-help-btn {
    font-weight: bold;
}
.cv-search-help-table code {
    white-space: nowrap;
}

/* Top navbar searchbar */
.cv-searchbar-container {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}
.cv-searchbar-form {
    position: relative;
    width: 100%;
    max-width: 480px;
}
.cv-searchbar-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}
.cv-searchbar-input {
    padding-left: 2.2rem;
}
.cv-searchbar-result {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}
.cv-searchbar-result-title {
    color: var(--cv-brand-color);
}
.cv-searchbar-result a:hover .cv-searchbar-result-title {
    text-decoration: underline;
}
.cv-searchbar-result-description {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* 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 send-confirmation modal: recipient counts mirrored from the summary box */
.cv-sirene-notify-confirm {
    background-color: #eee;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    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;
}

/* Sirene message detail: tech info table, label column width */
.cv-sirene-detail-table th {
    width: 20%;
}

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

/* Discrete "schema info" question-mark link next to a page title */
.cv-schema-help-icon {
    color: #adb5bd;
    margin-left: 0.35rem;
    font-size: 1.1rem;
    vertical-align: middle;
}
.cv-schema-help-icon:hover {
    color: #6c757d;
}

/* Per-field info popover trigger (instance_detail.html) - same look as
   .cv-schema-help-icon, but this one stays a popover, not a modal */
.cv-field-info {
    color: #adb5bd;
    cursor: pointer;
    font-size: 1.1rem;
}
.cv-field-info:hover {
    color: #6c757d;
}

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

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

/* Related objects icon link - fixed-size circle (admintools/ipam list-group
   language, see .cv-admintools-icon/.cv-ipam-icon) so rows stay aligned
   regardless of which icon glyph a schema uses */
.cv-related-icon {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    font-size: 0.85rem;
}
.cv-related-icon i {
    transition: transform 0.2s;
}
.cv-related-icon:hover i {
    transform: scale(1.5);
}

/* Related objects count badge - fixed min-width so a 1-digit vs 4-digit
   count doesn't push each row's name/instance-list out of alignment
   (the bug this redesign fixes) */
.cv-related-count {
    min-width: 2.25rem;
    text-align: center;
    transition: filter 0.2s;
}
.cv-related-count:hover {
    filter: brightness(0.6);
}

/* Related objects classname label - fixed width so the "other related
   instances" list on the right starts at the same x position every row;
   long labels are ellipsized instead of pushing that alignment out */
.cv-related-name {
    min-width: 12rem;
    max-width: 20rem;
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-instance-disabled {
    text-decoration: line-through;
    color: grey;
    font-style: italic;
}

/* 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;
    }
}


/* DataTask */

.datatask-nav-item { position: relative; }

.datatask-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    width: 1.1rem;
    height: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.datatask-dropdown { min-width: 280px; }

.datatask-item { display: block; padding: 4px 12px; }

.datatask-name { font-weight: 500; font-size: 0.85rem; }

.datatask-state { font-size: 0.75rem; font-weight: 600; }
.datatask-state-queued  { color: #888; }
.datatask-state-running { color: #2980b9; }
.datatask-state-done    { color: #27ae60; }
.datatask-state-failed  { color: #e74c3c; }
.datatask-state-aborted { color: #e67e22; }

.datatask-progress-bar-wrap {
    background: #e0e0e0;
    border-radius: 3px;
    height: 5px;
    margin: 3px 0;
    width: 100%;
}

.datatask-progress-bar {
    background: #2980b9;
    border-radius: 3px;
    height: 5px;
    min-width: 2px;
    transition: width 0.4s;
}

.datatask-progress-text { font-size: 0.72rem; color: #555; }

.datatask-label-idle {
    font-size: 0.75rem;
    color: #aaa;
    font-weight: 500;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 7px;
}

.datatask-label-running {
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 600;
    border: 1px solid #27ae60;
    border-radius: 4px;
    padding: 2px 7px;
}

.datatask-nav-item {
    margin-right: 0.75rem;
}

.navbar-user-dropdown {
    border-left: 1px solid #dee2e6;
    padding-left: 0.75rem;
}

.datatask-all-link { font-size: 0.82rem; }

.datatask-filter-select { max-width: 160px; }

.datatask-detail-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.25rem;
    max-width: 860px;
}

.datatask-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.datatask-detail-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.datatask-detail-state {
    font-size: 0.85rem;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 1px 8px;
}

.datatask-detail-table th {
    width: 130px;
    color: #666;
    font-weight: 500;
}

.datatask-section-header {
    background: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.6rem;
    border-top: 2px solid #dee2e6;
}

.import-section-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 860px;
}

.import-section-header {
    background: #e9ecef;
    color: #495057;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.6rem;
    margin: -1.25rem -1.25rem 1rem -1.25rem;
    border-radius: 6px 6px 0 0;
}

.import-section-toggle {
    display: block;
    color: inherit;
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

.import-section-toggle::after {
    border: solid;
    border-width: 0 .075rem .075rem 0;
    content: "";
    display: inline-block;
    padding: 2px;
    position: absolute;
    right: 0.6rem;
    top: 0.5rem;
    transform: rotate(-135deg);
    transition: all .2s ease-out;
}

.import-section-toggle.collapsed::after {
    transform: rotate(45deg);
}

.cv-file-input::file-selector-button {
    background: var(--bs-dark);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.cv-file-input::-webkit-file-upload-button {
    background: var(--bs-dark);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

/* Bootstrap ships its own higher-specificity hover rule -
   .form-control:hover:not(:disabled):not([readonly])::file-selector-button
   { background-color: var(--bs-secondary-bg) } (a light gray) - which wins
   over a plain .cv-file-input::file-selector-button:hover rule regardless of
   source order. Matching that same selector shape (plus our class) is what
   actually beats it on specificity. */
.form-control.cv-file-input:hover:not(:disabled):not([readonly])::file-selector-button {
    background: #495057;
    color: #fff;
}

.form-control.cv-file-input:hover:not(:disabled):not([readonly])::-webkit-file-upload-button {
    background: #495057;
    color: #fff;
}

.form-control.cv-file-input:active::file-selector-button {
    background: #1a1d20;
    color: #fff;
}

.form-control.cv-file-input:active::-webkit-file-upload-button {
    background: #1a1d20;
    color: #fff;
}

.datatask-detail-subkey {
    width: 130px;
    color: #888;
    font-weight: 500;
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

.datatask-detail-json {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.8rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Burger row action menu */
.cv-burger-cell { width: 2em; white-space: nowrap; padding: 0.1rem 0.2rem !important; }
.cv-burger-btn  { padding: 0.1rem 0.6rem; font-size: 0.75rem; line-height: 1.4; border: none; background: transparent; color: #888; }
.cv-burger-btn:hover { background: rgba(0,0,0,0.06); color: #333; }
.cv-burger-dropdown { display: inline-block; }
.cv-menu-danger { color: var(--bs-danger); }

/* Copy to clipboard icon */
.cv-copy-icon { font-size: 1.2rem; }

/* Revision diff modal */
.cv-rev-row { cursor: pointer; }
.cv-rev-item { font-size: 0.85rem; }
.cv-rev-meta-key { color: #666; font-size: 0.85rem; width: 30%; }
.cv-rev-diff-icon { font-size: 1rem; color: #0d6efd; vertical-align: middle; }
.cv-rev-diff-table td:first-child { color: #666; font-size: 0.85rem; width: 30%; }
.cv-rev-before { color: #842029; background-color: #f8d7da; }
.cv-rev-after  { color: #0a3622; background-color: #d1e7dd; }
.cv-rev-badge-create  { background-color: #198754; color: #fff; }
.cv-rev-badge-update  { background-color: #0d6efd; color: #fff; }
.cv-rev-badge-delete  { background-color: #dc3545; color: #fff; }
.cv-rev-badge-init    { background-color: #6c757d; color: #fff; }
.cv-rev-badge-enable  { background-color: #198754; color: #fff; }
.cv-rev-badge-disable { background-color: #ffc107; color: #000; }
.cv-rev-badge-keyname { background-color: #6f42c1; color: #fff; }

/* IPAM: card identity distinct from plain instance list/detail tables - reuses the
   admintools card + icon-row language (.cv-admintools-icon/-item/-desc) so the app's two
   "operational" panels (admin tools, IPAM) read as one family. */

.cv-ipam-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.cv-ipam-card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* icon-row list, sized down a notch from cv-admintools-icon/-item (IPAM panels pack more
   rows per page than admintools' action list) */
.cv-ipam-icon {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    font-size: 0.85rem;
}
.cv-ipam-item {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.cv-ipam-item .cv-ipam-desc {
    font-size: 0.8125rem;
}

/* app_data/private.html - schema classname/keyname column: same font as the
   displayname/description columns (plain span, not <code>), tinted blue */
.cv-data-schema-keyname {
    color: var(--bs-primary, #0d6efd);
}

/* app_data/private.html table header - same blue as the home dashboard's
   section title (.cv-dashboard-section-title) instead of Bootstrap's thead-dark.
   Bootstrap sets background-color/color directly on th/td (.table>:not(caption)>*>*),
   so the override must target the <th> cells, not the <thead> itself. */
.cv-data-schema-thead th {
    background-color: #cfe2ff;
    color: #084298;
}

/* app_data/private.html - Bootstrap's .table sets width:100%, stretching every
   column (even icon-only ones) to fill the page; auto instead sizes the whole
   table - and each column within it - to its own content, no more. */
.cv-data-schema-table {
    width: auto;
}

/* compact horizontal fact strip (first/last IP, mask, size, ...) - one line instead of a
   column of table rows for plain read-only facts */
.cv-ipam-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cv-ipam-stat {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}
.cv-ipam-stat .cv-ipam-stat-label {
    color: #6c757d;
    margin-right: 0.35rem;
}
.cv-ipam-stat .cv-ipam-stat-value {
    font-family: monospace;
    font-weight: 600;
}

/* compact large tables (subnet list, vlan list, IP list) - denser than the default
   table-sm, and table cell links use plain text/chevron instead of full buttons so row
   height stays text-height, not button-height */
.cv-ipam-table th,
.cv-ipam-table td {
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    vertical-align: middle;
}

/* compact click-through link chip: used both for the generic list-view field rendering
   (_datapoint_list.html, ipv4 / ipam_subnet / ipam_vlan values) and for "view" links
   inside IPAM's own compact tables/rows - plain text height, no button chrome */
.cv-ipam-link {
    display: block;
    font-family: monospace;
    white-space: nowrap;
    text-decoration: none;
}
.cv-ipam-link i {
    margin-right: 0.25rem;
}

/* generic click-through for a "schema"-type field's referenced instance(s) in the
   list-view table (_datapoint_list.html) - any schema other than ipam_subnet/ipam_vlan
   (those keep cv-ipam-link's monospace look). Plain inline link, not a block/chip,
   since a cell can hold several comma-separated values (e.g. a multi-valued user field) */
.cv-schema-cell-link {
    text-decoration: none;
}
.cv-schema-cell-link:hover {
    text-decoration: underline;
}

/* secondary cell in a row that's a link (e.g. description next to a linked CIDR/keyname) -
   fills the cell like cv-ipam-link, but reads as plain text, not a colored/monospace link */
.cv-ipam-row-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.cv-ipam-view-link {
    white-space: nowrap;
    text-decoration: none;
    font-size: 0.8125rem;
}
.cv-ipam-view-link i {
    margin-left: 0.25rem;
}

/* compact occupancy bar for the subnet list table - genuine Bootstrap .progress/.progress-bar
   (guaranteed already loaded/working elsewhere), just constrained to a small fixed size
   instead of Bootstrap's own full-width default */
.cv-ipam-progress {
    width: 70px;
    height: 6px;
}

/* subnet-size visual distinction in the subnet list (large/medium/small - see
   common.py:subnet_size_class, thresholds chosen to match this app's own addressing
   convention: /16 country supernets, /24 clinics, /27-/28 VLANs) */
.cv-ipam-size-large {
    font-weight: 700;
    font-size: 0.95rem;
    color: #b02a37;
}
.cv-ipam-size-medium {
    font-weight: 600;
    color: #0d6efd;
}
.cv-ipam-size-small {
    font-weight: 400;
    color: #6c757d;
}

/* instance_detail ipam_ip hook: subnet hierarchy table - CIDR column, one
   entry per ancestor subnet. white-space:pre preserves the leading-space
   indent (app_data/ipam.py get_ip_subnet_hierarchy's "indent" field) so
   depth reads visually without a fixed set of indent-level CSS classes.
   ", a" repeats the rule on the wrapped <a> too - the global "a {
   font-family... }" rule above sets it directly on the anchor, which wins
   over inheriting it from this parent span otherwise */
.cv-ipam-hierarchy-mono,
.cv-ipam-hierarchy-mono a {
    font-family: var(--bs-font-monospace, monospace);
    white-space: pre;
}

/* instance_detail ipam_ip/ipam_subnet hooks: fixed width on the subnet/CIDR
   column, matching the label-column convention used by the main fields
   table and general-info table above (width="20%" on their first <td>) */
.cv-ipam-hierarchy-col-subnet {
    width: 20%;
}

/* instance_detail ipam_ip/ipam_subnet hierarchy tables: smaller font for
   the per-subnet data rows (not the header/separator rows, styled below) */
.cv-ipam-hierarchy-row-sm {
    font-size: 0.8125rem;
}

/* bold separator rows in the ipam_subnet detail page's combined Subnet
   Hierarchy table ("Parent subnets"/"Current Subnet"/"Child subnets"
   section rows) - not the per-subnet data rows, which stay regular weight
   (cv-ipam-hierarchy-row-sm on _subnet_hierarchy_row.html) */
.cv-ipam-hierarchy-separator {
    font-weight: bold;
}

/* the same table's yellow column-header row (Subnet/Description/Size/...) -
   bold to match the separator rows above, and full-size rather than the
   cv-ipam-hierarchy-row-sm data rows, since it's the row a reader anchors on */
.cv-ipam-hierarchy-header {
    font-weight: bold;
    font-size: 1rem;
}

/* prototypes/ipam_subnet_calculator.html - IPv4 subnet calculator mockup.
   All prototype-only CSS uses the cv-proto- prefix, to keep it obviously
   separate from classes used by the real product UI. */

.cv-proto-subnet-value {
    font-family: var(--bs-font-monospace, monospace);
    font-weight: 600;
}

.cv-proto-subnet-bits {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 1.05rem;
    letter-spacing: 1px;
    word-break: break-all;
    line-height: 1.9;
}

.cv-proto-subnet-bit-net {
    color: #0d6efd;
    font-weight: 600;
}

.cv-proto-subnet-bit-host {
    color: #adb5bd;
}

.cv-proto-subnet-octet-sep {
    color: #6c757d;
    margin: 0 2px;
}

.cv-proto-subnet-example-btn {
    margin: 0 0.375rem 0.375rem 0;
}

.cv-proto-subnet-table-wrap {
    max-height: 480px;
    overflow-y: auto;
}

.cv-proto-subnet-card-header {
    background-color: #cfe2ff;
    color: #084298;
    font-weight: 600;
}

/* prototypes/dashboard.html - home dashboard mockup (DASHBOARD_CONTENT).
   Sections are rounded containers; each entry is a small compact square
   widget in a wrapping grid. */

.cv-proto-dashboard-section {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: var(--bs-body-bg, #fff);
}

.cv-proto-dashboard-section-title {
    margin: 0;
    padding: 0.5rem 1rem;
    background-color: #cfe2ff;
    color: #084298;
    font-weight: 600;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.cv-proto-dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
}

.cv-proto-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.15s ease-in-out;
}

.cv-proto-dashboard-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: var(--bs-body-color, #212529);
}

.cv-proto-dashboard-label {
    font-size: 0.75rem;
    margin-top: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.cv-proto-dashboard-count {
    font-size: 0.7rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* app_home/private.html - the real Home dashboard (DASHBOARD_CONTENT), same
   look as the cv-proto-dashboard-* mockup above. cv-dashboard-* is shipped
   product UI, kept as a separate prefix from cv-proto-* per convention
   (see cv-ipam-tool-* below for the same pattern). */

.cv-dashboard-section {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: var(--bs-secondary-bg, #e9ecef);
}

.cv-dashboard-section-title {
    margin: 0;
    padding: 0.5rem 1rem;
    background-color: #cfe2ff;
    color: #084298;
    font-weight: 600;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.cv-dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
}

.cv-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.15s ease-in-out;
}

.cv-dashboard-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
    color: var(--bs-body-color, #212529);
}

.cv-dashboard-label {
    font-size: 0.75rem;
    margin-top: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.cv-dashboard-count {
    font-size: 0.7rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* app_data/ipam/subnet_calculator.html + bandwidth_calculator.html - small
   interactive IPAM tools, same look as the cv-proto-subnet-* mockup above.
   cv-ipam-tool-* is shared across every such tool (kept as a separate
   prefix from cv-proto-* since this is shipped product UI, not a
   prototype); cv-ipam-subnetcalc-bit-*/octet-sep are specific to the
   Subnet Calculator's binary breakdown, not shared. */

.cv-ipam-tool-value {
    font-family: var(--bs-font-monospace, monospace);
    font-weight: 600;
}

.cv-ipam-tool-unit-select {
    max-width: 8rem;
    flex: 0 0 auto;
}

.cv-ipam-tool-example-btn {
    margin: 0 0.375rem 0.375rem 0;
}

.cv-ipam-tool-table-wrap {
    max-height: 480px;
    overflow-y: auto;
}

.cv-ipam-tool-card-header {
    background-color: #cfe2ff;
    color: #084298;
    font-weight: 600;
}

.cv-ipam-subnetcalc-bits {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 1.05rem;
    letter-spacing: 1px;
    word-break: break-all;
    line-height: 1.9;
}

.cv-ipam-subnetcalc-bit-net {
    color: #0d6efd;
    font-weight: 600;
}

.cv-ipam-subnetcalc-bit-host {
    color: #adb5bd;
}

.cv-ipam-subnetcalc-octet-sep {
    color: #6c757d;
    margin: 0 2px;
}

