@import './css/tokens.css';
@import './css/layout.css';
@import './css/components.css';
@import './css/tabs/dashboard.css';
@import './css/tabs/moderation.css';
@import './css/tabs/tickets.css';
@import './css/tabs/reports.css';
@import './css/tabs/content.css';

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-green: #059669;
  --accent-yellow: #d97706;
  --accent-red: #dc2626;
  --accent-blue: #2563eb;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* Global layout */
[data-theme="light"] body,
[data-theme="light"] .layout-wrapper,
[data-theme="light"] .main-content {
  background: #f1f5f9;
  color: #0f172a;
}

/* Main surfaces / cards */
[data-theme="light"] .section,
[data-theme="light"] .stat-card,
[data-theme="light"] .server-card,
[data-theme="light"] .chart-card,
[data-theme="light"] .response-card,
[data-theme="light"] .log-entry,
[data-theme="light"] .todo-card,
[data-theme="light"] .export-card,
[data-theme="light"] .structure-template-card,
[data-theme="light"] .empty-state,
[data-theme="light"] .actions-bar {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: var(--shadow-sm);
}

/* Sidebar */
[data-theme="light"] .sidebar { background: #ffffff; box-shadow: 2px 0 10px rgba(0,0,0,0.04); }
[data-theme="light"] .sidebar-nav .tab.active { background: #e0e7ff; color: var(--accent); }
[data-theme="light"] .sidebar-nav .tab:hover:not(.active) { background: #f1f5f9; }
[data-theme="light"] .user-profile { background: #f8fafc; border-color: #e2e8f0; }
[data-theme="light"] .user-name { color: #1e293b; }
[data-theme="light"] .user-role { color: #64748b; }

/* Section titles */
[data-theme="light"] .section-title { color: #0f172a; }

/* Bot profile */
[data-theme="light"] .bot-id { background: #f1f5f9; color: #64748b; }
[data-theme="light"] .bot-avatar { box-shadow: 0 0 10px rgba(79, 70, 229, 0.15); }

/* Log entries */
[data-theme="light"] .log-entry:hover { border-color: var(--accent); }
[data-theme="light"] .log-time { background: #f1f5f9; color: #64748b; }
[data-theme="light"] .log-message { background: #f8fafc; border-left-color: #e2e8f0; }
[data-theme="light"] .log-response { background: rgba(5, 150, 105, 0.05); }

/* Tags */
[data-theme="light"] .tag { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
[data-theme="light"] .tag.tag-keyword { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
[data-theme="light"] .tag.tag-reply { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
[data-theme="light"] .tag.tag-matchall { background: #fffbeb; border-color: #fde68a; color: #b45309; }
[data-theme="light"] .tag.tag-exact { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
[data-theme="light"] .tag.tag-stop { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
[data-theme="light"] .tag.tag-cooldown { background: #faf5ff; border-color: #e9d5ff; color: #7c3aed; }
[data-theme="light"] .tag.tag-minlen { background: #f0fdfa; border-color: #99f6e4; color: #0d9488; }
[data-theme="light"] .tag.tag-channel { background: #f0f9ff; border-color: #bae6fd; color: #0284c7; }
[data-theme="light"] .tag.tag-exclude { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
[data-theme="light"] .channel-tag { background: #f1f5f9; color: #475569; }

/* Patchnotes */
[data-theme="light"] .patchnote-section { background: #f8fafc; }
[data-theme="light"] .pn-added { background: rgba(5, 150, 105, 0.1); color: #047857; }
[data-theme="light"] .pn-fixed { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }
[data-theme="light"] .pn-removed { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
[data-theme="light"] .pn-add { color: #047857; }
[data-theme="light"] .pn-fix { color: #1d4ed8; }
[data-theme="light"] .pn-rem { color: #dc2626; }

/* Audit badges */
[data-theme="light"] .audit-green { background: #ecfdf5; color: #047857; }
[data-theme="light"] .audit-red { background: #fef2f2; color: #dc2626; }
[data-theme="light"] .audit-yellow { background: #fffbeb; color: #b45309; }
[data-theme="light"] .audit-blue { background: #eff6ff; color: #1d4ed8; }
[data-theme="light"] .audit-purple { background: #faf5ff; color: #7c3aed; }
[data-theme="light"] .audit-default { background: #f1f5f9; color: #475569; }

/* Tickets */
[data-theme="light"] .ticket-history-meta { background: #f8fafc; }
[data-theme="light"] .ticket-chat-msg { background: #f8fafc; }
[data-theme="light"] .ticket-chat-msg.bot { background: rgba(5, 150, 105, 0.04); }
[data-theme="light"] .ticket-chat-author { color: #2563eb; }
[data-theme="light"] .ticket-chat-msg.bot .ticket-chat-author { color: #059669; }

/* Reports & Appeals */
[data-theme="light"] .btn-report-resolve { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
[data-theme="light"] .btn-report-resolve:hover { background: #d1fae5; }
[data-theme="light"] .btn-report-reject { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
[data-theme="light"] .btn-report-reject:hover { background: #fee2e2; }
[data-theme="light"] .report-review-panel { background: #f8fafc; }

/* Reputation */
[data-theme="light"] .rep-top .log-time { color: #b45309; background: #fffbeb; }

/* Automod */
[data-theme="light"] .automod-block { background: #f8fafc; }
[data-theme="light"] .automod-header { background: #f1f5f9; }

/* Kanban / To-Do */
[data-theme="light"] .kanban-column { background: #f8fafc; }
[data-theme="light"] .kanban-header { background: #f1f5f9; }
[data-theme="light"] .kanban-cards.drag-over { background: rgba(79, 70, 229, 0.05); }
[data-theme="light"] .todo-card-meta { border-top-color: #e2e8f0; }
[data-theme="light"] .priority-high { background: #fef2f2; color: #dc2626; }
[data-theme="light"] .priority-medium { background: #fffbeb; color: #b45309; }
[data-theme="light"] .priority-low { background: #ecfdf5; color: #059669; }
[data-theme="light"] .btn-icon-kb { background: #e2e8f0; color: #475569; }
[data-theme="light"] .btn-icon-kb:hover { background: #fecaca; color: #dc2626; }
[data-theme="light"] .todo-card.dragging { box-shadow: 0 10px 25px rgba(0,0,0,0.15); }

/* Forms & Inputs */
[data-theme="light"] .checkbox-group label { background: #f8fafc; }
[data-theme="light"] .range-group { background: #f8fafc; }
[data-theme="light"] .range-group span { color: var(--accent); }

/* Buttons */
[data-theme="light"] .status-btn:hover { background: #f1f5f9; }
[data-theme="light"] .btn-secondary:hover { background: #f1f5f9; border-color: #94a3b8; }
[data-theme="light"] .btn-icon:hover { background: #f1f5f9; }
[data-theme="light"] .btn-icon-sm:hover { background: #f1f5f9; }
[data-theme="light"] .card-actions button:hover { background: #f1f5f9; }

/* Structure */
[data-theme="light"] .structure-item { background: #f8fafc; }
[data-theme="light"] .structure-item:hover { background: #f1f5f9; }
[data-theme="light"] .role-color-dot { border-color: #e2e8f0; }
[data-theme="light"] .badge-managed { background: #eef2ff; color: #4338ca; }
[data-theme="light"] .badge-hoist { background: #fffbeb; color: #b45309; }
[data-theme="light"] .badge-mention { background: #eff6ff; color: #1d4ed8; }
[data-theme="light"] .badge-type { background: #f1f5f9; color: #64748b; }

/* Toast */
[data-theme="light"] .toast { color: #0f172a; box-shadow: var(--shadow-md); }

/* Danger zone */
[data-theme="light"] .structure-danger-zone { background: #fef2f2; border-color: #fecaca; }

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.12); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.25); }

/* Skeleton */
[data-theme="light"] .skeleton-box { background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 50%, #f8fafc 75%); background-size: 200% 100%; }

/* Login */
[data-theme="light"] .login-box:hover { box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); }

/* Count badge */
[data-theme="light"] .count-badge { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }

/* Punishment colors */
[data-theme="light"] .punishment-active .log-user { color: var(--accent); }

/* Pagination */
[data-theme="light"] .btn-page { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
[data-theme="light"] .btn-page:hover:not(:disabled) { background: #f1f5f9; color: #0f172a; border-color: var(--accent); }

/* Modal overlay */
[data-theme="light"] .modal-overlay { background: rgba(15, 23, 42, 0.3); }

/* Select option dropdowns */
[data-theme="light"] .punishments-filters select option { background: #ffffff; }
[data-theme="light"] #structure-guild option { background: #ffffff; }

/* Automod hover */
[data-theme="light"] .automod-block:hover { border-color: #cbd5e1; }

/* Structure channel child */
[data-theme="light"] .structure-channel-child { border-left-color: #e2e8f0; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

.hidden { display: none !important; }

/* ===== LOGIN ===== */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(52, 211, 153, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(96, 165, 250, 0.05) 0%, transparent 50%);
}

.login-box {
  background: rgba(22, 24, 29, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
  width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-icon { font-size: 52px; margin-bottom: 20px; display: inline-block; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3)); }
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.login-box h1 { font-size: 26px; margin-bottom: 4px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.login-box p { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }

.login-box input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 17, 23, 0.6);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.login-box button {
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.login-box button:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.login-box button:active { transform: translateY(0); }

.error { color: var(--accent-red); margin-top: 8px; font-size: 12px; font-weight: 500; }

/* ===== LAYOUT ===== */
.layout-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-base);
}

.layout-body {
  display: flex;
  min-height: 0;
  flex: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 230px;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sidebar-header .logo { font-size: 22px; }
.sidebar-header h1 { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
  text-align: left;
  width: 100%;
  position: relative;
}

.tab-icon { font-size: 16px; width: 22px; text-align: center; opacity: 0.7; transition: opacity var(--transition-fast); }
.tab:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.tab:hover .tab-icon { opacity: 1; }

.tab.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent), 0 0 12px rgba(99, 102, 241, 0.08);
}
.tab.active .tab-icon { opacity: 1; color: var(--accent); }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-logout:hover { background: rgba(239,68,68,0.1); }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse at 30% 0%, rgba(99, 102, 241, 0.03) 0%, transparent 50%);
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(15, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  font-size: 20px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(30, 33, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); }
.status-dot.idle { background: var(--warning); }
.status-dot.dnd { background: var(--danger); }
.status-dot.invisible,
.status-dot.offline { background: var(--text-muted); }

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-content {
  display: none;
  animation: fadeIn 0.15s ease-out;
  max-width: 1100px;
  margin: 0 auto;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== BOT PROFILE ===== */
.bot-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.bot-profile:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.bot-profile::before { display: none; }

.bot-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.bot-info h2 { font-size: 20px; margin-bottom: 4px; font-weight: 600; color: var(--text-primary); }
.bot-id { font-size: 11px; color: var(--text-muted); font-family: monospace; background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: 3px; }

.bot-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.online { background: var(--success); }
.status-dot.idle { background: var(--warning); }
.status-dot.dnd { background: var(--danger); }
.status-dot.invisible, .status-dot.offline { background: var(--text-muted); }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(99, 102, 241, 0.3));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.stat-card::after { display: none; }
.stat-card:hover { 
  border-color: rgba(99, 102, 241, 0.3); 
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 26px; margin-bottom: 10px; display: block; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.stat-delta { font-size: 11px; color: var(--text-muted); }

/* ===== SECTIONS ===== */
.section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.section:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
.section-header .section-title { margin-bottom: 0; }

/* ===== STATUS BUTTONS ===== */
.status-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.status-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.status-btn:hover { background: rgba(255,255,255,0.04); }
.status-btn.active-status { font-weight: 600; }
.status-btn.online.active-status { border-color: var(--accent-green); color: var(--accent-green); background: rgba(16,185,129,0.08); }
.status-btn.idle.active-status { border-color: var(--accent-yellow); color: var(--accent-yellow); background: rgba(245,158,11,0.08); }
.status-btn.dnd.active-status { border-color: var(--accent-red); color: var(--accent-red); background: rgba(239,68,68,0.08); }
.status-btn.invisible.active-status { border-color: #9ca3af; color: #9ca3af; background: rgba(156,163,175,0.08); }

/* ===== FORMS ===== */
.activity-form, .send-form, .nickname-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.activity-form select, .send-form select, .nickname-form select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  transition: all 0.2s ease;
  font-family: inherit;
}
.activity-form select:focus, .send-form select:focus, .nickname-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

.activity-form input, .nickname-form input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
.activity-form input:focus, .nickname-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

.send-form { flex-direction: column; align-items: stretch; }
.send-form .row { display: flex; gap: 10px; }
.send-form select { flex: 1; }

.send-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  min-height: 80px;
  transition: all 0.2s ease;
}
.send-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover { 
  background: var(--accent-hover); 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-secondary:hover { background: rgba(255,255,255,0.05); border-color: rgba(255, 255, 255, 0.15); }

/* ===== SERVERS ===== */
.servers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.server-card:hover { 
  border-color: rgba(99, 102, 241, 0.3); 
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.server-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.server-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.server-icon-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.server-name { font-size: 14px; font-weight: 600; }
.server-members { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.server-id { font-size: 10px; color: var(--text-muted); font-family: monospace; margin-top: 2px; }

.server-channels {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.server-channels-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.channel-tag {
  display: inline-block;
  background: rgba(0,0,0,0.2);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  margin: 0 4px 4px 0;
  color: var(--text-secondary);
}
.channel-tag::before { content: '#'; color: var(--accent); margin-right: 2px; }

/* ===== LOG ===== */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 600px;
  overflow-y: auto;
}

.log-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.log-entry:hover { border-color: rgba(99, 102, 241, 0.3); transform: translateX(2px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }

.log-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.log-user { font-weight: 600; color: var(--text-primary); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.log-time { font-size: 11px; color: var(--text-muted); background: rgba(0,0,0,0.1); padding: 2px 8px; border-radius: 4px; }
.log-guild-channel { font-size: 11px; color: var(--text-secondary); }
.log-message { color: var(--text-primary); font-size: 13px; background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: var(--radius-sm); border-left: 3px solid var(--border); }

.log-response {
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(16,185,129,0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-green);
}

.log-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ===== ACTIONS BAR ===== */
.actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.search-box { flex: 1; min-width: 200px; position: relative; }

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

.count-badge {
  background: rgba(99,102,241,0.08);
  color: var(--accent-hover);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(99,102,241,0.15);
}

/* ===== CARDS (RESPONSES, PATCHNOTES, ETC) ===== */
.responses-list { display: flex; flex-direction: column; gap: 8px; }

.response-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.response-card:hover { 
  border-color: rgba(99,102,241,0.4); 
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.response-card.disabled { opacity: 0.5; filter: grayscale(50%); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-number { font-size: 14px; color: var(--text-primary); font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 6px; }

.card-actions button {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-actions button:hover { background: var(--border); color: var(--text-primary); }
.card-actions button.btn-delete:hover { border-color: var(--accent-red); color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }
.card-actions button.btn-toggle.active { border-color: var(--accent-green); color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }

.card-section { margin-bottom: 8px; }
.card-section:last-child { margin-bottom: 0; }

.card-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

/* ===== TAGS ===== */
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tag {
  background: rgba(0,0,0,0.2);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  font-weight: 500;
}

.tag.tag-keyword { border-color: rgba(99,102,241,0.2); color: #a5b4fc; }
.tag.tag-reply { border-color: rgba(59,130,246,0.2); color: #93c5fd; }
.tag.tag-matchall { border-color: rgba(245,158,11,0.2); color: #fcd34d; font-size: 10px; }
.tag.tag-exact { border-color: rgba(16,185,129,0.2); color: #6ee7b7; font-size: 10px; }
.tag.tag-stop { border-color: rgba(239,68,68,0.2); color: #fca5a5; }
.tag.tag-cooldown { border-color: rgba(168,85,247,0.2); color: #d8b4fe; font-size: 10px; }
.tag.tag-minlen { border-color: rgba(20,184,166,0.2); color: #5eead4; font-size: 10px; }
.tag.tag-channel { border-color: rgba(14,165,233,0.2); color: #7dd3fc; font-size: 10px; }
.tag.tag-exclude { border-color: rgba(249,115,22,0.2); color: #fdba74; font-size: 10px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.empty-state .empty-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.5; }
.empty-state h3 { font-size: 15px; margin-bottom: 4px; color: var(--text-primary); font-weight: 600; }
.empty-state p { font-size: 12px; }

/* ===== SETTINGS GRID ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.setting-item label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.setting-item input[type="text"], .setting-item input[type="number"] {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: all 0.2s ease;
}
.setting-item input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

.range-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.range-group input[type="range"] { flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer; }
.range-group span { font-weight: 700; font-size: 14px; min-width: 40px; color: var(--accent-hover); text-align: right; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: auto;
  animation: overlayIn 0.15s ease-out;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.modal-open {
  overflow: hidden;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: modalIn 0.2s ease-out;
}
.modal.modal-wide { width: 620px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-header h2 { font-size: 16px; font-weight: 700; }

.modal-body { padding: 20px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
.form-group .hint { font-weight: 400; color: var(--text-muted); font-size: 11px; margin-left: 4px; }

.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-textarea { resize: vertical; min-height: 60px; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12); }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-half { flex: 1; min-width: 140px; }

.form-group input[type="number"] {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}
.form-group input[type="number"]:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  background: rgba(0,0,0,0.15);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.12s;
}
.checkbox-group label:hover { border-color: var(--text-muted); }
.checkbox-group input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid var(--accent-green);
  z-index: 2000;
  animation: slideLeft 0.2s ease-out;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}
.toast.toast-error { border-left-color: var(--accent-red); }

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== PUNISHMENTS ===== */
.punishments-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.punishments-filters select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.punishments-filters select:focus { border-color: var(--accent); }
.punishments-filters select option { background: var(--bg-secondary); color: var(--text-primary); }

.punishment-inactive { opacity: 0.5; }
.punishment-active .log-user { color: var(--accent-hover); }

/* ===== TICKETS ===== */
.ticket-clickable { cursor: pointer; transition: border-color 0.12s; }
.ticket-clickable:hover { border-color: var(--accent); }

.ticket-history-modal { width: 640px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; }

.ticket-history-meta {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

.ticket-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
}

.ticket-history-list {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
}

.ticket-chat-msg {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  border-left: 3px solid var(--accent-blue);
}
.ticket-chat-msg.bot {
  border-left-color: var(--accent-green);
  background: rgba(16,185,129,0.03);
}

.ticket-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}
.ticket-chat-author { font-size: 13px; font-weight: 600; color: #93c5fd; display: flex; align-items: center; gap: 4px; }
.ticket-chat-msg.bot .ticket-chat-author { color: #6ee7b7; }
.ticket-chat-time { font-size: 10px; color: var(--text-muted); font-family: monospace; }
.ticket-chat-content { font-size: 13px; color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* ===== PATCHNOTES ===== */
.patchnote-section {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.12);
  border-radius: var(--radius-sm);
}

.patchnote-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}
.pn-added { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.pn-fixed { background: rgba(59,130,246,0.12); color: #93c5fd; }
.pn-removed { background: rgba(239,68,68,0.12); color: #fca5a5; }

.pn-item { font-size: 12px; padding: 2px 0; color: var(--text-primary); line-height: 1.4; }
.pn-add { color: #6ee7b7; }
.pn-fix { color: #93c5fd; }
.pn-rem { color: #fca5a5; }

/* ===== REPUTATION ===== */
.rep-top { border-left: 2px solid var(--accent-yellow); }
.rep-top .log-time { font-size: 14px; font-weight: 700; color: var(--accent-yellow); background: rgba(245,158,11,0.08); padding: 2px 8px; }

/* ===== AUDIT ===== */
.audit-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
.audit-green { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.audit-red { background: rgba(239,68,68,0.12); color: #fca5a5; }
.audit-yellow { background: rgba(245,158,11,0.12); color: #fcd34d; }
.audit-blue { background: rgba(59,130,246,0.12); color: #93c5fd; }
.audit-purple { background: rgba(139,92,246,0.12); color: #c4b5fd; }
.audit-default { background: rgba(107,114,128,0.12); color: #d1d5db; }

/* ===== REPORTS / APPEALS ===== */
.report-open { border-left: 2px solid var(--accent-yellow); }
.report-resolved { border-left: 2px solid var(--accent-green); opacity: 0.6; }
.report-rejected { border-left: 2px solid var(--accent-red); opacity: 0.5; }
.report-closed { border-left: 2px solid #64748b; opacity: 0.6; }

.report-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.btn-report-resolve, .btn-report-reject {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-report-resolve { background: rgba(16,185,129,0.08); color: #6ee7b7; border-color: rgba(16,185,129,0.2); }
.btn-report-resolve:hover { background: rgba(16,185,129,0.15); }
.btn-report-reject { background: rgba(239,68,68,0.08); color: #fca5a5; border-color: rgba(239,68,68,0.2); }
.btn-report-reject:hover { background: rgba(239,68,68,0.15); }

.report-review-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-review-panel textarea,
.report-review-panel input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.report-review-panel textarea { min-height: 60px; resize: vertical; }
.report-review-panel textarea:focus, .report-review-panel input:focus { border-color: var(--accent); }

/* ===== AUTOMOD ===== */
.automod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.automod-block {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.automod-block:hover { border-color: rgba(255,255,255,0.1); }

.automod-header {
  padding: 8px 12px;
  background: rgba(0,0,0,0.1);
  border-bottom: 1px solid var(--border);
}

.automod-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.automod-toggle input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

.automod-settings { padding: 8px 12px; }

.automod-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.automod-row:last-child { margin-bottom: 0; }
.automod-row label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.automod-row input[type="number"] {
  width: 60px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  text-align: center;
}
.automod-row input[type="number"]:focus { border-color: var(--accent); }

/* ===== REPORT HISTORY ===== */
.report-history-modal { width: 640px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column; }
.report-history-actions { padding: 10px 18px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.report-review-input { width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-input); color: var(--text-primary); font-family: inherit; outline: none; }
.report-review-input:focus { border-color: var(--accent); }

/* ===== STRUCTURE MANAGER ===== */
.structure-guild-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.structure-guild-bar label { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.structure-guild-bar select {
  flex: 1;
  max-width: 350px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.structure-guild-bar select:focus { border-color: var(--accent); }

#structure-guild option { background: var(--bg-secondary); color: var(--text-primary); }

.structure-list { display: flex; flex-direction: column; gap: 1px; }
.structure-empty { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }

.structure-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.1);
  transition: background 0.1s;
}
.structure-item:hover { background: rgba(0,0,0,0.2); }

.structure-item-left { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.structure-item-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.structure-item-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.role-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); }
.channel-type-icon { font-size: 13px; flex-shrink: 0; width: 18px; text-align: center; }

.structure-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.badge-managed { background: rgba(99,102,241,0.12); color: var(--accent-hover); }
.badge-hoist { background: rgba(245,158,11,0.12); color: var(--accent-yellow); }
.badge-mention { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.badge-type { background: rgba(156,163,175,0.08); color: var(--text-muted); font-size: 9px; }

.structure-members { font-size: 11px; color: var(--text-muted); white-space: nowrap; margin-right: 2px; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.06); }

.btn-icon-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.1s;
  opacity: 0.5;
}
.btn-icon-sm:hover { opacity: 1; background: rgba(255,255,255,0.06); }
.btn-danger-icon:hover { background: rgba(239,68,68,0.12); }

.structure-category-group { margin-top: 2px; }
.structure-channel-child { margin-left: 20px; border-left: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Role modal color picker */
.role-color-picker { display: flex; align-items: center; gap: 8px; }
.role-color-picker input[type="color"] {
  width: 36px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  padding: 1px;
}
.role-color-picker input[type="color"]::-webkit-color-swatch-wrapper { padding: 1px; }
.role-color-picker input[type="color"]::-webkit-color-swatch { border-radius: 3px; border: none; }
.color-hex-label { font-size: 12px; color: var(--text-secondary); font-family: monospace; font-weight: 600; }

.checkbox-inline {
  display: flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.checkbox-inline input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

/* ===== TEMPLATES ===== */
.structure-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.structure-template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.structure-template-card:hover { 
  border-color: var(--accent); 
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.template-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.template-card-header h4 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.template-stats { display: flex; gap: 8px; font-size: 12px; color: var(--text-muted); }
.template-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }

.template-preview-section { margin-bottom: 12px; }
.template-preview-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.template-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.template-role-chip { font-size: 11px; padding: 2px 8px; border-radius: 4px; border: 1px solid; font-weight: 500; }
.template-channel-chip { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,0.06); color: var(--text-secondary); }

.template-apply-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px !important;
  background: var(--accent-green) !important;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.template-apply-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ===== DANGER ZONE ===== */
.structure-danger-zone {
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  background: rgba(239,68,68,0.05);
  padding: 16px;
}

.structure-danger-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}
.structure-danger-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.btn-danger {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.1);
  color: var(--accent-red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); border-color: var(--accent-red); transform: translateY(-1px); }

/* ===== EXPORT ===== */
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.export-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.export-card:hover { 
  border-color: rgba(99, 102, 241, 0.3); 
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.export-card-icon { font-size: 32px; margin-bottom: 8px; }
.export-card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; color: var(--text-primary); }
.export-card-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.export-card-buttons { display: flex; gap: 8px; justify-content: center; }

.btn-export {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-export-csv { background: rgba(16,185,129,0.08); color: var(--accent-green); border-color: rgba(16,185,129,0.2); }
.btn-export-csv:hover { background: var(--accent-green); color: #fff; }
.btn-export-json { background: rgba(59,130,246,0.08); color: #3B82F6; border-color: rgba(59,130,246,0.2); }
.btn-export-json:hover { background: #3B82F6; color: #fff; }

/* ===== COMMAND PERMISSIONS ===== */
.cmd-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.cmd-perm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s;
}
.cmd-perm-item:hover { border-color: var(--accent); }

.cmd-perm-item label { font-size: 12px; color: var(--text-primary); white-space: nowrap; flex-shrink: 0; }
.cmd-perm-item label code { color: var(--text-muted); font-size: 10px; margin-left: 3px; }

.cmd-perm-item select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 11px;
  cursor: pointer;
  min-width: 120px;
}
.cmd-perm-item select:focus { outline: none; border-color: var(--accent); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .layout-wrapper { flex-direction: column; }
  .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-header { padding: 10px; justify-content: center; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 6px 8px; gap: 4px; }
  .tab { width: auto; white-space: nowrap; padding: 5px 10px; border-radius: var(--radius-sm); }
  .tab.active { border-left: none; border-bottom: 2px solid var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .sidebar-footer { padding: 8px 10px; display: flex; justify-content: center; }
  .btn-logout { width: auto; padding: 5px 10px; }
  .main-content { padding: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .login-box { width: 90vw; padding: 24px; }
  .activity-form, .nickname-form { flex-direction: column; align-items: stretch; }
  .activity-form input, .nickname-form input, .activity-form select, .nickname-form select { width: 100%; min-width: unset; }
  .modal-header, .modal-body, .modal-footer { padding: 12px; }
  .automod-grid { grid-template-columns: 1fr; }
  .structure-guild-bar { flex-wrap: wrap; }
  .structure-guild-bar select { max-width: 100%; }
  .structure-templates-grid { grid-template-columns: 1fr; }
  .structure-channel-child { margin-left: 12px; }
  .structure-danger-bar { flex-direction: column; text-align: center; }
  .export-grid { grid-template-columns: repeat(2, 1fr); }
  .cmd-perms-grid { grid-template-columns: 1fr; }
  .cmd-perm-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .cmd-perm-item select { width: 100%; }
}

@media (max-width: 480px) {
  .export-grid { grid-template-columns: 1fr; }
}


/* ===== CHARTS GRID (DASHBOARD) ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  max-height: 350px;
  min-height: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.chart-card:hover {
  box-shadow: var(--shadow-md);
}

.chart-card canvas {
  max-height: 280px !important;
  width: 100% !important;
  height: auto !important;
}

.chart-header {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-container {
  position: relative;
  flex: 1;
  min-height: 250px;
  width: 100%;
}

.pie-container {
  min-height: 250px;
  display: flex;
  justify-content: center;
}

@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-container { min-height: 200px; }
}

/* ===== KANBAN BOARD (TO-DO) ===== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px); /* Fill screen height minus header */
  min-height: 400px;
}

.kanban-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.kanban-header .kb-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.kanban-cards {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.2s;
}

.kanban-cards.drag-over {
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
}

.todo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.todo-card:hover { 
  border-color: var(--accent); 
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.todo-card:active { cursor: grabbing; opacity: 0.9; transform: scale(0.98); }

.todo-card.dragging {
  opacity: 0.5;
  border: 1px dashed var(--accent);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  transform: scale(1.05);
}

.todo-card-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.todo-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 8px;
  margin-top: 4px;
}

.todo-priority-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.priority-high { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.priority-medium { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.priority-low { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

.todo-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.todo-card:hover .todo-card-actions { opacity: 1; }

.btn-icon-kb {
  background: rgba(0,0,0,0.4);
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.btn-icon-kb:hover { background: rgba(239, 68, 68, 0.8); color: #fff; }

@media (max-width: 900px) {
  .kanban-board {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .kanban-column {
    height: 400px;
  }
  .todo-card-actions { opacity: 1; }
}

/* ========== PAGINATION ========== */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  margin-top: 8px;
}

.btn-page {
  background: var(--bg-tertiary, #161b22);
  color: var(--text-secondary, #8b949e);
  border: 1px solid var(--border-primary, #30363d);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-page:hover:not(:disabled) {
  background: var(--bg-secondary, #21262d);
  color: var(--text-primary, #c9d1d9);
  border-color: var(--accent-blue, #3b82f6);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-secondary, #8b949e);
  font-size: 13px;
  min-width: 100px;
  text-align: center;
}

/* ========== Discord OAuth2 Login ========== */
.btn-discord-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.35);
}

.btn-discord-login:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.45);
}

.btn-discord-login:active {
  transform: translateY(0);
  background: #3C45A5;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.btn-discord-login svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}


/* ========== Профиль пользователя в сайдбаре ========== */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 4px 6px 8px;
  background: rgba(30, 33, 40, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}
.user-profile:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(30, 33, 40, 0.7);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== SKELETON LOADING ===== */
.skeleton-box {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}
.skeleton-line {
  height: 14px;
  background: var(--border);
  border-radius: 4px;
  opacity: 0.5;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== MOBILE RESPONSIVE ===== */
.header-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.btn-menu {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 95;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s;
}
.mobile-overlay.active { display: block; opacity: 1; }

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.06); }

@media (max-width: 768px) {
  .layout-wrapper { flex-direction: column; }
  .header-mobile { display: flex; }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    width: 260px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 4px 0 10px rgba(0,0,0,0.2);
  }
  .sidebar.open { left: 0; }
  .main-content { padding: 12px; }
  .stats-grid, .charts-grid, .settings-grid { grid-template-columns: 1fr; }
  .kanban-board { flex-direction: column; height: auto; gap: 16px; }
  .kanban-col { min-height: 200px; max-height: none; }
  .modal-wide { max-width: 95%; }
  .form-row { flex-direction: column; }
  .chart-card { max-height: 300px; }
}
