/* ============================================================
   ApactaControl — Design Tokens (Stripe-inspired)
   ============================================================ */
:root {
    --ac-accent:         #5469d4;
    --ac-accent-hover:   #4254c8;
    --ac-accent-light:   #eef2ff;
    --ac-accent-ring:    rgba(84, 105, 212, 0.20);

    --ac-bg:             #f6f9fc;
    --ac-surface:        #ffffff;
    --ac-surface-alt:    #f8fafc;

    --ac-border:         #e3e8ef;
    --ac-border-strong:  #c1ccd9;

    --ac-text-primary:   #1a1f36;
    --ac-text-secondary: #4f566b;
    --ac-text-muted:     #8792a2;

    --ac-green:          #09825d;
    --ac-green-bg:       #d3f5e9;
    --ac-red:            #c0143c;
    --ac-red-bg:         #fde8ed;
    --ac-amber:          #9b6900;
    --ac-amber-bg:       #fef3c7;
    --ac-blue-info:      #1a56db;
    --ac-blue-info-bg:   #e1effe;

    --ac-shadow-xs: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --ac-shadow-sm: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
    --ac-shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
    --ac-shadow-lg: 0 8px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.07);

    --ac-radius-sm:  6px;
    --ac-radius-md:  10px;
    --ac-radius-lg:  14px;

    --ac-font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ac-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ============================================================
   Bootstrap Variable Overrides
   ============================================================ */
body {
    --bs-body-bg:           var(--ac-bg);
    --bs-body-color:        var(--ac-text-primary);
    --bs-body-font-family:  var(--ac-font);
    --bs-border-color:      var(--ac-border);
    --bs-primary:           var(--ac-accent);
    --bs-primary-rgb:       84, 105, 212;
    --bs-link-color:        var(--ac-accent);
    --bs-link-hover-color:  var(--ac-accent-hover);

    font-family: var(--ac-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ac-text-primary);
    background: var(--ac-bg);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ac-text-primary);
}

h2 { font-size: 1.5rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 0.95rem; }

.text-muted { color: var(--ac-text-muted) !important; }

label, .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ac-text-secondary);
    margin-bottom: 0.35rem;
}

small, .form-text {
    color: var(--ac-text-muted);
    font-size: 0.8rem;
}

code {
    font-family: var(--ac-font-mono);
    font-size: 0.8em;
    background: var(--ac-surface-alt);
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--ac-text-secondary);
}

/* ============================================================
   Navigation (ac-navbar)
   ============================================================ */
.ac-navbar {
    background: var(--ac-surface);
    border-bottom: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-xs);
    padding: 0.6rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.ac-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ac-text-primary);
    letter-spacing: -0.01em;
}

.ac-navbar .navbar-brand i {
    color: var(--ac-accent);
}

.ac-navbar .navbar-toggler {
    border-color: var(--ac-border);
}

.ac-navbar .navbar-toggler-icon {
    filter: invert(0.4);
}

.ac-navbar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ac-text-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: var(--ac-radius-sm);
    transition: color 0.15s, background 0.15s;
}

.ac-navbar .nav-link:hover {
    color: var(--ac-text-primary);
    background: var(--ac-surface-alt);
}

.ac-navbar .nav-link.active {
    color: var(--ac-accent);
    background: var(--ac-accent-light);
    font-weight: 600;
}

.ac-navbar .badge.bg-danger {
    background: var(--ac-red) !important;
}

/* ============================================================
   Breadcrumbs
   ============================================================ */
.app-breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.app-breadcrumb .breadcrumb-item a {
    color: var(--ac-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.15s;
}

.app-breadcrumb .breadcrumb-item a:hover {
    color: var(--ac-text-primary);
}

.app-breadcrumb .breadcrumb-item.active {
    color: var(--ac-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.app-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--ac-border-strong);
}

/* ============================================================
   Cards (global)
   ============================================================ */
.card {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-md);
    box-shadow: var(--ac-shadow-xs);
}

.card-header {
    background: var(--ac-surface);
    border-bottom: 1px solid var(--ac-border);
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ac-text-secondary);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--ac-surface-alt);
    border-top: 1px solid var(--ac-border);
    padding: 0.75rem 1.25rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--ac-radius-sm);
    padding: 0.45rem 1rem;
    transition: all 0.15s ease;
    letter-spacing: 0;
}

.btn-primary {
    background: var(--ac-accent);
    border-color: var(--ac-accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(84, 105, 212, 0.35);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--ac-accent-hover);
    border-color: var(--ac-accent-hover);
    color: #fff;
    box-shadow: 0 2px 6px rgba(84, 105, 212, 0.45);
}

