/* Privacy Panel — Light Theme (matching authority panel) */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fb;
    color: #2d3748;
    min-height: 100vh;
}

/* ── Header ── */
.header {
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
}

.role-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin { background: #ebf5ff; color: #3182ce; }
.role-user { background: #f0fff4; color: #38a169; }

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* ── Stats Cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    font-size: 13px;
    color: #718096;
    margin-top: 2px;
}

/* ── Search ── */
.search-section {
    margin-bottom: 24px;
}

.search-box {
    background: #fff;
    border-radius: 14px;
    padding: 8px 8px 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.12);
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: #667eea;
}

.search-icon {
    color: #a0aec0;
    font-size: 18px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: #2d3748;
    background: transparent;
}

.search-box input::placeholder {
    color: #a0aec0;
}

.search-tips {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding-left: 4px;
}

.search-tips span {
    font-size: 12px;
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.btn-outline:hover {
    background: #f7fafc;
}

.btn-danger {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
}

.btn-danger:hover {
    background: #fed7d7;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

/* ── Results ── */
.results-container {
    margin-bottom: 24px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.results-header h3 {
    font-size: 16px;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-meta {
    font-size: 13px;
    color: #718096;
}

.result-group {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.result-group-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf2f7;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
}

.source-qq { background: #ebf4ff; color: #3182ce; }
.source-jd { background: #fff5f5; color: #e53e3e; }
.source-wb { background: #f0fff4; color: #38a169; }

.result-count {
    font-size: 13px;
    color: #718096;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f7fafc;
    border-bottom: 1px solid #edf2f7;
}

.data-table td {
    padding: 10px 20px;
    font-size: 14px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f7fafc;
}

.data-table code {
    background: #edf2f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
    background: #fff;
    border-radius: 12px;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.no-results p {
    font-size: 16px;
}

/* ── Admin Section ── */
.admin-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}

.section-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #edf2f7;
}

.section-header h3 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
}

.toggle-icon {
    color: #a0aec0;
    transition: transform 0.2s;
}

.section-body {
    padding: 20px 24px;
}

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

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
}

.add-user-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.add-user-form input, .add-user-form select {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.add-user-form input:focus, .add-user-form select:focus {
    border-color: #667eea;
}

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    justify-content: center;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.page-btn.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ── Login Page ── */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    text-align: center;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #718096;
    font-size: 14px;
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fff5f5;
    color: #e53e3e;
    border: 1px solid #fed7d7;
}

.login-footer {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 24px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .header { padding: 0 16px; }
    .container { padding: 16px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .search-box { flex-wrap: wrap; }
    .search-box input { width: 100%; }
    .login-card { width: 340px; padding: 30px; }
    .add-user-form { flex-direction: column; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .header-left h1 { display: none; }
}
