body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: #0f172a;
    color: white;
}

a {
    text-decoration: none;
    color: inherit;
}

a:visited {
    color: inherit;
}

.layout {
    display: flex;
}

.sidebar {
    width: 220px;
    background: #020617;
    padding: 20px;
    height: 100vh;
    font-size: 14px;
}

.sidebar a {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #94a3b8;
    transition: 0.2s;
}

.sidebar a:hover {
    color: #ef4444;
}

.content {
    flex: 1;
    padding: 36px;
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 20px;
    font-weight: 300;
}

/* GRID */
.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* CARD */
.guild-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 20px;
    transition: 0.2s;
}

.guild-card:hover {
    transform: translateY(-4px);
    background: #334155;
}

/* HEADER */
.guild-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.guild-name {
    font-weight: bold;
}

/* ICON */
.guild-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.guild-icon.fallback {
    background: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* BUTTON */
.btn {
    background: #6366f1;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    display: inline-block;
}

.btn:hover {
    background: #4f46e5;
}

.config {
    background: #1e293b;
    padding: 15px;
    margin-top: 10px;
    border-radius: 10px;
}

.empty {
    padding: 20px;
    background: #1e293b;
    border-radius: 10px;
    text-align: center;
}

/* Sections */
.section-title {
    margin-top: 24px;
    margin-bottom: 14px;
    font-size: 22px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.section-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
    margin-bottom: 30px;
}

.config-block {
    margin-bottom: 24px;
}

/* Badge */
.badge {
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.badge.installed {
    color: #22c55e;
}

.badge.not-installed {
    color: #94a3b8;
}

/* Card active (serveur avec bot) */
.guild-card.active {
    border: 1px solid #22c55e;
}

/* Bouton install */
.btn.install {
    background: #22c55e;
}

.btn.install:hover {
    background: #16a34a;
}


/* Config UI  */
.config-category {
    margin-top: 20px;
}

.config-group {
    background: #1e293b;
    padding: 12px;
    border-radius: 10px;
    margin-top: 10px;
}

.group-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #94a3b8;
}

.config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.channel-name {
    width: 180px;
    font-weight: bold;
}

.input {
    background: #020617;
    border: none;
    padding: 6px;
    border-radius: 6px;
    color: white;
}

.logo {
    display: block;
    text-align: center;
    margin-bottom: 20px;
}

.logo:hover {
    opacity: 0.95;
}

.logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 8px;
}

.logo-title {
    font-weight: bold;
    font-size: 19px;
    font-weight: 600;
}

.logo-title .by {
    font-size: 10px;
    vertical-align: super;
    margin-left: 4px;
    color: #94a3b8;
}

.config-row.invalid input {
    border: 1px solid #ef4444;
}

.error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.config-row.dirty {
    border: 1px solid #ffa600;
    background: rgba(255, 165, 0, 0.08);
}

.config-row .unsaved {
    color: #ffa600;
    font-size: 12px;
    margin-left: 10px;
}
.admin-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.admin-blacklist {
    background: #1e293b;
    padding: 12px;
    border-radius: 12px;
    min-width: 360px;
}

.admin-blacklist .row {
    display: flex;
    gap: 8px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.stats-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 14px;
}

.stats-card span {
    display: block;
    color: #94a3b8;
    font-size: 13px;
}

.stats-card strong {
    font-size: 26px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.table-scroll {
    overflow-x: auto;
}

.muted {
    color: #94a3b8;
}

.license-summary {
    margin-top: 8px;
    font-size: 12px;
    color: #cbd5e1;
}

.license-summary.inactive {
    color: #94a3b8;
}

.badge {
    border-radius: 999px;
    padding: 3px 8px;
    display: inline-block;
    margin-top: 6px;
}

.badge-group {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

.badge.source {
    background: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

.badge.license-gift {
    background: rgba(168, 85, 247, 0.22);
    color: #d8b4fe;
}

.badge.license-trial {
    background: rgba(59, 130, 246, 0.22);
    color: #93c5fd;
}

.badge.license-premium {
    background: rgba(245, 158, 11, 0.24);
    color: #fde68a;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

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

.modal-card {
    width: min(520px, calc(100vw - 32px));
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 18px;
}

.modal-card label {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
    color: #cbd5e1;
}

.modal-card .input {
    width: 100%;
    box-sizing: border-box;
}

.modal-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #334155;
    text-align: left;
    font-size: 14px;
}

.admin-table th {
    background: #0b1220;
    color: #94a3b8;
}

.btn.danger {
    background: #ef4444;
}

.btn.danger:hover {
    background: #dc2626;
}

.admin-sort {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 22px; align-items: start; }

.card {
    background: #1e293b;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid #334155;
    margin-bottom: 22px;
}

.blacklist-form {
    display: grid;
    gap: 10px;
}

.admin-blacklist .subtitle {
    margin-top: 0;
    margin-bottom: 12px;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sort-arrow {
    opacity: 0.7;
    font-size: 12px;
}

.muted {
    color: #94a3b8;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.actions-cell .btn {
    margin-top: 0;
}

.btn {
    border: none;
    cursor: pointer;
}

.btn:disabled,
.btn.is-loading {
    opacity: 0.7;
    cursor: wait;
}

.btn.danger-outline {
    background: transparent;
    border: 1px solid #ef4444;
    color: #fecaca;
}

.btn.danger-outline:hover {
    background: rgba(239, 68, 68, 0.2);
}

.admin-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.15);
}

.admin-table tbody tr:nth-child(odd) {
    background: #111827;
}

.admin-table tbody tr:nth-child(even) {
    background: #0f172a;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    vertical-align: middle;
    white-space: nowrap;
}

.table-responsive {
    overflow-x: auto;
}

.date-col {
    color: #cbd5e1;
    min-width: 190px;
}

.actions-center {
    justify-content: center;
}

.section-subtitle {
    margin: 6px 0 12px;
    color: #cbd5e1;
    font-size: 16px;
}

.admin-card h1 {
    margin-top: 4px;
}

.usage-card {
    margin-top: 28px;
    margin-bottom: 28px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 18px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.usage-card .section-title {
    margin-top: 0;
}

.usage-highlight {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.25);
}

.usage-progress-wrap {
    margin-top: 10px;
    margin-bottom: 14px;
}

.usage-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #0b1220;
    overflow: hidden;
    margin-top: 8px;
}

#usage-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #22d3ee);
}

.chart-wrap {
    background: #0f172a;
    border-radius: 12px;
    padding: 12px;
}

@media (max-width: 980px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-table {
        min-width: 980px;
    }
}

#licenses-table th:last-child,
#licenses-table td:last-child {
    min-width: 260px;
    white-space: normal;
}

#licenses-table td {
    vertical-align: top;
}