.btn-outline-primary {
    color: var(--ac-accent);
    border-color: var(--ac-accent);
}

.btn-outline-primary:hover {
    background: var(--ac-accent-light);
    color: var(--ac-accent-hover);
    border-color: var(--ac-accent-hover);
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
}

/* ============================================================
   Form Controls
   ============================================================ */
.form-control,
.form-select {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: var(--ac-text-primary);
    background: var(--ac-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ac-accent);
    box-shadow: 0 0 0 3px var(--ac-accent-ring);
    outline: none;
}

.form-control::placeholder {
    color: var(--ac-text-muted);
    font-size: 0.85rem;
}

.input-group-text {
    background: var(--ac-surface-alt);
    border-color: var(--ac-border);
    color: var(--ac-text-muted);
    font-size: 0.875rem;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding: 0.3em 0.65em;
    border-radius: 100px;
}

.badge.bg-success  { background: var(--ac-green)    !important; }
.badge.bg-danger   { background: var(--ac-red)      !important; }
.badge.bg-warning  { background: var(--ac-amber-bg) !important; color: var(--ac-amber)          !important; }
.badge.bg-secondary { background: #d5dae3           !important; color: var(--ac-text-secondary) !important; }
.badge.bg-info     { background: var(--ac-blue-info-bg) !important; color: var(--ac-blue-info)  !important; }

/* ============================================================
   Alerts
   ============================================================ */
.alert-info {
    background: var(--ac-blue-info-bg);
    border-color: #bfdbfe;
    color: var(--ac-blue-info);
    border-radius: var(--ac-radius-md);
    font-size: 0.875rem;
}

.alert-success {
    background: var(--ac-green-bg);
    border-color: #6ee7b7;
    color: var(--ac-green);
    border-radius: var(--ac-radius-md);
}

.alert-warning {
    background: var(--ac-amber-bg);
    border-color: #fde68a;
    color: var(--ac-amber);
    border-radius: var(--ac-radius-md);
}

.alert-danger {
    background: var(--ac-red-bg);
    border-color: #fca5a5;
    color: var(--ac-red);
    border-radius: var(--ac-radius-md);
}

/* ============================================================
   Modals (global)
   ============================================================ */
.modal-content {
    border-radius: var(--ac-radius-lg);
    border: none;
    box-shadow: var(--ac-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--ac-border);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--ac-border);
    padding: 1rem 1.5rem;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
    z-index: 1080;
}

.toast {
    border-radius: var(--ac-radius-md);
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-md);
}

.toast-header.bg-success { background: var(--ac-green)    !important; color: #fff !important; }
.toast-header.bg-danger  { background: var(--ac-red)      !important; color: #fff !important; }
.toast-header.bg-warning { background: var(--ac-amber-bg) !important; color: var(--ac-amber) !important; }

/* ============================================================
   Nav Tabs
   ============================================================ */
.nav-tabs {
    border-bottom: 1px solid var(--ac-border);
}

.nav-tabs .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ac-text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.6rem 1rem;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
    color: var(--ac-text-primary);
    border-bottom-color: var(--ac-border-strong);
}

.nav-tabs .nav-link.active {
    color: var(--ac-accent);
    background: transparent;
    border-bottom: 2px solid var(--ac-accent);
    font-weight: 600;
}

/* ============================================================
   Tables
   ============================================================ */
.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ac-text-muted);
    background: var(--ac-surface-alt);
    border-bottom: 1px solid var(--ac-border);
    padding: 0.75rem 1rem;
}

.table tbody td {
    font-size: 0.875rem;
    color: var(--ac-text-primary);
    padding: 0.7rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--ac-border);
}

.table-borderless th {
    color: var(--ac-text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-borderless td {
    font-size: 0.875rem;
    color: var(--ac-text-primary);
}

/* ============================================================
   DataTables
   ============================================================ */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    padding: 0.35rem 0.7rem;
    font-size: 0.875rem;
    margin-left: 0.4rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    font-size: 0.875rem;
    margin: 0 0.25rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    font-size: 0.875rem;
    color: var(--ac-text-secondary);
}

#table_id tbody tr:hover {
    background: var(--ac-accent-light) !important;
}

/* ============================================================
   Dashboard (Index)
   ============================================================ */
.dashboard-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.dashboard-summary-item {
    flex: 1;
    text-align: center;
    padding: 1rem 1.25rem;
    border-radius: var(--ac-radius-md);
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-xs);
}

.dashboard-summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ac-text-primary);
    line-height: 1.1;
}

.dashboard-summary-label {
    font-size: 0.75rem;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}

