:root {
  --hamster-primary: #f7a440;
  --hamster-secondary: #5c4a32;
  --hamster-bg: #131320;
  --hamster-card-bg: #1c1c32;
  --hamster-border: #2a2a4a;
  --hamster-text: #d8d8e8;
  --hamster-muted: #7a7a9a;
}

body {
  background-color: var(--hamster-bg);
  color: var(--hamster-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.sidebar {
  background: linear-gradient(180deg, #2a1f10 0%, #1a1210 100%);
  min-height: 100vh;
  color: #fff;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.25rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar .nav-link.active {
  background: rgba(247, 164, 64, 0.15);
  color: var(--hamster-primary);
  border-left-color: var(--hamster-primary);
  font-weight: 600;
}

.sidebar .nav-link.active i {
  color: var(--hamster-primary);
}

.sidebar .nav-link i {
  width: 1.5rem;
}

.sidebar .nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  padding: 0 0.75rem;
  margin-bottom: 0.3rem;
}

.guild-card {
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: 2px solid var(--hamster-border);
  border-radius: 12px;
}

.guild-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.guild-card.offline {
  opacity: 0.5;
  border-style: dashed;
}

.guild-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--hamster-border);
}

.badge-bot {
  background: var(--hamster-primary);
  color: #fff;
  font-size: 0.7rem;
}

.settings-card {
  background: var(--hamster-card-bg);
  border: 1px solid var(--hamster-border);
  border-radius: 12px;
}

.settings-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--hamster-border);
  font-weight: 600;
}

.form-label {
  font-weight: 500;
  color: var(--hamster-text);
}

.btn-hamster {
  background: var(--hamster-primary);
  border: none;
  color: #fff;
}

.btn-hamster:hover {
  background: #e08f30;
  color: #fff;
}

.btn-outline-hamster {
  border: 1px solid var(--hamster-primary);
  color: var(--hamster-primary);
}

.btn-outline-hamster:hover {
  background: var(--hamster-primary);
  color: #fff;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: #28a745;
}

.status-dot.offline {
  background: #dc3545;
}

.flash-message {
  animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* Matrix permission table */
.matrix-wrapper {
  overflow-x: auto;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  border: none;
}

.matrix-table th.matrix-corner {
  vertical-align: middle;
  padding: 0.4rem 0.5rem;
  white-space: nowrap;
  font-weight: 600;
  color: var(--hamster-muted);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--hamster-border);
}

.matrix-table th.role-header {
  vertical-align: middle;
  text-align: center;
  padding: 0.35rem 0.2rem;
  background: var(--hamster-card-bg);
  border-bottom: 1px solid var(--hamster-border);
  min-width: 80px;
  max-width: 100px;
  position: relative;
  font-size: 0.72rem;
  font-weight: 500;
}

.matrix-table th.role-header .role-header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: 90px;
  margin: 0 auto;
}

.matrix-table td.cell {
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
  padding: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  border: 1px solid rgba(42, 42, 74, 0.3);
  transition: background 0.1s;
}

.matrix-table td.cell-none {
  background: transparent;
}

.matrix-table td.cell-allow {
  background: rgba(25, 135, 84, 0.06);
}

.matrix-table td.cell-deny {
  background: rgba(220, 53, 69, 0.06);
}

.matrix-table td.cell i {
  font-size: 0.75rem;
  line-height: 1;
}

.matrix-table td.cell .bi-check-lg {
  color: #28a745;
}

.matrix-table td.cell .bi-x-lg {
  color: #dc3545;
}

.matrix-table td.cell:hover {
  outline: 1px solid var(--hamster-primary);
  outline-offset: -1px;
}

.matrix-table .plugin-group th {
  background: var(--hamster-card-bg);
  border-bottom: 1px solid var(--hamster-border);
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-weight: 700;
  text-transform: capitalize;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.matrix-table .plugin-group:hover th {
  background: rgba(247, 164, 64, 0.08);
}

.matrix-table .role-color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.matrix-table .command-cell {
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(42, 42, 74, 0.2);
}

.matrix-table .command-cell code {
  font-size: 0.75rem;
}

.matrix-table .role-bulk-actions,
.matrix-table .row-bulk-actions {
  opacity: 0.2;
  transition: opacity 0.12s;
}

.matrix-table .role-header:hover .role-bulk-actions,
.matrix-table .command-cell:hover .row-bulk-actions {
  opacity: 1;
}

.matrix-table .role-bulk-actions .btn-link,
.matrix-table .row-bulk-actions .btn-link {
  text-decoration: none;
  font-size: 0.5rem;
  line-height: 1;
  padding: 0 1px;
}

.matrix-table .role-bulk-actions .btn-link i,
.matrix-table .row-bulk-actions .btn-link i {
  font-size: 0.6rem;
}

.role-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1.2;
}
