/* redmineflux_notification_ui.css — Redmineflux Notification plugin shared UI
 * ============================================================================
 * Consolidated, plugin-scoped stylesheet implementing rfd-102's standardized
 * design tokens and component styles, matching the Timesheet plugin's
 * "Modern" table/action-icon/delete-modal family (rf_teams_index.css) and the
 * Helpdesk plugin's page-header/heading pattern (rf_helpdesk_ui.css), per
 * PLUGIN_UI_DESIGN_SYSTEM.md.
 *
 * Namespace: every class here is `rfn-*` (Redmineflux Notification) — unique
 * to this plugin, never shared at runtime with Timesheet/Helpdesk/any other
 * plugin, so this file introduces no cross-plugin dependency. The `--rfn-*`
 * custom properties on :root are likewise inert everywhere they are not
 * referenced, so declaring them carries no cross-plugin risk.
 *
 * Font-family is applied ONLY to `.rfn-*` selectors below — never to a
 * blanket `#content, #content *` selector — so this file cannot alter
 * typography on any other plugin's or Redmine core's pages.
 *
 * Structure
 *   1. Design tokens
 *   2. Page header
 *   3. Buttons
 *   4. Icon-only action buttons
 *   5. Cards / sections
 *   6. Tables
 *   7. Toolbar / filters
 *   8. Badges
 *   9. Switch (toggle)
 *  10. Modals (standard + delete/digest confirmation)
 *  11. Empty states
 *  12. Alerts / status items
 *  13. Forms
 *  14. Pagination (wrapper only — never Redmine's native <ul class="pages">)
 *  15. Bulk action bar
 *  16. Responsive (768px / 480px)
 * ========================================================================= */

/* The Inter web font used to be loaded here from fonts.googleapis.com on every page (the visitor's address and
   referrer went to a third party). The font-family lists below already fall back to the system fonts. */

/* =========================================================================
 * 1. DESIGN TOKENS
 * ====================================================================== */
:root {
  --rfn-accent: #0094FF;
  --rfn-accent-hover: #0077CC;
  --rfn-accent-tint: #eff6ff;
  --rfn-accent-ring: rgba(0, 148, 255, 0.1);

  --rfn-success: #22c55e;
  --rfn-success-hover: #16a34a;
  --rfn-success-bg: #dcfce7;
  --rfn-success-text: #15803d;

  --rfn-danger: #dc2626;
  --rfn-danger-hover: #b91c1c;
  --rfn-danger-bg: #fee2e2;
  --rfn-danger-text: #b91c1c;

  --rfn-warning: #f59e0b;
  --rfn-warning-hover: #d97706;
  --rfn-warning-bg: #fef3c7;
  --rfn-warning-text: #92400e;

  --rfn-info: #0094FF;
  --rfn-info-bg: #dbeafe;
  --rfn-info-text: #1d4ed8;

  --rfn-neutral-bg: #f3f4f6;
  --rfn-neutral-text: #374151;

  --rfn-text-primary: #111827;
  --rfn-text-secondary: #374151;
  --rfn-text-muted: #6b7280;
  --rfn-text-faint: #9ca3af;

  --rfn-border: #e5e7eb;
  --rfn-border-input: #d1d5db;
  --rfn-bg-surface: #ffffff;
  --rfn-bg-subtle: #f9fafb;

  --rfn-radius-sm: 6px;
  --rfn-radius-md: 10px;
  --rfn-radius-lg: 16px;
  --rfn-radius-pill: 9999px;

  --rfn-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);

  --rfn-space-1: 4px;
  --rfn-space-2: 8px;
  --rfn-space-3: 12px;
  --rfn-space-4: 16px;
  --rfn-space-5: 20px;
  --rfn-space-6: 24px;

  --rfn-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* The plugin's default accent is blue everywhere (its own design system).
   Only when the active theme is Scarlet should it switch to Scarlet's
   brand orange, so the buttons/links don't clash with Scarlet's palette.
   Every other theme (Lotus, Daisy, core default, ...) keeps the plugin's
   own blue from :root above. */