.setting-card {
    border-radius: var(--ac-radius-md);
    border: 1px solid var(--ac-border);
    background: var(--ac-surface);
    box-shadow: var(--ac-shadow-xs);
    transition: box-shadow 0.2s, transform 0.15s;
}

.setting-card:hover {
    box-shadow: var(--ac-shadow-md);
    transform: translateY(-1px);
}

.setting-card.status-ok {
    border-left: 3px solid var(--ac-green);
}

.setting-card.status-error {
    border-left: 3px solid var(--ac-red);
}

.setting-card.status-warning {
    border-left: 3px solid var(--ac-amber);
}

.setting-card.status-inactive {
    border-left: 3px solid var(--ac-border-strong);
    opacity: 0.7;
}

/* Button group border radii in card footer */
.setting-card .card-footer .btn-group .btn:first-child {
    border-radius: var(--ac-radius-sm) 0 0 var(--ac-radius-sm);
}

.setting-card .card-footer .btn-group .btn:last-child {
    border-radius: 0 var(--ac-radius-sm) var(--ac-radius-sm) 0;
}

.setting-card .card-footer .btn-group .btn {
    font-size: 0.78rem;
    border-radius: 0;
}

/* ============================================================
   Wizard (Create Setting)
   ============================================================ */
.wizard-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 1rem;
}

.wizard-progress-step {
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 70px;
}

.wizard-step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--ac-border);
    background: var(--ac-surface);
    color: var(--ac-text-muted);
    transition: all 0.3s ease;
}

.wizard-step-circle.active {
    border-color: var(--ac-accent);
    color: var(--ac-accent);
    background: var(--ac-accent-light);
    box-shadow: 0 0 0 4px var(--ac-accent-ring);
}

.wizard-step-circle.completed {
    border-color: var(--ac-green);
    background: var(--ac-green);
    color: #fff;
}

.wizard-step-label {
    font-size: 0.78rem;
    color: var(--ac-text-muted);
    margin-top: 0.35rem;
    white-space: nowrap;
}

.wizard-step-label.active {
    color: var(--ac-accent);
    font-weight: 600;
}

.wizard-step-label.completed {
    color: var(--ac-green);
}

.wizard-progress-line {
    flex: 1;
    height: 2px;
    background: var(--ac-border);
    margin: 20px 0.5rem 0;
    transition: background 0.3s ease;
}

