/* SYSTEM module — settings, gateways, templates, notifications, AI, addons, utilities */
#systemSettingsPage [hidden], #systemCustomNotificationForm [hidden], #systemUpdatePage [hidden] { display: none !important; }

.system-page-actions { flex-wrap: wrap; }
.system-page-actions .form-control { width: auto; min-width: 160px; padding: 9px 14px; }
.system-switch-list .setting-row-desc a { word-break: break-all; }
.system-radio-group { flex-wrap: wrap; }
.system-radio-group .form-check { margin-bottom: 0; }
.system-checkbox { margin-top: 6px; }
.system-color-picker { width: 52px; padding: 0 4px; border: 1px solid var(--border-color); border-radius: 10px 0 0 10px; background: var(--bg-surface); cursor: pointer; }
.system-settings .form-actions { margin-top: 4px; }

/* Payment gateways */
.system-gateway-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.system-gateway-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 16px; padding: 20px; transition: var(--transition); }
.system-gateway-card.is-active { border-color: rgba(79, 70, 229, 0.45); box-shadow: 0 8px 24px rgba(79, 70, 229, 0.10); }
.system-gateway-head { display: flex; align-items: center; gap: 14px; }
.system-gateway-logo { width: 56px; height: 56px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary); font-size: 1.4rem; }
.system-gateway-logo img { max-width: 44px; max-height: 36px; object-fit: contain; }
.system-gateway-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--border-color); }

/* Templates */
.system-code-input { font-family: 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; line-height: 1.5; }
.system-email-preview { width: 100%; min-height: 460px; height: 100%; border: 1px solid var(--border-color); border-radius: 12px; background: #fff; }
.system-shortcodes { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.system-shortcode { border: 1px solid var(--border-color); background: #f8fafc; color: var(--text-main); cursor: default; font-family: SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; }
.system-shortcode[data-insert-code] { cursor: pointer; }
.system-shortcode[data-insert-code]:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.system-excerpt { max-width: 360px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Custom notifications */
.system-lookup { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 10px; }

/* AI assistant */
.system-ai-output { min-height: 320px; padding: 16px; border: 1px dashed var(--border-color); border-radius: 12px; background: #f8fafc; outline: none; white-space: normal; }
.system-ai-output:focus { border-color: var(--primary); background: #fff; }
.system-ai-output:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.system-ai-variant + .system-ai-variant { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-color); }

/* Addons */
.system-addon-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }

/* Server information */
.system-info-table td:first-child { color: var(--text-muted); width: 56px; }

/* System update */
.system-version-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.system-version-card { text-align: center; padding: 22px 16px; border: 1px solid var(--border-color); border-radius: 12px; background: #f8fafc; }
.system-version-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.system-version-value { font-size: 1.8rem; font-weight: 800; margin-top: 6px; color: var(--primary); }
.system-update-hints { padding-left: 20px; margin-bottom: 16px; font-size: 0.92rem; }
.system-update-hints li { margin-bottom: 6px; }
.system-update-log { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.system-update-log li { padding: 10px 14px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; display: flex; gap: 10px; align-items: center; }
.system-update-log li:last-child { border-bottom: none; }
.system-release-notes { margin: 0 0 16px; padding: 18px; }

@media (max-width: 992px) {
    .system-lookup { grid-template-columns: 1fr; }
    .system-email-preview { min-height: 300px; }
    .system-page-actions { width: 100%; }
}
