/* The cards are hidden until the first read resolves, so the page never flashes a
   switch position that does not reflect the real WAF state. */
.waf-switcher-page .switch-card {
    visibility: hidden;
}

.waf-switcher-page.is-loaded .switch-card {
    visibility: visible;
}

.switch-card {
    border: 1px solid #e3e6ea;
    border-left: 4px solid #1a7f47;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.15s ease-in-out;
}

/* Off state is carried by the left rule, the badge and the label text — never by colour
   alone, so it still reads without colour perception. */
.switch-card.is-off {
    border-left-color: #b02a37;
    background-color: #fffafa;
}

/* The master switch is the break-glass control: give it a heavier accent than the
   sub-switch so the two are never mistaken for each other. */
.switch-card-critical .switch-card-icon {
    color: #b02a37;
}

/* Keep the status badge pinned to the top-right of the card: without min-width:0 the long
   description pushes it onto its own line and the two cards stop lining up. */
.switch-card-text {
    min-width: 0;
}

.switch-card-header .status-badge {
    flex-shrink: 0;
}

.switch-card-icon {
    font-size: 1.6rem;
    line-height: 1;
    color: #6c757d;
    width: 2rem;
    text-align: center;
}

.switch-card .card-title {
    font-weight: 600;
}

.status-badge {
    align-self: flex-start;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    padding: 0.4em 0.7em;
}

.switch-card-detail {
    border-top: 1px solid #f0f1f3;
    padding-top: 12px;
}

/* Locked = the switch is disabled because bypassing the whole ACL makes it meaningless.
   Dim the control, not the status, so the current state stays readable. */
.switch-card.is-locked .switch-control {
    opacity: 0.55;
}

.switch-control .form-check-input {
    width: 2.6em;
    height: 1.3em;
    margin-right: 0.6em;
    cursor: pointer;
}

.switch-control .form-check-input:disabled {
    cursor: not-allowed;
}

.switch-control .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.switch-control .form-check-label {
    font-weight: 600;
    cursor: pointer;
}

/* Scope selector: which web ACLs a switch will act on. Narrowed scope is called out in
   amber so it never looks like the default "everything" state. */
.scope-select {
    width: auto;
    min-width: 190px;
    font-weight: 600;
}

.scope-select.is-narrowed {
    border-color: #ffc107;
    background-color: #fffdf5;
}

/* One block per web ACL inside a card: the switches act on all of them at once, but each
   ACL still reports its own state (and its own failure). */
.web-acl-row {
    border-top: 1px solid #f0f1f3;
    padding: 10px 0;
}

.web-acl-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}

.web-acl-detail {
    margin-top: 2px;
}

.web-acl-error {
    margin-top: 2px;
    color: #b02a37;
}

.web-acl-row .managed-rule-list {
    margin-top: 6px;
    padding-left: 14px;
    border-left: 2px solid #f0f1f3;
}

.managed-rule-list li {
    padding: 4px 0;
    flex-wrap: wrap;
}

.managed-rule-name {
    color: #343a40;
    background-color: #f6f7f9;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.82rem;
}

/* main.css widens every .modal-dialog to 90% for the big data-editing modals; a
   confirmation dialog reads far better at a normal width. */
#confirmModal .modal-dialog {
    max-width: 520px !important;
}

#confirm-consequences li {
    margin-bottom: 4px;
}

.toast.toast-success .toast-header { color: #1a7f47; }
.toast.toast-danger .toast-header  { color: #b02a37; }
.toast.toast-info .toast-header    { color: #055160; }

.toast-container {
    z-index: 10001;
}