.wizard-progress-line.completed {
    background: var(--ac-green);
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: wizardFadeIn 0.3s ease;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-step-card {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    box-shadow: var(--ac-shadow-sm);
    max-width: 720px;
    margin: 0 auto;
}

.wizard-step-card .card-body {
    padding: 2.25rem;
}

.wizard-help {
    font-size: 0.82rem;
    color: var(--ac-text-muted);
    margin-top: 0.2rem;
}

.module-card {
    border: 1.5px solid var(--ac-border);
    border-radius: var(--ac-radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    height: 100%;
    user-select: none;
    background: var(--ac-surface);
}

.module-card:hover {
    border-color: var(--ac-border-strong);
    box-shadow: var(--ac-shadow-xs);
}

.module-card.checked {
    border-color: var(--ac-accent);
    background: var(--ac-accent-light);
}

.module-card .module-icon {
    font-size: 1.5rem;
    color: var(--ac-text-muted);
    margin-bottom: 0.4rem;
}

.module-card.checked .module-icon {
    color: var(--ac-accent);
}

.module-card .module-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.module-card .module-desc {
    font-size: 0.75rem;
    color: var(--ac-text-muted);
    line-height: 1.3;
}

.module-card .form-check-input {
    display: none;
}

.wizard-summary .summary-section {
    margin-bottom: 1.5rem;
}

.wizard-summary .summary-section-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ac-text-primary);
    border-bottom: 1px solid var(--ac-border);
    padding-bottom: 0.4rem;
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wizard-summary .summary-section-header .btn-edit-step {
    font-size: 0.78rem;
    color: var(--ac-text-muted);
    cursor: pointer;
    text-decoration: none;
}

.wizard-summary .summary-section-header .btn-edit-step:hover {
    color: var(--ac-accent);
}

.wizard-summary .summary-row {
    display: flex;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.wizard-summary .summary-label {
    width: 180px;
    color: var(--ac-text-muted);
    flex-shrink: 0;
}

.wizard-summary .summary-value {
    color: var(--ac-text-primary);
}

.wizard-summary .not-set {
    color: var(--ac-text-muted);
    font-style: italic;
}

.api-verify-result {
    display: none;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--ac-radius-sm);
}

.api-verify-result.show {
    display: block;
}

.api-verify-result.success {
    background: var(--ac-green-bg);
    color: var(--ac-green);
}

.api-verify-result.error {
    background: var(--ac-red-bg);
    color: var(--ac-red);
}

.wizard-nav {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

/* ============================================================
   Section Edit (Show Setting)
   ============================================================ */
.btn-section-edit {
    font-size: 0.85rem;
    color: var(--ac-text-muted);
    background: none;
    border: none;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    border-radius: var(--ac-radius-sm);
    transition: all 0.15s;
}

.btn-section-edit:hover {
    color: var(--ac-accent);
    background: var(--ac-accent-light);
}

.active-state-banner {
    border-radius: var(--ac-radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.active-state-banner.is-active {
    background: var(--ac-amber-bg);
    border: 1px solid #fde68a;
    color: var(--ac-amber);
}

.active-state-banner.is-inactive {
    background: var(--ac-green-bg);
    border: 1px solid #6ee7b7;
    color: var(--ac-green);
}

.activate-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

.activate-switch .form-check-label {
    font-weight: 600;
    margin-left: 0.5rem;
    cursor: pointer;
}

.section-edit-modal .modal-content {
    border-radius: var(--ac-radius-lg);
    border: none;
    box-shadow: var(--ac-shadow-lg);
}

.section-edit-modal .modal-header {
    border-bottom: 1px solid var(--ac-border);
    padding: 1.25rem 1.5rem;
}

.section-edit-modal .modal-body {
    padding: 1.5rem;
}

.section-edit-modal .modal-footer {
    border-top: 1px solid var(--ac-border);
    padding: 1rem 1.5rem;
}

/* ============================================================
   Operation Panel (Features)
   ============================================================ */
#operationPanel {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#operationPanel.fade-in {
    opacity: 1;
    transform: translateY(0);
}

#operationPanel.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

.op-panel-card {
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-md);
    border-radius: var(--ac-radius-lg);
    overflow: hidden;
}

.op-panel-header {
    background: var(--ac-text-primary);
    color: #fff;
    padding: 1.25rem 1.5rem;
}

.op-panel-header h5 {
    margin: 0;
    font-weight: 600;
}

.op-panel-body {
    padding: 1.5rem;
}

.op-elapsed-timer {
    font-family: var(--ac-font-mono);
    font-size: 1.1rem;
    color: var(--ac-text-muted);
}

.op-current-item {
    font-size: 0.9rem;
    color: var(--ac-text-secondary);
    min-height: 1.4em;
    transition: opacity 0.2s;
}

.op-log-container {
    max-height: 180px;
    overflow-y: auto;
    font-size: 0.82rem;
    font-family: var(--ac-font-mono);
    background: var(--ac-surface-alt);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    padding: 0.75rem;
}

.op-log-container .log-entry {
    padding: 2px 0;
    border-bottom: 1px solid var(--ac-border);
    color: var(--ac-text-secondary);
}

.op-log-container .log-entry:last-child {
    border-bottom: none;
}

.op-log-container .log-time {
    color: var(--ac-text-muted);
    margin-right: 0.5rem;
}

/* Result Metrics */
.op-result-card {
    border: 1px solid var(--ac-border);
    box-shadow: var(--ac-shadow-sm);
    border-radius: var(--ac-radius-md);
}

.op-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.op-metric {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 1rem 0.75rem;
    border-radius: var(--ac-radius-md);
    background: var(--ac-surface-alt);
}

.op-metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.op-metric-label {
    font-size: 0.8rem;
    color: var(--ac-text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.op-metric.created { border-left: 3px solid var(--ac-green); }
.op-metric.created .op-metric-value { color: var(--ac-green); }

.op-metric.updated { border-left: 3px solid var(--ac-accent); }
.op-metric.updated .op-metric-value { color: var(--ac-accent); }

.op-metric.deleted { border-left: 3px solid var(--ac-red); }
.op-metric.deleted .op-metric-value { color: var(--ac-red); }

.op-metric.skipped { border-left: 3px solid var(--ac-border-strong); }
.op-metric.skipped .op-metric-value { color: var(--ac-text-muted); }

.op-metric.failed { border-left: 3px solid var(--ac-red); background: var(--ac-red-bg); }
.op-metric.failed .op-metric-value { color: var(--ac-red); }

/* Error / Warning panels */
.op-errors-container,
.op-warnings-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--ac-radius-sm);
}

.op-error-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--ac-border);
    font-size: 0.875rem;
}

.op-error-item:last-child {
    border-bottom: none;
}

.op-error-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--ac-red-bg);
    color: var(--ac-red);
}

