* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #0b0b0f;
    color: #eee;
    font-family: Arial, Helvetica, sans-serif;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    background: rgba(255, 255, 255, .05);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.navbar .brand {
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    text-decoration: none;
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    margin-left: 20px;
}

.nav-links a:hover {
    color: #fff;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 25px;
}

.card.center {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
    transition: .2s ease;
}

.btn:hover {
    background: rgba(255, 255, 255, .2);
    box-shadow: 0 0 15px purple;
}

.btn.small {
    padding: 6px 14px;
    font-size: 13px;
}

.btn.danger {
    border-color: rgba(255, 80, 80, .5);
}

.btn.danger:hover {
    box-shadow: 0 0 15px red;
}

label {
    display: block;
    margin: 14px 0 6px;
    color: #aaa;
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(0, 0, 0, .4);
    color: #fff;
    font-size: 15px;
}

.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.guild-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}

.guild-card.disabled {
    opacity: .5;
}

.guild-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.guild-icon.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .1);
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 10px;
}

.guild-name {
    margin-bottom: 10px;
    font-weight: bold;
}

.select-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.select-row select {
    flex: 1;
}

.refresh-btn {
    flex-shrink: 0;
    width: 44px;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:disabled {
    opacity: .5;
    cursor: default;
}

.card-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.color-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3);
    vertical-align: middle;
    margin-right: 8px;
}

.role-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .3);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
}

.color-row {
    display: flex;
    gap: 12px;
}

.color-row > div {
    flex: 1;
}

input[type="color"] {
    padding: 4px;
    height: 44px;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

th,
td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.muted {
    color: #888;
    font-size: 13px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    color: #ccc;
    cursor: pointer;
    font-size: 14px;
    transition: .2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, .12);
}

.tab-btn.active {
    background: rgba(150, 60, 255, .25);
    border-color: rgba(180, 100, 255, .6);
    color: #fff;
}

.tab-panel.hidden {
    display: none;
}

.hidden {
    display: none;
}

.modules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.modules-header h2 {
    margin: 0;
}

.module-search {
    max-width: 280px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.module-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    padding: 18px;
}

.module-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.module-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.module-name {
    font-weight: bold;
    font-size: 17px;
    color: #fff;
}

.module-badge {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: .03em;
}

.module-badge.new {
    background: rgba(74, 222, 128, .15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, .4);
}

.module-desc {
    margin: 10px 0 14px;
}

.module-filter-banner {
    background: rgba(150, 60, 255, .12);
    border: 1px solid rgba(180, 100, 255, .3);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #ddd;
}

.module-filter-banner a {
    color: #c9a4ff;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 999px;
    transition: .2s ease;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #ccc;
    border-radius: 50%;
    transition: .2s ease;
}

.switch input:checked + .slider {
    background: rgba(46, 204, 113, .35);
    border-color: rgba(74, 222, 128, .7);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
    background: #4ade80;
}

.switch input:disabled + .slider {
    opacity: .5;
    cursor: default;
}

.switch.small {
    width: 38px;
    height: 22px;
}

.switch.small .slider::before {
    height: 14px;
    width: 14px;
}

.switch.small input:checked + .slider::before {
    transform: translateX(16px);
}

.subflag-card {
    background: rgba(0, 0, 0, .2);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    color: #ddd;
    font-size: 14px;
}

.checkbox-row input {
    width: auto;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 16px;
    margin-top: 8px;
}

.flash-box {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 20px;
}

.option-row {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, .2);
}

.dropdown-preview {
    border-left: 4px solid #5865f2;
    padding: 14px 16px;
    background: rgba(0, 0, 0, .3);
    border-radius: 6px;
    margin-bottom: 10px;
}