body.theme-Redmineflux_scarlet {
  --rfn-accent: #fc641f;
  --rfn-accent-hover: #e0530f;
  --rfn-accent-tint: #fff1eb;
  --rfn-accent-ring: rgba(252, 100, 31, 0.1);
}

/* =========================================================================
 * 2. PAGE HEADER — Helpdesk pattern (rf_helpdesk_ui.css §2)
 * ====================================================================== */
.rfn-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rfn-space-4);
  padding: var(--rfn-space-5) var(--rfn-space-6);
  background: var(--rfn-bg-surface);
  border: 1px solid var(--rfn-border);
  border-radius: var(--rfn-radius-md);
  margin-bottom: 18px;
  font-family: var(--rfn-font);
}

.rfn-page-header-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.rfn-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--rfn-text-primary);
  margin: 0;
  line-height: 1.3;
}

.rfn-page-subtitle {
  font-size: 13px;
  color: var(--rfn-text-muted);
  margin: 3px 0 0 0;
}

.rfn-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* =========================================================================
 * 3. BUTTONS — 40px standard / 32px compact, radius 6px
 * ====================================================================== */
.rfn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rfn-space-2);
  height: 40px;
  padding: 0 var(--rfn-space-5);
  box-sizing: border-box;
  font-family: var(--rfn-font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--rfn-radius-sm);
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.rfn-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.rfn-btn-compact {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

/* .rfn-btn is applied to <a>, <button> AND <input type="submit"> across
   the plugin (e.g. Save uses f.submit, Cancel uses link_to). Redmine
   core has its own "input[type=submit], button[type=submit]" rule
   (appearance, a hardcoded 28px block-size, and a plain white
   background-color) plus a generic "input, select, textarea, button"
   rule (background-color, color, border) — both selectors carry an
   element match that a single ".rfn-btn-primary"-style class doesn't,
   so on specificity they silently win over ours. The effect: an
   <input>-based button renders 4px shorter AND with core's white
   background instead of ours, even though our classes declare both.
   Matching the element type together with two of our own classes
   reliably out-specifies core's rules regardless of stylesheet order,
   for every property core also touches (appearance, height, background,
   border-color, color). */
input.rfn-btn.rfn-btn-primary,
button.rfn-btn.rfn-btn-primary {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  background: var(--rfn-accent);
  border-color: var(--rfn-accent);
  color: #fff;
}

input.rfn-btn.rfn-btn-secondary,
button.rfn-btn.rfn-btn-secondary {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  background: var(--rfn-bg-surface);
  border-color: var(--rfn-border-input);
  color: var(--rfn-text-secondary);
}

input.rfn-btn.rfn-btn-danger,
button.rfn-btn.rfn-btn-danger {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  background: var(--rfn-danger);
  border-color: var(--rfn-danger);
  color: #fff;
}

input.rfn-btn.rfn-btn-info,
button.rfn-btn.rfn-btn-info {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  background: var(--rfn-info);
  border-color: var(--rfn-info);
  color: #fff;
}

input.rfn-btn.rfn-btn-compact,
button.rfn-btn.rfn-btn-compact {
  height: 32px;
}

.rfn-btn-primary {
  background: var(--rfn-accent);
  border-color: var(--rfn-accent);
  color: #fff !important;
}

/* Scarlet's theme CSS has a blanket ".theme-Redmineflux_scarlet a:hover,
   .theme-Redmineflux_scarlet a:active { background-color: unset !important; }"
   rule, meant to keep plain text links from picking up a stray hover
   background. Both that rule and the naive ".rfn-btn-primary:hover"
   fix below are !important, so it comes down to specificity — and
   Scarlet's selector also matches the "a" element itself
   (2 classes + 1 element = (0,2,1)), which beats a bare
   ".rfn-btn-primary:hover" (2 classes + 0 elements = (0,2,0)), so the
   button's background/text still vanished on hover even with
   !important in place. Matching two of the button's own classes
   (.rfn-btn.rfn-btn-primary:hover = 3 classes = (0,3,0)) beats it
   outright regardless of element type or stylesheet load order, and
   works whether the button markup is an <a>, <button> or
   <input type="submit">. */
.rfn-btn.rfn-btn-primary:hover {
  background: var(--rfn-accent-hover) !important;
  border-color: var(--rfn-accent-hover);
}

.rfn-btn-secondary {
  background: var(--rfn-bg-surface);
  border-color: var(--rfn-border-input);
  color: var(--rfn-text-secondary) !important;
}

.rfn-btn.rfn-btn-secondary:hover {
  background: var(--rfn-bg-subtle) !important;
}

.rfn-btn-danger {
  background: var(--rfn-danger);
  border-color: var(--rfn-danger);
  color: #fff !important;
}

.rfn-btn.rfn-btn-danger:hover {
  background: var(--rfn-danger-hover) !important;
  border-color: var(--rfn-danger-hover);
}

.rfn-btn-info {
  background: var(--rfn-info);
  border-color: var(--rfn-info);
  color: #fff !important;
}

.rfn-btn.rfn-btn-info:hover {
  background: var(--rfn-accent-hover) !important;
  border-color: var(--rfn-accent-hover);
}

.rfn-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.rfn-btn:focus-visible {
  outline: 2px solid var(--rfn-accent);
  outline-offset: 2px;
}

/* =========================================================================
 * 4. ICON-ONLY ACTION BUTTONS — Timesheet's rf_teams_index.css .action-icon
 * ====================================================================== */
.rfn-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--rfn-radius-sm);
  transition: all 0.15s;
  text-decoration: none !important;
  color: var(--rfn-text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.rfn-action-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.rfn-action-icon:hover {
  transform: translateY(-1px);
}

.rfn-view-icon:hover {
  background: var(--rfn-accent-tint);
  color: var(--rfn-accent);
}

.rfn-edit-icon:hover {
  background: #f0fdf4;
  color: var(--rfn-success-text);
}

.rfn-copy-icon:hover {
  background: var(--rfn-accent-tint);
  color: var(--rfn-accent);
}

.rfn-delete-icon:hover {
  background: var(--rfn-danger-bg);
  color: var(--rfn-danger);
}

.rfn-action-buttons {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* =========================================================================
 * 5. CARDS / SECTIONS
 * ====================================================================== */
.rfn-card {
  background: var(--rfn-bg-surface);
  border: 1px solid var(--rfn-border);
  border-radius: var(--rfn-radius-md);
  box-shadow: var(--rfn-shadow-sm);
  margin-bottom: var(--rfn-space-4);
  font-family: var(--rfn-font);
}

.rfn-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rfn-space-3);
  padding: var(--rfn-space-3) var(--rfn-space-4);
  border-bottom: 1px solid var(--rfn-border);
}