.op-error-suggestion {
    font-size: 0.8rem;
    color: var(--ac-text-muted);
    font-style: italic;
}

.op-warning-item {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #fde68a;
    font-size: 0.875rem;
}

/* Section Cards */
.op-section-card {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-md);
    box-shadow: var(--ac-shadow-xs);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.op-section-card:hover {
    box-shadow: var(--ac-shadow-sm);
}

.op-section-card.section-create {
    border-left: 3px solid var(--ac-green);
}

.op-section-card.section-delete {
    border-left: 3px solid var(--ac-red);
}

.op-section-card.section-status {
    border-left: 3px solid var(--ac-amber);
}

.op-section-card .card-header {
    background: var(--ac-surface);
    border-bottom: 1px solid var(--ac-border);
    padding: 1rem 1.25rem;
}

.op-section-card .card-body {
    padding: 1.25rem;
}

.op-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.section-create .op-section-number {
    background: var(--ac-green-bg);
    color: var(--ac-green);
}

.section-delete .op-section-number {
    background: var(--ac-red-bg);
    color: var(--ac-red);
}

.section-status .op-section-number {
    background: var(--ac-amber-bg);
    color: var(--ac-amber);
}

.op-btn-desc {
    font-size: 0.78rem;
    color: var(--ac-text-muted);
    margin-top: 0.25rem;
}

/* Confirmation Modal */
#opConfirmModal .modal-content {
    border-radius: var(--ac-radius-lg);
    border: none;
    box-shadow: var(--ac-shadow-lg);
}

#opConfirmModal .modal-header {
    border-bottom: 1px solid var(--ac-border);
    padding: 1.25rem 1.5rem;
}

#opConfirmModal .modal-body {
    padding: 1.5rem;
}

#opConfirmModal .modal-footer {
    border-top: 1px solid var(--ac-border);
    padding: 1rem 1.5rem;
}

#opConfirmModal .op-desc {
    color: var(--ac-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

#opConfirmModal .op-filter-preview {
    background: var(--ac-surface-alt);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

#opConfirmModal .op-filter-preview strong {
    color: var(--ac-text-primary);
}

#opConfirmModal .danger-input-wrapper {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--ac-red-bg);
    border: 1px solid #fca5a5;
    border-radius: var(--ac-radius-sm);
}

#opConfirmModal .danger-input-wrapper label {
    color: var(--ac-red);
    font-weight: 600;
    font-size: 0.9rem;
}

#opConfirmModal .danger-input-wrapper input {
    border-color: #fca5a5;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
}

/* ============================================================
   Troubleshooting
   ============================================================ */
.detail-card {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-md);
    box-shadow: var(--ac-shadow-xs);
    border-left: 3px solid var(--ac-accent);
    overflow: hidden;
}

.detail-card:hover {
    box-shadow: var(--ac-shadow-sm);
}

.detail-card .card-header {
    border-bottom: 1px solid var(--ac-border);
    padding: 1rem 1.25rem;
}

.row-clickable:hover {
    background: var(--ac-accent-light) !important;
}

.trans-log {
    max-height: 250px;
    overflow-y: auto;
    font-size: 0.82rem;
    font-family: var(--ac-font-mono);
    background: var(--ac-surface-alt);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-sm);
    padding: 0.75rem;
}

.trans-entry {
    padding: 3px 0;
    border-bottom: 1px solid var(--ac-border);
}

.trans-entry:last-child {
    border-bottom: none;
}

.trans-time {
    color: var(--ac-text-muted);
    margin-right: 0.5rem;
}

#pane-sundhedstjek .card {
    transition: box-shadow 0.2s;
}

#pane-sundhedstjek .card:hover {
    box-shadow: var(--ac-shadow-sm);
}

#guidSearchResults .table td {
    vertical-align: middle;
}

#errorExplanationPanel .card {
    border-left-width: 3px !important;
}

#errorExplanationPanel ol li,
#errorExplanationPanel ul li {
    margin-bottom: 0.3rem;
}

#errorLogAccordion .accordion-button {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

#errorLogAccordion .accordion-button:not(.collapsed) {
    background: var(--ac-accent-light);
    color: var(--ac-accent);
}

#expenseDetaljer .list-group-item {
    border-left: 3px solid var(--ac-accent);
}

/* ============================================================
   General Utility
   ============================================================ */
.fade-transition {
    transition: opacity 0.3s ease;
}

.operations-area {
    transition: opacity 0.3s ease;
}

.operations-area.dimmed {
    opacity: 0.3;
    pointer-events: none;
}

.progress-bar-animated-custom {
    animation: progress-bar-stripes 1s linear infinite;
}
