/* Firewall boshqaruv sahifasi (faqat global admin). Mavjud dark theme o'zgaruvchilaridan foydalanadi. */
.fw-page { display: flex; flex-direction: column; gap: 22px; padding-bottom: 30px; }
.fw-page * { box-sizing: border-box; }

/* alerts */
.fw-alerts { display: flex; flex-direction: column; gap: 10px; }
.fw-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; font-size: 0.86rem; line-height: 1.5; border: 1px solid; }
.fw-alert i { margin-top: 3px; }
.fw-alert--warn { background: rgba(234, 179, 8, 0.10); border-color: rgba(234, 179, 8, 0.35); color: #fde68a; }
.fw-alert--bad { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.4); color: #fecaca; }
.fw-alert--info { background: rgba(59, 130, 246, 0.10); border-color: rgba(59, 130, 246, 0.35); color: #bfdbfe; }

/* summary cards */
.fw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.fw-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--card-shadow); border-top: 3px solid var(--accent-color); min-width: 0; }
.fw-card--status.is-on { border-top-color: var(--success-color); }
.fw-card--status.is-off { border-top-color: var(--danger-color); }
.fw-card--blocked { border-top-color: var(--danger-color); }
.fw-card--rules { border-top-color: var(--accent-color); }
.fw-card--failed { border-top-color: var(--warning-color); }
.fw-card-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; background: rgba(255, 255, 255, 0.05); }
.fw-card--status.is-on .fw-card-icon { color: #4ade80; background: rgba(34, 197, 94, 0.12); }
.fw-card--status.is-off .fw-card-icon { color: #f87171; background: rgba(239, 68, 68, 0.12); }
.fw-card--blocked .fw-card-icon { color: #f87171; background: rgba(239, 68, 68, 0.12); }
.fw-card--rules .fw-card-icon { color: #60a5fa; background: rgba(59, 130, 246, 0.12); }
.fw-card--failed .fw-card-icon { color: #fbbf24; background: rgba(234, 179, 8, 0.12); }
.fw-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fw-card-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 600; }
.fw-card-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.fw-card--status.is-on .fw-card-value { color: #4ade80; }
.fw-card--status.is-off .fw-card-value { color: #f87171; }
.fw-card-sub { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-card-reason { white-space: normal; color: #fca5a5; font-weight: 600; line-height: 1.35; }
.fw-card-reason:empty { display: none; }
.fw-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.fw-toolbar .fw-select { width: auto; min-width: 230px; }
.fw-toolbar .fw-input { width: auto; flex: 1 1 200px; max-width: 320px; }
.fw-table td .fw-rule-name { font-weight: 600; word-break: break-word; }
.fw-table td.fw-wrap { white-space: normal; word-break: break-word; max-width: 240px; }

/* panels */
.fw-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.fw-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--card-shadow); padding: 20px 22px; min-width: 0; }
.fw-panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.fw-panel-head h3 { margin: 0; font-size: 1.02rem; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.fw-panel-head h3 i { color: var(--text-secondary); font-size: 0.95rem; }
.fw-panel-head .fw-spacer { flex: 1; }
.fw-hint { margin: 0 0 14px; font-size: 0.8rem; line-height: 1.55; color: var(--text-secondary); }

/* key/value list */
.fw-kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 0; margin: 0; }
.fw-kv dt, .fw-kv dd { margin: 0; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 0.88rem; min-width: 0; }
.fw-kv dt { color: var(--text-secondary); }
.fw-kv dd { color: var(--text-primary); font-weight: 500; word-break: break-word; }
.fw-kv dt:last-of-type, .fw-kv dd:last-of-type { border-bottom: none; }
.fw-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }

/* pills */
.fw-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.fw-pill--ok { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.fw-pill--warn { background: rgba(234, 179, 8, 0.14); color: #fbbf24; }
.fw-pill--bad { background: rgba(239, 68, 68, 0.14); color: #f87171; }
.fw-pill--muted { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.fw-pill--info { background: rgba(59, 130, 246, 0.14); color: #60a5fa; }
.fw-chip { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; }
.fw-chip--ok { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.fw-chip--warn { background: rgba(234, 179, 8, 0.16); color: #fbbf24; }
.fw-chip--bad { background: rgba(239, 68, 68, 0.16); color: #f87171; }
.fw-chip--muted { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }

/* buttons */
.fw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 9px; border: 1px solid transparent; font-family: var(--font-family); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s; line-height: 1.2; white-space: nowrap; }
.fw-btn:active { transform: translateY(1px); }
.fw-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.fw-btn--primary { background: var(--accent-color); color: #fff; }
.fw-btn--primary:hover:not([disabled]) { background: var(--accent-hover); }
.fw-btn--danger { background: rgba(239, 68, 68, 0.9); color: #fff; }
.fw-btn--danger:hover:not([disabled]) { background: #dc2626; }
.fw-btn--ghost { background: rgba(255, 255, 255, 0.04); color: var(--text-secondary); border-color: var(--border-color); }
.fw-btn--ghost:hover:not([disabled]) { background: rgba(255, 255, 255, 0.09); color: var(--text-primary); }
.fw-btn--soft { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.35); }
.fw-btn--soft:hover:not([disabled]) { background: rgba(59, 130, 246, 0.22); }
.fw-btn--soft-danger { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.4); }
.fw-btn--soft-danger:hover:not([disabled]) { background: rgba(239, 68, 68, 0.24); }
.fw-btn--sm { padding: 5px 11px; font-size: 0.78rem; border-radius: 8px; }

/* tables */
.fw-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.fw-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.fw-table th { text-align: left; padding: 10px 12px; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.fw-table td { padding: 11px 12px; font-size: 0.87rem; color: var(--text-primary); border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.fw-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.fw-table tbody tr:last-child td { border-bottom: none; }
.fw-table .fw-col-actions { text-align: right; white-space: nowrap; width: 1%; }
.fw-table .fw-empty td { text-align: center; color: var(--text-secondary); padding: 26px 12px; }
.fw-table .fw-sub { display: block; font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.fw-table tr.is-block-rule td:first-child { box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.6); }

/* forms */
.fw-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fw-field--full { grid-column: 1 / -1; }
.fw-field label { font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.fw-input, .fw-select { width: 100%; height: 42px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--border-color); background: rgba(0, 0, 0, 0.22); color: var(--text-primary); font-family: var(--font-family); font-size: 0.9rem; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.fw-input:focus, .fw-select:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.fw-select option { background: #1c2035; color: #fff; }
.fw-help { font-size: 0.74rem; color: var(--text-secondary); }
.fw-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.fw-inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fw-inline-form .fw-input { flex: 1 1 200px; width: auto; }
.fw-form-msg { font-size: 0.82rem; }
.fw-form-msg--ok { color: #4ade80; }
.fw-form-msg--bad { color: #f87171; }

/* switch */
.fw-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.fw-toggle-row:last-of-type { border-bottom: none; }
.fw-toggle-row strong { display: block; font-size: 0.9rem; font-weight: 600; }
.fw-toggle-row span { font-size: 0.76rem; color: var(--text-secondary); }
.fw-switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.fw-switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 2; }
.fw-switch i { position: absolute; inset: 0; border-radius: 999px; background: #374151; transition: background 0.2s; }
.fw-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.fw-switch input:checked + i { background: var(--success-color); }
.fw-switch input:checked + i::after { transform: translateX(20px); }
.fw-switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4); }

/* current IP */
.fw-ip-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-top: 16px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); }
.fw-ip-box small { display: block; color: var(--text-secondary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.fw-ip-box strong { font-size: 1.1rem; }

/* modal */
.fw-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(6, 8, 15, 0.72); backdrop-filter: blur(3px); animation: fwFade 0.15s ease; }
.fw-modal { width: 100%; max-width: 520px; max-height: 92%; display: flex; flex-direction: column; background: #1a1e33; border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.7); overflow: hidden; }
.fw-modal--danger { border-color: rgba(239, 68, 68, 0.55); }
.fw-modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border-color); }
.fw-modal-head h4 { margin: 0; font-size: 1.05rem; font-weight: 600; flex: 1; color: var(--text-primary); }
.fw-modal-head .fw-x { background: none; border: none; color: var(--text-secondary); font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 2px 6px; }
.fw-modal-head .fw-x:hover { color: #fff; }
.fw-modal--danger .fw-modal-head h4 { color: #fca5a5; }
.fw-modal-body { padding: 20px 22px; overflow-y: auto; font-size: 0.9rem; line-height: 1.6; color: var(--text-primary); }
.fw-modal-body p { margin: 0 0 10px; }
.fw-modal-body ul { margin: 8px 0 0; padding-left: 20px; color: #fde68a; }
.fw-modal-error { margin-top: 14px; padding: 10px 12px; border-radius: 8px; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); color: #fecaca; font-size: 0.84rem; display: none; }
.fw-modal-error.is-visible { display: block; }
.fw-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-color); background: rgba(0, 0, 0, 0.15); flex-wrap: wrap; }

/* toast */
.fw-toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 3100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, 92%); }
.fw-toast { padding: 12px 16px; border-radius: 10px; font-size: 0.86rem; background: #1a1e33; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: fwFade 0.2s ease; }
.fw-toast--ok { border-color: rgba(34, 197, 94, 0.5); }
.fw-toast--bad { border-color: rgba(239, 68, 68, 0.6); }
.fw-toast--warn { border-color: rgba(234, 179, 8, 0.6); }

@keyframes fwFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

[hidden] { display: none !important; }
.fw-policy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
.fw-tile { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); min-width: 0; }
.fw-tile-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; }
.fw-tile strong { font-size: 1.1rem; }
.fw-tile small { color: var(--text-secondary); font-size: 0.74rem; line-height: 1.4; }
.fw-checklist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fw-checklist:empty { display: none; }
.fw-check { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; padding: 9px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-color); font-size: 0.84rem; }
.fw-check strong { display: block; font-size: 0.86rem; }
.fw-check span.fw-check-detail { color: var(--text-secondary); font-size: 0.78rem; word-break: break-word; }
.fw-check--pass { border-color: rgba(34, 197, 94, 0.35); } .fw-check--pass .fw-check-ico { color: #4ade80; }
.fw-check--warn { border-color: rgba(234, 179, 8, 0.4); } .fw-check--warn .fw-check-ico { color: #fbbf24; }
.fw-check--fail { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.06); } .fw-check--fail .fw-check-ico { color: #f87171; }
.fw-check--na .fw-check-ico { color: #94a3b8; }
.fw-check-ico { font-weight: 800; text-align: center; }
.fw-textarea { width: 100%; min-height: 84px; padding: 10px 13px; border-radius: 9px; border: 1px solid var(--border-color); background: rgba(0, 0, 0, 0.22); color: var(--text-primary); font-family: ui-monospace, Consolas, monospace; font-size: 0.86rem; outline: none; resize: vertical; }
.fw-textarea:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.fw-table td .fw-mini { display: block; font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; max-width: 260px; white-space: normal; }
@media (max-width: 1000px) {
    .fw-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .fw-form-grid { grid-template-columns: 1fr; }
    .fw-panel { padding: 16px; }
    .fw-kv { grid-template-columns: 1fr; }
    .fw-kv dt { border-bottom: none; padding-bottom: 0; }
    .fw-modal-foot .fw-btn { flex: 1; }
}