.rfn-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--rfn-text-primary);
  margin: 0;
}

.rfn-card-body {
  padding: var(--rfn-space-4) var(--rfn-space-5);
}

.rfn-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--rfn-text-primary);
  margin: 0 0 var(--rfn-space-3) 0;
}

.rfn-subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--rfn-text-secondary);
  margin: 0 0 var(--rfn-space-2) 0;
}

/* Two-column integration layout (project Slack/Teams settings tabs) */
.rfn-integration-grid {
  display: flex;
  gap: var(--rfn-space-5);
  align-items: flex-start;
  flex-wrap: wrap;
}

.rfn-integration-main {
  flex: 1 1 55%;
  min-width: 280px;
}

.rfn-integration-side {
  flex: 1 1 38%;
  min-width: 260px;
}

.rfn-setup-steps {
  font-size: 12px;
  color: var(--rfn-text-secondary);
  margin: var(--rfn-space-2) 0;
  padding-left: 18px;
}

.rfn-setup-steps li {
  margin: 5px 0;
}

.rfn-channel-preview {
  background: var(--rfn-bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--rfn-text-secondary);
}

/* =========================================================================
 * 6. TABLES — Modern no-zebra skin
 * ====================================================================== */
.rfn-table-wrapper {
  background: var(--rfn-bg-surface);
  border: 1px solid var(--rfn-border);
  border-radius: var(--rfn-radius-md);
  overflow-x: auto;
  margin-bottom: var(--rfn-space-4);
}

