/* FastAdmin / AdminLTE inspired admin theme */
:root {
  --fa-primary: #3c8dbc;
  --fa-primary-dark: #367fa9;
  --fa-sidebar: #222d32;
  --fa-sidebar-hover: #1e282c;
  --fa-sidebar-active: #1e282c;
  --fa-sidebar-text: #b8c7ce;
  --fa-sidebar-active-text: #fff;
  --fa-content-bg: #ecf0f5;
  --fa-border: #d2d6de;
  --fa-text: #333;
  --fa-muted: #777;
  --fa-danger: #dd4b39;
  --fa-success: #00a65a;
  --fa-warning: #f39c12;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: var(--fa-text);
  background: var(--fa-content-bg);
  overflow: auto;
}

.hidden { display: none !important; }

/* ===== Login ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d2d6de;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 400px;
}
.login-logo {
  text-align: center;
  margin-bottom: 18px;
  font-size: 28px;
  font-weight: 300;
  color: #444;
  letter-spacing: 0.5px;
}
.login-logo b { font-weight: 700; color: var(--fa-primary); }
.login-box-body {
  background: #fff;
  padding: 24px 24px 20px;
  border-top: 3px solid var(--fa-primary);
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.login-box-msg {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--fa-muted);
  text-align: center;
}
.login-form-group { margin-bottom: 14px; }
.login-form-group input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  font-size: 14px;
}
.login-form-group input:focus {
  outline: none;
  border-color: var(--fa-primary);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(60,141,188,.3);
}
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.login-actions-row {
  display: flex;
  gap: 10px;
}
.login-actions-row button { flex: 1; }
.login-setup-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fa-muted);
  text-align: center;
}
.login-actions-row .hidden {
  display: none !important;
}

/* ===== Layout ===== */
.wrapper {
  min-height: 100vh;
  width: 100%;
}
.main-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 230px;
  height: 100vh;
  z-index: 810;
  background: var(--fa-sidebar);
  overflow-y: auto;
  transition: width .25s ease, transform .25s ease;
}
.sidebar-logo {
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: var(--fa-primary-dark);
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo small {
  font-size: 12px;
  font-weight: 400;
  opacity: .85;
}
.sidebar-user {
  padding: 12px 14px;
  color: var(--fa-sidebar-text);
  font-size: 12px;
  border-bottom: 1px solid #1a2226;
  line-height: 1.5;
}
.sidebar-user strong {
  display: block;
  color: #fff;
  font-size: 13px;
  margin-bottom: 2px;
}
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 8px 0 16px;
}
.sidebar-menu li { margin: 0; }
.sidebar-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px 10px 18px;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--fa-sidebar-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-menu button:hover {
  background: var(--fa-sidebar-hover);
  color: var(--fa-sidebar-active-text);
}
.sidebar-menu button.active {
  background: var(--fa-sidebar-active);
  border-left-color: var(--fa-primary);
  color: var(--fa-sidebar-active-text);
}
.sidebar-menu .menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  flex-shrink: 0;
}
.sidebar-menu .menu-icon img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  opacity: 0.88;
}
.sidebar-menu button:hover .menu-icon img,
.sidebar-menu button.active .menu-icon img {
  opacity: 1;
}
.sidebar-menu .menu-label { flex: 1; min-width: 0; }
.sidebar-menu .nav-badge {
  margin-left: auto;
}

.content-wrapper {
  margin-left: 230px;
  min-height: 100vh;
  background: var(--fa-content-bg);
  transition: margin-left .25s ease;
}
.main-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 50px;
  background: var(--fa-primary);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.sidebar-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.12); }
