/* ============================================================
   FPU CMS Admin – WordPress-inspired Design System
   WCAG 2.2 AA準拠
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
  /* WP palette */
  --wp-blue:        #2271b1;
  --wp-blue-hover:  #135e96;
  --wp-blue-light:  #d0dfe9;
  --wp-admin-bg:    #f0f0f1;
  --wp-sidebar-bg:  #1d2327;
  --wp-sidebar-item:#2c3338;
  --wp-sidebar-hover:#2c3338;
  --wp-sidebar-active:#2271b1;
  --wp-topbar-bg:   #1d2327;
  --wp-topbar-h:    32px;
  --wp-adminbar-bg: #23282d;

  /* Semantic */
  --color-primary:  var(--wp-blue);
  --color-primary-hover: var(--wp-blue-hover);
  --color-success:  #00a32a;
  --color-warning:  #dba617;
  --color-danger:   #d63638;
  --color-info:     #72aee6;

  /* Surface */
  --surface:        #ffffff;
  --surface-alt:    #f6f7f7;
  --border:         #c3c4c7;
  --border-light:   #dcdcde;

  /* Text – AA contrast */
  --text-primary:   #1d2327;
  --text-secondary: #50575e;
  --text-muted:     #787c82;
  --text-on-dark:   #f0f0f1;
  --text-link:      var(--wp-blue);

  /* Layout */
  --sidebar-w:      160px;
  --sidebar-w-open: 220px;
  --adminbar-h:     32px;
  --subheader-h:    56px;

  /* Radius / shadow – subtle, WP-like */
  --radius:         4px;
  --radius-sm:      2px;
  --radius-lg:      8px;
  --shadow-card:    0 1px 3px rgba(0,0,0,.13);
  --shadow-focus:   0 0 0 2px #fff, 0 0 0 4px var(--wp-blue);
  --transition:     .15s ease;
}

/* ── Base ── */
html { height: 100%; font-size: 13px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--wp-admin-bg);
  min-height: 100%;
}
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--wp-blue-hover); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 13px; }

/* ── Focus visible (WCAG 2.1 §2.4.7) ── */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus) !important;
}
:focus:not(:focus-visible) { outline: none; }

/* ============================================================
   ADMIN BAR (top black bar)
   ============================================================ */
#adminbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--adminbar-h);
  background: var(--wp-adminbar-bg);
  display: flex; align-items: center;
  padding: 0 14px;
  z-index: 9999;
  gap: 20px;
}
.adminbar-logo {
  display: flex; align-items: center; gap: 8px;
  color: #a7aaad;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.adminbar-logo .logo-mark {
  width: 24px; height: 24px;
  background: var(--wp-blue);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.adminbar-items { display: flex; gap: 0; flex: 1; }
.adminbar-item {
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px;
  height: var(--adminbar-h);
  color: #a7aaad;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.adminbar-item:hover { background: #32373c; color: #fff; text-decoration: none; }
.adminbar-item.has-badge { position: relative; }
.adminbar-badge {
  background: var(--color-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 9px;
  min-width: 16px;
  height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 3px;
}
.adminbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.adminbar-user {
  display: flex; align-items: center; gap: 6px;
  color: #a7aaad; font-size: 12px; cursor: pointer;
  padding: 0 8px; height: var(--adminbar-h);
  transition: background var(--transition);
}
.adminbar-user:hover { background: #32373c; color: #fff; }
.adminbar-avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--wp-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#wpcmsadmin {
  display: flex;
  padding-top: var(--adminbar-h);
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR (#adminmenuwrap)
   ============================================================ */
#adminmenuwrap {
  width: var(--sidebar-w);
  background: var(--wp-sidebar-bg);
  position: fixed;
  top: var(--adminbar-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: width var(--transition);
  flex-shrink: 0;
}
#adminmenuwrap::-webkit-scrollbar { width: 4px; }
#adminmenuwrap::-webkit-scrollbar-track { background: transparent; }
#adminmenuwrap::-webkit-scrollbar-thumb { background: #3c434a; border-radius: 2px; }

/* Separator */
.wp-menu-separator {
  height: 1px;
  background: #3c434a;
  margin: 8px 0;
}

/* Menu item */
.wp-menu-item {
  position: relative;
  list-style: none;
}
.wp-menu-item > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 14px;
  color: #b4b9be;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.wp-menu-item > a:hover {
  background: var(--wp-sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.wp-menu-item > a .menu-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  opacity: .85;
}
.wp-menu-item > a .menu-label { flex: 1; font-size: 13px; }
.wp-menu-item > a .menu-badge {
  background: var(--color-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 9px;
  min-width: 16px;
  height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto;
}
.wp-menu-item > a .menu-badge.orange { background: var(--color-warning); }

/* Active */
.wp-menu-item.current > a,
.wp-menu-item.current > a:hover {
  background: var(--wp-sidebar-active);
  color: #fff;
  border-left-color: #72aee6;
}

/* Submenu */
.wp-submenu {
  background: #16191c;
  display: none;
}
.wp-menu-item.open > .wp-submenu { display: block; }
.wp-submenu li a {
  display: flex; align-items: center;
  padding: 5px 12px 5px 44px;
  color: #ccd;
  font-size: 12.5px;
  text-decoration: none;
  transition: color var(--transition);
}
.wp-submenu li a:hover { color: #fff; text-decoration: none; }
.wp-submenu li.current a { color: #72aee6; }

/* Toggle arrow */
.wp-menu-item .menu-arrow {
  font-size: 10px;
  opacity: .6;
  margin-left: 4px;
  transition: transform .2s;
}
.wp-menu-item.open .menu-arrow { transform: rotate(180deg); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#wpcontent {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

/* Sub-header (breadcrumb + actions bar) */
#wpsubheader {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 20px;
  height: var(--subheader-h);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: var(--adminbar-h);
  z-index: 100;
}
.subheader-title {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  flex: 1;
}
.subheader-title strong { font-weight: 600; }
.subheader-actions { display: flex; align-items: center; gap: 8px; }

/* Wrap */
#wpbody-content {
  padding: 20px;
}

/* ============================================================
   NOTICES
   ============================================================ */
.notice {
  background: var(--surface);
  border-left: 4px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
}
.notice p { margin: 0; line-height: 1.5; }
.notice-success { border-left-color: var(--color-success); }
.notice-warning { border-left-color: var(--color-warning); background: #fcf9e8; }
.notice-error   { border-left-color: var(--color-danger);  background: #fcf0f1; }
.notice-info    { border-left-color: var(--wp-blue); }
.notice-dismiss {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  padding: 0 4px; line-height: 1;
}
.notice-dismiss:hover { color: var(--color-danger); }

/* ============================================================
   CARDS / POSTBOX
   ============================================================ */
.postbox {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}
.postbox-header {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 10px;
}
.postbox-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.4;
}
.postbox-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}
.postbox-actions { display: flex; gap: 6px; align-items: center; }
.postbox-body { padding: 16px; }
.postbox-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dce9f5; color: var(--wp-blue); }
.stat-icon.green  { background: #d8f5e3; color: var(--color-success); }
.stat-icon.orange { background: #fef5e0; color: var(--color-warning); }
.stat-icon.red    { background: #fce8e8; color: var(--color-danger); }
.stat-icon.grey   { background: var(--surface-alt); color: var(--text-secondary); }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.stat-delta { font-size: 11px; margin-top: 2px; }
.stat-delta.up   { color: var(--color-success); }
.stat-delta.down { color: var(--color-danger); }

/* ============================================================
   TABLES  (WP list-table style)
   ============================================================ */
.wp-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wp-list-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-alt);
  white-space: nowrap;
  letter-spacing: .02em;
}
.wp-list-table thead th input[type="checkbox"] { margin: 0; }
.wp-list-table tbody tr { border-bottom: 1px solid var(--border-light); }
.wp-list-table tbody tr:last-child { border-bottom: none; }
.wp-list-table tbody tr:hover > td { background: #f6f7f7; }
.wp-list-table tbody td {
  padding: 10px 10px;
  vertical-align: middle;
  color: var(--text-primary);
  font-size: 13px;
}
.wp-list-table .column-title { font-weight: 600; }
.wp-list-table .row-actions {
  visibility: hidden;
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.wp-list-table tbody tr:hover .row-actions { visibility: visible; }
.row-actions a {
  font-size: 12px;
  color: var(--text-link);
  text-decoration: none;
}
.row-actions a:hover { text-decoration: underline; }
.row-actions .trash  { color: var(--color-danger); }
.row-actions .sep    { color: var(--text-muted); user-select: none; }
.check-column { width: 2em; padding-right: 0; }

/* Tablenav (WP-style toolbar above/below table) */
.tablenav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  flex-wrap: wrap;
  min-height: 38px;
}
.tablenav .tablenav-pages-navspan { font-size: 12.5px; color: var(--text-secondary); }
.tablenav .spacer { flex: 1; }
.tablenav-pages { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.displaying-num { font-style: italic; font-size: 12px; color: var(--text-muted); }

/* ============================================================
   SUBSUBSUB (WP "状態別フィルタ" tabs)
   ============================================================ */
.subsubsub {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 8px;
  font-size: 13px;
}
.subsubsub li { display: flex; align-items: center; }
.subsubsub li::after { content: "|"; color: var(--border); padding: 0 6px; }
.subsubsub li:last-child::after { content: ""; }
.subsubsub a {
  color: var(--text-link);
  text-decoration: none;
  padding: 2px 0;
}
.subsubsub a:hover { text-decoration: underline; }
.subsubsub li.current a { color: var(--text-primary); font-weight: 600; }
.subsubsub .count { color: var(--text-muted); font-size: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.button, .button-primary, .button-secondary, .button-link,
.button-large, .button-small, .button-hero {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 30px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}
.button, .button-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}
.button:hover, .button-secondary:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
  text-decoration: none;
  color: var(--text-primary);
}
.button-primary {
  background: var(--wp-blue);
  border-color: var(--wp-blue-hover);
  color: #fff;
}
.button-primary:hover {
  background: var(--wp-blue-hover);
  border-color: #0e4f82;
  color: #fff;
  text-decoration: none;
}
.button-hero {
  height: 42px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
}
.button-large { height: 36px; padding: 0 14px; font-size: 13.5px; }
.button-small { height: 24px; padding: 0 8px; font-size: 12px; }
.button-link {
  background: none;
  border-color: transparent;
  color: var(--text-link);
  padding: 0 4px;
  height: auto;
}
.button-link:hover { text-decoration: underline; color: var(--wp-blue-hover); }
.button-delete, .button-danger {
  background: var(--surface);
  border-color: var(--color-danger);
  color: var(--color-danger);
}
.button-delete:hover, .button-danger:hover {
  background: var(--color-danger);
  color: #fff;
  text-decoration: none;
}
.button-success {
  background: var(--color-success);
  border-color: #007a1f;
  color: #fff;
}
.button-success:hover { background: #007a1f; color: #fff; text-decoration: none; }
.button-warning {
  background: var(--color-warning);
  border-color: #b8861b;
  color: #fff;
}
.button-warning:hover { background: #b8861b; color: #fff; text-decoration: none; }
button:disabled, .button:disabled { opacity: .6; cursor: not-allowed; pointer-events: none; }
.button [aria-hidden="true"] { font-size: 14px; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.form-table { width: 100%; border-collapse: collapse; }
.form-table th {
  width: 220px;
  padding: 15px 20px 15px 0;
  vertical-align: top;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-table td { padding: 12px 0; vertical-align: top; }
.form-table th label { line-height: 1.6; }

label { font-size: 13px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.form-required { color: var(--color-danger); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color var(--transition);
  outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
  border-color: var(--wp-blue);
  box-shadow: 0 0 0 1px var(--wp-blue);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.large-text { width: 99%; max-width: 500px; }
.regular-text { width: 25em; }
.small-text { width: 5em; }
textarea.large-text { min-height: 140px; resize: vertical; }
.description { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; display: block; line-height: 1.5; }

/* Inline search */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-box input[type="search"] {
  width: 200px;
  padding-right: 28px;
}

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.post-state {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.state-publish  { background: #d8f5e3; color: #006b21; }
.state-draft    { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.state-pending  { background: #fef5e0; color: #7a4f00; }
.state-trash    { background: #fce8e8; color: #8a1a1a; }
.state-private  { background: #e8eaf5; color: #2e3192; }
.state-future   { background: #eef5ff; color: #0044a0; }
.state-rejected { background: #fce8e8; color: #8a1a1a; }

/* Role badges */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.role-super   { background: #23282d; color: #f0f0f1; }
.role-admin   { background: #1d4f8a; color: #fff; }
.role-editor  { background: #1a6b3c; color: #fff; }
.role-author  { background: #4a3570; color: #fff; }
.role-viewer  { background: #3c434a; color: #f0f0f1; }

/* ============================================================
   INLINE ACTION BAR (above table)
   ============================================================ */
.bulkactions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bulkactions select { width: 180px; height: 28px; font-size: 12.5px; }
.bulkactions .button { height: 28px; font-size: 12.5px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-links {
  display: flex; align-items: center; gap: 4px; font-size: 13px;
}
.pagination-links .button { min-width: 28px; height: 28px; padding: 0 6px; justify-content: center; }
.pagination-links .current-page-selector { width: 3em; text-align: center; height: 28px; }

/* ============================================================
   ACTIVITY / TIMELINE
   ============================================================ */
.activity-list { list-style: none; padding: 0; }
.activity-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: flex-start;
  font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.dot-blue   { background: var(--wp-blue); }
.dot-green  { background: var(--color-success); }
.dot-orange { background: var(--color-warning); }
.dot-red    { background: var(--color-danger); }
.activity-body { flex: 1; }
.activity-text { line-height: 1.5; }
.activity-time { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ============================================================
   APPROVAL ITEM
   ============================================================ */
.approval-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.approval-row:last-child { border-bottom: none; }
.approval-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--wp-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.approval-body { flex: 1; min-width: 0; }
.approval-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approval-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.approval-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--wp-blue);
  transition: width .3s ease;
}
.progress-fill.green  { background: var(--color-success); }
.progress-fill.orange { background: var(--color-warning); }

/* ============================================================
   WORKFLOW STEPS
   ============================================================ */
.workflow-steps {
  display: flex;
  align-items: flex-start;
  padding: 6px 0;
  overflow-x: auto;
}
.wf-step {
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 80px;
}
.wf-step::after {
  content: '';
  position: absolute;
  top: 13px; left: 50%;
  width: 100%; height: 2px;
  background: var(--border);
  z-index: 0;
}
.wf-step:last-child::after { display: none; }
.wf-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  position: relative; z-index: 1;
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition);
}
.wf-step.done .wf-dot  { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.wf-step.active .wf-dot{ background: var(--wp-blue); border-color: var(--wp-blue); color: #fff; }
.wf-step.done::after   { background: var(--color-success); }
.wf-label { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.wf-step.active .wf-label { color: var(--wp-blue); font-weight: 600; }
.wf-step.done .wf-label  { color: var(--color-success); }

/* ============================================================
   LOG TABLE
   ============================================================ */
.log-op {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
}
.op-create  { background: #d8f5e3; color: #00521a; }
.op-edit    { background: #dce9f5; color: #0b3d6e; }
.op-publish { background: #e8eaf5; color: #1a1e72; }
.op-delete  { background: #fce8e8; color: #7a1515; }
.op-login   { background: #edf8f5; color: #00564a; }
.op-logout  { background: var(--surface-alt); color: var(--text-muted); }

/* ============================================================
   TOGGLE SWITCH (accessible)
   ============================================================ */
.toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.toggle-wrap:last-child { border-bottom: none; }
.toggle-info .toggle-label  { font-size: 13.5px; font-weight: 400; color: var(--text-primary); display: inline; margin-bottom: 0; }
.toggle-info .toggle-desc   { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: block; }
.wp-toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.wp-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.wp-toggle-track {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.wp-toggle input:checked + .wp-toggle-track { background: var(--wp-blue); }
.wp-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: left .2s;
}
.wp-toggle input:checked + .wp-toggle-track::after { left: 23px; }
.wp-toggle input:focus-visible + .wp-toggle-track { box-shadow: var(--shadow-focus); }

/* ============================================================
   MEDIA GRID
   ============================================================ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.media-item {
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
  background: var(--surface);
}
.media-item:hover { border-color: var(--wp-blue); }
.media-item:focus-within { border-color: var(--wp-blue); box-shadow: var(--shadow-focus); }
.media-thumb {
  height: 80px;
  background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.media-name {
  font-size: 11px;
  padding: 4px 6px;
  color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--border-light);
}

/* ============================================================
   PAGE TREE
   ============================================================ */
.page-tree { font-size: 13px; line-height: 2; }
.page-tree .pt-root { font-weight: 700; color: var(--wp-blue); }
.page-tree .pt-l1 { padding-left: 20px; display: flex; align-items: center; gap: 6px; }
.page-tree .pt-l2 { padding-left: 40px; display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.page-tree .pt-l3 { padding-left: 60px; display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }
.page-tree .pt-icon { font-size: 13px; opacity: .7; }

/* ============================================================
   INLINE EDITOR TOOLBAR (mock)
   ============================================================ */
.editor-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.editor-toolbar {
  display: flex; align-items: center; gap: 1px;
  padding: 5px 8px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.editor-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition);
  border: none; background: none;
}
.editor-btn:hover { background: var(--border-light); color: var(--text-primary); }
.editor-sep { width: 1px; height: 18px; background: var(--border-light); margin: 0 3px; }
.editor-body {
  min-height: 180px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  background: var(--surface);
  color: var(--text-primary);
}
.editor-body:focus { box-shadow: none; }

/* ============================================================
   INLINE CONFIRM DIALOG (replaces popup)
   ============================================================ */
.inline-confirm {
  background: #fcf9e8;
  border: 1px solid var(--color-warning);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: none;
  gap: 12px;
  align-items: flex-start;
  margin-top: 10px;
}
.inline-confirm.visible { display: flex; }
.inline-confirm p { margin: 0 0 10px; font-size: 13.5px; color: var(--text-primary); }
.inline-confirm-actions { display: flex; gap: 6px; }
.inline-confirm-icon { font-size: 20px; flex-shrink: 0; }
.inline-confirm-body { flex: 1; }

/* ============================================================
   SKIP LINK (WCAG §2.4.1)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--wp-blue);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 99999;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 6px; color: #fff; text-decoration: none; }

/* ============================================================
   SCREEN READER ONLY (WCAG accessible labels)
   ============================================================ */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-success  { color: var(--color-success); }
.text-danger   { color: var(--color-danger); }
.text-warning  { color: var(--color-warning); }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.fs-12   { font-size: 12px; }
.fs-13   { font-size: 13px; }
.truncate{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }
.hidden  { display: none !important; }
.visually-hidden { @extend .screen-reader-text; }

/* ============================================================
   BACK LINK
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 14px;
}
.back-link:hover { color: var(--wp-blue); text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 782px) {
  #adminmenuwrap { width: 0; overflow: hidden; }
  #adminmenuwrap.open { width: var(--sidebar-w-open); }
  #wpcontent { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3c4c7; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8c8f94; }

/* ============================================================
   CHART MOCK
   ============================================================ */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  padding: 8px 0 0;
}
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--wp-blue);
  opacity: .75;
  transition: opacity .2s;
  min-height: 4px;
}
.chart-bar-fill:hover { opacity: 1; }
.chart-bar-fill.green { background: var(--color-success); }
.chart-bar-label { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   LANG TAB
   ============================================================ */
.lang-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; }
.lang-tab-btn {
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  background: none;
  font-family: inherit;
  transition: color var(--transition);
  margin-bottom: -1px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.lang-tab-btn:hover { color: var(--text-primary); }
.lang-tab-btn.active {
  color: var(--text-primary);
  background: var(--surface);
  border-color: var(--border-light);
  font-weight: 600;
}
.lang-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* ============================================================
   BACKUP ROWS
   ============================================================ */
.backup-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.backup-row:last-child { border-bottom: none; }
.backup-type { font-weight: 600; min-width: 72px; }

/* ============================================================
   ROLE CARD
   ============================================================ */
.role-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px;
}
.role-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.role-icon-wrap {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.role-name  { font-size: 13.5px; font-weight: 700; }
.role-count { font-size: 12px; color: var(--text-muted); }
.perm-tags  { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-tag   {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  padding: 1px 6px;
  color: var(--text-secondary);
}

/* ============================================================
   COMMENT THREAD
   ============================================================ */
.comment-thread { border: 1px solid var(--border-light); border-radius: var(--radius); overflow: hidden; }
.comment-item { padding: 12px 14px; border-bottom: 1px solid var(--border-light); }
.comment-item:last-child { border-bottom: none; }
.comment-item.reviewer { background: #f6f7f7; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-author { font-size: 13px; font-weight: 700; }
.comment-time   { font-size: 11.5px; color: var(--text-muted); margin-left: auto; }
.comment-text   { font-size: 13px; line-height: 1.6; color: var(--text-primary); }

/* ============================================================
   MINI AVATAR
   ============================================================ */
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--wp-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.user-avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.user-avatar.lg { width: 36px; height: 36px; font-size: 14px; }