.rfn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: var(--rfn-font);
}

.rfn-table thead {
  background: var(--rfn-bg-subtle);
}

.rfn-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--rfn-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--rfn-border);
  white-space: nowrap;
}

.rfn-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.15s;
}

.rfn-table tbody tr:last-child {
  border-bottom: none;
}

.rfn-table tbody tr:hover {
  background: var(--rfn-bg-subtle);
}

.rfn-table tbody tr.rfn-row-disabled {
  opacity: 0.55;
}

.rfn-table td {
  padding: 12px 16px;
  color: var(--rfn-text-secondary);
  vertical-align: middle;
}

.rfn-table .rfn-col-checkbox,
.rfn-table .rfn-col-center {
  text-align: center;
}

.rfn-table .rfn-col-checkbox {
  width: 36px;
}

.rfn-table .rfn-col-actions {
  width: 130px;
  text-align: center;
}

.rfn-table .rfn-cell-name {
  font-weight: 600;
  color: var(--rfn-accent);
}

.rfn-table .rfn-cell-muted {
  color: var(--rfn-text-muted);
  font-size: 12px;
}

.rfn-table .rfn-cell-wrap {
  max-width: 320px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.rfn-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--rfn-accent);
}

/* Redmine core wraps every plugin's settings page in
   <div class="box tabular settings">, and core has an even more specific
   ".tabular.settings label" rule (margin-inline-start: -300px;
   inline-size: 295px; on top of the base ".tabular label" float/align)
   that assumes the classic "label before its input, pulled into a
   reserved left gutter" layout. None of this plugin's own labels follow
   that pattern (checkbox-then-label rows, form-group divs), so they
   inherit the float + huge negative margin anyway and get shoved off to
   the left, mostly hidden behind the sidebar — leaving only the last
   letter or two of the label text visible (e.g. "Issue added" -> "d"),
   or nothing visible at all when the negative margin pushes the label
   fully under the sidebar.
   ".tabular.settings label" (2 classes) beats a plain
   ".plugin-redmineflux_notification label" (1 class) on specificity, so
   this reset has to match core's own selector shape with 3 classes to
   win reliably. */
.plugin-redmineflux_notification .tabular.settings label {
  float: none;
  margin-inline-start: 0;
  inline-size: auto;
  text-align: start;
  font-weight: normal;
  line-height: normal;
}

/* =========================================================================
 * 7. TOOLBAR / FILTERS
 * ====================================================================== */
.rfn-toolbar {
  display: flex;
  gap: var(--rfn-space-3);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--rfn-space-4) var(--rfn-space-5);
  background: var(--rfn-bg-surface);
  border: 1px solid var(--rfn-border);
  border-radius: var(--rfn-radius-md);
  margin-bottom: var(--rfn-space-4);
  font-family: var(--rfn-font);
}

.rfn-toolbar-search {
  flex: 1;
  min-width: 200px;
}

.rfn-toolbar-filters {
  display: flex;
  gap: var(--rfn-space-2);
  align-items: center;
  flex-wrap: wrap;
}

.rfn-input,
.rfn-select {
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--rfn-border-input);
  border-radius: var(--rfn-radius-sm);
  font-size: 14px;
  font-family: var(--rfn-font);
  color: var(--rfn-text-secondary);
  background: var(--rfn-bg-surface);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* .rfn-toolbar-filters is a flex row with no per-item width floor, so a
   <select>'s intrinsic width (sized to fit its selected option's text)
   gets squeezed below what its own text needs whenever the row doesn't
   have room for all the filters — the browser then clips/overlaps the
   label instead of resizing the field, e.g. "All Channels" rendering as
   "Al Channels". flex-wrap (already set above) handles the case where
   the row genuinely doesn't fit by wrapping to a new line instead. */
