* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e4e4e7;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: #1a1d27;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #2a2d3a;
}

.sidebar .logo {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.sidebar a {
    color: #a1a1aa;
    text-decoration: none;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.15s;
}

.sidebar a:hover { background: #2a2d3a; color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .logout { color: #f87171; }

.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h1 { font-size: 1.5rem; }
.user { color: #71717a; font-size: 0.9rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-value { font-size: 2rem; font-weight: 700; color: #60a5fa; }
.stat-label { color: #71717a; margin-top: 0.5rem; font-size: 0.85rem; }

.table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1d27;
    border-radius: 12px;
    overflow: hidden;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #2a2d3a;
}

.table th { background: #15171f; color: #a1a1aa; font-size: 0.8rem; text-transform: uppercase; }
.table tr:hover { background: #1f2230; }

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover { background: #2563eb; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-primary { padding: 0.75rem 2rem; font-size: 1rem; }

.badge {
    background: #2a2d3a;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 1.5rem;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card h3 { margin-bottom: 1rem; color: #a1a1aa; }
.card p { margin-bottom: 0.5rem; }
.card ul { list-style: none; }
.card li { padding: 0.3rem 0; }

.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select, .filters input {
    padding: 0.5rem 0.75rem;
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    color: #e4e4e7;
}

.pagination { margin-top: 1rem; display: flex; gap: 1rem; align-items: center; }

.settings-form { max-width: 600px; }
.settings-section {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.settings-section h3 { margin-bottom: 1rem; }
.settings-section label { display: block; margin: 0.75rem 0 0.25rem; color: #a1a1aa; font-size: 0.85rem; }
.settings-section input[type="number"], .settings-section select, .settings-section textarea {
    width: 100%;
    padding: 0.5rem;
    background: #0f1117;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    color: #e4e4e7;
}
.settings-section small { color: #71717a; }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #451a1a; color: #fca5a5; }
.alert-success { background: #14532d; color: #86efac; }

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 100vh;
}

.login-form {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-form h1 { text-align: center; margin-bottom: 0.25rem; }
.login-form .subtitle { text-align: center; color: #71717a; margin-bottom: 2rem; }
.login-form label { display: block; margin: 1rem 0 0.25rem; color: #a1a1aa; font-size: 0.85rem; }
.login-form input {
    width: 100%;
    padding: 0.75rem;
    background: #0f1117;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    color: #e4e4e7;
}
.login-form button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}
.login-form button:hover { background: #2563eb; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tab {
    padding: 0.5rem 1rem;
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    color: #a1a1aa;
    text-decoration: none;
    font-size: 0.9rem;
}
.tab:hover { color: #fff; border-color: #3b82f6; }
.tab.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

.checkbox-row { display: flex !important; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto !important; }

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.module-card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
    position: relative;
}
.module-card:hover { border-color: #3b82f6; }
.module-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.module-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.module-card p { color: #71717a; font-size: 0.85rem; }
.module-card .status {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.status.on { background: #14532d; color: #86efac; }
.status.off { background: #2a2d3a; color: #71717a; }

.hint { color: #71717a; font-size: 0.85rem; margin-bottom: 1rem; }
.badge-count { background: #3b82f6; color: #fff; padding: 0.15rem 0.5rem; border-radius: 10px; font-size: 0.8rem; margin-left: 0.5rem; }
.type-badge { font-size: 0.8rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.type-user { background: #1e3a5f; color: #93c5fd; }
.type-prefix { background: #3b2f1e; color: #fcd34d; }
.type-channel { background: #1e2f3b; color: #7dd3fc; }
.type-domain { background: #1e3b2f; color: #86efac; }
.example-cell { color: #71717a; font-size: 0.85rem; }
.empty-row { text-align: center; color: #71717a; padding: 1.5rem !important; }
.table-compact { margin: 1rem 0; font-size: 0.9rem; }
.whitelist-add-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.whitelist-add-form input { flex: 1; padding: 0.5rem; background: #0f1117; border: 1px solid #2a2d3a; border-radius: 8px; color: #e4e4e7; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

code { background: #2a2d3a; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85rem; }
