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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    background: #f5f5f5;
    line-height: 1.5;
}

/* Login */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2.5rem;
    width: 360px;
    text-align: center;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-card > p {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.login-card input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.login-card input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.login-card button {
    width: 100%;
    padding: 0.6rem;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.login-card button:hover { background: #333; }

/* Dashboard */
.dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left a,
.header-left h1 {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: #111;
}

.badge {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
}

.btn-ghost {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-ghost:hover { background: #f9fafb; }

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.2rem;
}

/* Sections */
.section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.section-header h2 { margin-bottom: 0; }

.toggle {
    font-size: 1.25rem;
    color: #9ca3af;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.toggle:hover { background: #f3f4f6; }

/* Add form */
.add-form {
    margin-top: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.field input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}

.field input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.checkbox-row {
    display: flex;
    gap: 1rem;
    padding-top: 0.4rem;
}

.check {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

.add-form > button {
    background: #111;
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.add-form > button:hover { background: #333; }
.add-form > button:disabled { opacity: 0.5; }

.inline-msg {
    margin-left: 0.75rem;
    font-size: 0.85rem;
}

/* Sites list */
.sites-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.site-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.site-domain {
    font-weight: 600;
    font-size: 0.95rem;
}

.site-name {
    font-size: 0.8rem;
    color: #6b7280;
}

.site-features {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.tag {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.site-stats {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.site-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
}

.btn-sm:hover { background: #f9fafb; }

.btn-danger {
    color: #dc2626;
    border-color: #fecaca;
}

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

/* Utility */
.success { color: #16a34a; }
.error { color: #dc2626; }

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; }
    .site-card { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