.rfn-toolbar-filters .rfn-select {
  flex-shrink: 0;
  min-width: 140px;
}

.rfn-input {
  width: 100%;
}

.rfn-input:focus,
.rfn-select:focus {
  outline: none;
  border-color: var(--rfn-accent);
  box-shadow: 0 0 0 3px var(--rfn-accent-ring);
}

/* =========================================================================
 * 8. BADGES — one pastel palette, five semantic states + channel variants
 * ====================================================================== */
.rfn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--rfn-radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-family: var(--rfn-font);
}

.rfn-badge-neutral {
  background: var(--rfn-neutral-bg);
  color: var(--rfn-neutral-text);
}

.rfn-badge-info {
  background: var(--rfn-info-bg);
  color: var(--rfn-info-text);
}

.rfn-badge-success {
  background: var(--rfn-success-bg);
  color: var(--rfn-success-text);
}

.rfn-badge-danger {
  background: var(--rfn-danger-bg);
  color: var(--rfn-danger-text);
}

.rfn-badge-warning {
  background: var(--rfn-warning-bg);
  color: var(--rfn-warning-text);
}

/* Channel-type tags — distinct hues kept from the pre-existing palette,
   normalized to the one canonical badge shape rather than a second system. */
.rfn-badge-channel-in_app {
  background: #ecfdf5;
  color: #065f46;
}

.rfn-badge-channel-email {
  background: var(--rfn-info-bg);
  color: #1e40af;
}

.rfn-badge-channel-slack {
  background: #f3e8ff;
  color: #6b21a8;
}

.rfn-badge-channel-teams {
  background: #eef2ff;
  color: #3730a3;
}

.rfn-badge-channel-webhook {
  background: var(--rfn-warning-bg);
  color: var(--rfn-warning-text);
}

/* Non-uppercase inline tag (event type / condition count) — same shape,
   normal-case text, per §17: uppercase+letter-spacing only fits short
   status words, not longer free-form labels. */
.rfn-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--rfn-font);
}

.rfn-tag-muted {
  color: var(--rfn-text-faint);
  font-style: italic;
  font-weight: 500;
}

/* =========================================================================
 * 9. SWITCH (TOGGLE) — one canonical implementation
 * ====================================================================== */
.rfn-switch {
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
  vertical-align: middle;
}

.rfn-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s;
}

.rfn-switch-on {
  background: var(--rfn-success);
}

.rfn-switch-on::after {
  left: 19px;
}

.rfn-switch-off {
  background: var(--rfn-border-input);
}

/* Two host shapes share this component: the <a> itself carries
   .rfn-switch-on/-off directly (notification_rules/index.html.erb), or a
   wrapping .nr-toggle-btn (a JS-hook class, not renamed — see the settings-tab
   toggle+bulk-submit JS) contains a child .rfn-switch span
   (settings/_notification_rules_settings.html.erb). Both get the same
   hover-darken feedback. */
.rfn-switch-on:hover,
.nr-toggle-btn:hover .rfn-switch-on {
  background: var(--rfn-success-hover);
}

.rfn-switch-off:hover,
.nr-toggle-btn:hover .rfn-switch-off {
  background: var(--rfn-text-faint);
}

.rfn-switch-status {
  font-size: 12px;
  color: var(--rfn-text-muted);
  margin-left: 6px;
  vertical-align: middle;
}

/* =========================================================================
 * 10. MODALS — standard shape shared by delete + digest-run confirmation
 * ====================================================================== */
.rfn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 9999;
}

.rfn-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.rfn-modal {
  background: var(--rfn-bg-surface);
  border-radius: var(--rfn-radius-lg);
  padding: 40px;
  width: 400px;
  max-width: calc(100vw - 32px);
  position: relative;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.2s;
  font-family: var(--rfn-font);
}

