/* -------------------------------------------------- */
/* Typography                                          */
/* -------------------------------------------------- */

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 600;
}

/* -------------------------------------------------- */
/* Sidebar                                             */
/* -------------------------------------------------- */

.sidebar {
    width: 250px;
    background-color: #1a1d21 !important;
    color: #adb5bd;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1030;
    }
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-body {
    flex: 1 1 auto;
    padding: 0;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav .nav-link {
    display: block;
    color: #adb5bd;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #0d6efd;
}

.sidebar-nav .nav-link i {
    width: 1.25rem;
    margin-right: 0.5rem;
    text-align: center;
}

.sidebar-group-heading {
    padding: 10px 16px 2px;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d !important;
    font-weight: 600;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.25);
    margin: 0.75rem 1rem;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #6c757d;
    font-size: 0.75rem;
}

/* -------------------------------------------------- */
/* Main content area                                   */
/* -------------------------------------------------- */

@media (min-width: 992px) {
    .main-content {
        margin-left: 250px;
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* -------------------------------------------------- */
/* Topbar                                              */
/* -------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar .breadcrumb {
    font-size: 0.875rem;
}

.topbar-user {
    white-space: nowrap;
    font-size: 0.875rem;
}

.topbar-user-link {
    color: var(--bs-body-color);
}

.topbar-user-link:hover {
    color: var(--bs-primary);
}

/* -------------------------------------------------- */
/* Content area                                        */
/* -------------------------------------------------- */

.content-area {
    flex: 1;
    padding: 1.5rem;
}

.content-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--bs-border-color);
    text-align: center;
}

/* -------------------------------------------------- */
/* Cards                                               */
/* -------------------------------------------------- */

.card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-color: var(--bs-border-color);
}

.card-header {
    background-color: var(--bs-tertiary-bg);
    font-weight: 500;
}

/* -------------------------------------------------- */
/* Tables                                              */
/* -------------------------------------------------- */

.table thead th {
    background-color: var(--bs-tertiary-bg);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
}

/* -------------------------------------------------- */
/* Dashboard cards                                     */
/* -------------------------------------------------- */

.dashboard-card {
    text-align: center;
    padding: 1.5rem;
}

.dashboard-card .display-6 {
    font-weight: 600;
}

.dashboard-card i {
    font-size: 2rem;
    color: var(--bs-secondary-color);
}

/* -------------------------------------------------- */
/* Badges in detail views                              */
/* -------------------------------------------------- */

.detail-table th {
    width: 180px;
    white-space: nowrap;
    font-weight: 500;
    color: var(--bs-secondary-color);
    background-color: transparent;
}

/* -------------------------------------------------- */
/* Enforcement toggle                                  */
/* -------------------------------------------------- */

.enforcement-toggle .form-check-input {
    width: 2.5rem;
    height: 1.25rem;
    cursor: pointer;
    border-color: var(--bs-border-color);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.enforcement-toggle .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

.enforcement-toggle .form-check-input:not(:checked) {
    background-color: #dc3545;
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

.enforcement-toggle .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
    border-color: #198754;
}

.enforcement-toggle .form-check-input:not(:checked):focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    border-color: #dc3545;
}

.enforcement-label {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.enforcement-label--active {
    color: #198754;
}

.enforcement-label--inactive {
    color: #dc3545;
}

/* -------------------------------------------------- */
/* Documentation content                               */
/* -------------------------------------------------- */

.doc-content h1 { font-size: 1.75rem; margin-bottom: 1rem; }
.doc-content h2 { font-size: 1.4rem; margin-top: 1.5rem; margin-bottom: 0.75rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--bs-border-color); }
.doc-content h3 { font-size: 1.15rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.doc-content table { width: 100%; margin-bottom: 1rem; }
.doc-content table th,
.doc-content table td { padding: 0.5rem 0.75rem; border: 1px solid var(--bs-border-color); }
.doc-content table th { background-color: var(--bs-tertiary-bg); font-weight: 600; }
.doc-content code { font-size: 0.875em; color: var(--bs-code-color); }
.doc-content pre { background-color: var(--bs-tertiary-bg); padding: 1rem; border-radius: 0.375rem; overflow-x: auto; }
.doc-content pre code { color: inherit; }

/* -------------------------------------------------- */
/* Tom Select dark mode overrides                      */
/* -------------------------------------------------- */

[data-bs-theme="dark"] .ts-wrapper .ts-control,
[data-bs-theme="dark"] .ts-wrapper .ts-dropdown {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ts-wrapper .ts-control input {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ts-dropdown .option {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ts-dropdown .active {
    background-color: var(--bs-primary);
    color: #fff;
}

tr.clickable-row {
  cursor: pointer;
}

.bulk-action-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: var(--bs-tertiary-bg);
  transition: background-color 0.2s ease;
  /* Match the height of btn-sm (30px) + py-2 (16px) to prevent layout shift
     when transitioning between hint text and button states. */
  min-height: 46px;
  display: flex;
  align-items: center;
}

.bulk-action-bar .btn {
  font-size: 0.75rem;
}

/* -------------------------------------------------- */
/* Detail page header & pill navigation                */
/* -------------------------------------------------- */

/* Two-column grid header for detail pages */
.detail-header-grid,
.site-header-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem;
    align-items: start;
}

.detail-header-right,
.site-header-right {
    text-align: right;
}

.detail-header-bottom,
.site-header-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.25rem;
}

/* Pill navigation tabs */
.detail-pills,
.site-pills {
    gap: 0.5rem;
}

.detail-pill,
.site-pill {
    position: relative;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-pill);
    color: var(--bs-secondary-color);
}

.detail-pill:hover,
.site-pill:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.detail-pill.active,
.site-pill.active {
    border-color: transparent;
}

/* Canonical notification dot — top-right corner badge */
.site-pill-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bs-body-bg);
}

.site-pill-dot--danger {
    background: var(--bs-danger);
}

.site-pill-dot--warning {
    background: var(--bs-warning);
}

/* -------------------------------------------------- */
/* Filter bar controls                                 */
/* -------------------------------------------------- */

/* Uniform narrow width for filter select dropdowns so the filter row fits
 * on a single line on standard desktop widths. Pages with longer option
 * labels (e.g. groups) may override with a wider width up to ~11rem. */
.filter-select {
  width: 10rem;
}