.header-breadcrumb {
  flex: 1;
  min-width: 0;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-breadcrumb .sep { margin: 0 6px; opacity: .7; }
.header-breadcrumb .active { color: #fff; font-weight: 600; }
.navbar-custom-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.navbar-custom-menu .header-user {
  color: rgba(255,255,255,.9);
  font-size: 13px;
  margin-right: 4px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content {
  padding: 15px;
  min-height: 0;
}

/* Sidebar collapsed */
.wrapper.sidebar-collapse .main-sidebar { width: 50px; }
.wrapper.sidebar-collapse .sidebar-logo span,
.wrapper.sidebar-collapse .sidebar-user,
.wrapper.sidebar-collapse .menu-label,
.wrapper.sidebar-collapse .nav-badge { display: none; }
.wrapper.sidebar-collapse .sidebar-menu button {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.wrapper.sidebar-collapse .sidebar-menu .menu-icon { margin-right: 0; }
.wrapper.sidebar-collapse .content-wrapper { margin-left: 50px; }

/* ===== Box panel (FastAdmin box) ===== */
.module {
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  border-top: 3px solid var(--fa-primary);
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
  margin-bottom: 0;
  padding: 0;
}
.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 12px 15px;
  border-bottom: 1px solid #f4f4f4;
  background: #fff;
}
.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #444;
  line-height: 24px;
}
.module-head .toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.module-head .toolbar-actions button {
  height: 30px;
}
.box-body {
  padding: 15px;
}
.toolbar-filters .muted {
  font-size: 13px;
  line-height: 1.5;
}
.overview-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--fa-muted);
  line-height: 1.6;
}