.rfn-modal-overlay.active .rfn-modal {
  transform: scale(1);
}

.rfn-modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--rfn-text-faint);
  border-radius: var(--rfn-radius-sm);
  transition: color 0.15s, background-color 0.15s;
}

.rfn-modal-close:hover {
  color: var(--rfn-text-secondary);
  background: var(--rfn-bg-subtle);
}

.rfn-modal-icon-container {
  margin-bottom: 20px;
}

.rfn-modal-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--rfn-danger-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.rfn-modal-icon-circle svg {
  width: 36px;
  height: 36px;
  color: var(--rfn-danger);
}

.rfn-modal-icon-info {
  background: var(--rfn-info-bg);
}

.rfn-modal-icon-info svg {
  color: var(--rfn-info-text);
}

.rfn-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--rfn-text-primary);
  margin: 0 0 12px 0;
}

.rfn-modal-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--rfn-text-muted);
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* Was reported right-aligned against the centered title/icon above it.
     This only ever inherited text-align: center from .rfn-modal rather
     than declaring it directly, so anything with higher specificity
     (a stale cached asset, a locale-specific override, etc.) could win
     without this rule ever changing — declare it explicitly instead of
     relying on inheritance. */
  text-align: center !important;
}

.rfn-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.rfn-modal-actions .rfn-btn {
  flex: 1;
  height: 45px;
}

/* =========================================================================
 * 11. EMPTY STATES
 * ====================================================================== */
.rfn-empty-state {
  background: var(--rfn-bg-surface);
  border: 1px solid var(--rfn-border);
  border-radius: var(--rfn-radius-md);
  text-align: center;
  padding: 64px 20px;
  font-family: var(--rfn-font);
}

.rfn-empty-state svg {
  width: 56px;
  height: 56px;
  color: #d1d5db;
}

.rfn-empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--rfn-text-primary);
  margin: 16px 0 8px 0;
}

.rfn-empty-state p {
  font-size: 14px;
  color: var(--rfn-text-muted);
  margin: 0 0 20px 0;
}

.rfn-empty-state p:last-child {
  margin-bottom: 0;
}

/* =========================================================================
 * 12. ALERTS / STATUS ITEMS
 * ====================================================================== */
.rfn-alert {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--rfn-radius-sm);
  font-size: 13px;
  border-left: 4px solid transparent;
  font-family: var(--rfn-font);
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: var(--rfn-space-4);
}

.rfn-alert p {
  margin: 6px 0 0 0;
}

.rfn-alert-success {
  background: var(--rfn-success-bg);
  border-left-color: var(--rfn-success);
  color: var(--rfn-success-text);
}

.rfn-alert-info {
  background: var(--rfn-info-bg);
  border-left-color: var(--rfn-info);
  color: var(--rfn-info-text);
}

.rfn-alert-warning {
  background: var(--rfn-warning-bg);
  border-left-color: var(--rfn-warning);
  color: var(--rfn-warning-text);
}

.rfn-alert-danger {
  background: var(--rfn-danger-bg);
  border-left-color: var(--rfn-danger);
  color: var(--rfn-danger-text);
}

.rfn-status-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--rfn-radius-sm);
  font-size: 13px;
  border-left: 4px solid transparent;
  margin: var(--rfn-space-2) 0;
}

.rfn-status-item-success {
  background: var(--rfn-success-bg);
  border-left-color: var(--rfn-success);
}

.rfn-status-item-info {
  background: var(--rfn-info-bg);
  border-left-color: var(--rfn-info);
}

.rfn-status-item-warning {
  background: var(--rfn-warning-bg);
  border-left-color: var(--rfn-warning);
}

.rfn-status-item-icon {
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
}

.rfn-status-item-content {
  flex: 1;
  min-width: 0;
  color: var(--rfn-text-secondary);
}

