* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    padding: 24px;
}

body.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
}

.card.narrow { max-width: 380px; }

h1, h2, h3 { margin: 0 0 8px; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; color: #cbd5e1; }

p, .subtitle {
    margin: 0 0 16px;
    color: #94a3b8;
    font-size: 0.9rem;
}

code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

input, select, textarea, button, a.btn {
    font-size: 0.9rem;
}

input[type="password"],
input[type="text"],
input[type="search"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #e2e8f0;
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
}

button, a.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #1e293b;
    color: #e2e8f0;
    text-decoration: none;
    cursor: pointer;
}

button[type="submit"] {
    background: #2563eb;
    color: #fff;
    border: none;
    margin-top: 10px;
}

button[type="submit"]:hover { background: #1d4ed8; }
a.btn:hover, button.btn:hover { background: #334155; }

button.danger, a.btn.danger {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
}

.header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#search {
    min-width: 220px;
    width: auto;
}

.panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.import-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.import-box {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    text-decoration: none;
}

.file-item small { color: #94a3b8; }
.file-item.active {
    border-color: #2563eb;
    background: #172554;
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert.error, .error {
    background: #7f1d1d;
    color: #fecaca;
}

.alert.success {
    background: #14532d;
    color: #bbf7d0;
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.stat {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.stat strong {
    display: block;
    font-size: 1.1rem;
}

.table-wrap {
    overflow: auto;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #1e293b;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
    font-size: 0.85rem;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #334155;
    text-align: left;
    vertical-align: top;
}

th {
    background: #111827;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

tr:hover td { background: #243044; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-allowed { background: #14532d; color: #bbf7d0; }
.badge-blocked { background: #7f1d1d; color: #fecaca; }
.badge-bot { background: #1e3a8a; color: #bfdbfe; }

.truncate {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
}