/* ===== Buttons ===== */
button {
  height: 36px;
  padding: 0 14px;
  border-radius: 3px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--fa-primary);
  color: #fff;
  border-color: var(--fa-primary-dark);
  transition: background .15s, border-color .15s;
}
button:hover { background: var(--fa-primary-dark); }
button:active { transform: translateY(1px); }
.btn-secondary {
  background: #f4f4f4;
  color: #444;
  border-color: #ddd;
}
.btn-secondary:hover { background: #e7e7e7; color: #333; }
.btn-danger {
  background: #fff;
  color: var(--fa-danger);
  border-color: #f5c6cb;
}
.btn-danger:hover { background: #fdf2f2; }
.btn-success {
  background: var(--fa-success);
  border-color: #008d4c;
  color: #fff;
}
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-icon {
  min-width: 34px;
  padding: 0 8px;
  font-size: 15px;
  line-height: 1;
}

/* ===== Forms ===== */
.row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.row input,
.row select {
  flex: 1 1 200px;
  min-width: 160px;
}
input, select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  font-size: 13px;
  background: #fff;
  color: var(--fa-text);
}
select { min-width: 140px; }
input:focus, select:focus {
  outline: none;
  border-color: var(--fa-primary);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(60,141,188,.25);
}

/* ===== Toolbar / search ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px;
  background: #f9f9f9;
  border: 1px solid #f4f4f4;
  border-radius: 3px;
}
.toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 280px;
  min-width: 0;
}
.toolbar-filters input,
.toolbar-filters select {
  flex: 1 1 150px;
  min-width: 130px;
  height: 34px;
  margin: 0;
}
.toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.toolbar-actions button { height: 34px; }

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.stats.stats-secondary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  padding: 14px 16px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--fa-primary);
}
.stat-card-virtual::before {
  background: #9ca3af;
}
.stat-label {
  font-size: 12px;
  color: var(--fa-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #444;
}

/* ===== Tables ===== */
.table-wrap {
  margin-top: 0;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  overflow: auto;
  background: #fff;
  max-height: 500px;
}
#modUsers .table-wrap,
#modRooms .table-wrap,
#modInvites .table-wrap,
#modFeedback .table-wrap {
  height: 500px;
  max-height: 500px;
  min-height: 500px;
}
#modUsers tr.table-empty-row td,
#modRooms tr.table-empty-row td,
#modInvites tr.table-empty-row td,
#modFeedback tr.table-empty-row td {
  text-align: center;
  vertical-align: middle;
  height: 458px;
  padding: 32px 16px;
  color: #999;
  font-size: 14px;
  white-space: normal;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 920px;
}
th, td {
  border-bottom: 1px solid #f4f4f4;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  background: #f9f9f9;
  color: #555;
  font-weight: 600;
  border-bottom: 2px solid var(--fa-border);
  z-index: 1;
}
#feedbackTable { min-width: 960px; }
#feedbackTable tbody tr {
  height: 52px;
}
#feedbackTable tbody td {
  height: 52px;
  max-height: 52px;
  padding-top: 8px;
  padding-bottom: 8px;
  overflow: hidden;
  vertical-align: middle;
}
#feedbackTable tbody td.feedback-content-cell {
  white-space: normal;
}
td.feedback-content-cell {
  max-width: 360px;
  min-width: 220px;
  word-break: break-word;
}
.feedback-content-plain {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-size: 13px;
}
.feedback-content-fold {
  max-width: 100%;
}
.feedback-content-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  line-height: 1.4;
  color: #444;
  margin: 0;
}
.feedback-content-summary::-webkit-details-marker { display: none; }
.feedback-content-preview {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feedback-content-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}
.feedback-content-toggle::after {
  content: '展开';
  font-size: 12px;
  color: var(--fa-primary);
}
.feedback-content-fold[open] .feedback-content-preview {
  display: none;
}
.feedback-content-fold[open] .feedback-content-toggle::after {
  content: '收起';
}
.feedback-content-body {
  margin-top: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
  color: #444;
}
.feedback-content-body-floating {
  max-height: min(280px, calc(100vh - 24px));
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
td.feedback-imgs-cell {
  white-space: nowrap;
  overflow: hidden;
  max-width: 140px;
}
.feedback-imgs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  max-height: 36px;
  overflow: hidden;
}
td.feedback-imgs-cell a {
  display: block;
  margin: 0;
  flex-shrink: 0;
  line-height: 0;
}
td.feedback-imgs-cell img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--fa-border);
  display: block;
}
tbody tr:hover { background: #f5f9fc; }
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:nth-child(even):hover { background: #f0f7fb; }

.avatar-cell { width: 56px; }
.avatar-thumb {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 2px;
  border: none;
  object-fit: cover;
  display: inline-block;
  background: #e5e7eb;
  vertical-align: middle;
  flex-shrink: 0;
}
.avatar-virtual-default {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 2px;
  border: none;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  flex-shrink: 0;
}
.avatar-empty {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 2px;
  border: none;
  background: #e5e7eb;
  color: #9ca3af;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  flex-shrink: 0;
}

/* 用户管理：固定列宽与行高，切换真实/虚拟时不跳动 */
#modUsers .table-wrap {
  scrollbar-gutter: stable;
}
#modUsers table {
  table-layout: fixed;
  min-width: 1092px;
}
#modUsers tbody tr {
  height: 54px;
}
#modUsers tbody td {
  height: 54px;
  max-height: 54px;
}
#modUsers tbody td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}
#modUsers th:nth-child(1),
#modUsers td:nth-child(1) {
  width: 52px;
  text-align: center;
}
#modUsers th:nth-child(2),
#modUsers td:nth-child(2) {
  width: 108px;
}
#modUsers th:nth-child(3),
#modUsers td:nth-child(3) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
  padding-left: 8px;
  padding-right: 8px;
}
#modUsers th:nth-child(4),
#modUsers td:nth-child(4) {
  width: 72px;
  min-width: 72px;
  text-align: center;
  overflow: visible;
  text-overflow: clip;
}
#modUsers th:nth-child(5),
#modUsers td:nth-child(5) {
  width: 76px;
  min-width: 76px;
  text-align: center;
  overflow: visible;
  text-overflow: clip;
}
#modUsers th:nth-child(6),
#modUsers td:nth-child(6) {
  width: 64px;
  min-width: 64px;
}
#modUsers th:nth-child(7),
#modUsers td:nth-child(7) {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}
#modUsers td.openid-cell {
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: clip;
  padding-top: 0;
  padding-bottom: 0;
}
#modUsers td.openid-cell .openid-text {
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: #555;
  line-height: 54px;
  white-space: nowrap;
  cursor: pointer;
}
#modUsers td.openid-cell:hover .openid-text {
  color: var(--fa-primary);
}
#modUsers th:nth-child(8),
#modUsers td:nth-child(8) {
  width: 152px;
  min-width: 152px;
}
#modUsers th:nth-child(9),
#modUsers td:nth-child(9) {
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  padding-right: 8px;
  overflow: visible;
  text-overflow: clip;
}
#modUsers td:nth-child(9) .ops button.btn-mini:last-child {
  margin-right: 0;
}
#modUsers .status-tag {
  min-width: 40px;
  text-align: center;
  box-sizing: border-box;
  border: none;
  border-radius: 2px;
  padding: 3px 10px;
  font-weight: 500;
  line-height: 1.4;
}