.rfn-status-item-content strong {
  color: var(--rfn-text-primary);
}

/* =========================================================================
 * 13. FORMS — used for the plugin/project Slack & Teams settings tabs
 * ====================================================================== */
.rfn-form-group {
  margin-bottom: var(--rfn-space-4);
}

.rfn-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--rfn-text-secondary);
  margin-bottom: 6px;
  font-family: var(--rfn-font);
}

.rfn-form-control {
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--rfn-border-input);
  border-radius: var(--rfn-radius-sm);
  font-size: 14px;
  font-family: var(--rfn-font);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rfn-form-control:focus {
  outline: none;
  border-color: var(--rfn-accent);
  box-shadow: 0 0 0 3px var(--rfn-accent-ring);
}

.rfn-form-control-full {
  width: 100%;
}

.rfn-form-control-lg {
  width: 100%;
  max-width: 400px;
}

.rfn-form-control-md {
  width: 100%;
  max-width: 260px;
}

.rfn-form-hint {
  color: var(--rfn-text-muted);
  font-style: italic;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

.rfn-form-fieldset {
  margin: var(--rfn-space-4) 0;
  padding: var(--rfn-space-3) var(--rfn-space-4);
  border: 1px solid var(--rfn-border);
  border-radius: var(--rfn-radius-sm);
}

.rfn-form-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--rfn-text-secondary);
  padding: 0 4px;
}

.rfn-form-checkbox-row {
  margin: 8px 0;
  font-family: var(--rfn-font);
  font-size: 14px;
  color: var(--rfn-text-secondary);
}

/* =========================================================================
 * 14. PAGINATION — restyles Redmine's own <ul class="pages"> wrapper only
 * ====================================================================== */
.rfn-pagination {
  padding: var(--rfn-space-4) var(--rfn-space-2) 0;
  font-family: var(--rfn-font);
}

.rfn-pagination ul.pages li a,
.rfn-pagination ul.pages li span {
  border-radius: var(--rfn-radius-sm);
}

.rfn-pagination ul.pages li.current span {
  background: var(--rfn-accent);
  border-color: var(--rfn-accent);
}

/* =========================================================================
 * 15a. LAYOUT UTILITY — inline space-between row (embedded settings-tab
 * summaries, e.g. rule count + "New Rule" button)
 * ====================================================================== */
.rfn-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--rfn-space-3);
  margin-bottom: var(--rfn-space-3);
  font-family: var(--rfn-font);
}

/* =========================================================================
 * 15. BULK ACTION BAR
 * ====================================================================== */
.rfn-bulk-bar {
  display: none;
  margin-top: var(--rfn-space-2);
  padding: var(--rfn-space-3) var(--rfn-space-4);
  background: var(--rfn-warning-bg);
  border: 1px solid #fde68a;
  border-radius: var(--rfn-radius-sm);
  gap: var(--rfn-space-3);
  align-items: center;
  font-size: 13px;
  color: var(--rfn-warning-text);
  font-family: var(--rfn-font);
}

.rfn-bulk-bar.rfn-bulk-bar-visible {
  display: flex;
}

/* =========================================================================
 * 16. RESPONSIVE — 768px (tablet) + 480px (mobile), per §23
 * ====================================================================== */
@media (max-width: 768px) {
  .rfn-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .rfn-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .rfn-table th,
  .rfn-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .rfn-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .rfn-toolbar-search {
    min-width: 0;
  }

  .rfn-integration-main,
  .rfn-integration-side {
    flex: 1 1 100%;
  }

  .rfn-modal {
    width: calc(100vw - 24px);
    padding: 28px;
  }

  .rfn-modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .rfn-page-title {
    font-size: 18px;
  }

  .rfn-modal-icon-circle {
    width: 64px;
    height: 64px;
  }

  .rfn-modal-icon-circle svg {
    width: 28px;
    height: 28px;
  }
}


#nrDeleteDesc.rfn-modal-description {
  padding-inline-start: 0px;
  font-size: 15px;
}