* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #001529;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.25rem;
}

.current-site {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.65);
    margin-top: 0.25rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0.5rem 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 1.5rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8e8e8;
}

.content-header h1 {
    font-size: 1.5rem;
}

.user-info {
    color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
}

.actions {
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table a {
    color: #f97316;
    text-decoration: none;
    margin-right: 0.5rem;
}

.data-table a:hover {
    text-decoration: underline;
}

.admin-form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
}

.admin-form .form-group {
    margin-bottom: 1rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.admin-form textarea {
    min-height: 100px;
}

.admin-form textarea.editor {
    min-height: 300px;
}

.domain-input-group {
    display: flex;
    align-items: stretch;
}

.domain-input-group .protocol-select {
    width: auto;
    min-width: 110px;
    border-radius: 4px 0 0 4px;
    border-right: none;
    font-size: 0.9rem;
    background: #f5f5f5;
}

.domain-input-group input[type="text"] {
    border-radius: 0 4px 4px 0;
    flex: 1;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
    font-size: 0.85rem;
}

.form-actions {
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f97316;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #ea580c;
}

.btn-primary {
    background: #f97316;
}

.btn-primary:hover {
    background: #ea580c;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #d68910;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
}

.pagination a {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a.active,
.pagination a:hover {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 40%, #0f2b4a 70%, #132f50 100%);
    position: relative;
    overflow: hidden;
    margin: -1.5rem;
    padding: 1.5rem;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 50%);
    animation: auth-bg-drift 20s ease-in-out infinite alternate;
}

@keyframes auth-bg-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, -1%) rotate(1deg); }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    padding: 40px 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: auth-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-card-in {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo svg {
    filter: drop-shadow(0 4px 12px rgba(249, 115, 22, 0.3));
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #8c8c8c;
    margin: 0;
}

.auth-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    animation: auth-alert-in 0.3s ease;
}

@keyframes auth-alert-in {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.auth-alert-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.auth-alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.auth-alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.auth-alert-warning {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #d48806;
}

.auth-alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #096dd9;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field-icon {
    position: absolute;
    left: 14px;
    color: #bfbfbf;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s;
    pointer-events: none;
    z-index: 1;
}

.auth-field input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 42px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #1a1a2e;
    background: #fafafa;
    outline: none;
    transition: all 0.25s;
}

.auth-field input::placeholder {
    color: #bfbfbf;
}

.auth-field input:hover {
    border-color: #bfbfbf;
    background: #fff;
}

.auth-field input:focus {
    border-color: #1677ff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.auth-field input:focus + .auth-field-icon,
.auth-field:focus-within .auth-field-icon {
    color: #f97316;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    margin-top: 8px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.auth-submit:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.auth-footer p {
    font-size: 0.8125rem;
    color: #bfbfbf;
    margin: 0;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px 24px;
        border-radius: 12px;
    }

    .auth-title {
        font-size: 1.25rem;
    }
}