.ops { white-space: nowrap; }
.ops button.btn-mini,
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  margin-right: 4px;
  margin-bottom: 4px;
  background: #fff;
  color: #444;
  border: 1px solid #d2d6de;
  cursor: pointer;
  vertical-align: middle;
}
.ops button.btn-mini:hover,
.btn-mini:hover { background: #f4f4f4; }
.btn-mini-danger {
  background: #fff;
  color: var(--fa-danger);
  border-color: #f5c6cb;
}
.btn-mini-danger:hover { background: #fdf2f2; }

/* ===== Tags ===== */
.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  border: none;
  color: #666;
  background: #e5e7eb;
}
.status-tag-danger {
  color: #dc2626;
  background: #fee2e2;
}
.status-tag-active {
  color: #16a34a;
  background: #dcfce7;
}
.status-tag-real {
  color: #2563eb;
  background: #dbeafe;
}
.status-tag-virtual {
  color: #6b7280;
  background: #e5e7eb;
}

/* ===== Dropdown ===== */
.room-more {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.room-more summary.btn-mini {
  list-style: none;
  -webkit-appearance: none;
  appearance: none;
}
.room-more summary.btn-mini::-webkit-details-marker { display: none; }
.room-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
  min-width: 148px;
  padding: 4px 0;
}
.room-more-panel.room-more-panel-fixed {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 5000;
}
.room-more-panel.room-more-panel-open {
  display: block;
}
.room-more[open] summary.btn-mini,
.member-more[open] summary.btn-mini {
  position: relative;
  z-index: 1;
}
.room-more-item {
  display: block;
  width: 100%;
  height: 34px;
  padding: 0 14px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #444;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.room-more-item:hover { background: #f5f5f5; }
.room-more-item-danger { color: var(--fa-danger); }
.room-more-item-danger:hover { background: #fdf2f2; }

/* ===== Pagination ===== */
.pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.pager-meta { font-size: 12px; }
.pager-actions { display: flex; gap: 6px; }
.muted { font-size: 12px; color: var(--fa-muted); }

/* ===== Panel block / collapse ===== */
.panel-block {
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #fafafa;
}
.panel-block > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  list-style: none;
  margin-bottom: 0;
}
.panel-block > summary::-webkit-details-marker { display: none; }
.panel-block[open] > summary { margin-bottom: 10px; }

/* ===== Messages ===== */
.msg {
  margin: 0 0 12px;
  font-size: 13px;
  color: #dc2626;
  min-height: 20px;
  background: #fee2e2;
  border: none;
  border-radius: 2px;
  padding: 10px 12px;
}
.msg:empty { display: none; }
.msg.msg-ok {
  color: #16a34a;
  background: #dcfce7;
}

.admin-toast {
  position: fixed;
  top: 62px;
  left: 50%;
  z-index: 950;
  margin: 0;
  min-width: 160px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #dc2626;
  background: #fee2e2;
  border: none;
  border-radius: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.admin-toast:empty {
  display: none;
}
.admin-toast.admin-toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.admin-toast.msg-ok {
  color: #16a34a;
  background: #dcfce7;
}

/* ===== Modal ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  padding: 0;
  box-shadow: 0 5px 20px rgba(0,0,0,.2);
  overflow: hidden;
}
.modal-body {
  padding: 16px;
  overflow: hidden;
}
.modal-body .form-field {
  margin-bottom: 12px;
}
.modal-body .form-field:last-child {
  margin-bottom: 0;
}
.modal-body .form-control,
.modal-body input,
.modal-body select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  flex: none;
}
.modal-body input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.modal-body input[type="number"]::-webkit-outer-spin-button,
.modal-body input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.modal-title {
  margin: 0;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #444;
  background: #f7f7f7;
  border-bottom: 1px solid #f4f4f4;
}
.modal > .row,
.modal > .field-row,
.modal > .member-add-bar,
.modal > .member-add-hint,
.modal > .table-wrap,
.modal > .muted.member-modal-subtitle {
  margin-left: 16px;
  margin-right: 16px;
  width: calc(100% - 32px);
  max-width: calc(100% - 32px);
  box-sizing: border-box;
}
.modal > .row:first-of-type,
.modal > .muted.member-modal-subtitle:first-of-type { margin-top: 16px; }
.modal > .table-wrap { margin-top: 12px; margin-bottom: 0; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
  padding: 12px 16px;
  border-top: 1px solid #f4f4f4;
  background: #fafafa;
}
.modal.modal-wide { max-width: 720px; }
.modal-confirm { max-width: 420px; }
.confirm-body {
  margin: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}
.modal .row.field-row {
  display: block;
  flex: none;
  width: auto;
}
.modal .row.field-row input,
.modal .row.field-row select {
  width: 100%;
  flex: none;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.modal .row:not(.field-row) input,
.modal .row:not(.field-row) select {
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#memberModal .modal,
#roomLogsModal .modal {
  max-width: min(920px, calc(100vw - 32px));
}
#memberModal .table-wrap,
#roomLogsModal .table-wrap {
  max-height: min(52vh, 480px);
}
.member-modal-subtitle { margin-bottom: 10px; }
.member-add-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f9f9f9;
  border: 1px solid #f4f4f4;
  border-radius: 3px;
}
.member-add-bar input {
  flex: 1 1 140px;
  min-width: 120px;
  height: 34px;
  margin: 0;
}
.member-add-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}
.member-add-bar button { height: 34px; flex-shrink: 0; }
.member-add-hint { width: 100%; margin: 0; font-size: 12px; }
.field-row { flex: 1 1 100%; min-width: 0; margin-bottom: 0; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 6px;
}
.field-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.45; }
.field-row input[type="number"] { min-width: 0; }

.nav-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 10px;
  background: var(--fa-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
.col-members { white-space: nowrap; }
.log-content {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.notice-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--fa-border);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}
#modUsers th:last-child,
#modUsers td:last-child,
#modRooms th:last-child,
#modRooms td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
}

#modUsers th:last-child,
#modRooms th:last-child {
  background: #f9f9f9;
  z-index: 3;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.06);
}

#modRooms tbody tr.row-more-open {
  position: relative;
  z-index: 40;
}

#modRooms tbody tr.row-more-open td:last-child,
#modUsers tbody tr.row-more-open td:last-child {
  z-index: 41;
  overflow: visible;
}

#modUsers tbody tr:nth-child(even) td:last-child,
#modRooms tbody tr:nth-child(even) td:last-child {
  background: #fafafa;
}

#modUsers tbody tr:hover td:last-child,
#modRooms tbody tr:hover td:last-child {
  background: #f5f9fc;
}

.modal-mask:not(.hidden) {
  display: flex !important;
}

.modal-mask.hidden {
  display: none;
}

.module > .overview-hint,
.module > .stats-page-body,
.module > .toolbar,
.module > .panel-block,
.module > .pager-bar,
.module > .table-wrap,
.module > .notice-form {
  margin-left: 15px;
  margin-right: 15px;
}
.module > .toolbar {
  margin-top: 12px;
}
.module > .pager-bar {
  margin-bottom: 10px;
}

.module > *:last-child {
  margin-bottom: 15px;
}

.main-header .btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.main-header .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.main-header .btn-danger {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.main-header .btn-danger:hover {
  background: rgba(221, 75, 57, 0.85);
  color: #fff;
  border-color: #c23321;
}

.notice-form label.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  cursor: pointer;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats.stats-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .main-sidebar {
    transform: translateX(-100%);
    width: 230px;
  }
  .wrapper.sidebar-open .main-sidebar { transform: translateX(0); }
  .content-wrapper { margin-left: 0 !important; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .navbar-custom-menu .header-user { display: none; }
  .header-breadcrumb { font-size: 12px; }
  .toolbar-filters input,
  .toolbar-filters select { min-width: 100%; flex: 1 1 100%; }
  table { min-width: 680px; }
  .login-actions-row { flex-direction: column; }
}
